| Line 14... |
Line 14... |
| 14 |
// | |
|
14 |
// | |
|
| 15 |
// | You should have received a copy of the GNU General Public |
|
15 |
// | You should have received a copy of the GNU General Public |
|
| 16 |
// | License along with this library; if not, write to the Free Software |
|
16 |
// | License along with this library; if not, write to the Free Software |
|
| 17 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 18 |
// +------------------------------------------------------------------------------------------------------+
|
18 |
// +------------------------------------------------------------------------------------------------------+
|
| 19 |
// CVS : $Id: participe.class.php,v 1.5 2007-10-10 13:56:23 alexandre_tb Exp $
|
19 |
// CVS : $Id: participe.class.php,v 1.6 2008-08-25 15:11:56 alexandre_tb Exp $
|
| 20 |
/**
|
20 |
/**
|
| 21 |
* Application projet
|
21 |
* Application projet
|
| 22 |
*
|
22 |
*
|
| 23 |
* La classe partiicpe assure la jointure entre projet et Auth
|
23 |
* La classe partiicpe assure la jointure entre projet et Auth
|
| 24 |
* Elle se base sur la table projet_statut_utilisateur
|
24 |
* Elle se base sur la table projet_statut_utilisateur
|
| Line 27... |
Line 27... |
| 27 |
//Auteur original :
|
27 |
//Auteur original :
|
| 28 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
28 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
| 29 |
//Autres auteurs :
|
29 |
//Autres auteurs :
|
| 30 |
*@author Aucun
|
30 |
*@author Aucun
|
| 31 |
*@copyright Tela-Botanica 2000-2004
|
31 |
*@copyright Tela-Botanica 2000-2004
|
| 32 |
*@version $Revision: 1.5 $
|
32 |
*@version $Revision: 1.6 $
|
| 33 |
// +------------------------------------------------------------------------------------------------------+
|
33 |
// +------------------------------------------------------------------------------------------------------+
|
| 34 |
*/
|
34 |
*/
|
| Line 35... |
Line 35... |
| 35 |
|
35 |
|
| Line 96... |
Line 96... |
| 96 |
if (DB::isError($resultat)) {
|
96 |
if (DB::isError($resultat)) {
|
| 97 |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
|
97 |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
|
| 98 |
}
|
98 |
}
|
| 99 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ORDERED)) {
|
99 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ORDERED)) {
|
| 100 |
array_push ($tableau_resultat, $ligne) ;
|
100 |
array_push ($tableau_resultat, $ligne) ;
|
| - |
|
101 |
$id = $ligne[0];
|
| - |
|
102 |
$inscrits[$id]['nom'] = $ligne[1];
|
| - |
|
103 |
$inscrits[$id]['prenom'] = $ligne[2];
|
| - |
|
104 |
$inscrits[$id]['mail'] = $ligne[3];
|
| - |
|
105 |
$inscrits[$id]['date'] = $ligne[4];
|
| - |
|
106 |
$inscrits[$id]['id_statut'] = $ligne[5];
|
| 101 |
}
|
107 |
}
|
| 102 |
$resultat->free() ;
|
108 |
$resultat->free() ;
|
| 103 |
return $tableau_resultat ;
|
109 |
return $tableau_resultat ;
|
| 104 |
} // end of member function getInscrits
|
110 |
} // end of member function getInscrits
|
| Line 167... |
Line 173... |
| 167 |
* @static
|
173 |
* @static
|
| 168 |
* @access public
|
174 |
* @access public
|
| 169 |
*/
|
175 |
*/
|
| 170 |
function getStatutSurProjetCourant( $id_utilisateur, $id_projet, &$dbObject )
|
176 |
function getStatutSurProjetCourant( $id_utilisateur, $id_projet, &$dbObject )
|
| 171 |
{
|
177 |
{
|
| - |
|
178 |
|
| - |
|
179 |
if (participe::isAdministrateur($id_utilisateur, $dbObject)) return PROJET_DROIT_ADMINISTRATEUR;
|
| 172 |
$requete = 'select psu_id_statut from projet_statut_utilisateurs'.
|
180 |
$requete = 'select psu_id_statut from projet_statut_utilisateurs'.
|
| 173 |
' where psu_id_utilisateur="'.$id_utilisateur.'" and psu_id_projet ='.$id_projet ;
|
181 |
' where psu_id_utilisateur="'.$id_utilisateur.'" and psu_id_projet ='.$id_projet ;
|
| 174 |
$resultat = $dbObject->query ($requete) ;
|
182 |
$resultat = $dbObject->query ($requete) ;
|
| 175 |
if (DB::isError ($resultat)) {
|
183 |
if (DB::isError ($resultat)) {
|
| 176 |
echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
|
184 |
return DB::raiseError('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
|
| 177 |
return;
|
- |
|
| 178 |
}
|
185 |
}
|
| 179 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
|
186 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
|
| 180 |
if (!$resultat->numRows()) {
|
187 |
if (!$resultat->numRows()) {
|
| 181 |
return 4 ; // Le statut ne participe pas
|
188 |
return 4 ; // Le statut ne participe pas
|
| 182 |
}
|
189 |
}
|
| Line 361... |
Line 368... |
| 361 |
array_push ($tableau_resultat, $ligne) ;
|
368 |
array_push ($tableau_resultat, $ligne) ;
|
| 362 |
}
|
369 |
}
|
| 363 |
$resultat->free() ;
|
370 |
$resultat->free() ;
|
| 364 |
return $tableau_resultat ;
|
371 |
return $tableau_resultat ;
|
| 365 |
} // end of member function getCoordinateurs
|
372 |
} // end of member function getCoordinateurs
|
| - |
|
373 |
|
| - |
|
374 |
/**
|
| - |
|
375 |
* Renvoie la constante de statut d un utilisateur
|
| - |
|
376 |
*
|
| - |
|
377 |
* define ('PROJET_DROIT_ADMINISTRATEUR', 1) ;
|
| - |
|
378 |
* define ('PROJET_DROIT_COORDINATEUR', 2) ;
|
| - |
|
379 |
* define ('PROJET_DROIT_PROPRIETAIRE', 4) ;
|
| - |
|
380 |
* define ('PROJET_DROIT_CONTRIBUTEUR', 8) ;
|
| - |
|
381 |
* define ('PROJET_DROIT_AUCUN', 16) ;
|
| - |
|
382 |
* define ('PROJET_DROIT_EN_ATTENTE', 32);
|
| - |
|
383 |
*
|
| - |
|
384 |
* @access public
|
| - |
|
385 |
* @return int La constante de statut
|
| - |
|
386 |
*/
|
| - |
|
387 |
|
| - |
|
388 |
function getStatut($id_utilisateur, $id_projet)
|
| - |
|
389 |
{
|
| - |
|
390 |
$statut = $this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $this->_db);
|
| - |
|
391 |
switch ($statut)
|
| - |
|
392 |
{
|
| - |
|
393 |
case 0 : return PROJET_DROIT_ADMINISTRATEUR;
|
| - |
|
394 |
break;
|
| - |
|
395 |
case 1 : return PROJET_DROIT_COORDINATEUR;
|
| - |
|
396 |
break;
|
| - |
|
397 |
case 2 : return PROJET_DROIT_CONTRIBUTEUR;
|
| - |
|
398 |
break;
|
| - |
|
399 |
case 3 : return PROJET_DROIT_EN_ATTENTE;
|
| - |
|
400 |
break;
|
| - |
|
401 |
default : return PROJET_DROIT_AUCUN;
|
| - |
|
402 |
}
|
| - |
|
403 |
}
|
| 366 |
} // end of participe
|
404 |
} // end of participe
|
| 367 |
?>
|
405 |
?>
|