Subversion Repositories Applications.gtt

Rev

Rev 2 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 25
1
<?php
1
<?php
2
 
2
 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// |@author ABDOOL RAHEEM shaheen   shaheenar50@hotmail.com                                                 |
22
// |@author ABDOOL RAHEEM shaheen   shaheenar50@hotmail.com                                                 |
23
// |@version 3                                                                                            |
23
// |@version 3                                                                                            |
24
 
24
 
25
// +------------------------------------------------------------------------------------------------------+
25
// +------------------------------------------------------------------------------------------------------+
26
/*
26
/*
27
*fichier contenant le menu principal de l'application de gestion du temps de travail 
27
*fichier contenant le menu principal de l'application de gestion du temps de travail 
28
*@package gtt_general
28
*@package gtt_general
29
//Auteur original :
29
//Auteur original :
30
*@author        Dorian Bannier <dbannier@aol.com>
30
*@author        Dorian Bannier <dbannier@aol.com>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
32
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
33
*@copyright     Copyright (C) 2003 Tela-Botanica
33
*@copyright     Copyright (C) 2003 Tela-Botanica
34
*/
34
*/
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
include_once CHEMIN_FN_GENERIQUE_AFFICHAGE;
-
 
37
include_once CHEMIN_MENU.'gtt_menu_admin_projet.php';
36
include_once CHEMIN_MENU.'gtt_menu_admin_projet.php';
38
 
-
 
39
 
37
 
40
 /**
38
 /**
41
 *fonction traitant l'ajout de projet
39
 *fonction traitant l'ajout de projet
42
 */
40
 */
43
 
41
 
44
 function traiterAjoutProjet()
42
 function traiterAjoutProjet()
45
 {
43
 {
46
  if (isset($_POST["champ_valider_projet"]))
44
  if (isset($_POST["champ_valider_projet"]))
47
  {  
45
  {  
48
     if(isset( $_POST["champ_date_deb_projet"]))
46
     if(isset( $_POST["champ_date_deb_projet"]))
49
     {
47
     {
50
     $tabDate=$_POST["champ_date_deb_projet"];
48
     $tabDate=$_POST["champ_date_deb_projet"];
51
     $t='-';
49
     $t='-';
52
     $dateNonFormate=$tabDate['Y'];
50
     $dateNonFormate=$tabDate['Y'];
53
     $dateNonFormate.=$t;
51
     $dateNonFormate.=$t;
54
     $dateNonFormate.=$tabDate['M'];
52
     $dateNonFormate.=$tabDate['M'];
55
     $dateNonFormate.=$t;
53
     $dateNonFormate.=$t;
56
     $dateNonFormate.=$tabDate['d'];
54
     $dateNonFormate.=$tabDate['d'];
57
    }else $dateNonFormate=null;
55
    }else $dateNonFormate=null;
58
    
56
    
59
     $tab=array(
57
     $tab=array(
60
         GEST_CHAMPS_NOM_PROJET=>$_POST["champ_nom_projet"],
58
         GEST_CHAMPS_NOM_PROJET=>$_POST["champ_nom_projet"],
61
	 GEST_CHAMPS_DESCRIPTION_PROJET=>$_POST["champ_description"],
59
	 GEST_CHAMPS_DESCRIPTION_PROJET=>$_POST["champ_description"],
62
	 GEST_CHAMPS_DATE_DEBUT_PROJET=>$dateNonFormate,
60
	 GEST_CHAMPS_DATE_DEBUT_PROJET=>$dateNonFormate,
63
	 GEST_CHAMPS_DUREE_PREVUE_PROJET=>$_POST["champ_duree_prev_projet"],
61
	 GEST_CHAMPS_DUREE_PREVUE_PROJET=>$_POST["champ_duree_prev_projet"],
64
	 GEST_CHAMPS_AVANCEMENT_PROJET=>$_POST["champ_avancement_projet"],
62
	 GEST_CHAMPS_AVANCEMENT_PROJET=>$_POST["champ_avancement_projet"],
65
	 GEST_CHAMPS_ID_CATEGORIE=>$_POST["champ_categorie_projet"]);
63
	 GEST_CHAMPS_ID_CATEGORIE=>$_POST["champ_categorie_projet"]);
66
	  	 
64
	  	 
67
     $i=&Projet::nextId();
65
     $i=&Projet::nextId();
68
     $proj=new Projet($i);
66
     $proj=new Projet($i);
69
     
67
     
70
     $proj->construireProjet($tab);
68
     $proj->construireProjet($tab);
71
     $k=$proj->enregistrerNewProjet();
69
     $k=$proj->enregistrerNewProjet();
72
      
70
      
73
  }
71
  }
74
  $_POST["champ_valider_projet"]='dejaValider';
72
  $_POST["champ_valider_projet"]='dejaValider';
75
  $_POST["champ_nom_projet"]='';
73
  $_POST["champ_nom_projet"]='';
76
 }
74
 }
77
 /**
75
 /**
78
*fonction traitant la supression de projets 
76
*fonction traitant la supression de projets 
79
*la supression de projets entraine la suppression d'eventuelles
77
*la supression de projets entraine la suppression d'eventuelles
80
*taches faisant partie du projet
78
*taches faisant partie du projet
81
*/
79
*/
82
 
80
 
83
function traiterSupprimerProjet()
81
function traiterSupprimerProjet()
84
{
82
{
85
   if(isset($_POST["btn_supprimer_projet"]))
83
   if(isset($_POST["btn_supprimer_projet"]))
86
   {
84
   {
87
    $i=$_POST["champ_proj_supprimer"];
85
    $i=$_POST["champ_proj_supprimer"];
88
    
86
    
89
    $verif=&Projet::contientTache($i);
87
    $verif=&Projet::contientTache($i);
90
    
88
    
91
    if($verif!=1)
89
    if($verif!=1)
92
    {
90
    {
93
    $b=&Projet::supprimerProjet($i);
91
    $b=&Projet::supprimerProjet($i);
94
    }else $b=0;
92
    }else $b=0;
95
    if ($b==0)
93
    if ($b==0)
96
    {
94
    {
97
	echo "echec supression";
95
	echo "echec supression";
98
    }
96
    }
99
    
97
    
100
   }
98
   }
101
   $_POST["btn_supprimer_projet"]='dejaValider';
99
   $_POST["btn_supprimer_projet"]='dejaValider';
102
   $_POST["champ_proj_supprimer"]='';
100
   $_POST["champ_proj_supprimer"]='';
103
}
101
}
104
 /**
102
 /**
105
*fonction verifiant si le projet contient des taches
103
*fonction verifiant si le projet contient des taches
106
*/
104
*/
107
 
105
 
108
function verifContientTache()
106
function verifContientTache()
109
{
107
{
110
    $i=$_POST["champ_proj_supprimer"];
108
    $i=$_POST["champ_proj_supprimer"];
111
    $verif=&Projet::contientTache($i);
109
    $verif=&Projet::contientTache($i);
112
    if ($verif==1)return false;
110
    if ($verif==1)return false;
113
    else return true;
111
    else return true;
114
    
112
    
115
}
113
}
116
 
114
 
117
/**
115
/**
118
*fonction traitant toutes les actions du menu admin projet
116
*fonction traitant toutes les actions du menu admin projet
119
*/
117
*/
120
function traiterAdminProjet()
118
function traiterAdminProjet()
121
{
119
{
122
$text=creerEntetePage(GESTION_ADMIN_PROJET_L);
120
$text=creerEntetePage(GESTION_ADMIN_PROJET_L);
123
//cas de l'ajout
121
//cas de l'ajout
124
$form=afficherMenuAjouterProjet();
122
$form=afficherMenuAjouterProjet();
125
if (isset($_POST["champ_valider_projet"])and $_POST["champ_valider_projet"]!='dejaValider'and $form->validate()) 
123
if (isset($_POST["champ_valider_projet"])and $_POST["champ_valider_projet"]!='dejaValider'and $form->validate()) 
126
   {
124
   {
127
       $form->process('traiterAjoutProjet');
125
       $form->process('traiterAjoutProjet');
128
       $t=afficherMenuAjouterProjet();
126
       $t=afficherMenuAjouterProjet();
129
       $text.=$t->ToHTml();
127
       $text.=$t->ToHTml();
130
   }else{
128
   }else{
131
       $text.=$form->ToHtml();
129
       $text.=$form->ToHtml();
132
   }
130
   }
133
   
131
   
134
//cas de la suppression
132
//cas de la suppression
135
  $forms=afficherMenuSupprimerProjet();
133
  $forms=afficherMenuSupprimerProjet();
136
 if (isset($_POST["btn_supprimer_projet"]) and $_POST["btn_supprimer_projet"]!='dejaValider' and  $forms->validate())
134
 if (isset($_POST["btn_supprimer_projet"]) and $_POST["btn_supprimer_projet"]!='dejaValider' and  $forms->validate())
137
   {
135
   {
138
       $forms->process('traiterSupprimerProjet');
136
       $forms->process('traiterSupprimerProjet');
139
       $m=afficherMenuSupprimerProjet();
137
       $m=afficherMenuSupprimerProjet();
140
       $text.=$m->ToHtml();
138
       $text.=$m->ToHtml();
141
   }else{
139
   }else{
142
       $text.=$forms->ToHtml();
140
       $text.=$forms->ToHtml();
143
   }
141
   }
144
   
142
   
145
   //affichage des options d'administration
143
   //affichage des options d'administration
146
    
144
    
147
    $formp=creerFormulaireOptionAdmin();
145
    $formp=creerFormulaireOptionAdmin();
148
    $text.=$formp->ToHtml();
146
    $text.=$formp->ToHtml();
149
      //affichage des options disponibles pour l'utilisateur courant
147
      //affichage des options disponibles pour l'utilisateur courant
150
    $text.=afficherOptionAplication($GLOBALS['idCurrentUser']);
148
    $text.=afficherOptionAplication($GLOBALS['idCurrentUser']);
151
    
149
    
152
 
150
 
153
 return $text;  
151
 return $text;  
154
}
152
}
155
?>
153
?>