Subversion Repositories Applications.projet

Rev

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

Rev 11 Rev 15
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
18
// | You should have received a copy of the GNU 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
// CVS : $Id: projet.class.php,v 1.3 2005-09-27 16:42:00 alexandre_tb Exp $
22
// CVS : $Id: projet.class.php,v 1.4 2005-09-28 16:29:39 ddelon Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* La classe projet
26
* La classe projet
27
*
27
*
Line 29... Line 29...
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.3 $
34
*@version       $Revision: 1.4 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
Line 143... Line 143...
143
     */
143
     */
144
    var $_type;
144
    var $_type;
Line 145... Line 145...
145
 
145
 
146
    /**
146
    /**
147
     * 
147
     * 
148
     *
148
     * PHP5 
149
     * @return projet
149
     * @return projet
150
     * @access public
150
     * @access public
151
     */
151
     */
152
    function __construct( )
152
    function __construct( &$dbObject,  $id_projet = "")
-
 
153
    {
153
    {
154
      $this->projet($dbObject,  $id_projet);
154
        
155
      
Line 155... Line 156...
155
    } // end of member function __construct
156
    } // end of member function __construct
156
 
157
 
157
    /**
158
    /**
Line 489... Line 490...
489
        if (!PROJET_UTILISE_TYPE) {
490
        if (!PROJET_UTILISE_TYPE) {
490
            $tableau_de_valeur['projet_type'] = 0 ;
491
            $tableau_de_valeur['projet_type'] = 0 ;
491
        }
492
        }
492
        $id = SQL_obtenirNouveauId($this->_db, 'projet', 'p_id') ;
493
        $id = SQL_obtenirNouveauId($this->_db, 'projet', 'p_id') ;
493
        $requete = 'insert into projet set p_id='.$id ;
494
        $requete = 'insert into projet set p_id='.$id ;
-
 
495
        if (!isset($tableau_de_valeur['projet_wikini'])) {
-
 
496
        	$tableau_de_valeur['projet_wikini']='';
-
 
497
        }
494
        $requete .= ', p_titre="'.$tableau_de_valeur['projet_titre'].'", p_description="'.$tableau_de_valeur['projet_description'].'"'.
498
        $requete .= ', p_titre="'.$tableau_de_valeur['projet_titre'].'", p_description="'.$tableau_de_valeur['projet_description'].'"'.
495
                    ', p_espace_internet="'.$tableau_de_valeur['projet_espace_internet'].'", p_date_creation=NOW()'.
499
                    ', p_espace_internet="'.$tableau_de_valeur['projet_espace_internet'].'", p_date_creation=NOW()'.
496
                    ', p_wikini="'.$tableau_de_valeur['projet_wikini'].'", p_nom_repertoire="'.$nom_repertoire.'", p_resume="'.$tableau_de_valeur['projet_resume'].
500
                    ', p_wikini="'.$tableau_de_valeur['projet_wikini'].'", p_nom_repertoire="'.$nom_repertoire.'", p_resume="'.$tableau_de_valeur['projet_resume'].
497
                    '", p_type='.$tableau_de_valeur['projet_type'] ;
501
                    '", p_type='.$tableau_de_valeur['projet_type'] ;
498
        $resultat = $this->_db->query ($requete) ;
502
        $resultat = $this->_db->query ($requete) ;
Line 643... Line 647...
643
        $requete = "select p_id from projet order by p_id desc limit 0,1" ;
647
        $requete = "select p_id from projet order by p_id desc limit 0,1" ;
644
        $resultat = $objetDB->query ($requete) ;
648
        $resultat = $objetDB->query ($requete) ;
645
        if (DB::isError ($resultat)) {
649
        if (DB::isError ($resultat)) {
646
            die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
650
            die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
647
        }
651
        }
-
 
652
        if ($resultat->numRows() > 0) {
648
        $ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
653
	        $ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
649
        $nom = strtoupper(substr($chaine, 0, 1)) ;
654
	        $nom = strtoupper(substr($chaine, 0, 1)) ;
650
        $nom .= $ligne->p_id + 1 ;
655
	        $nom .= $ligne->p_id + 1 ;
-
 
656
        }
-
 
657
	    else {
-
 
658
	    	$nom = strtoupper(substr($chaine, 0, 1)) ;
-
 
659
	        $nom .=  1 ;
-
 
660
	    }
651
        return $nom ;
661
        return $nom ;
Line 652... Line 662...
652
        
662
        
Line 653... Line 663...
653
    } // end of member function genereNomRepertoire
663
    } // end of member function genereNomRepertoire