menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuVue('Ajouterprofil'); $this->profil = new Profil(); $this->profilsysteme = (new ProfilSysteme())->getListe(); } public function index() { $this->genererVue(array('profilsysteme' => $this->profilsysteme)); } public function ajouter() { $codeSociete = $this->requete->getSession()->getAttribut('codeSociete'); $codeProfil = $this->requete->getParametre("codeProfil"); // Début contrôle doublon if (!$this->profil->existeligne($codeProfil)) { $libelle = $this->requete->getParametre("libelle"); $codeProfilSysteme = $this->requete->getParametre("codeProfilSysteme"); $this->profil->ajouter($codeSociete, $codeProfil, $libelle, $codeProfilSysteme); $this->executerAction("index"); } else $this->genererVue(array('profilsysteme' => $this->profilsysteme, 'msgErreur' => 'Ce code existe déjà!'), "index"); // Fin doublon } }