/** * @brief Fonction qui affiche le formulaire de modification d'une oeuvre après sélection de l'oeuvre à modifier par l'utilisateur. * @access public * @author David Lachambre * @author Philippe Germain * @return void */ function afficherFormModif() { $oeuvre = new Oeuvre(); $oArrondissement = new Arrondissement(); $oCategorie = new Categorie(); $langue = $_COOKIE['langue']; $oeuvreAModifier = $oeuvre->getAnyOeuvreById($_POST['idOeuvre'], $langue); if ($oeuvreAModifier) { $arrondissements = $oArrondissement->getAllArrondissements(); $categories = $oCategorie->getAllCategories($langue); $titreModif = $oeuvreAModifier['titre']; $adresseModif = $oeuvreAModifier['adresse']; $idCategorieModif = $oeuvreAModifier['idCategorie']; $idArrondissementModif = $oeuvreAModifier['idArrondissement']; if ($_COOKIE["langue"] == "FR") { $descriptionModif = $oeuvreAModifier['descriptionFR']; } else { if ($_COOKIE["langue"] == "EN") { $descriptionModif = $oeuvreAModifier['descriptionEN']; } } ?> <form method="POST" name="formModifOeuvre" id='formModifSelectOeuvre' action="?r=gestion" onsubmit="return valideModifierOeuvre();"> <input type='text' class="inputGestion" name='titreModif' id='titreModif' placeholder="Titre de l'oeuvre" value='<?php echo $titreModif; ?> '/> <br><span class="erreur" id="erreurTitreOeuvreModif"></span> <input type='text' class="inputGestion" name='adresseModif' id='adresseModif' placeholder="Adresse " value='<?php echo $adresseModif; ?> '/> <br><span class="erreur" id="erreurAdresseOeuvreModif"></span> <br> <textarea name='descriptionModif' class="inputGestion textAreaGestion" id='descriptionModif' placeholder="Description "><?php echo $descriptionModif; ?> </textarea> <br><span class="erreur" id="erreurDescriptionModif"></span> <select name="selectArrondissementModif" id="selectArrondissementModif" class="selectGestion"> <option value="">Choisir un arrondissement</option> <?php foreach ($arrondissements as $arrondissement) { if ($arrondissement["idArrondissement"] == $idArrondissementModif) { $selection = "selected"; } else { $selection = ""; } echo "<option value='" . $arrondissement["idArrondissement"] . "'" . $selection . ">" . $arrondissement["nomArrondissement"]; } ?> </select> <br><span class="erreur" id="erreurSelectArrondissementModif"></span> <select name="selectCategorieModif" id="selectCategorieModif" class="selectGestion"> <option value="">Choisir une catégorie</option> <?php foreach ($categories as $categorie) { if ($categorie["idCategorie"] == $idCategorieModif) { $selection = "selected"; } else { $selection = ""; } echo "<option value='" . $categorie["idCategorie"] . "'" . $selection . ">" . $categorie["nomCategorie{$langue}"]; } echo "</select>"; ?> </select> <br><span class="erreur" id="erreurSelectCategorieModif"></span> <br><input class="boutonMoyenne boutonHover" id='btnModCat' type='submit' name='boutonModifOeuvre' value='Modifer'> </form> <?php } else { echo "<span class='erreur'>cette oeuvre n'existe pas.</span>"; } }
/** * @brief Méthode qui appelle la vue d'affichage de la page d'une oeuvre qui n'a pas encore été approuvée - pour les utilisateurs admin * @access private * @return void */ private function oeuvreSoumise() { $oeuvre = new Oeuvre(); $oeuvreAffichee = $oeuvre->getAnyOeuvreById($_GET["o"]); $commentaire = new Commentaire(); $commentairesOeuvre = $commentaire->getCommentairesByOeuvre($_GET["o"], $this->langueAffichage); $photo = new Photo(); $photosOeuvre = $photo->getPhotosByOeuvre($_GET["o"], false); $artiste = new Artiste(); $artistesOeuvre = $artiste->getArtistesbyOeuvreId($_GET["o"]); $this->oVue = new VueOeuvreSoumise(); $this->oVue->setDataGlobal('oeuvreSoumise', "page d'une oeuvre soumise", $this->langueAffichage, $this->pOeuvreSoumise); $this->oVue->setData($oeuvreAffichee, $commentairesOeuvre, $photosOeuvre, $artistesOeuvre, $this->langueAffichage); $this->oVue->afficherMeta(); $this->oVue->afficherEntete(); $this->oVue->afficherBody(); $this->oVue->afficherPiedPage(); }