Subversion Repositories Applications.projet

Rev

Rev 397 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 397 Rev 431
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.7 2008-09-16 14:11:31 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.7 $
32
*@version       $Revision: 1.6 $
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
*/
34
*/
Line 35... Line 35...
35
 
35
 
Line 227... Line 227...
227
     * @access public
227
     * @access public
228
     */
228
     */
229
    function setStatut( $id_statut,  $id_utilisateur,  $id_projet )
229
    function setStatut( $id_statut,  $id_utilisateur,  $id_projet )
230
    {    	
230
    {
231
        $requete = 'update projet_statut_utilisateurs set psu_id_statut='.$this->_db->escapeSimple($id_statut).
231
        $requete = 'update projet_statut_utilisateurs set psu_id_statut='.$this->_db->escapeSimple($id_statut).
232
                    ' where psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).' and psu_id_projet='.$this->_db->escapeSimple($id_projet);
232
                    ' where psu_id_utilisateur='.$id_utilisateur.' and psu_id_projet='.$this->_db->escapeSimple($id_projet);
Line 233... Line 233...
233
        
233
        
234
        if (participe::getStatutSurProjetCourant($id_utilisateur, $id_projet, $this->_db) == 4) {
234
        if (participe::getStatutSurProjetCourant($id_utilisateur, $id_projet, $this->_db) == 4) {
235
            $requete = 'insert into projet_statut_utilisateurs set psu_id_statut='.$this->_db->escapeSimple($id_statut).
235
            $requete = 'insert into projet_statut_utilisateurs set psu_id_statut='.$this->_db->escapeSimple($id_statut).
236
                    ', psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).',psu_id_projet='.$this->_db->escapeSimple($id_projet).
236
                    ', psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).',psu_id_projet='.$this->_db->escapeSimple($id_projet).
237
                    ', psu_date_inscription=NOW()';
237
                    ', psu_date_inscription=NOW()';
238
        }
238
        }
239
        if ($id_statut == 4) {  // Si le statut est ne participe pas, on supprime l'inscrit
239
        if ($id_statut == 4) {  // Si le statut est ne participe pas, on supprime l'inscrit
240
            $requete = 'delete from projet_statut_utilisateurs where psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).
-
 
241
            			' and psu_id_projet='.$this->_db->escapeSimple($id_projet) ;
240
            $requete = 'delete from projet_statut_utilisateurs where psu_id_utilisateur='.$this->_db->escapeSimple($id_utilisateur).' and psu_id_projet='.$this->_db->escapeSimple($id_projet) ;
242
        }
241
        }
243
        $resultat = $this->_db->query ($requete) ;
242
        $resultat = $this->_db->query ($requete) ;
244
        if (DB::isError ($resultat)) {
243
        if (DB::isError ($resultat)) {
245
            die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
244
            die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;