Subversion Repositories Applications.gtt

Compare Revisions

Ignore whitespace Rev 94 → Rev 95

/trunk/presentation/preferences.tpl.html
1,3 → 1,9
<?php if (isset($messages)) : ?>
<?php foreach ($messages as $message) : ?>
<p class="information"><?=$message;?></p>
<?php endforeach; ?>
<?php endif; ?>
<?php if ($preferences) : ?>
<form id="gestion_admin_pref" action="index.php?action=<?=GTT_ACTION_PREFERENCE_VALIDER;?>" name="gestion_admin_pref" method="post">
<input name="champ_nb_total_proj" value="<?=$nbre_projets;?>" type="hidden"/>
<ul>
12,4 → 18,5
<?php endforeach; ?>
<li><input id="btn_valider_editer" name="btn_valider_editer" value="<?=$i18n_general_valider;?>" type="submit" /></li>
</ul>
</form>
</form>
<?php endif; ?>
/trunk/presentation/gestion.tpl.html
63,6 → 63,6
<input id="btn_valider" name="btn_valider" value="<?=$i18n_general_valider;?>" type="submit" />
</form>
<?php else : ?>
<p>Veuillez sélectionner des projets via le menu "Gestion de mes projets".</p>
<p class="information">Veuillez sélectionner des projets via le menu "Gestion de mes projets".</p>
<? endif;?>
</div>
/trunk/presentation/stat_tableau_global.tpl.html
1,19 → 1,22
<div id="navigation">
<p>Navigation : <a href="<?=$url_mois_precedent;?>">&lt;&lt;</a> <?=$mois['mois'];?> <?=$mois['annee'];?> <a href="<?=$url_mois_suivant;?>">&gt;&gt;</a></p>
</div>
<?php if ($projets || $absences) : ?>
<table id="tab_tps_w_mensuel_salarie" summary="Tableau du temps de travail mensuel par salarié.">
<caption>
<a href="<?=$url_mois_precedent;?>">&lt;&lt;</a> <?=$mois['mois'];?> <?=$mois['annee'];?> <a href="<?=$url_mois_suivant;?>">&gt;&gt;</a>
</caption>
<caption>Tableaux global - <?=$mois['mois'];?> <?=$mois['annee'];?></caption>
<thead>
<tr>
<th>Projets</th>
<?php foreach ($utilisateurs as $utilisateur) : ?>
<?php foreach ($utilisateurs as $utilisateur) : ?>
<th>
<?=$utilisateur['prenom_nom']?>
</th>
<?php endforeach; ?>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php $ligne = "impair"; ?>
<?php if ($projets) : ?>
<?foreach ($projets as $categorie => $pr):?>
<tr class="categories">
<td class="categories_titre"><?=$categorie;?></td>
29,8 → 32,9
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php $ligne = "impair"; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if ($absences) : ?>
<tr class="absences">
<td class="absences_titre">Absences</td>
<?php foreach ($utilisateurs as $utilisateur) : ?>
44,6 → 48,14
<td class="absence"><?= (isset($utilisateur['ab'][$ab_id])) ? $utilisateur['ab'][$ab_id] : "&nbsp;";?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</table>
<?php endif; ?>
 
<?php if (isset($messages)) : ?>
<?php foreach ($messages as $message) : ?>
<p class="information"><?=$message;?></p>
<?php endforeach; ?>
<?php endif; ?>
/trunk/presentation/admin_categorie.tpl.html
1,6 → 1,7
<?php if (isset($message)) : ?>
<p class="information"><?=$message;?></p>
<?php endif; ?>
<?php if ($categories) : ?>
<form id="admin_categorie_editer" class="editer" name="admin_categorie_editer" action="index.php?action=admin-categorie_editer" method="post">
<fieldset>
<legend>Éditer une catégorie</legend>
18,6 → 19,7
</ul>
</fieldset>
</form>
<?php endif; ?>
<form id="admin_categorie_ajouter" name="admin_categorie_ajouter" action="<?=$form_url;?>" method="post">
<fieldset>
<legend><?=$form_legend;?></legend>
/trunk/presentation/admin_projet.tpl.html
1,6 → 1,8
<?php if (isset($message)) : ?>
<p class="information"><?=$message;?></p>
<?php endif; ?>
 
<?php if ($projets) : ?>
<form id="admin_projet_editer" class="editer" name="admin_projet_editer" action="index.php?action=admin-projet_editer" method="post">
<fieldset>
<legend>Éditer un projet</legend>
18,6 → 20,7
</ul>
</fieldset>
</form>
<?php endif; ?>
<form id="admin_projet_ajouter" name="admin_projet_ajouter" action="<?=$form_url;?>" method="post">
<fieldset>
<legend><?=$form_legend;?></legend>
29,11 → 32,15
</li>
<li>
<label for="praj_ce_categorie">Catégorie :</label>
<?php if ($categories) : ?>
<select id="praj_ce_categorie" name="praj_ce_categorie">
<?php foreach ($categories as $Categorie) : ?>
<option value="<?=$Categorie->getIdCategorie();?>" <?=(isset($CategorieDefaut) && $CategorieDefaut->getIdCategorie() == $Categorie->getIdCategorie()) ? 'selected="selected"' : '';?>><?=$Categorie->getLibelle();?></option>
<?php endforeach; ?>
</select>
<?php else : ?>
<input size="30" id="praj_ce_categorie" name="praj_ce_categorie" type="text" disabled="disabled" value="Veuillez définir des catégories..."/>
<?php endif; ?>
</li>
<li>
<label for="praj_description">Description :</label>
/trunk/bibliotheque/noyau/GestionnaireErreur.class.php
229,7 → 229,7
continue;
}
// Nous testons les erreurs PEAR pour ne pas en tenir compte
if (!GTT_DEBOGAGE_PEAR && stristr($aso_erreur['fichier'],GTT_DEBOGAGE_PEAR_CHAINE)) {
if (!GTT_DEBOGAGE_PEAR && preg_match(GTT_DEBOGAGE_PEAR_REGEXP_CHAINE, $aso_erreur['fichier'])) {
$erreur_pear_fichier_nbre++;
} else if (!GTT_DEBOGAGE_PEAR && preg_match(GTT_DEBOGAGE_PEAR_REGEXP_MESSAGE, $aso_erreur['message'])) {
$erreur_pear_message_nbre++;
285,7 → 285,7
if ($erreur_pear_nbre != 0) {
$retour .= '<p class="attention">'.
'<strong>Nombre d\'erreurs PEAR totales : </strong>'.$erreur_pear_nbre.'<br />'."\n".
'<strong> - éliminées car le "fichier" contené '.GTT_DEBOGAGE_PEAR_CHAINE.' : </strong>'.$erreur_pear_fichier_nbre.'<br />'."\n".
'<strong> - éliminées car le "fichier" correspondé à '.GTT_DEBOGAGE_PEAR_REGEXP_CHAINE.' : </strong>'.$erreur_pear_fichier_nbre.'<br />'."\n".
'<strong> - éliminées car le "message" correspondé à '.GTT_DEBOGAGE_PEAR_REGEXP_MESSAGE.' : </strong>'.$erreur_pear_message_nbre.'<br />'."\n".
'</p>'."\n";
}
/trunk/bibliotheque/metier/Utilisateur.class.php
51,7 → 51,8
const GU_ID_MAX = 'UTILISATEUR_ID_MAX';
const GU_CE_STATUT = 'UTILISATEUR_CE_STATUT';
const GU_MAIL = 'UTILISATEUR_MAIL';
const GU_TOUS_AFFICHABLE = 'UTILISATEUR_TOUS_AFFICHABLE';
const GU_TOUS_AFFICHABLE = 'UTILISATEUR_TOUS_AFFICHABLE';
const GU_ADMIN = 'UTILISATEUR_ADMIN';
 
/*** Attributs : */
private $id_utilisateur;
312,7 → 313,13
'FROM gestion_utilisateur '.
'WHERE gu_mark_recapitulatif = 0 '.
'ORDER BY gu_prenom, gu_nom ASC';
break;
break;
case Utilisateur::GU_ADMIN:
$requete = 'SELECT * '.
'FROM gestion_utilisateur '.
'WHERE gu_mark_admin = 1 ';
break;
default :
$message = 'Commande '.$cmd.'inconnue!';
$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
/trunk/bibliotheque/metier/aGttSql.class.php
131,10 → 131,8
$tab_resultat[] = $this->basculerEnregistrementObjet($donnees, $instancier);
}
$resultat_nbre = count($tab_resultat);
if ($resultat_nbre > 1) {
if ($resultat_nbre >= 1) {
return $tab_resultat;
} else if ($resultat_nbre == 1) {
return $tab_resultat[0];
} else if ($resultat_nbre == 0) {
return false;
}
/trunk/bibliotheque/metier/Absence.class.php
48,6 → 48,7
/*** Constantes : */
const GA_ID = 'ABSENCE_ID';
const GA_ID_ABSENCE_MOTIF = 'ABSENCE_ID_ABSENCE_MOTIF';
const GA_ID_UTILISATEUR = 'ABSENCE_ID_UTILISATEUR';
const GA_ID_UTILISATEUR_DATE_DEB_FIN = 'ABSENCE_ID_UTILISATEUR_DATE_DEB_FIN';
const GA_ID_MAX_UTILISATEUR = 'ABSENCE_ID_MAX_UTILISATEUR';
const GA_ID_MAX_ABSENCE_MOTIF = 'ABSENCE_ID_MAX_ABSENCE_MOTIF';
139,6 → 140,11
'FROM gestion_absence '.
'WHERE ga_id_absence_motif = #0 ';
break;
case Absence::GA_ID_UTILISATEUR:
$requete = 'SELECT * '.
'FROM gestion_absence '.
'WHERE ga_id_utilisateur = #0 ';
break;
case Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN:
$requete = 'SELECT * '.
'FROM gestion_absence '.
/trunk/bibliotheque/metier/TravailProjet.class.php
52,6 → 52,7
const GTP_ID_MAX_PROJET = 'TRAVAILPROJET_ID_MAX_PROJET';
const GTP_ID_MAX_DATE_TRAVAIL = 'TRAVAILPROJET_ID_MAX_DATE_TRAVAIL';
const GTP_PROJET = 'TRAVAILPROJET_ID_PROJET';
const GTP_UTILISATEUR = 'TRAVAILPROJET_ID_UTILISATEUR';
/*** Attributs : */
private $id_utilisateur;
158,6 → 159,11
'FROM gestion_travail_projet '.
'WHERE gtp_id_projet = #0 ';
break;
case TravailProjet::GTP_UTILISATEUR:
$requete = 'SELECT gtp_id_utilisateur '.
'FROM gestion_travail_projet '.
'WHERE gtp_id_utilisateur = #0 ';
break;
default :
$message = 'Commande '.$cmd.' inconnue!';
$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
/trunk/actions/GttCtrlActionUtilisateur.class.php
File deleted
\ No newline at end of file
/trunk/actions/GttCtrlActionAdminUtilisateurStatut.class.php
34,9 → 34,6
$UtilisateurStatut = new UtilisateurStatut();
$bool_existe = $UtilisateurStatut->consulter(UtilisateurStatut::GUS_LIBELLE, array($_POST['usaj_libelle']));
if ($bool_existe == false) {
$UtilisateurStatutMax = $UtilisateurStatut->consulter(UtilisateurStatut::GUS_ID_MAX);
$id_max = $UtilisateurStatutMax->getIdUtilisateurStatut();
$UtilisateurStatut->setIdUtilisateurStatut(++$id_max);
$UtilisateurStatut->setLibelle($_POST['usaj_libelle']);
$UtilisateurStatut->ajouter();
} else {
/trunk/actions/GttCtrlActionGestion.class.php
154,9 → 154,7
// Récupération de la catégorie du projet
$ProjetCategorie = new ProjetCategorie();
$cmd = ProjetCategorie::GPC_ID;
$param = $Projet->getCeCategorie();
$Categorie = $ProjetCategorie->consulter($cmd, $param);
$Categorie = current($ProjetCategorie->consulter(ProjetCategorie::GPC_ID, $Projet->getCeCategorie()));
// Nous vérifions le temps de travail pour ce projet pour la semaine courrante
$aso_tps_w = $aso_tps_w_vide;
/trunk/actions/GttCtrlActionStatTableauGlobal.class.php
39,13 → 39,25
$aso_stat['mois']['annee'] = $Month->thisYear();
$mois_courant_j1 = $Month->thisYear().'-'.sprintf("%02s", $Month->thisMonth()).'-'.sprintf("%02s", $Month->thisDay()).' 00:00:00';
$mois_courant_j36 = date('Y-m-d H:i:s', mktime(0, 0, 0, $NMonth->thisMonth(), 0, $NMonth->thisYear()));
 
//+-------------------------------------------------------------------------------------------------+
// GESTION D'INFO GLOBALES
//+-------------------------------------------------------------------------------------------------+
// Récupération des infos sur les utilisateurs
$DaoUtilsateur = new Utilisateur();
$utilisateurs = $DaoUtilsateur->consulter(Utilisateur::GU_TOUS_AFFICHABLE);
if (is_object($utilisateurs)) {
$utilisateurs[0] = $utilisateurs;
// Récupération des motifs d'absence
$AbsenceMotif = new AbsenceMotif();
$cmd = AbsenceMotif::GAM_TOUS;
$tab_am = $AbsenceMotif->consulter($cmd);
if (false == $tab_am) {
$aso_stat['absences'] = false;
$aso_stat['messages'][] = "Aucun motif d'absence de renseigné";
}
// Pour chaque utilisateur nous récupérons les infos
foreach ($utilisateurs as $Utilisateur) {
$aso_gestion = array();
//+-------------------------------------------------------------------------------------------------+
61,7 → 73,10
$UtilsateurAProjet = new UtilisateurAProjet();
$tab_uap = $UtilsateurAProjet->consulter(UtilisateurAProjet::GUAP_UTILISATEUR, $Utilisateur->getIdUtilisateur());
if (is_array($tab_uap) && count($tab_uap) > 0) {
if (false == $tab_uap) {
$aso_stat['projets'] = false;
$aso_stat['messages'][] = "Aucune information sur le travail de ${aso_gestion['prenom_nom']}";
} else {
//echo '<pre>la'.print_r($tab_uap, true).'</pre>';
$tab_projet_id = array();
foreach ($tab_uap as $uap) {
73,9 → 88,6
$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN;
$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
$tab_tp = $TravailProjet->consulter($cmd, $param);
if ($tab_tp && count($tab_tp) == 1) {
$tab_tp = array($tab_tp);
}
// Récupération des infos sur les projets de l'utilisateur
$aso_gestion['totaux'] = 0;
114,32 → 126,24
$aso_stat['projets'][$Categorie->getLibelle()][$Projet->getIdProjet()] = $Projet->getNom();
}
}
 
//+-------------------------------------------------------------------------------------------------+
// GESTION DES ABSENCES
//+-------------------------------------------------------------------------------------------------+
// Récupération des motifs d'absence
$AbsenceMotif = new AbsenceMotif();
$cmd = AbsenceMotif::GAM_TOUS;
$tab_am = $AbsenceMotif->consulter($cmd);
if ($tab_am && count($tab_am) == 1) {
$tab_am = array($tab_am);
}
// Récupération des absences pour un utilisateur à une date donnée
$Absence = new Absence();
$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN;
$param = array($Utilisateur->getIdUtilisateur(), $mois_courant_j1, $mois_courant_j36);
$tab_a = $Absence->consulter($cmd, $param);
if ($tab_a && count($tab_a) == 1) {
$tab_a = array($tab_a);
}
$aso_gestion['ab_total'] = '';
if ($tab_am) {
foreach ($tab_am as $AM) {
$aso_stat['absences'][$AM->getIdAbsenceMotif()] = $AM->getLibelle();
//$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0;
if ($tab_a) {
if (false == $tab_a) {
$aso_stat['absences'] = false;
$aso_stat['messages'][] = "Aucune information sur les absences de ${aso_gestion['prenom_nom']}";
} else {
if (false != $tab_am) {
foreach ($tab_am as $AM) {
$aso_stat['absences'][$AM->getIdAbsenceMotif()] = $AM->getLibelle();
//$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = 0;
foreach ($tab_a as $A) {
if ($A->getIdAbsenceMotif() == $AM->getIdAbsenceMotif() && $A->getDuree() != 0) {
$aso_gestion['ab'][$AM->getIdAbsenceMotif()] = $A->getDuree();
152,7 → 156,7
}
$aso_stat['utilisateurs'][] = $aso_gestion;
}
 
//trigger_error('<pre>'.print_r($aso_stat, true).'</pre>', E_USER_NOTICE);
$this->getRegistre()->ajouterDonnee('stat_tableau_global', $aso_stat);
}
/trunk/actions/GttCtrlActionAdminCategorie.class.php
20,12 → 20,16
// Récupération des infos sur les categories existantes
$tab_pc = $ProjetCategorie->consulter(ProjetCategorie::GPC_TOUS);
foreach ($tab_pc as $pc) {
if ($pc->getIdCategorie() != 0) {
$aso_categ['id'] = $pc->getIdCategorie();
$aso_categ['libelle'] = $pc->getLibelle();
$aso_admin_categ['categories'][] = $aso_categ;
}
if (false == $tab_pc) {
$aso_admin_categ['categories'] = false;
} else {
foreach ($tab_pc as $pc) {
if ($pc->getIdCategorie() != 0) {
$aso_categ['id'] = $pc->getIdCategorie();
$aso_categ['libelle'] = $pc->getLibelle();
$aso_admin_categ['categories'][] = $aso_categ;
}
}
}
// Modification des titres, légendes et bouton
$aso_admin_categ['form_legend'] = 'Ajouter une categorie';
79,9 → 83,6
$ProjetCategorie = new ProjetCategorie();
$bool_existe = $ProjetCategorie->consulter(ProjetCategorie::GPC_LIBELLE, array($_POST['caaj_libelle']));
if ($bool_existe == false) {
$ProjetCategorieMax = $ProjetCategorie->consulter(ProjetCategorie::GPC_ID_MAX);
$id_max = $ProjetCategorieMax->getIdCategorie();
$ProjetCategorie->setIdCategorie(++$id_max);
$ProjetCategorie->setLibelle($_POST['caaj_libelle']);
$ProjetCategorie->setAbreviation($_POST['caaj_abreviation']);
$ProjetCategorie->ajouter();
/trunk/actions/GttCtrlActionAdminProjet.class.php
24,10 → 24,14
// Récupération des projets
$tab_p = $Projet->consulter(Projet::GP_TOUS);
foreach ($tab_p as $Pr) {
$aso_projet['id'] = $Pr->getIdProjet();
$aso_projet['nom'] = $Pr->getNom();
$aso_admin_projet['projets'][] = $aso_projet;
if (false == $tab_p) {
$aso_admin_projet['projets'] = false;
} else {
foreach ($tab_p as $Pr) {
$aso_projet['id'] = $Pr->getIdProjet();
$aso_projet['nom'] = $Pr->getNom();
$aso_admin_projet['projets'][] = $aso_projet;
}
}
// Modification des titres, légendes et bouton
96,9 → 100,6
$Projet = new Projet();
$bool_existe = $Projet->consulter(Projet::GP_NOM, array($_POST['praj_nom']));
if ($bool_existe == false) {
$ProjetMax = $Projet->consulter(Projet::GP_ID_MAX);
$id_max = $ProjetMax->getIdProjet();
$Projet->setIdProjet(++$id_max);
$Projet->setCeCategorie($_POST['praj_ce_categorie']);
$Projet->setNom($_POST['praj_nom']);
$Projet->setDescription($_POST['praj_description']);
135,18 → 136,12
$bool_existe = $TravailProjet->consulter(TravailProjet::GTP_PROJET, array($_POST['prsu_id']));
if ($bool_existe == false) {
trigger_error('TravailProjet -> OK', E_USER_NOTICE);
// Vérif des taches
$ProjetTache = new ProjetTache();
$bool_existe = $ProjetTache->consulter(ProjetTache::GPT_PROJET, array($_POST['prsu_id']));
if ($bool_existe == false) {
trigger_error('ProjetTache -> OK', E_USER_NOTICE);
// Suppression du projet
$Projet = new Projet();
$Projet->setIdProjet($_POST['prsu_id']);
if ($Projet->supprimer()) {
$aso_admin_projet['message'] = "Le projet a été supprimé.";
}
}
// Suppression du projet
$Projet = new Projet();
$Projet->setIdProjet($_POST['prsu_id']);
if ($Projet->supprimer()) {
$aso_admin_projet['message'] = "Le projet a été supprimé.";
}
}
}
// Message d'erreur si le projet contient des données
/trunk/actions/GttCtrlActionPreferences.class.php
13,32 → 13,37
$this->getRegistre()->setTitre('Modifier mes préférences');
$Projet = new Projet();
$tab_projets = $Projet->consulter(Projet::GP_TOUS);
$aso_preferences['nbre_projets'] = count($tab_projets);
// Parcourt du tableau de projets
foreach ($tab_projets as $Projet) {
// Vérification de la présence du projet dans les préférences de l'utilisateur
$UtilisateurAProjet = new UtilisateurAProjet();
$cmd = UtilisateurAProjet::GUAP_ID;
$param = array($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur(), $Projet->getIdProjet());
$coche = false;
if ($present = $UtilisateurAProjet->consulter($cmd, $param)) {
$coche = true;
}
 
// Récupération de la catégorie du projet
$ProjetCategorie = new ProjetCategorie();
$cmd = ProjetCategorie::GPC_ID;
$param = $Projet->getCeCategorie();
$Categorie = $ProjetCategorie->consulter($cmd, $param);
 
// Récupération de toutes les infos
$aso_preferences['preferences'][$Categorie->getLibelle()][] = array(
'id' => $Projet->getIdProjet(),
'valeur' => $Projet->getIdProjet(),
'nom' => $Projet->getNom(),
'coche' => $coche);
}
ksort($aso_preferences['preferences']);
if (false == $tab_projets) {
$aso_preferences['messages'][] = "Veuillez commencer par ajouter des catégories de projet et des projets !";
$aso_preferences['preferences'] = false;
} else {
$aso_preferences['nbre_projets'] = count($tab_projets);
// Parcourt du tableau de projets
foreach ($tab_projets as $Projet) {
// Vérification de la présence du projet dans les préférences de l'utilisateur
$UtilisateurAProjet = new UtilisateurAProjet();
$cmd = UtilisateurAProjet::GUAP_ID;
$param = array($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur(), $Projet->getIdProjet());
$coche = false;
if ($present = $UtilisateurAProjet->consulter($cmd, $param)) {
$coche = true;
}
// Récupération de la catégorie du projet
$ProjetCategorie = new ProjetCategorie();
$Categorie = current($ProjetCategorie->consulter(ProjetCategorie::GPC_ID, $Projet->getCeCategorie()));
// Récupération de toutes les infos
$aso_preferences['preferences'][$Categorie->getLibelle()][] = array(
'id' => $Projet->getIdProjet(),
'valeur' => $Projet->getIdProjet(),
'nom' => $Projet->getNom(),
'coche' => $coche);
}
ksort($aso_preferences['preferences']);
}
//echo '<pre>'.print_r($aso_preferences, true).'</pre>';
$this->getRegistre()->ajouterDonnee('preferences', $aso_preferences);
}
50,13 → 55,15
$UtilisateurAProjet->setIdUtilisateur($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur());
$UtilisateurAProjet->supprimer();
//echo '<pre>'.print_r($_POST, true).'</pre>';
foreach ($_POST['pr'] as $pr_id) {
$UtilisateurAProjet = new UtilisateurAProjet();
$UtilisateurAProjet->setIdUtilisateur($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur());
$UtilisateurAProjet->setIdProjet($pr_id);
$UtilisateurAProjet->ajouter();
if (isset($_POST['pr'])) {
foreach ($_POST['pr'] as $pr_id) {
$UtilisateurAProjet = new UtilisateurAProjet();
$UtilisateurAProjet->setIdUtilisateur($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur());
$UtilisateurAProjet->setIdProjet($pr_id);
$UtilisateurAProjet->ajouter();
}
}
 
// Action suivante
$this->setSuivant('__defaut__');
}
/trunk/actions/GttCtrlActionAdminUtilisateur.class.php
173,9 → 173,6
public function executerAjouter()
{
$Utilisateur = new Utilisateur();
$UtilisateurMax = $Utilisateur->consulter(Utilisateur::GU_ID_MAX);
$id_max = $UtilisateurMax->getIdUtilisateur();
$Utilisateur->setIdUtilisateur(++$id_max);
$Utilisateur->setNom($_POST['ut_nom']);
$Utilisateur->setPrenom($_POST['ut_prenom']);
$Utilisateur->setAdresse($_POST['ut_adresse']);
236,13 → 233,42
 
public function executerSupprimer()
{
// Suppression du statut d'utilisateur
$aso_admin_utilisateur = array();
// Vérif du nombre d'utilisateur admin (doit être supérieur à 1)
$Utilisateur = new Utilisateur();
$Utilisateur->setIdUtilisateur($_POST['utsu_id']);
$Utilisateur->supprimer();
$nbre_admin = $Utilisateur->consulter(Utilisateur::GU_ADMIN);
if (count($nbre_admin) > 1) {
trigger_error('Utilisateur admin > 1 -> OK', E_USER_NOTICE);
// Vérif des travail_projets
$TravailProjet = new TravailProjet();
$bool_existe = $TravailProjet->consulter(TravailProjet::GTP_UTILISATEUR, array($_POST['utsu_id']));
if ($bool_existe == false) {
trigger_error('TravailProjet -> OK', E_USER_NOTICE);
// Vérif des absences
$Absence = new Absence();
$bool_existe = $Absence->consulter(Absence::GA_ID_UTILISATEUR, array($_POST['utsu_id']));
if ($bool_existe == false) {
trigger_error('Absence -> OK', E_USER_NOTICE);
// Suppression de l'utilisateur
$Utilisateur = new Utilisateur();
$Utilisateur->setIdUtilisateur($_POST['utsu_id']);
if ($Utilisateur->supprimer()) {
$aso_admin_utilisateur['messages'][] = "L'utilisateur a été supprimé.";
}
}
}
} else {
$aso_admin_utilisateur['messages'][] = "Il n'est pas possible de supprimer le seul administrateur!";
}
// Message d'erreur si l'utilisateur contient des données
if (isset($bool_existe) && $bool_existe != false) {
$aso_admin_utilisateur['messages'][] = "Il n'est pas possible de supprimer un utilisateur contenant des données!";
}
 
// TODO : Suppression des données de cet utilisateur
 
// Enregistrement du message
$this->getRegistre()->ajouterDonnee('admin_utilisateur', $aso_admin_utilisateur);
// Action suivante
$this->setSuivant('__defaut__');
}
/trunk/gtt_config.inc.php
65,9 → 65,9
/** Constante stockant si oui ou non on veut afficher le débogage des fichiers PEAR.*/
define('GTT_DEBOGAGE_PEAR', false);
/** Constante stockant la chaine permettant de repérer en se basant sur le chemin, les fichiers provenant de la bibliothèque PEAR.*/
define('GTT_DEBOGAGE_PEAR_CHAINE', '/lib/php/');
define('GTT_DEBOGAGE_PEAR_REGEXP_CHAINE', '/(?:\/lib\/php\/|pear)/i');
/** Constante stockant une expression régulière permettant de repérer en se basant sur le message, les fichiers provenant de la bibliothèque PEAR.*/
define('GTT_DEBOGAGE_PEAR_REGEXP_MESSAGE', '/^Non-static method (?:DB|PEAR|Calendar_Engine_Factory|Calendar_Factory)/');
define('GTT_DEBOGAGE_PEAR_REGEXP_MESSAGE', '/Non-static method (?:DB|PEAR|Calendar_Engine_Factory|Calendar_Factory)/i');
/** Constante stockant si oui ou non on veut afficher le contexte de débogage.*/
define('GTT_DEBOGAGE_CONTEXTE', false);
/** Constante stockant une valeur correspondant au niveau d'erreur à employer pour le code PHP.*/
/trunk/documentation/gtt_v4.xml
258,6 → 258,7
</SETTINGS>
<METADATA>
<REGIONS>
<REGION ID="1777" RegionName="A impl\195\169menter" XPos="969" YPos="148" Width="340" Height="670" RegionColor="0" TablePrefix="0" TableType="0" OverwriteTablePrefix="0" OverwriteTableType="0" Comments="" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="27" />
</REGIONS>
<TABLES>
<TABLE ID="1394" Tablename="gestion_absence" PrevTableName="" XPos="386" YPos="643" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="2" >
300,7 → 301,7
</TABLE>
<TABLE ID="1395" Tablename="gestion_projet_categorie" PrevTableName="gestion_categorie" XPos="43" YPos="71" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="3" >
<COLUMNS>
<COLUMN ID="1415" ColName="gpc_id_categorie" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<COLUMN ID="1415" ColName="gpc_id_categorie" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
452,7 → 453,7
</TABLE>
<TABLE ID="1399" Tablename="gestion_absence_motif" PrevTableName="gestion_motif_absence" XPos="44" YPos="521" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="7" >
<COLUMNS>
<COLUMN ID="1435" ColName="gam_id_absence_motif" PrevColName="" Pos="1" idDatatype="1" DatatypeParams="(3)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<COLUMN ID="1435" ColName="gam_id_absence_motif" PrevColName="" Pos="1" idDatatype="1" DatatypeParams="(3)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
463,18 → 464,14
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1770" ColName="gam_cp_diminuer" PrevColName="" Pos="2" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si ce motif diminue le nombre d\aheur de cong\195\169s pay\195\169s.">
<COLUMN ID="1770" ColName="gam_mark_cp_diminuer" PrevColName="gam_cp_diminuer" Pos="2" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si ce motif diminue le nombre d\aheur de cong\195\169s pay\195\169s.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1771" ColName="gam_hs_augmenter" PrevColName="" Pos="3" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si ce motif augmente quand m\195\170me le nombre d\aheures supl\195\169mentaires.">
<COLUMN ID="1772" ColName="gam_mark_hs_diminuer" PrevColName="gam_hs_diminuer" Pos="4" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si ce motif diminue le nombre d\aheures supl\195\169mentaires.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1772" ColName="gam_hs_diminuer" PrevColName="" Pos="4" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si ce motif diminue le nombre d\aheures supl\195\169mentaires.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="1583" />
517,7 → 514,7
</TABLE>
<TABLE ID="1404" Tablename="gestion_projet" PrevTableName="" XPos="44" YPos="195" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="12" >
<COLUMNS>
<COLUMN ID="1522" ColName="gp_id_projet" PrevColName="" Pos="6" idDatatype="5" DatatypeParams="(11)" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant du projet.">
<COLUMN ID="1522" ColName="gp_id_projet" PrevColName="" Pos="6" idDatatype="5" DatatypeParams="(11)" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
583,7 → 580,7
</TABLE>
<TABLE ID="1405" Tablename="gestion_utilisateur_statut" PrevTableName="gestion_statut" XPos="673" YPos="234" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="13" >
<COLUMNS>
<COLUMN ID="1461" ColName="gus_id_utilisateur_statut" PrevColName="" Pos="1" idDatatype="1" DatatypeParams="(3)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<COLUMN ID="1461" ColName="gus_id_utilisateur_statut" PrevColName="" Pos="1" idDatatype="1" DatatypeParams="(3)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
650,7 → 647,7
</TABLE>
<TABLE ID="1408" Tablename="gestion_utilisateur" PrevTableName="" XPos="686" YPos="365" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="16" >
<COLUMNS>
<COLUMN ID="1477" ColName="gu_id_utilisateur" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<COLUMN ID="1477" ColName="gu_id_utilisateur" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="(11)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />