-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
114 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t340/servlets/ateliers/EditerAtelier.java → ...it340/servlets/atelier/EditerAtelier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/fr/enseirb/t3/it340/servlets/atelier/SupprimerAtelier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package fr.enseirb.t3.it340.servlets.atelier; | ||
|
||
import fr.enseirb.t3.it340.bdd.BddAtelier; | ||
import fr.enseirb.t3.it340.bdd.BddCreneau; | ||
import fr.enseirb.t3.it340.modeles.Atelier; | ||
import fr.enseirb.t3.it340.servlets.authentification.Authentification; | ||
import spark.ModelAndView; | ||
import spark.Request; | ||
import spark.Response; | ||
import spark.Route; | ||
|
||
public class SupprimerAtelier implements Route { | ||
public String handle(Request request, Response response) throws Exception { | ||
|
||
// On regarde si l'utilisateur a accès | ||
ModelAndView modelAndView = Authentification.checkLabo(request, response); | ||
if (modelAndView != null) | ||
return null; | ||
|
||
// On vérifie si l'atelier appartient bien au labo | ||
Atelier atelier = null; | ||
|
||
try { | ||
int idAtelier = Integer.parseInt(request.params("idAtelier")); | ||
atelier = BddAtelier.getAtelierById(idAtelier); | ||
} catch (NumberFormatException e) { | ||
response.redirect("/laboratoire/ateliers"); | ||
} | ||
|
||
if (atelier == null) { | ||
response.redirect("/laboratoire/ateliers"); | ||
return ""; | ||
} else { | ||
|
||
// On vérifie que l'atelier appartient bien au labo | ||
int idLaboFromAtelier = atelier.getIdLabo(); | ||
int idLabo = request.session().attribute("labo"); | ||
|
||
if (idLabo != idLaboFromAtelier) { | ||
return ""; | ||
} else { | ||
// TODO | ||
} | ||
} | ||
|
||
return ""; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...rvlets/ateliers/VisualisationAtelier.java → ...ervlets/atelier/VisualisationAtelier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/ateliers/VisualisationCreerAtelier.java → ...ts/atelier/VisualisationCreerAtelier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../ateliers/VisualisationEditerAtelier.java → ...s/atelier/VisualisationEditerAtelier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...it340/servlets/ateliers/CreerCreneau.java → .../it340/servlets/creneau/CreerCreneau.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t340/servlets/ateliers/EditerCreneau.java → ...it340/servlets/creneau/EditerCreneau.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../ateliers/VisualisationEditerCreneau.java → ...s/creneau/VisualisationEditerCreneau.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...vlets/ateliers/VisualisationCreneaux.java → ...vlets/creneaux/VisualisationCreneaux.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters