Subversion Repositories Applications.projet

Rev

Rev 203 | Rev 300 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 203 Rev 260
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.4 2007-04-19 09:30:28 alexandre_tb Exp $
19
// CVS : $Id: participe.class.php,v 1.5 2007-10-10 13:56:23 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.4 $
32
*@version       $Revision: 1.5 $
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
*/
34
*/
Line 35... Line 35...
35
 
35
 
Line 172... Line 172...
172
        $requete = 'select psu_id_statut from projet_statut_utilisateurs'.
172
        $requete = 'select psu_id_statut from projet_statut_utilisateurs'.
173
                    ' where psu_id_utilisateur="'.$id_utilisateur.'" and psu_id_projet ='.$id_projet ;
173
                    ' where psu_id_utilisateur="'.$id_utilisateur.'" and psu_id_projet ='.$id_projet ;
174
        $resultat = $dbObject->query ($requete) ;
174
        $resultat = $dbObject->query ($requete) ;
175
        if (DB::isError ($resultat)) {
175
        if (DB::isError ($resultat)) {
176
            echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
176
            echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
-
 
177
            return;
177
        }
178
        }
178
        $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
179
        $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
179
        if (!$resultat->numRows()) {
180
        if (!$resultat->numRows()) {
180
            return 4 ;      // Le statut ne participe pas
181
            return 4 ;      // Le statut ne participe pas
181
        }
182
        }
Line 247... Line 248...
247
     * @static
248
     * @static
248
     * @access public
249
     * @access public
249
     */
250
     */
250
    function isCoordinateur( $id_utilisateur, $id_projet, &$objetDB )
251
    function isCoordinateur( $id_utilisateur, $id_projet, &$objetDB )
251
    {
252
    {
-
 
253
        if (!is_object($objetDB)) $objetDB = $this->_db;
252
        $statut = $this->getStatutSurProjetCourant($id_utilisateur,  $id_projet, $objetDB) ;
254
        $statut = $this->getStatutSurProjetCourant($id_utilisateur,  $id_projet, $objetDB) ;
253
        if ($statut == 1) {
255
        if ($statut == 1) {
254
            return true;
256
            return true;
255
        }
257
        }
256
        return false ;
258
        return false ;
Line 289... Line 291...
289
     * @return bool
291
     * @return bool
290
     * @access public
292
     * @access public
291
     */
293
     */
292
    function isObservateur( $id_utilisateur,  $id_projet, &$objetDB )
294
    function isObservateur( $id_utilisateur,  $id_projet, &$objetDB )
293
    {
295
    {
-
 
296
        if (!is_object($objetDB)) $objetDB = $this->_db;
294
        if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 3) {
297
        if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 3) {
295
            return true;
298
            return true;
296
        }
299
        }
297
        return false ;
300
        return false ;
298
    } // end of member function isObservateur
301
    } // end of member function isObservateur
Line 306... Line 309...
306
     * @return bool
309
     * @return bool
307
     * @access public
310
     * @access public
308
     */
311
     */
309
    function isContributeur( $id_utilisateur,  $id_projet, &$objetDB )
312
    function isContributeur( $id_utilisateur,  $id_projet, &$objetDB )
310
    {
313
    {
-
 
314
        if (!is_object($objetDB)) $objetDB = $this->_db;
311
        if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 4) return false; 
315
        if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 4) return false; 
312
        if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 2) {
316
        if ($this->getStatutSurProjetCourant($id_utilisateur, $id_projet, $objetDB) == 2) {
313
            return true;
317
            return true;
314
        }
318
        }
315
        return false ;
319
        return false ;