5,7 → 5,7 |
{ |
$Registre->ajouterEspace('AdminCategorie', 'admin_categorie'); |
$Registre->ajouterSquelette('admin_categorie', 'admin_categorie.tpl.html'); |
$Registre->setTitre('Administrer les catégories des projets'); |
$Registre->setTitre('Administrer les catégories des projets'); |
} |
|
public function executer() |
12,13 → 12,13 |
{ |
$aso_admin_categ = array(); |
|
// Récupération des catégories |
// Récupération des catégories |
$ProjetCategorie = new ProjetCategorie(); |
|
// Ajout de la catégorie par défaut |
// Ajout de la catégorie par défaut |
$aso_admin_categ['ProjetCategorie'] = $ProjetCategorie; |
|
// Récupération des infos sur les categories existantes |
// Récupération des infos sur les categories existantes |
$tab_pc = $ProjetCategorie->consulter(ProjetCategorie::GPC_TOUS); |
if (false == $tab_pc) { |
$aso_admin_categ['categories'] = false; |
31,7 → 31,7 |
} |
} |
} |
// Modification des titres, légendes et bouton |
// Modification des titres, légendes et bouton |
$aso_admin_categ['form_legend'] = 'Ajouter une categorie'; |
$aso_admin_categ['form_bouton_value'] = 'Ajouter'; |
$aso_admin_categ['form_bouton_id'] = 'btn_categorie_ajouter'; |
45,12 → 45,12 |
{ |
// Ajout du statut d'utilisateur |
if (isset($_POST['btn_categorie_modifier'])) { |
// Récupération des données de la categorie à modifier |
// Récupération des données de la categorie à modifier |
$ProjetCategorie = new ProjetCategorie(); |
$ProjetCategorie->consulter(ProjetCategorie::GPC_ID, $_POST['casu_id'], true); |
$aso_admin_categ['ProjetCategorie'] = $ProjetCategorie; |
|
// Modification des titres, légendes et bouton |
// Modification des titres, légendes et bouton |
$aso_admin_categ['form_legend'] = 'Modifier une categorie'; |
$aso_admin_categ['form_bouton_value'] = 'Modifier'; |
$aso_admin_categ['form_bouton_id'] = 'btn_categorie_modifier'; |
79,7 → 79,7 |
|
public function executerValiderAjouter() |
{ |
// Ajout de la catégorie |
// Ajout de la catégorie |
$ProjetCategorie = new ProjetCategorie(); |
$bool_existe = $ProjetCategorie->consulter(ProjetCategorie::GPC_LIBELLE, array($_POST['caaj_libelle'])); |
if ($bool_existe == false) { |
87,7 → 87,7 |
$ProjetCategorie->setAbreviation($_POST['caaj_abreviation']); |
$ProjetCategorie->ajouter(); |
} else { |
$aso_admin_categ['message'] = 'Cette catégorie existe déjà !'; |
$aso_admin_categ['message'] = 'Cette catégorie existe déjà !'; |
$this->getRegistre()->ajouterDonnee('admin_categorie', $aso_admin_categ); |
} |
|
97,12 → 97,12 |
|
public function executerValiderSupprimer() |
{ |
// Suppression de la catégorie |
// Suppression de la catégorie |
$ProjetCategorie = new ProjetCategorie(); |
$ProjetCategorie->setIdCategorie($_POST['casu_id']); |
$ProjetCategorie->supprimer(); |
|
// Mise à jour des projets appartenant à la catégorie |
// Mise à jour des projets appartenant à la catégorie |
$Projet = new Projet(); |
$tab_p = $Projet->consulter(Projet::GP_CE_CATEGORIE, $_POST['casu_id']); |
if ($tab_p != false) { |