1,5 → 1,5 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
19,7 → 19,7 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: projet.class.php,v 1.5 2005-10-14 08:50:37 alexandre_tb Exp $ |
// CVS : $Id: projet.class.php,v 1.6 2005-11-14 10:14:30 ddelon Exp $ |
/** |
* Application projet |
* |
31,7 → 31,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.5 $ |
*@version $Revision: 1.6 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
42,7 → 42,8 |
|
include_once PROJET_CHEMIN_CLASSES.'document.class.php' ; |
include_once PROJET_CHEMIN_CLASSES.'liste_discussion.class.php' ; |
include_once PROJET_CHEMIN_FONCTIONS.'SQL_manipulation.fonct.php' ; |
/* Permet la récupération d'un nouvel identifiant d'une table.*/ |
require_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'sql/SQL_manipulation.fonct.php'; |
include_once 'Mail.php' ; |
|
// +------------------------------------------------------------------------------------------------------+ |
54,7 → 55,7 |
|
/** |
* class projet |
* |
* |
*/ |
class projet |
{ |
72,7 → 73,7 |
/** Compositions: */ |
|
/*** Attributes: ***/ |
|
|
/** |
* L'identifiant du projet. |
* @access private |
144,8 → 145,8 |
var $_type; |
|
/** |
* |
* PHP5 |
* |
* PHP5 |
* @return projet |
* @access public |
*/ |
152,12 → 153,12 |
function __construct( &$dbObject, $id_projet = "") |
{ |
$this->projet($dbObject, $id_projet); |
|
|
} // end of member function __construct |
|
/** |
* |
* |
* |
* @param DB dbObject Un objet PEAR:DB |
* @param int id_projet On passe un identifiant de projet au constructeur. Cela lui permet de faire une |
* première requête pour les infos de bases comme le titre, le description etc. |
174,7 → 175,7 |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ; |
|
|
// Affectations dans les propriétés |
$this->_id_projet = $ligne->p_id ; |
$this->_titre = $ligne->p_titre ; |
186,7 → 187,7 |
$this->_type = $ligne->p_type ; |
// On récupère le nom du répertoire |
$this->_nom_repertoire = $ligne->p_nom_repertoire ; |
|
|
// on regarde si on a à faire au projet racine |
if (PROJET_UTILISE_HIERARCHIE) { |
$requete = 'select ph_id_projet_pere, ph_id_projet_fils from projet_hierarchie where ph_id_projet_fils='.$this->_id_projet ; |
204,11 → 205,11 |
} // end of member function projet |
|
/** |
* |
* |
* |
* @param DB dbObject Un objet PEAR:DB |
* @param int id_projet On passe un identifiant de projet au constructeur. |
* @return bool |
* @return bool |
* @access public |
*/ |
function projetExiste( &$dbObject, $id_projet) |
224,11 → 225,11 |
} |
} |
} // end of member function projet |
|
|
/** |
* |
* |
* @param int id_projet |
* |
* @param int id_projet |
* @return string |
* @access public |
*/ |
236,10 → 237,10 |
{ |
return $this->_titre ; |
} // end of member function getTitre |
|
|
/** |
* |
* |
* |
* @return string |
* @access public |
*/ |
260,8 → 261,8 |
} // end of member function getId |
|
/** |
* |
* |
* |
* @return string |
* @access public |
*/ |
271,8 → 272,8 |
} // end of member function getDescription |
|
/** |
* |
* |
* |
* @return string |
* @access public |
*/ |
303,7 → 304,7 |
if ($resultat->numRows()) { |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ; |
$this->_listes_associes[] = new liste_discussion($ligne->pl_id_liste, $this->_db) ; |
|
|
} |
} // end of member function getListesAssociees |
|
332,7 → 333,7 |
* (cliquable)" |
* |
* @param visibilite visibilite Si visibilite est à prive, tous les fichiers sont renvoyés ainsi qu'une entrée |
* pour indiquer la visibilité du document. |
* pour indiquer la visibilité du document. |
* @return Array |
* @access public |
*/ |
347,10 → 348,10 |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$tableau_document = array() ; |
|
|
// Un compteur |
$i = 0 ; |
|
|
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) { |
array_push ($tableau_document, new document ($ligne->pd_id, &$this->_db, $chemin, $chemin_icones)) ; |
} |
374,11 → 375,11 |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$tableau_document = array() ; |
|
|
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) { |
array_push ($tableau_document, new document ($ligne->pd_id, $this->_db)); |
} |
|
|
return $tableau_document ; |
} // end of member function getListeRepertoireHierarchisee |
|
458,7 → 459,7 |
*/ |
function __destruct( ) |
{ |
|
|
} // end of member function __destruct |
|
/** |
470,7 → 471,7 |
*/ |
function supprimer( ) |
{ |
|
|
} // end of member function supprimer |
|
/** |
502,14 → 503,14 |
', p_wikini="'.$tableau_de_valeur['projet_wikini'].'", p_nom_repertoire="'.$nom_repertoire.'", p_resume="'.$tableau_de_valeur['projet_resume']. |
'", p_type='.$tableau_de_valeur['projet_type'] ; |
$resultat = $this->_db->query ($requete) ; |
|
|
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
|
|
// On affecte à l'objet projet son identifiant |
$this->_id_projet = $id ; |
|
|
//insertion dans projet_hiérarchie |
if (PROJET_UTILISE_HIERARCHIE) { |
$requete = 'insert into projet_hierarchie set ph_id_projet_pere='.$tableau_de_valeur['projet_asso']. |
542,15 → 543,15 |
if (DB::isError($resultat)) { |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
|
|
if (PROJET_UTILISE_HIERARCHIE) { |
// suppression dans projet_hierarchie |
|
|
$requete = 'delete from projet_hierarchie where ph_id_projet_fils='.$this->_id_projet ; |
$resultat = $this->_db->query ($requete) ; |
|
|
//insertion dans projet_hiérarchie |
|
|
$requete = 'insert into projet_hierarchie set ph_id_projet_pere='.$tableau_de_valeur['projet_asso']. |
', ph_id_projet_fils='.$this->_id_projet ; |
$resultat = $this->_db->query ($requete) ; |
577,9 → 578,9 |
|
|
/** |
* |
* |
* @param string code_sql |
* |
* @param string code_sql |
* @return bool |
* @access public |
*/ |
591,13 → 592,13 |
$msg = 'La suppression du répertoire n\'a pas fonctionné' ; |
} |
// A ajouter la suppression des documents associés |
|
|
// La suppression des évènements associés |
|
|
// Le projet lui-même |
$requete = "delete from projet where p_id=".$this->_id_projet ; |
$resultat = $this->_db->query ($requete) ; |
|
|
if (PROJET_UTILISE_HIERARCHIE) { |
$requete = "delete from projet_hierarchie where ph_id_projet_fils=".$this->_id_projet ; |
$resultat = $this->_db->query ($requete) ; |
669,7 → 670,7 |
$nom .= 1 ; |
} |
return $nom ; |
|
|
} // end of member function genereNomRepertoire |
|
/** |
771,7 → 772,7 |
} |
return $tableau_resultat ; |
} // end of member function getHierarchie |
|
|
/** |
* Renvoie l'identifiant du pere du projet courrant. |
* |