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 9
1
<?php
1
<?php
2
// +------------------------------------------------------------------------------------------------------+
2
// +------------------------------------------------------------------------------------------------------+
3
// | PHP version 4.1                                                                                      |
3
// | PHP version 4.1                                                                                      |
4
// +------------------------------------------------------------------------------------------------------+
4
// +------------------------------------------------------------------------------------------------------+
5
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
5
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// +------------------------------------------------------------------------------------------------------+
6
// +------------------------------------------------------------------------------------------------------+
7
// | This library is free software; you can redistribute it and/or                                        |
7
// | This library is free software; you can redistribute it and/or                                        |
8
// | modify it under the terms of the GNU Lesser General Public                                           |
8
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | License as published by the Free Software Foundation; either                                         |
9
// | License as published by the Free Software Foundation; either                                         |
10
// | version 2.1 of the License, or (at your option) any later version.                                   |
10
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// |                                                                                                      |
11
// |                                                                                                      |
12
// | This library is distributed in the hope that it will be useful,                                      |
12
// | This library is distributed in the hope that it will be useful,                                      |
13
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
13
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
14
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | Lesser General Public License for more details.                                                      |
15
// | Lesser General Public License for more details.                                                      |
16
// |                                                                                                      |
16
// |                                                                                                      |
17
// | You should have received a copy of the GNU Lesser General Public                                     |
17
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | License along with $this library; if not, write to the Free Software                                  |
18
// | License along with $this library; if not, write to the Free Software                                  |
19
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
19
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// +------------------------------------------------------------------------------------------------------+
20
// +------------------------------------------------------------------------------------------------------+
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
include_once 'gtt_taches.class.php';
25
include_once 'gtt_taches.class.php';
26
/**
26
/**
27
  * class Projet
27
  * class Projet
28
  * 
28
  * 
29
  */
29
  */
30
 
30
 
31
class Projet
31
class Projet
32
{
32
{
33
 
33
 
34
  /**Aggregations: */
34
  /**Aggregations: */
35
 
35
 
36
  var $liste_taches = array();
36
  var $liste_taches = array();
37
  /**Attributes: */
37
  /**Attributes: */
38
    var $_id_projet=null;
38
    var $_id_projet=null;
39
   
39
   
40
    var $_nom_projet=null;
40
    var $_nom_projet=null;
41
   
41
   
42
    var $_description_projet=null;
42
    var $_description_projet=null;
43
    
43
    
44
    var $_date_debut_projet = null;
44
    var $_date_debut_projet = null;
45
    
45
    
46
    var $_duree_prevue_projet=null;
46
    var $_duree_prevue_projet=null;
47
    
47
    
48
    var $_avancement_projet=null;
48
    var $_avancement_projet=null;
49
    
49
    
50
    var $_categorie=null;
50
    var $_categorie=null;
51
      
51
      
52
    
52
    
53
  /**
53
  /**
54
  *constructeur 
54
  *constructeur 
55
  */
55
  */
56
  function Projet($id)
56
  function Projet($id)
57
  {
57
  {
58
    $this->_id_projet= $id;
58
    $this->_id_projet= $id;
59
  }
59
  }
60
  
60
  
61
   /**
61
   /**
62
  *construit un projet a partir d'un tableau associatif
62
  *construit un projet a partir d'un tableau associatif
63
  *le tableau ne contient toutefois pas la liste de taches
63
  *le tableau ne contient toutefois pas la liste de taches
64
  */
64
  */
65
  function construireProjet($tableau)
65
  function construireProjet($tableau)
66
  {
66
  {
67
      
67
      
68
      $this->_nom_projet=$tableau[GEST_CHAMPS_NOM_PROJET];
68
      $this->_nom_projet=$tableau[GEST_CHAMPS_NOM_PROJET];
69
      $this->_description_projet=$tableau[GEST_CHAMPS_DESCRIPTION_PROJET];
69
      $this->_description_projet=$tableau[GEST_CHAMPS_DESCRIPTION_PROJET];
70
      $this->_date_debut_projet=$tableau[GEST_CHAMPS_DATE_DEBUT_PROJET];
70
      $this->_date_debut_projet=$tableau[GEST_CHAMPS_DATE_DEBUT_PROJET];
71
      $this->_duree_prevue_projet= $tableau[GEST_CHAMPS_DUREE_PREVUE_PROJET];
71
      $this->_duree_prevue_projet= $tableau[GEST_CHAMPS_DUREE_PREVUE_PROJET];
72
      $this->_avancement_projet=$tableau[GEST_CHAMPS_AVANCEMENT_PROJET];
72
      $this->_avancement_projet=$tableau[GEST_CHAMPS_AVANCEMENT_PROJET];
73
      $this->_categorie=$tableau[GEST_CHAMPS_ID_CATEGORIE];
73
      $this->_categorie=$tableau[GEST_CHAMPS_ID_CATEGORIE];
74
  }
74
  }
75
 
75
 
76
 /**
76
 /**
77
   *recupere l'identifiant de la base de donnees
77
   *recupere l'identifiant de la base de donnees
78
   */
78
   */
79
   
79
   
80
   function nextId()
80
   function nextId()
81
   {
81
   {
82
    $requete = 'SELECT MAX('.GEST_CHAMPS_ID_PROJET.') AS maxi FROM '.GEST_PROJET;
82
    $requete = 'SELECT MAX('.GEST_CHAMPS_ID_PROJET.') AS maxi FROM '.GEST_PROJET;
83
    $resultat = $GLOBALS['db']->query($requete);
83
    $resultat = $GLOBALS['db']->query($requete);
84
    if (DB::isError($resultat) || $resultat->numRows() > 1) {
84
    if (DB::isError($resultat) || $resultat->numRows() > 1) {
85
        return false;
85
        return false;
86
    }
86
    }
87
    
87
    
88
    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
88
    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
89
    return $ligne->maxi + 1;  
89
    return $ligne->maxi + 1;  
90
   }
90
   }
91
   
91
   
92
 
92
 
93
  /**
93
  /**
94
    * enregistre un nouveau projet
94
    * enregistre un nouveau projet
95
    *renvoie 0 si aucun enregistrement effectue,
95
    *renvoie 0 si aucun enregistrement effectue,
96
    *1 si enregistrement ok
96
    *1 si enregistrement ok
97
    *-1 si erreur
97
    *-1 si erreur
98
    *on suppose qu'on aura pas d'erreur car
98
    *on suppose qu'on aura pas d'erreur car
99
    *on controle les projets a enregistrer : pas de duplicata
99
    *on controle les projets a enregistrer : pas de duplicata
100
    */
100
    */
101
  function enregistrerNewProjet()
101
  function enregistrerNewProjet()
102
  {
102
  {
103
    $table=GEST_PROJET;
103
    $table=GEST_PROJET;
104
    $p=&Projet::nextId();
104
    $p=&Projet::nextId();
105
    $this->_id_projet=$p;
105
    $this->_id_projet=$p;
106
    
106
    
107
    $champs=array(
107
    $champs=array(
108
        GEST_CHAMPS_ID_PROJET =>$this->_id_projet,
108
        GEST_CHAMPS_ID_PROJET =>$this->_id_projet,
109
	    GEST_CHAMPS_NOM_PROJET => "$this->_nom_projet",
109
	    GEST_CHAMPS_NOM_PROJET => "$this->_nom_projet",
110
	    GEST_CHAMPS_DESCRIPTION_PROJET =>"$this->_description_projet",
110
	    GEST_CHAMPS_DESCRIPTION_PROJET =>"$this->_description_projet",
111
	    GEST_CHAMPS_DATE_DEBUT_PROJET =>$this->_date_debut_projet,
111
	    GEST_CHAMPS_DATE_DEBUT_PROJET =>$this->_date_debut_projet,
112
	    GEST_CHAMPS_DUREE_PREVUE_PROJET =>$this->_duree_prevue_projet,
112
	    GEST_CHAMPS_DUREE_PREVUE_PROJET =>$this->_duree_prevue_projet,
113
	    GEST_CHAMPS_AVANCEMENT_PROJET =>$this->_avancement_projet,
113
	    GEST_CHAMPS_AVANCEMENT_PROJET =>$this->_avancement_projet,
114
	    GEST_CHAMPS_ID_CATEGORIE => $this->_categorie);
114
	    GEST_CHAMPS_ID_CATEGORIE => $this->_categorie);
115
	    
115
	    
116
    $resultat = $GLOBALS['db']->autoExecute($table, $champs,DB_AUTOQUERY_INSERT);	    
116
    $resultat = $GLOBALS['db']->autoExecute($table, $champs,DB_AUTOQUERY_INSERT);	    
117
  
117
  
118
    if (DB::isError($resultat)) {
118
    if (DB::isError($resultat)) {
119
    die($resultat->getMessage());
119
    die($resultat->getMessage());
120
    }
120
    }
121
        
121
        
122
    $j =$GLOBALS['db']->affectedRows($resultat);
122
    $j =$GLOBALS['db']->affectedRows($resultat);
123
    return $j;    
123
    return $j;    
124
  }
124
  }
125
  /*
125
  /*
126
  *recupere une liste de taches
126
  *recupere une liste de taches
127
  */
127
  */
128
  function recupererListeTaches()
128
  function recupererListeTaches()
129
  {
129
  {
130
	  
130
	  
131
  }
131
  }
132
  
132
  
133
  /*
133
  /*
134
  * modifie la liste de taches
134
  * modifie la liste de taches
135
  *@param $t : tableau de taches
135
  *@param $t : tableau de taches
136
  */
136
  */
137
  function setListeTaches($t)
137
  function setListeTaches($t)
138
  {
138
  {
139
    $this->_liste_taches= $t;
139
    $this->_liste_taches= $t;
140
  }
140
  }
141
  
141
  
142
  /**
142
  /**
143
    *recupere un projet pour instancier l'objet
143
    *recupere un projet pour instancier l'objet
144
    *renvoie -1 si erreur
144
    *renvoie -1 si erreur
145
    *renvoie utilisateur sinon
145
    *renvoie utilisateur sinon
146
    */
146
    */
147
  function recupererProjet($id)
147
  function recupererProjet($id)
148
  {
148
  {
149
    $requete="SELECT ".GEST_CHAMPS_NOM_PROJET.", ".GEST_CHAMPS_DESCRIPTION_PROJET.", ".GEST_CHAMPS_DATE_DEBUT_PROJET.", "
149
    $requete="SELECT ".GEST_CHAMPS_NOM_PROJET.", ".GEST_CHAMPS_DESCRIPTION_PROJET.", ".GEST_CHAMPS_DATE_DEBUT_PROJET.", "
150
	     .GEST_CHAMPS_DUREE_PREVUE_PROJET.", ".GEST_CHAMPS_AVANCEMENT_PROJET." , ".GEST_CHAMPS_ID_CATEGORIE.
150
	     .GEST_CHAMPS_DUREE_PREVUE_PROJET.", ".GEST_CHAMPS_AVANCEMENT_PROJET." , ".GEST_CHAMPS_ID_CATEGORIE.
151
	     " FROM ".GEST_PROJET.
151
	     " FROM ".GEST_PROJET.
152
	     " WHERE ".GEST_CHAMPS_ID_PROJET." = $id";
152
	     " WHERE ".GEST_CHAMPS_ID_PROJET." = $id";
153
  
153
  
154
    $resultat = $GLOBALS['db']->query($requete);
154
    $resultat = $GLOBALS['db']->query($requete);
155
    
155
    
156
    (DB::isError($resultat)) ?
156
    (DB::isError($resultat)) ?
157
               die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
157
               die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
158
        
158
        
159
    $tab = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
159
    $tab = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
160
    $j=$resultat->numRows();
160
    $j=$resultat->numRows();
161
    if ($j==1)
161
    if ($j==1)
162
   { 
162
   { 
163
     $project = new Projet($id);
163
     $project = new Projet($id);
164
     $project->construireProjet($tab);
164
     $project->construireProjet($tab);
165
     return $project;
165
     return $project;
166
    //recuperation de la liste de taches
166
    //recuperation de la liste de taches
167
    
167
    
168
    
168
    
169
   }else {
169
   }else {
170
	   return -1;
170
	   return -1;
171
   }
171
   }
172
	
172
	
173
  }
173
  }
174
  /**
174
  /**
175
  *fonction verifiant si le projet contient des taches
175
  *fonction verifiant si le projet contient des taches
176
  *renvoie 1 si le projet contient des taches
176
  *renvoie 1 si le projet contient des taches
177
  *et 0 sinon
177
  *et 0 sinon
178
  */
178
  */
179
  
179
  
180
  function contientTache($id)
180
  function contientTache($id)
181
  {
181
  {
182
    $requete="SELECT ".GEST_CHAMPS_ID_TACHE.
182
    $requete="SELECT ".GEST_CHAMPS_ID_TACHE.
183
             " FROM ".GEST_TACHES.
183
             " FROM ".GEST_TACHES.
184
	     " WHERE ".GEST_CHAMPS_ID_PROJET." = $id ";
184
	     " WHERE ".GEST_CHAMPS_ID_PROJET." = $id ";
185
	     
185
	     
186
     $ligne= $GLOBALS['db']->query($requete);
186
     $ligne= $GLOBALS['db']->query($requete);
187
   
187
   
188
   (DB::isError($ligne)) ?
188
   (DB::isError($ligne)) ?
189
           die (BOG_afficherErreurSql(__FILE__, __LINE__, $ligne->getMessage(), $requete)) : '' ;
189
           die (BOG_afficherErreurSql(__FILE__, __LINE__, $ligne->getMessage(), $requete)) : '' ;
190
 
190
 
191
   $j= $ligne->numRows();
191
   $j= $ligne->numRows();
192
    if ($j==0){
192
    if ($j==0){
193
	return -1;
193
	return -1;
194
    }else {
194
    }else {
195
	return 1;
195
	return 1;
196
    }
196
    }
197
  }
197
  }
198
 
198
 
199
  /**
199
  /**
200
   *supprime un projet de la base de donnees
200
   *supprime un projet de la base de donnees
201
   *ne prend pas en compte les taches
201
   *ne prend pas en compte les taches
202
    */
202
    */
203
  function supprimerProjet($id)
203
  function supprimerProjet($id)
204
  {
204
  {
205
    $requete="DELETE FROM ".GEST_PROJET.
205
    $requete="DELETE FROM ".GEST_PROJET.
206
             " WHERE ".GEST_CHAMPS_ID_PROJET." =$id";
206
             " WHERE ".GEST_CHAMPS_ID_PROJET." =$id";
207
	     
207
	     
208
    $ligne=$GLOBALS['db']->query($requete);
208
    $ligne=$GLOBALS['db']->query($requete);
209
    (DB::isError($ligne)) ?
209
    (DB::isError($ligne)) ?
210
               die (BOG_afficherErreurSql(__FILE__, __LINE__, $ligne->getMessage(), $requete)) : '' ;
210
               die (BOG_afficherErreurSql(__FILE__, __LINE__, $ligne->getMessage(), $requete)) : '' ;
211
    
211
    
212
    $j=$GLOBALS['db']->affectedRows();
212
    $j=$GLOBALS['db']->affectedRows();
213
    return $j;
213
    return $j;
214
  }
214
  }
215
 
215
 
216
  /**
216
  /**
217
  *fonction recuperant la date de debut d'un projet
217
  *fonction recuperant la date de debut d'un projet
218
  */
218
  */
219
  function getDateDeb()
219
  function getDateDeb()
220
  {
220
  {
221
      return $this->_date_debut_projet;
221
      return $this->_date_debut_projet;
222
  }
222
  }
223
  /**
223
  /**
224
  *fonction recuperant la duree prevue
224
  *fonction recuperant la duree prevue
225
  */
225
  */
226
  function getDureePrevue()
226
  function getDureePrevue()
227
  {
227
  {
228
      return $this->_duree_prevue_projet;
228
      return $this->_duree_prevue_projet;
229
  }
229
  }
230
  /**
230
  /**
231
   *etablit le pourcentage d'avancement du projet
231
   *etablit le pourcentage d'avancement du projet
232
    */
232
    */
233
  function setAvancement($pourcentage)
233
  function setAvancement($pourcentage)
234
  {
234
  {
235
    $this->_avancement_projet=$pourcentage;
235
    $this->_avancement_projet=$pourcentage;
236
  }
236
  }
237
  
237
  
238
  /*
238
  /*
239
  *modofie la duree prevue
239
  *modofie la duree prevue
240
  */
240
  */
241
  
241
  
242
  function setDureePrevue($d)
242
  function setDureePrevue($d)
243
  {
243
  {
244
	  $this->_duree_prevue_projet = $d;
244
	  $this->_duree_prevue_projet = $d;
245
  }
245
  }
246
  /*
246
  /*
247
  *modifie la description
247
  *modifie la description
248
  */
248
  */
249
  
249
  
250
  function setDescription($desc)
250
  function setDescription($desc)
251
  {
251
  {
252
	  $this->_description_projet = $desc;
252
	  $this->_description_projet = $desc;
253
  }
253
  }
254
  
254
  
255
  function mettreAJourProjet()
255
  function mettreAJourProjet()
256
  {
256
  {
257
	 $table=GEST_PROJET;
257
	 $table=GEST_PROJET;
258
	 
258
	 
259
	$requete="UPDATE $table SET "
259
	$requete="UPDATE $table SET "
260
		     .GEST_CHAMPS_NOM_PROJET." = \"$this->_nom_projet\","
260
		     .GEST_CHAMPS_NOM_PROJET." = \"$this->_nom_projet\","
261
	             .GEST_CHAMPS_DESCRIPTION_PROJET." =\"$this->_description_projet\","
261
	             .GEST_CHAMPS_DESCRIPTION_PROJET." =\"$this->_description_projet\","
262
	             .GEST_CHAMPS_DATE_DEBUT_PROJET." =\"$this->_date_debut_projet\","
262
	             .GEST_CHAMPS_DATE_DEBUT_PROJET." =\"$this->_date_debut_projet\","
263
	             .GEST_CHAMPS_DUREE_PREVUE_PROJET." =$this->_duree_prevue_projet,"
263
	             .GEST_CHAMPS_DUREE_PREVUE_PROJET." =$this->_duree_prevue_projet,"
264
	             .GEST_CHAMPS_AVANCEMENT_PROJET." =$this->_avancement_projet,"
264
	             .GEST_CHAMPS_AVANCEMENT_PROJET." =$this->_avancement_projet,"
265
	             .GEST_CHAMPS_ID_CATEGORIE." = $this->_categorie"
265
	             .GEST_CHAMPS_ID_CATEGORIE." = $this->_categorie"
266
				 ." WHERE ".GEST_CHAMPS_ID_PROJET." =$this->_id_projet";
266
				 ." WHERE ".GEST_CHAMPS_ID_PROJET." =$this->_id_projet";
267
		
267
		
268
		$resultat= $GLOBALS['db']->query($requete);
268
		$resultat= $GLOBALS['db']->query($requete);
269
		(DB::isError($resultat)) ?
269
		(DB::isError($resultat)) ?
270
		           die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
270
		           die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
271
		    
271
		    
272
		
272
		
273
		$j= $GLOBALS['db']->affectedRows();
273
		$j= $GLOBALS['db']->affectedRows();
274
		echo "$j";
274
		echo "$j";
275
		
275
		
276
		switch ($j)
276
		switch ($j)
277
		{
277
		{
278
			case 0: return 0;
278
			case 0: return 0;
279
			case 1: return 1;
279
			case 1: return 1;
280
			default: return -1;
280
			default: return -1;
281
		}
281
		}
282
		
282
		
283
  }
283
  }
284
  /**fonction recuperant la liste de projets 
284
	/** Méthode recuperant la liste de projets */
285
  */
-
 
286
  
-
 
287
  function recupererTableauProjet()
285
	function recupererTableauProjet()
288
  {
286
	{
289
      $requete="SELECT ".GEST_CHAMPS_ID_PROJET." , ".GEST_CHAMPS_NOM_PROJET.",C.".GEST_CHAMPS_ID_CATEGORIE.",C.".GEST_CHAMPS_LIBELLE_CATEGORIE.
287
		$requete = 'SELECT '.GEST_CHAMPS_ID_PROJET." , ".GEST_CHAMPS_NOM_PROJET.",C.".GEST_CHAMPS_ID_CATEGORIE.",C.".GEST_CHAMPS_LIBELLE_CATEGORIE.
290
               " FROM ".GEST_PROJET." P  ,".GEST_CATEGORIE." C ".
288
					" FROM ".GEST_PROJET." P  ,".GEST_CATEGORIE." C ".
291
	       " WHERE P.".GEST_CHAMPS_ID_CATEGORIE." = C.".GEST_CHAMPS_ID_CATEGORIE.
289
					" WHERE P.".GEST_CHAMPS_ID_CATEGORIE." = C.".GEST_CHAMPS_ID_CATEGORIE.
292
	       " ORDER BY C.".GEST_CHAMPS_ID_CATEGORIE;
290
					" ORDER BY C.".GEST_CHAMPS_ID_CATEGORIE;
293
      $tab= array();
291
		$tab = array();
294
      $resultat=$GLOBALS['db']->query($requete);
292
		$resultat = $GLOBALS['db']->query($requete);
-
 
293
		(DB::isError($resultat)) ? die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
295
      
294
 
296
      (DB::isError($resultat)) ?
-
 
297
          die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
-
 
298
      $j=$resultat->numRows();
295
		$j = $resultat->numRows();
299
      if ($j!=0)
296
		if ($j != 0) {
300
      {
-
 
301
	  while($ligne=$resultat->fetchRow(DB_FETCHMODE_ASSOC))
297
			while($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
302
	  {
-
 
303
	    $case=array(GEST_CHAMPS_ID_PROJET =>$ligne[GEST_CHAMPS_ID_PROJET],
298
				$case = array(	GEST_CHAMPS_ID_PROJET => $ligne[GEST_CHAMPS_ID_PROJET],
304
	                  GEST_CHAMPS_NOM_PROJET =>$ligne[GEST_CHAMPS_NOM_PROJET],
299
								GEST_CHAMPS_NOM_PROJET => $ligne[GEST_CHAMPS_NOM_PROJET],
305
			  GEST_CHAMPS_LIBELLE_CATEGORIE =>$ligne[GEST_CHAMPS_LIBELLE_CATEGORIE]);
300
								GEST_CHAMPS_LIBELLE_CATEGORIE => $ligne[GEST_CHAMPS_LIBELLE_CATEGORIE]);
306
			  
-
 
307
	      array_push($tab,$case);
301
				array_push($tab, $case);
308
	  }
302
			}
309
      }
303
		}
310
      return $tab;
304
		return $tab;
311
  }
305
	}
-
 
306
 
312
 /**
307
 /**
313
*fonction recuperant la tache par defaut d'un projet
308
*fonction recuperant la tache par defaut d'un projet
314
*tache par defaut : tache s'appelant general
309
*tache par defaut : tache s'appelant general
315
*@id : identifiant du projet
310
*@id : identifiant du projet
316
*@param : $nom : nom de la atche par default
311
*@param : $nom : nom de la atche par default
317
*@return identifiant de la tache
312
*@return identifiant de la tache
318
*/
313
*/
319
 
314
 
320
function getDefaultTache($id, $nom)
315
function getDefaultTache($id, $nom)
321
{
316
{
322
    $requete="SELECT ".GEST_CHAMPS_ID_TACHE.
317
    $requete="SELECT ".GEST_CHAMPS_ID_TACHE.
323
             " FROM ".GEST_TACHES.
318
             " FROM ".GEST_TACHES.
324
	     " WHERE ".GEST_CHAMPS_ID_PROJET." = $id ".
319
	     " WHERE ".GEST_CHAMPS_ID_PROJET." = $id ".
325
	     " AND ".GEST_CHAMPS_NOM_TACHE."=\" $nom\"";
320
	     " AND ".GEST_CHAMPS_NOM_TACHE."=\" $nom\"";
326
     $ligne= $GLOBALS['db']->query($requete);
321
     $ligne= $GLOBALS['db']->query($requete);
327
   
322
   
328
   (DB::isError($ligne)) ?
323
   (DB::isError($ligne)) ?
329
           die (BOG_afficherErreurSql(__FILE__, __LINE__, $ligne->getMessage(), $requete)) : '' ;
324
           die (BOG_afficherErreurSql(__FILE__, __LINE__, $ligne->getMessage(), $requete)) : '' ;
330
 
325
 
331
   $j= $ligne->numRows();
326
   $j= $ligne->numRows();
332
   if ($j==1)
327
   if ($j==1)
333
   {
328
   {
334
       $resultat=$ligne->fetchRow(DB_FETCHMODE_ORDERED);
329
       $resultat=$ligne->fetchRow(DB_FETCHMODE_ORDERED);
335
       return $resultat[0];
330
       return $resultat[0];
336
   }else return -1;
331
   }else return -1;
337
	     
332
	     
338
}     
333
}     
339
  
334
  
340
  function afficherProjet()
335
  function afficherProjet()
341
  {
336
  {
342
	  echo "<br /> projet: ";
337
	  echo "<br /> projet: ";
343
	  echo "id projet: \n";
338
	  echo "id projet: \n";
344
	  echo"$this->_id_projet  <br /> ";
339
	  echo"$this->_id_projet  <br /> ";
345
	  echo "nom projet: \n";
340
	  echo "nom projet: \n";
346
	  echo"$this->_nom_projet  <br /> ";
341
	  echo"$this->_nom_projet  <br /> ";
347
	  echo "description projet: \n";
342
	  echo "description projet: \n";
348
	  echo"$this->_description_projet  <br /> ";
343
	  echo"$this->_description_projet  <br /> ";
349
          echo "avancement : \n";
344
          echo "avancement : \n";
350
	  echo"$this->_avancement_projet  <br /> ";
345
	  echo"$this->_avancement_projet  <br /> ";
351
	  echo "date debut projet: \n";
346
	  echo "date debut projet: \n";
352
	  echo"$this->_date_debut_projet  <br /> ";
347
	  echo"$this->_date_debut_projet  <br /> ";
353
	  echo "duree prevue du projet: \n";
348
	  echo "duree prevue du projet: \n";
354
	  echo"$this->_duree_prevue_projet  <br /> ";
349
	  echo"$this->_duree_prevue_projet  <br /> ";
355
	  echo "categorie : ";
350
	  echo "categorie : ";
356
	  echo "$this->_categorie <br />";
351
	  echo "$this->_categorie <br />";
357
	  echo "liste de taches : ";
352
	  echo "liste de taches : ";
358
	  $liste=$this->_liste_taches;
353
	  $liste=$this->_liste_taches;
359
	  if (isset($liste))
354
	  if (isset($liste))
360
	  {
355
	  {
361
	  foreach ($liste as $t)
356
	  foreach ($liste as $t)
362
	  {
357
	  {
363
		  echo "$t \t , ";
358
		  echo "$t \t , ";
364
	  }
359
	  }
365
	  }
360
	  }
366
	  echo "<br />";
361
	  echo "<br />";
367
  }
362
  }
368
 
363
 
369
}
364
}
370
?>
365
?>