Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 59 → Rev 58

/trunk/classes/projet.class.php
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.6 2005-11-14 10:14:30 ddelon Exp $
// CVS : $Id: projet.class.php,v 1.5 2005-10-14 08:50:37 alexandre_tb Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.6 $
*@version $Revision: 1.5 $
// +------------------------------------------------------------------------------------------------------+
*/
 
42,8 → 42,7
 
include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'liste_discussion.class.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 PROJET_CHEMIN_FONCTIONS.'SQL_manipulation.fonct.php' ;
include_once 'Mail.php' ;
 
// +------------------------------------------------------------------------------------------------------+
55,7 → 54,7
 
/**
* class projet
*
*
*/
class projet
{
73,7 → 72,7
/** Compositions: */
 
/*** Attributes: ***/
 
/**
* L'identifiant du projet.
* @access private
145,8 → 144,8
var $_type;
 
/**
*
* PHP5
*
* PHP5
* @return projet
* @access public
*/
153,12 → 152,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.
175,7 → 174,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 ;
187,7 → 186,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 ;
205,11 → 204,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)
225,11 → 224,11
}
}
} // end of member function projet
 
/**
*
*
*
* @param int id_projet
* @param int id_projet
* @return string
* @access public
*/
237,10 → 236,10
{
return $this->_titre ;
} // end of member function getTitre
 
/**
*
*
*
* @return string
* @access public
*/
261,8 → 260,8
} // end of member function getId
 
/**
*
*
*
* @return string
* @access public
*/
272,8 → 271,8
} // end of member function getDescription
 
/**
*
*
*
* @return string
* @access public
*/
304,7 → 303,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
 
333,7 → 332,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
*/
348,10 → 347,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)) ;
}
375,11 → 374,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
 
459,7 → 458,7
*/
function __destruct( )
{
 
} // end of member function __destruct
 
/**
471,7 → 470,7
*/
function supprimer( )
{
 
} // end of member function supprimer
 
/**
503,14 → 502,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'].
543,15 → 542,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) ;
578,9 → 577,9
 
 
/**
*
*
*
* @param string code_sql
* @param string code_sql
* @return bool
* @access public
*/
592,13 → 591,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) ;
670,7 → 669,7
$nom .= 1 ;
}
return $nom ;
 
} // end of member function genereNomRepertoire
 
/**
772,7 → 771,7
}
return $tableau_resultat ;
} // end of member function getHierarchie
 
/**
* Renvoie l'identifiant du pere du projet courrant.
*