Subversion Repositories Applications.gtt

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1 → Rev 2

/trunk/menu/gtt_menu_admin_utilisateur.php
New file
0,0 → 1,354
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
// |@version 3 |
/*@package gtt_general
//Auteur original :
*@author Dorian Bannier <dbannier@aol.com>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Copyright (C) 2003 Tela-Botanica
@version $Date: 2004/07/06
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
 
include_once CHEMIN_CLASSES_METIER.'gtt_statut.class.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_utilisateur.php';
 
//inclusion des paquets de la librairie pear
include_once 'HTML/QuickForm.php';
 
 
/**
*focntion affichant le menu aministration utilisateur
*@$tabDef =tableau contenant les parametres par defaut
*@$test =test si on est en insertion ou modification
*@ $mode = 1 =>modification
*@ $mode =0 =>insertion
*/
 
function afficherMenuAjouterUser($tabDef,$mode)
{
$id="MANIPULER_USER";
$size=30;
$assoc1 =array('class'=>$id);
$form=new HTML_QuickForm('gestion_utilisateur', 'post',$GLOBALS['urlBase'].GESTION_ADMIN_UTILISATEUR,'', $assoc1);
//creation des templates pour la mise en forme
$squelette =& $form->defaultRenderer();
$squelette->setFormTemplate("\n<form{attributes}>\n<ul>{content}\n</ul></form>");
$squelette->setElementTemplate('<li>'."\n".'{label}'."\n".'{element}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
$squelette->setGroupElementTemplate('{label}{element}','groupe');
$squelette->setRequiredNoteTemplate("\n".'<li>'.'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'.'</li>'."\n");
$squelette->setHeaderTemplate("\n".'<li><h2>'."\n".'{header}'."\n".'</h2></li>'."\n");
//entete du formulaire
$form->addElement('header', 'entete', GESTION_AJOUTER_UTILISATEUR_L);
//creation des Messages d'erreur
$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
//creation et ajouts des elements
//element cache pour verifier si formulaire est en mode insertion ou modification
$form->addElement('hidden', 'champ_verif', $mode);
//definition du champ d'activation
//premier ligne: nom
$size=20;
$assoc=array('class' =>$id, 'size'=>$size);
//desactivation des champs si mode modification
if ($mode==1)
{
$temp_assoc=array('disabled');
$assoc=array_merge($assoc,$temp_assoc);
}
$ligneNom = &HTML_QuickForm::createElement('text', 'champ_nom',GESTION_NOM_L.': ',$assoc);
$form->addElement($ligneNom);
//ligne : prenom
$assoc=array('class' =>$id, 'size'=>$size);
//desactivation des champs si mode modification
if ($mode==1)
{
$temp_assoc=array('disabled');
$assoc=array_merge($assoc,$temp_assoc);
}
$lignePrenom = &HTML_QuickForm::createElement('text', 'champ_prenom',GESTION_PRENOM_L.': ',$assoc);
$form->addElement($lignePrenom);
// ligne : adresse
$assoc=array('class' =>$id, 'size'=>$size);
$ligneAdresse= &HTML_QuickForm::createElement('text', 'champ_adresse',GTT_L_FU_ADRESSE.': ',$assoc);
$form->addElement($ligneAdresse);
//ligne :ville
$assoc=array('class' =>$id, 'size'=>$size);
$ligneVille = &HTML_QuickForm::createElement('text', 'champ_ville',GTT_L_FU_VILLE.': ',$assoc);
$form->addElement($ligneVille);
// ligne : code postal
$size=5;
$assoc=array('class' =>$id, 'size'=>$size);
$ligneCode = &HTML_QuickForm::createElement('text', 'champ_code_postal',GTT_L_FU_CODE_POSTAL.': ',$assoc);
$form->addElement($ligneCode);
// ligne :telephone
$size=10;
$assoc=array('class' =>$id, 'size'=>$size);
$ligneTel=&HTML_QuickForm::createElement('text', 'champ_telephone',GTT_L_FU_TEL.': ',$assoc);
$form->addElement($ligneTel);
// ligne :email
$size=25;
$assoc=array('class' =>$id, 'size'=>$size);
$ligneMail=&HTML_QuickForm::createElement('text', 'champ_email',GTT_L_FU_EMAIL.': ',$assoc);
$form->addElement($ligneMail);
// ligne : explication
$cl="EXPLICATION";
$assoc=array('class' =>$cl, 'size'=>$size);
if ($mode==1)
{
$ligneExplication=&HTML_QuickForm::createElement('HTML',GTT_L_FU_MAJ_MDP);
$form->addElement($ligneExplication);
}
// ligne : mot de passe
$size=20;
$assoc=array('class' =>$id, 'size'=>$size);
$ligneMDP=&HTML_QuickForm::createElement('password', 'champ_password',GTT_L_FU_MDP.': ', $assoc);
$form->addElement($ligneMDP);
//ligne : confirmer mot de passe
$assoc=array('class' =>$id, 'size'=>$size);
$ligneConfirmMDP=&HTML_QuickForm::createElement('password', 'champ_confirm_password',GTT_L_FU_CONFIRMATION_MDP.': ',$assoc);
$form->addElement( $ligneConfirmMDP);
//recuperation de la liste de statut
$assoc=array('class' =>$id);
$ligneStatut = &HTML_QuickForm::createElement('select', 'champ_statut',GESTION_STATUT_L.': ','',$assoc);
$ligneStatut->load($result) ;
$c="SELECT * FROM ".GEST_STATUT."";
$ligneStatut->loadQuery($GLOBALS['dsn'],$c,GEST_CHAMPS_LIBELLE_STATUT,GEST_CHAMPS_ID_STATUT);
$form->addElement($ligneStatut);
//conges payes initiaux
$size=3;
$assoc=array('class' =>$id, 'size'=>$size);
//desactivation des champs si mode modification
if ($mode==1)
{
$temp_assoc=array('disabled');
$assoc=array_merge($assoc,$temp_assoc);
}
$ligneConges = &HTML_QuickForm::createElement('text', 'champ_nb_conge',GESTION_CONGES_INIT_L.': ',$assoc);
$form->addElement($ligneConges);
 
//temps journalier de travail
$size=3;
$assoc=array('class' =>$id, 'size'=>$size);
$ligneTT = &HTML_QuickForm::createElement('text', 'champ_temps_travail',GTT_L_FU_TEMPS_TRAVAIL.': ',$assoc);
$form->addElement($ligneTT);
//heures supp
//desactivation des champs si mode modification
$size=3;
$assoc=array('class' =>$id, 'size'=>$size);
if ($mode==1)
{
$temp_assoc=array('disabled');
$assoc=array_merge($assoc,$temp_assoc);
}
$ligneHeuresSup = &HTML_QuickForm::createElement('text', 'champ_heure_supp_init',GESTION_HEURESINIT_L.': ',$assoc);
$form->addElement($ligneHeuresSup);
//administrateur
$size=1;
$assoc=array('class' =>$id,'size'=>$size);
$ligneAdmin = &HTML_QuickForm::createElement('checkbox', 'champ_administrateur',GTT_L_FU_ADMIN.': ','',$assoc);
if ($mode==1 and $tabDef['champ_administrateur']==true)
{
$ligneAdmin->setChecked(true);
}else{
$ligneAdmin->setChecked(false);
}
$form->addElement($ligneAdmin);
//ligne : admin2
$ligneAdmin2= &HTML_QuickForm::createElement('checkbox', 'champ_admin2',GTT_L_FU_ADMIN_2.': ','',$assoc);
if ($mode==1 and $tabDef['champ_admin2']==true)
{
$ligneAdmin2->setChecked(true);
}else{
$ligneAdmin2->setChecked(false);
}
$form->addElement($ligneAdmin2);
//element ok : valider le formulaire
$bouton=&HTML_QuickForm::createElement('submit', 'champ_valider',GTT_L_G_VALIDER,$assoc);
$form->addElement($bouton);
//ajout des regles de saisie
$form->applyFilter('champ_nom', 'trim');
$form->applyFilter('champ_prenom','trim');
$form->applyFilter('champ_email', 'trim');
//regles individuelles
//regles applicables si on est en mode insertion
if($mode==0)
{
$form->addRule('champ_nom',GTT_ERREUR_NOM, 'required','','client');
$form->addRule('champ_nom',GTT_ERREUR_NOM, 'lettersonly','','client');
$form->addRule('champ_prenom',GTT_ERREUR_PRENOM, 'required','','client');
$form->addRule('champ_prenom',GTT_ERREUR_PRENOM, 'lettersonly','','client');
$form->addRule('champ_password',GTT_ERREUR_PASSWD, 'required','','client');
$form->addRule('champ_confirm_password','', 'required','','client');
$form->addRule('champ_nb_conge',GTT_ERREUR_NOMBRE, 'numeric','','client');
$form->addRule('champ_heure_supp_init',GTT_ERREUR_NOMBRE, 'numeric','','client');
}
$form->addRule(array('champ_password','champ_confirm_password'),GESTION_ERREUR_PASSWORD_L, 'compare','','client');
$form->addRule('champ_temps_travail',GTT_ERREUR_NOMBRE, 'numeric','','client');
//nouvelles regles
$form->registerRule('verifValeurTemps','function','verifValeurTemps');
$form->addRule('champ_temps_travail',GTT_ERREUR_NOMBRE, 'verifValeurTemps','','client');
$form->addRule('champ_code_postal',GTT_ERREUR_NOMBRE, 'numeric','','client');
$form->addRule('champ_telephone',GTT_ERREUR_TEL, 'numeric','','client');
$form->addRule('champ_email',GTT_ERREUR_MAIL, 'required','','client');
$form->addRule('champ_email',GTT_ERREUR_MAIL, 'email','','client');
//creation de valeurs par defaut
$default=array("champ_nom"=> null,
"champ_prenom"=>null,
"champ_adresse" =>null,
"champ_ville" =>null,
"champ_code_postal" =>0,
"champ_telephone" => 0,
"champ_email" =>null,
"champ_administrateur" =>false,
"champ_statut"=>0,
"champ_admin2"=> false,
"champ_nb_conge"=>0,
"champ_temps_travail"=>7,
"champ_heure_supp_init"=>0);
if ($mode==1)
{
$form->setDefaults($tabDef);
$form->addElement('hidden', 'nom_utilisateur',$tabDef["champ_nom"]);
$form->addElement('hidden', 'prenom_utilisateur',$tabDef["champ_prenom"]);
$form->addElement('hidden', 'conges_utilisateur',$tabDef["champ_nb_conge"]);
$form->addElement('hidden', 'heure_supp_utilisateur',$tabDef["champ_heure_supp_init"]);
}else {
$form->setDefaults($default);
}
//ajout des regles de saisie
$form->applyFilter('champ_nom', 'trim');
$form->applyFilter('champ_prenom','trim');
$form->applyFilter('champ_email', 'trim');
$form->applyFilter('champ_adresse','trim');
return $form;
}
/**
*fonction creant le formulaire de suppression d'utilisateur
*affiche la liste des utilisateurs
*la supression se fera en fonction du choix de l'utilisateur
*/
 
function afficherMenuEditerUser()
{
$id="EDITER_USER";
$size=30;
$assoc1 =array('class'=>$id);
$form= new HTML_QuickForm('editer_utilisateur', 'post',$GLOBALS['urlBase'].GESTION_EDITER_UTILISATEUR,'',$assoc1);
$form->addElement('header', 'entete', GESTION_EDITER_UTILISATEUR_L);
//creation des elements
$id="EDITER_USER";
$assoc=array('class' =>$id);
$ligne[0]=&HTML_QuickForm::createElement('select', 'champ_utilisateur_supprimer',GESTION_UTILISATEUR_L." : ",'',$assoc);
$ligne[0]->load($result) ;
$c="SELECT * FROM ".GEST_UTILISATEUR."";
$ligne[0]->loadQuery($GLOBALS['dsn'],$c,GEST_CHAMPS_NOM,GEST_CHAMPS_ID_UTILISATEUR);
// $ligne[1]=&HTML_QuickForm::createElement('html','<a href ="'.$GLOBALS['urlBase'].GESTION_EDITER_UTILISATEUR.'">');
$ligne[2]=&HTML_QuickForm::createElement('submit', 'btn_modifier',GTT_L_G_MODIFIER, $assoc);
// $ligne[3]=&HTML_QuickForm::createElement('html','</a>');
//$ligne[4]=&HTML_QuickForm::createElement('html','<a href ="'.$GLOBALS['urlBase'].GESTION_ADMIN_UTILISATEUR.'">');
$ligne[5]=&HTML_QuickForm::createElement('submit', 'btn_supprimer',GTT_L_G_SUPPRIMER,$assoc);
// $ligne[6]=&HTML_QuickForm::createElement('html','</a>');
$form->addElement('hidden','action',GESTION_EDITER_UTILISATEUR);
//ajout
$form->addGroup($ligne,'groupe',"",'&nbsp',false);
//validation des donnees
return $form;
}
?>
/trunk/menu/gtt_menu_travail.php
New file
0,0 → 1,321
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
// |@version 3 |
/*@package gtt_general
//Auteur original :
*@author Dorian Bannier <dbannier@aol.com>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Copyright (C) 2003 Tela-Botanica
@version $Date: 2004/07/06
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
include_once CHEMIN_CLASSES_METIER.'gtt_travail.class.php';
include_once CHEMIN_CLASSES_METIER.'gtt_projet.class.php';
include_once CHEMIN_CLASSES_METIER.'gtt_absence.class.php';
include_once CHEMIN_CALENDRIER.'gtt_calendrier.class.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_travail.php';
//fichier langues
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
//inclusion des paquets de la librairie pear
include_once 'HTML/QuickForm.php';
 
/**
*fonction affichant le tableau des jours
*et le menu travail
*@param : $utilisateur : identifiant de l'utilisateur
*@param : semaine : numero de semaine
*/
function afficherTableauJour($url,$utilisateur,$semaine,$annee)
{
$id10="TABLEAU_JOUR_TRAVAIL";
$assoc10=array('class'=>$id10);
$form=new HTML_QuickForm('tableau_travail','post',$GLOBALS['urlBase'].GESTION_TRAVAIL,'',$assoc10);
//templates
$squelette =& $form->defaultRenderer();
$squelette->setGroupElementTemplate('<td>{label}{element}</td>','groupe');
//construction d'une preference
$pref=new Preference($utilisateur,0);
//recuperation du tableau de preferences regroupes par categorie
$tabPref=$pref->recupererTableauPreferences();
 
//creation des Messages d'erreur
$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
//affichage du nom, conges et heure supp de la personn
$user=&Utilisateur::recupererUtilisateur($utilisateur);
if($user!=-1)
{
$z=$form->addElement('html','<tr><td>'.GTT_L_TR_BIENVENUE."\t".$user->getPrenom()."\t".
$user->getNom().'</td></tr>');
$z=$form->addElement('html','<tr><td>'.'</td></tr>');
if($user->getConges()==1 or $user->getConges()==0 or $user->getConges()==-1)
{
$jour=GESTION_RTTJOUR_L;
}else $jour =GESTION_RTTJOURS_L;
$z=$form->addElement('html','<tr><td>'.GTT_L_TR_JOURS_CONGES." : ".$user->getConges().$jour.'</td></tr>');
$z=$form->addElement('html','<tr><td>'.'</td></tr>');
$quota=$user->getQuota();
$jour1=intval($quota / 24);
$heure= ($quota %24);
if($heure==0 or $heure==1 or $heure==-1)
{
$h=GTT_L_TR_HEURE_L;
}else $h=GTT_L_TR_HEURES_L;
if($jour1==0 or $jour1==1 or $jour1==-1)
{
$jour2=GESTION_RTTJOUR_L;
}else $jour2=GESTION_RTTJOURS_L;
$temps =$jour1.'&nbsp'.$jour2.'&nbsp'.$heure.'&nbsp'.$h;
$z=$form->addElement('html','<tr><td>'.GTT_L_TR_JOURS_RECUPERATION." : ".'</td></tr>');
$z=$form->addElement('html','<tr><td>'." ".$jour1.$jour2."\t".$heure.$h.'</td></tr>');
$z=$form->addElement('html','<tr><td>'.'</td></tr>');
}
//insertion du calendrier
$calendrier=new Calendrier($url,$semaine,$annee);
//affichage de la ligne mois
$z=$form->addElement('html','<tr><td>'.GTT_L_TR_MOIS." : ".
$calendrier->nom_mois[$calendrier->mois]."\t".$calendrier->annee.'</td></tr>');
$aff=$calendrier->afficherCalendrier($annee);
$form->addElement('html','<tr><td>'.$aff.'</td></tr>');
$z=$form->addElement('html','<tr><td>'.'</td></tr>');
//memoriser le nombre de projets inclus dans les preferences
$form->addElement('hidden','champ_nb_projet',count($tabPref));
//creation du tableau
$cat='';
$ok=0;
$form->addElement('html','<tr><td>'.GESTION_PROJETS_L.'</td><td></td><td>'.GESTION_LUN_L.'</td><td>'.
GESTION_MAR_L.'</td><td>'.GESTION_MER_L.'</td><td>'.GESTION_JEU_L.
'</td><td>'.GESTION_VEN_L.'</td><td>'.GESTION_SAM_L.'</td><td>'.GESTION_DIM_L.
'</td><td>'.GESTION_TACHES_L.'</td></tr>');
for ($i=0; $i<count($tabPref) ;$i++)
{
//ligne categorie si categorie pas deja inseree
$tabLigne=$tabPref[$i];
if ($cat!=$tabLigne['libelle_cat'])
{
$size1=25;
$id1="nom_categorie";
$assoc1=array('class' =>$id1, 'size'=>$size1);
$ligneNomCat=&HTML_QuickForm::createElement('html', '<tr><td>'.$tabLigne['libelle_cat'].' : '.'</td></tr>');
$form->addElement($ligneNomCat);
$cat =$tabLigne['libelle_cat'];
}
//creation de l'element hidden pour memoriser l'identifiant du projet
$ligneIdProjet=&HTML_QuickForm::createElement('hidden', 'champ_id_projet'.$i,$tabLigne['id_proj']);
$form->addElement($ligneIdProjet);
//nom des jours
$id2="nom_jours";
$size2=5;
$assoc2=array('class' =>$id2, 'size'=>$size2);
$ligne2[0]=&HTML_QuickForm::createElement('text','champ_lundi'.$i,'',$assoc2);
$ligne2[1]=&HTML_QuickForm::createElement('text','champ_mardi'.$i,'',$assoc2);
$ligne2[2]=&HTML_QuickForm::createElement('text','champ_mercredi'.$i,'',$assoc2);
$ligne2[3]=&HTML_QuickForm::createElement('text','champ_jeudi'.$i,'',$assoc2);
$ligne2[4]=&HTML_QuickForm::createElement('text','champ_vendredi'.$i,'',$assoc2);
$ligne2[5]=&HTML_QuickForm::createElement('text','champ_samedi'.$i,'',$assoc2);
$ligne2[6]=&HTML_QuickForm::createElement('text','champ_dimanche'.$i,'',$assoc2);
//creation des taches
$id3="nom_taches";
$assoc3=array('class' =>$id3);
$ligne2[7]=&HTML_QuickForm::createElement('select','champ_tache'.$i,'','',$assoc3);
//verification si le projet contient une tache
$verification=&Projet::contientTache($tabLigne['id_proj']);
//enregistrement de la tache par defaut
if ($verification!=1)
{
$tache=new Tache(0);
$tache->construireDefaultTache($tabLigne['id_proj'],GESTION_NOM_TACHE_DEFAUT_L);
$tache->enregistrerNewDefaultTache();
}
$ligne2[7]->load($result) ;
$c="SELECT * FROM ".GEST_TACHES." WHERE ".GEST_CHAMPS_ID_PROJET." = $tabLigne[id_proj]";
$ligne2[7]->loadQuery($GLOBALS['dsn'],$c,GEST_CHAMPS_NOM_TACHE,GEST_CHAMPS_ID_TACHE);
//recuperation de l'identifiant de la tache par defaut
$idDefTache=&Tache::recupererIdentifiantDefaultTache();
$ligne2[7]->setSelected(GESTION_NOM_TACHE_DEFAUT_L,$idDefTache);
$form->addGroup($ligne2,'groupe',$tabLigne['nom_proj'].' : ','&nbsp',false);
//filtres
$form->applyFilter('champ_lundi'.$i,'trim');
$form->applyFilter('champ_mardi'.$i,'trim');
$form->applyFilter('champ_mercredi'.$i,'trim');
$form->applyFilter('champ_jeudi'.$i,'trim');
$form->applyFilter('champ_vendredi'.$i,'trim');
$form->applyFilter('champ_samedi'.$i,'trim');
$form->applyFilter('champ_dimanche'.$i,'trim');
//creation de regles
$regle['champ_lundi'.$i][]=array(GTT_ERREUR_NOMBRE,'numeric','','client');
$regle['champ_mardi'.$i][]=array(GTT_ERREUR_NOMBRE,'numeric','','client');
$regle['champ_mercredi'.$i][]=array(GTT_ERREUR_NOMBRE,'numeric','','client');
$regle['champ_jeudi'.$i][]=array(GTT_ERREUR_NOMBRE,'numeric','','client');
$regle['champ_vendredi'.$i][]=array(GTT_ERREUR_NOMBRE,'numeric','','client');
$regle['champ_samedi'.$i][]=array(GTT_ERREUR_NOMBRE,'numeric','','client');
$regle['champ_dimanche'.$i][]=array(GTT_ERREUR_NOMBRE,'numeric','','client');
$form->addGroupRule('groupe', $regle);
}
//enregistrement de regles
$form->registerRule('verifTempsTravail','function','verifTempsTravail');
$regle2['champ_tache0'][]=array(GESTION_ERREUR_L,'verifTempsTravail','','client');
$form->addGroupRule('groupe', $regle2);
//ligne type de jour
$id4="type_jour";
$size4=3;
$assoc4=array('classe'=>$id4,'cols'=>10);
$tabMotif=&Motif::recupererTableauMotif();
$tabTypeJour1=array();
for ($h=0;$h<count($tabMotif);$h++)
{
array_push($tabTypeJour1,trim($tabMotif[$h][GEST_CHAMPS_LIBELLE_MOTIF]));
//champ cache pour recuperer le type de jour si des modifications
//sont faites eventuellement dans la base de donnees
//et le rang des motifs d'absence se b=voit altéré
$y=& $form->addElement('hidden',"champ_libelle_type_jour".$h,trim($tabMotif[$h][GEST_CHAMPS_LIBELLE_MOTIF]) );
$z=& $form->addElement('hidden',"champ_rtt_type_jour".$h,($tabMotif[$h][GEST_CHAMPS_TYPE_RTT]) );
}
$y=& $form->addElement('hidden',"champ_libelle_type_jour".count($tabMotif),GTT_NOM_TRAVAIL);
$z=& $form->addElement('hidden',"champ_rtt_type_jour".count($tabMotif),1);
array_push($tabTypeJour1,GTT_NOM_TRAVAIL);
$z=& $form->addElement('hidden',"champ_rtt_type_jour".(count($tabMotif)+1),1);
$y=& $form->addElement('hidden',"champ_libelle_type_jour".(count($tabMotif)+1),GTT_NOM_WEEK_END);
//CHAMP POUR AVOIR LE NOMBRE DE TYPE DE JOUR
$y=& $form->addElement('hidden',"champ_nb_type_jour",(count($tabMotif)+1+1));
//determination des indices des valeurs dans la table
$ferie=array_search('Ferié',$tabTypeJour1);
$trav=array_search('travail',$tabTypeJour1);
//calcul de la date du premier jour de la semaine choisie
$tabJour=$calendrier->lundiEtDimancheSemaine($calendrier->semaine,$calendrier->annee);
$d=date('d',mktime(0,0,0,1,$tabJour[0],$calendrier->annee));
$m=date('m',mktime(0,0,0,1,$tabJour[0],$calendrier->annee));
$Y=date('Y',mktime(0,0,0,1,$tabJour[0],$calendrier->annee));
//recuperation de la liste des absences de l'utilisateur
$listeAbsence=&Absence::recupAbsence( $GLOBALS['idCurrentUser'],date('Y-m-d',mktime(0,0,0,1,$tabJour[0],$calendrier->annee)),
date('Y-m-d',mktime(0,0,0,1,$tabJour[1],$calendrier->annee)));
//creation du tableau pour les week ends
$tabTypeJour2=array(array_search(GTT_NOM_TRAVAIL,$tabTypeJour1) => GTT_NOM_TRAVAIL,
(array_search(GTT_NOM_TRAVAIL,$tabTypeJour1)+1) =>GTT_NOM_WEEK_END);
//parcours de la liste de jours
for ($g=0;$g<7;$g++)
{
//creation des dates de la semaine
$date=mktime(0,0,0,$m,$d+(1*$g),$Y);
//ajout d'un element cache pour recuperer les dates
$form->addElement('hidden','champ_date_j'.$g,$date);
//proposition de l'option week end que si on est en we
if($g==5 or $g==6)
{
$tabTypeJour=$tabTypeJour2;
}else
{
$tabTypeJour=$tabTypeJour1;
}
$ligneType[$g]=&HTML_QuickForm::createElement('select','champ_type_jour'.$g,'',$tabTypeJour,$assoc4);
//determination du type de jour
//weekend
if (($g==5)or ($g==6))
{
$ligneType[$g]->setSelected(array_search(GTT_NOM_WEEK_END,$tabTypeJour));
}
//jours feries
elseif (in_array($date,$calendrier->liste_feries)==1 and ($g!=5 and $g!=6))
{
$ligneType[$g]->setSelected(array_search(GTT_NOM_FERIE,$tabTypeJour));
}else
{
$ligneType[$g]->setSelected(array_search(GTT_NOM_TRAVAIL,$tabTypeJour));
}
//parcours de liste des absences
if(count($listeAbsence)!=0)
{
for($t=0;$t<count($listeAbsence);$t++)
{
$h=$listeAbsence[$t];
$debAbs=explode('-',$h[GEST_CHAMPS_DATE_DEBUT_ABSENCE]);
$dateDebAbs=mktime(0,0,0,$debAbs[1],$debAbs[2],$debAbs[0]);
//date fin absence
if($h[GEST_CHAMPS_DATE_FIN_ABSENCE]!='0000-00-00')
{
$finAbs=explode('-',$h[GEST_CHAMPS_DATE_FIN_ABSENCE]);
$dateFinAbs=mktime(0,0,0,$finAbs[1],$finAbs[2],$finAbs[0]);
if (($dateDebAbs<=$date)and ($date<=$dateFinAbs))
{
$ligneType[$g]->setSelected($h[GEST_CHAMPS_ID_MOTIF]);
}
}else{
//cas ou la date de fin n'est pas rentre
if($dateDebAbs==$date)
{
$ligneType[$g]->setSelected($h[GEST_CHAMPS_ID_MOTIF]);
}
}
}
}
}
$form->addGroup($ligneType,'groupe','Type de Jour : ','&nbsp',false);
//ligne bouton validation
$size4=5;
$id4='bouton_valider_travail';
$assoc4=array('class' =>$id4, 'size'=>$size4);
$boutonSubmit= &HTML_QuickForm::createElement('submit', 'champ_valider_travail',GTT_L_G_VALIDER,$assoc4);
$form->addElement($boutonSubmit);
$form->addElement('html',afficherOptionAplication($utilisateur));
return $form;
}
 
?>
Property changes:
Added: svn:executable
/trunk/menu/CVS/Entries
New file
0,0 → 1,8
/gtt_menu_absence.php/1.1/Tue Feb 22 12:07:13 2005//
/gtt_menu_admin_categorie.php/1.1/Tue Feb 22 12:07:13 2005//
/gtt_menu_admin_motif_absence.php/1.1/Tue Feb 22 12:07:13 2005//
/gtt_menu_admin_projet.php/1.1/Tue Feb 22 12:07:13 2005//
/gtt_menu_admin_statut.php/1.1/Tue Feb 22 12:07:13 2005//
/gtt_menu_admin_utilisateur.php/1.1/Tue Feb 22 12:07:13 2005//
/gtt_menu_editer_preferences.php/1.1/Tue Feb 22 12:07:13 2005//
/gtt_menu_travail.php/1.1/Tue Feb 22 12:07:13 2005//
/trunk/menu/CVS/Repository
New file
0,0 → 1,0
gestion/version_3/menu
/trunk/menu/CVS/Root
New file
0,0 → 1,0
:extssh:jp_milcent@adullact.net:/cvsroot/eflore
/trunk/menu/gtt_menu_admin_motif_absence.php
New file
0,0 → 1,155
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
// |@version 3 |
/*@package gtt_general
//Auteur original :
*@author Dorian Bannier <dbannier@aol.com>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Copyright (C) 2003 Tela-Botanica
@version $Date: 2004/07/06
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
 
include_once CHEMIN_CLASSES_METIER.'gtt_motif.class.php';
//fichier langues
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
//inclusion des paquets de la librairie pear
include_once 'HTML/QuickForm.php';
 
/**
*fonction affichant le menu administration des motifs d'absence
*/
 
function afficherMenuAjouterMotif()
{
$id="AJOUTER_MOTIF";
$size=30;
$assoc1 =array('class'=>$id);
$form=new HTML_QuickForm('gestion_utilisateur', 'post',$GLOBALS['urlBase'].GESTION_ADMIN_MOTIF_ABSENCE,'', $assoc1);
//creation des templates
$squelette =&$form->defaultRenderer();
$squelette->setFormTemplate("\n<form{attributes}>\n<ul>{content}\n</ul></form>");
$squelette->setElementTemplate('<li>'."\n".'{label}'."\n".'{element}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
$squelette->setGroupElementTemplate('{label}{element}','groupe');
$squelette->setRequiredNoteTemplate("\n".'<li>'.'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'.'</li>'."\n");
$squelette->setHeaderTemplate("\n".'<li><h2>'."\n".'{header}'."\n".'</h2></li>'."\n");
//entete du formulaire
$form->addElement('header', 'entete', GESTION_ADMIN_MOTIF_L);
//creation des Messages d'erreur
$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
//creation et ajouts des elements
//ligne libelle motif
$size=25;
$assoc=array('class' =>$id, 'size'=>$size);
$ligneLibMotif= &HTML_QuickForm::createElement('text', 'champ_nom_motif',GESTION_LIBELLE_L.': ',$assoc);
$form->addElement($ligneLibMotif);
//ligne bouton validation
$size=5;
$assoc=array('class' =>$id, 'size'=>$size);
$boutonM = &HTML_QuickForm::createElement('submit', 'champ_valider_motif',GTT_L_G_VALIDER,$assoc);
$form->addElement($boutonM);
//ligne ajouter type RTT
$size=1;
$assoc=array('class' =>$id,'size'=>$size);
$ligneRtt = &HTML_QuickForm::createElement('checkbox', 'champ_rtt',GESTION_QUESTION_RTT_L.': ','',$assoc);
$ligneRtt->setChecked(true);
$form->addElement($ligneRtt);
//ajout de regles
$form->applyFilter('champ_nom_motif', 'trim');
$form->addRule('champ_nom_motif',GTT_ERREUR_NOM, 'required','','client');
$form->addRule('champ_nom_motif',GTT_ERREUR_NOM, 'alphanumeric','','client');
return $form;
}
/**
*fonction affichant le menu de supression d'un motif d'absence
*/
function afficherMenuSupressionMotif()
{
$id="SUPPRIMER_MOTIF";
$assoc1=array ('class' =>$id);
$form=new HTML_QuickForm('gestion_motif', 'post',$GLOBALS['urlBase'].GESTION_ADMIN_MOTIF_ABSENCE,'',$assoc1);
$squelette =&$form->defaultRenderer();
$squelette->setFormTemplate("\n<form{attributes}>\n<ul>{content}\n</ul></form>");
$squelette->setElementTemplate('<li>'."\n".'{label}'."\n".'{element}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
$squelette->setGroupElementTemplate('{label}{element}','groupe');
$squelette->setRequiredNoteTemplate("\n".'<li>'.'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'.'</li>'."\n");
$squelette->setHeaderTemplate("\n".'<li><h2>'."\n".'{header}'."\n".'</h2></li>'."\n");
//cration et ajout des elements
$form->addElement('header', 'entete', GESTION_SUPPRIMER_CONDITION_L);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
 
//creation des elements
$assoc=array('class' =>$id);
$ligne[0]=&HTML_QuickForm::createElement('select', 'champ_motif_supprimer',GESTION_MOTIF_L." : ",'',$assoc);
$ligne[0]->load($result) ;
$c="SELECT * FROM ".GEST_MOTIF_ABSENCE."";
 
$ligne[0]->loadQuery($GLOBALS['dsn'],$c,GEST_CHAMPS_LIBELLE_MOTIF,GEST_CHAMPS_ID_MOTIF);
$ligne[1]=&HTML_QuickForm::createElement('submit', 'btn_supprimer_motif',GTT_L_G_SUPPRIMER,$assoc);
//ajout
$form->addGroup($ligne,'groupe',"",'&nbsp',false);
//ajout des regles de groupe
$form->registerRule('verifMotifUtilise','function','verifMotifUtilise');
$regle['champ_motif_supprimer'][]=array(GTT_IMPOSSIBLE_SUPPR_MOTIF,'verifMotifUtilise','','client');
$form->addGroupRule('groupe', $regle);
return $form;
}
?>
/trunk/menu/gtt_menu_admin_categorie.php
New file
0,0 → 1,140
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
// |@version 3 |
/*@package gtt_general
//Auteur original :
*@author Dorian Bannier <dbannier@aol.com>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Copyright (C) 2003 Tela-Botanica
@version $Date: 2004/07/06
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
 
include_once CHEMIN_CLASSES_METIER.'gtt_categorie.class.php';
//fichier langues
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_categorie.php';
 
//inclusion des paquets de la librairie pear
include_once 'HTML/QuickForm.php';
 
 
/**
*fonction affichant le menu administration des categorie
*option ajout de categorie
*/
 
function afficherMenuAjouterCategorie()
{
 
$id="AJOUTER_CATEGORIE";
$assoc1=array ('class' =>$id);
$form=new HTML_QuickForm('gestion_categorie', 'post',$GLOBALS['urlBase'].GESTION_ADMIN_CATEGORIE,'',$assoc1);
$squelette =& $form->defaultRenderer();
$squelette->setFormTemplate("\n<form{attributes}>\n<ul>{content}\n</ul></form>");
$squelette->setElementTemplate('<li>'."\n".'{label}'."\n".'{element}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
$squelette->setGroupElementTemplate('{label}{element}','groupe');
$squelette->setRequiredNoteTemplate("\n".'<li>'.'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'.'</li>'."\n");
$squelette->setHeaderTemplate("\n".'<li><h2>'."\n".'{header}'."\n".'</h2></li>'."\n");
//creation et ajout des elements
$form->addElement('html','<fieldset>');
$form->addElement('header', 'entete', GESTION_AJOUTER_CATEGORIE_L);
//creation des Messages d'erreur
$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
//ligne nom categorie
$size=30;
$assoc=array('class' =>$id, 'size'=>$size);
$ligneNomCat= &HTML_QuickForm::createElement('text', 'champ_nom_cat',GESTION_LIBELLE_L.': ',$assoc);
$form->addElement($ligneNomCat);
//ligne bouton validation
$size=5;
$assoc=array('class' =>$id, 'size'=>$size);
$boutonC= &HTML_QuickForm::createElement('submit', 'champ_valider_cat',GTT_L_G_VALIDER,$assoc);
$form->addElement($boutonC);
//ajout de regles
$form->applyFilter('champ_nom_cat', 'trim');
 
$form->addRule('champ_nom_cat',GTT_ERREUR_NOM, 'required','','client');
$form->addRule('champ_nom_cat',GTT_ERREUR_NOM, 'alphanumeric','','client');
$form->addElement('html','</fieldset>');
return $form;
}
 
 
/**fonction affichant le menu
*supression d'une categorie
*/
 
function afficherMenuSupressionCategorie()
{
$id="SUPPRIMER_CATEGORIE";
$assoc1=array ('class' =>$id);
$form=new HTML_QuickForm('gestion_categorie2', 'post',$GLOBALS['urlBase'].GESTION_ADMIN_CATEGORIE,'',$assoc1);
//creation et ajout des elements
$form->addElement('header', 'entete', GESTION_SUPPRIMER_CATEGORIE_L);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
//creation des elements
$assoc=array('class' =>$id);
$ligne[0]=&HTML_QuickForm::createElement('select', 'champ_cat_supprimer',GESTION_CATEGORIE_L." : ",'',$assoc);
$ligne[0]->load($result) ;
$c="SELECT * FROM ".GEST_CATEGORIE."";
$ligne[0]->loadQuery($GLOBALS['dsn'],$c,GEST_CHAMPS_LIBELLE_CATEGORIE,GEST_CHAMPS_ID_CATEGORIE);
$ligne[1]=&HTML_QuickForm::createElement('submit', 'btn_supprimer_cat',GTT_L_G_SUPPRIMER,$assoc);
//ajout
$form->addGroup($ligne,'groupe',"",'&nbsp',false);
//ajout des regles de groupe
$form->registerRule('verifContientProjet','function','verifContientProjet');
$regle['champ_cat_supprimer'][]=array(GTT_IMPOSSIBLE_SUPPR_CAT,'verifContientProjet','','client');
$form->addGroupRule('groupe', $regle);
return $form;
}
?>
/trunk/menu/gtt_menu_admin_projet.php
New file
0,0 → 1,189
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
// |@version 3 |
/*@package gtt_general
//Auteur original :
*@author Dorian Bannier <dbannier@aol.com>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Copyright (C) 2003 Tela-Botanica
@version $Date: 2004/07/06
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
 
 
include_once CHEMIN_CLASSES_METIER.'gtt_projet.class.php';
include_once CHEMIN_CLASSES_METIER.'gtt_categorie.class.php';
//fichier langues
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
//inclusion des paquets de la librairie pear
include_once 'HTML/QuickForm.php';
 
/**
*fonction affichant le menu d'ajout d'un projet
*/
 
function afficherMenuAjouterProjet()
{
$id="AJOUTER_PROJET";
$assoc1=array ('class' =>$id);
$form=new HTML_QuickForm('gestion_projet', 'post',$GLOBALS['urlBase'].GESTION_ADMIN_PROJET,'',$assoc1);
$squelette =& $form->defaultRenderer();
$squelette->setFormTemplate("\n<form{attributes}>\n<ul>{content}\n</ul></form>");
$squelette->setElementTemplate('<li>'."\n".'{label}'."\n".'{element}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
$squelette->setGroupElementTemplate('{label}{element}','groupe');
$squelette->setRequiredNoteTemplate("\n".'<li>'.'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'.'</li>'."\n");
$squelette->setHeaderTemplate("\n".'<li><h2>'."\n".'{header}'."\n".'</h2></li>'."\n");
//creation et ajout des elements
$form->addElement('header', 'entete', GESTION_AJOUTER_PROJET_L);
//creation des Messages d'erreur
$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
//ligne nom du projet
$size=30;
$assoc=array('class' =>$id, 'size'=>$size);
$ligneNomProjet= &HTML_QuickForm::createElement('text', 'champ_nom_projet',GESTION_NOM_L." : ",$assoc);
$form->addElement($ligneNomProjet);
//ligne categorie du projet
$assoc=array('class' =>$id);
$cat=&HTML_QuickForm::createElement('select', 'champ_categorie_projet',GESTION_CATEGORIE_L." : ",'',$assoc);
$cat->load($result) ;
$c="SELECT * FROM ".GEST_CATEGORIE."";
$cat->loadQuery($GLOBALS['dsn'],$c,GEST_CHAMPS_LIBELLE_CATEGORIE,GEST_CHAMPS_ID_CATEGORIE);
$form->addElement($cat);
//ligne date debut prevue
$assoc=array('class'=>$id);
//definition des date sde debut et de fin
$min=date('Y')-5;
$max=date('Y')+5;
$option=array('language'=>'fr','minYear'=>$min, 'maxYear'=>$max);
$dateDeb=&HTML_QuickForm::createElement('date','champ_date_deb_projet',GESTION_DATE_DEB_PROJET_L.' : ',$option,$assoc);
$valDef=date("d,M,Y");
$dateDeb->setValue($valDef);
$form->addElement($dateDeb);
//champ duree prevue du projet compte en jours
$size=3;
$assoc=array('class'=>$id,'size'=>$size);
$dureePrev=&HTML_QuickForm::createElement('text','champ_duree_prev_projet',GESTION_DUREE_PROJET_L.':',$assoc);
$form->addElement($dureePrev);
//etat d'avancement du projet
$size=1;
$assoc=array('class'=>$id,'size'=>$size);
$valeur=array();
for ($i = 0; $i <= 100; $i++) {
array_push($valeur,$i);
}
 
$avancement=&HTML_QuickForm::createElement('select','champ_avancement_projet',GESTION_AVANCEMENT_PROJET_L.':',$valeur,$assoc);
$form->addElement($avancement);
//champ description du projet
$row=4;
$col=30;
$id="CHAMP_DESC_AJOUTER_PROJET";
$assoc=array('class '=>$id ,'rows'=>$row , 'cols'=>$col, 'wrap'=>"physical");
$description=&HTML_QuickForm::createElement('textarea','champ_description',GESTION_DESCRIPTION_L.' : ',$assoc);
$form->addElement($description);
//champ valider
$size=5;
$assoc=array('class' =>$id, 'size'=>$size);
$boutonP= &HTML_QuickForm::createElement('submit', 'champ_valider_projet',GTT_L_G_VALIDER,$assoc);
$form->addElement($boutonP);
//ajout de regles
$form->applyFilter('champ_nom_projet', 'trim');
 
$form->addRule('champ_nom_projet',GTT_ERREUR_NOM, 'required','','client');
$form->addRule('champ_nom_projet',GTT_ERREUR_NOM, 'alphanumeric','','client');
 
return $form;
}
 
 
/**supression d'un projet
*on ne peut supprimer que les projets n'ayant pas de taches
*/
function afficherMenuSupprimerProjet()
{
$id="SUPPRIMER_PROJET";
$assoc1=array ('class' =>$id);
$form=new HTML_QuickForm('gestion_projet2', 'post',$GLOBALS['urlBase'].GESTION_ADMIN_PROJET,'',$assoc1);
//creation et ajout des elements
$form->addElement('header', 'entete', GESTION_SUPPRIMER_PROJET_L);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
//creation des elements
$assoc=array('class' =>$id);
$ligne[0]=&HTML_QuickForm::createElement('select', 'champ_proj_supprimer',GESTION_PROJET_L." : ",'',$assoc);
$ligne[0]->load($result) ;
$p="SELECT * FROM ".GEST_PROJET."";
$ligne[0]->loadQuery($GLOBALS['dsn'],$p,GEST_CHAMPS_NOM_PROJET,GEST_CHAMPS_ID_PROJET);
$ligne[1]=&HTML_QuickForm::createElement('submit', 'btn_supprimer_projet',GTT_L_G_SUPPRIMER,$assoc);
//ajout
$form->addGroup($ligne,'groupe',"",'&nbsp',false);
//ajout des regles de groupe interdisant la supression
//au cas ou le projet contient des taches
$form->registerRule('verifContientTache','function','verifContientTache');
$regle['champ_proj_supprimer'][]=array(GTT_IMPOSSIBLE_SUPPR_PROJ,'verifContientTache','','client');
$form->addGroupRule('groupe', $regle);
return $form;
}
?>
/trunk/menu/gtt_menu_admin_statut.php
New file
0,0 → 1,131
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
// |@version 3 |
/*@package gtt_general
//Auteur original :
*@author Dorian Bannier <dbannier@aol.com>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Copyright (C) 2003 Tela-Botanica
@version $Date: 2004/07/06
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
 
include_once CHEMIN_CLASSES_METIER.'gtt_statut.class.php';
//fichier langues
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
//inclusion des paquets de la librairie pear
include_once 'HTML/QuickForm.php';
 
/**
*fonction affichant le menu afficher menu ajout statut
*/
 
function afficherMenuAjouterStatut()
{
$id="AJOUTER_STATUT";
$assoc1=array ('class' =>$id);
$form=new HTML_QuickForm('statut', 'post',$GLOBALS['urlBase'].GESTION_ADMIN_STATUT,'',$assoc1);
//creation des templates pour la mise en forme
$squelette =& $form->defaultRenderer();
$squelette->setFormTemplate("\n<form{attributes}>\n<ul>{content}\n</ul></form>");
$squelette->setElementTemplate('<li>'."\n".'{label}'."\n".'{element}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
$squelette->setGroupElementTemplate('{label}{element}','groupe');
$squelette->setRequiredNoteTemplate("\n".'<li>'.'<p>'."\n".'<span class="symbole_obligatoire">*</span> {requiredNote}'."\n".'</p>'.'</li>'."\n");
//creation et ajout des elements
$form->addElement('header', 'entete', GESTION_AJOUTER_STATUT_L);
//creation des Messages d'erreur
$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
//ligne libelle statut
$size=30;
$assoc=array('class' =>$id, 'size'=>$size);
$ligneNomStatut = &HTML_QuickForm::createElement('text', 'champ_nom_statut',GESTION_LIBELLE_L.': ',$assoc);
$form->addElement($ligneNomStatut);
//ligne bouton validation
$size=5;
$assoc=array('class' =>$id, 'size'=>$size);
$boutonS= &HTML_QuickForm::createElement('submit', 'champ_valider_statut',GTT_L_G_VALIDER,$assoc);
$form->addElement($boutonS);
//ajout de regles
$form->applyFilter('champ_nom_statut', 'trim');
$form->addRule('champ_nom_statut',GTT_ERREUR_NOM, 'required','','client');
$form->addRule('champ_nom_statut',GTT_ERREUR_NOM, 'alphanumeric','','client');
return $form;
}
/**
*fonction affichant le menu supression d'un statut
*/
function afficherMenuSupressionstatut()
{
$id="SUPPRIMER_STATUT";
$assoc1=array ('class' =>$id);
$form=new HTML_QuickForm('gestion_categorie2', 'post',$GLOBALS['urlBase'].GESTION_ADMIN_STATUT,'',$assoc1);
//creation et ajout des elements
$form->addElement('header', 'entete', GESTION_SUPPRIMER_STATUT_L);
//creation des elements
$assoc=array('class' =>$id);
$ligne[0]=&HTML_QuickForm::createElement('select', 'champ_statut_supprimer',GTT_L_FU_STATUT." : ",'',$assoc);
$ligne[0]->load($result) ;
$c="SELECT * FROM ".GEST_STATUT."";
$ligne[0]->loadQuery($GLOBALS['dsn'],$c,GEST_CHAMPS_LIBELLE_STATUT,GEST_CHAMPS_ID_STATUT);
$ligne[1]=&HTML_QuickForm::createElement('submit', 'btn_supprimer_statut',GTT_L_G_SUPPRIMER,$assoc);
//ajout
$form->addGroup($ligne,'groupe',"",'&nbsp',false);
//ajout des regles de groupe
$form->registerRule('verifStatutUtilise','function','verifStatutUtilise');
$regle['champ_statut_supprimer'][]=array(GTT_IMPOSSIBLE_SUPPR_STATUT,'verifStatutUtilise','','client');
$form->addGroupRule('groupe', $regle);
return $form;
}
?>
/trunk/menu/gtt_menu_editer_preferences.php
New file
0,0 → 1,111
<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// |@author ABDOOL RAHEEM shaheen shaheenar50@hotmail.com |
// |@version 3 |
/*@package gtt_general
//Auteur original :
*@author Dorian Bannier <dbannier@aol.com>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Copyright (C) 2003 Tela-Botanica
@version $Date: 2004/07/06
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
//inclusion des paquets de la librairie pear
include_once 'HTML/QuickForm.php';
//fichier langues
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
//classes metier
include_once CHEMIN_CLASSES_METIER.'gtt_projet.class.php';
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
include_once CHEMIN_CLASSES_METIER.'gtt_utilisateur.class.php';
 
 
/**
*fonction affichant le menu editer preferences
*/
 
function afficherMenuEditerPref($user)
{
$id="MANIPULER_PREFERENCES";
$size=100;
$assoc1 =array('class'=>$id);
$form=new HTML_QuickForm('gestion_admin_pref', 'post',$GLOBALS['urlBase'].GESTION_EDITER_PREFERENCES,'', $assoc1);
//entete du formulaire
$form->addElement('header', 'entete', GESTION_EDITER_PREFERENCES_L);
//creation des Messages d'erreur
$form->setRequiredNote('='.GTT_CHAMPS_OBLIGATOIRE);
$form->setJsWarnings(GTT_DONNEES_INCORRECTES, GTT_DONNEES_A_CORRIGER);
$TabProjet=&Projet::recupererTableauProjet();
$pref=new Preference($user,5000);
$tabPref=$pref->recupererTableauPreferences();
//conseils
$z=& $form->addElement('html','<tr><td>'.GESTION_CONSEILS_PREFERENCES.'</tr></td>');
//nombre de projets
$z=&$form->addElement('hidden','champ_nb_total_proj',count($TabProjet));
$cat='';
//parcourt du tableau de projets
for($y=0;$y<count($TabProjet);$y++)
{
$tab=$TabProjet[$y];
//ligne categorie
if ($cat!=$tab[GEST_CHAMPS_LIBELLE_CATEGORIE])
{
$size1=25;
$id1="nom_categorie";
$assoc1=array('class' =>$id1, 'size'=>$size1);
$ligneNomCateg=&HTML_QuickForm::createElement('html', '<tr><td>'.$tab[GEST_CHAMPS_LIBELLE_CATEGORIE].' : '.'</td></tr>');
$form->addElement($ligneNomCateg);
$cat =$tab[GEST_CHAMPS_LIBELLE_CATEGORIE];
}
//champ cache
$z=&$form->addElement('hidden','champ_id_pr'.$y,$tab[GEST_CHAMPS_ID_PROJET]);
$ligne[0]=&HTML_QuickForm::createElement('checkbox','champ_check'.$y);
$estDansPref=$pref->isInPreferences($tab[GEST_CHAMPS_ID_PROJET]);
$ligne[0]->setChecked($estDansPref);
$form->addGroup($ligne,'groupe',$tab[GEST_CHAMPS_NOM_PROJET].'&nbsp&nbsp&nbsp','&nbsp&nbsp&nbsp',false);
}
//champ_valider
$size4=5;
$id4='btn_editer_pref';
$assoc4=array('class' =>$id4, 'size'=>$size4);
$btnValiderEditer= &HTML_QuickForm::createElement('submit', 'btn_valider_editer',GTT_L_G_VALIDER,$assoc4);
$form->addElement($btnValiderEditer);
return $form;
}
?>
/trunk/menu/gtt_menu_absence.php
New file
0,0 → 1,0