Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 14 → Rev 15

/trunk/classes/document.class.php
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: document.class.php,v 1.3 2005-09-27 16:38:11 alexandre_tb Exp $
// CVS : $Id: document.class.php,v 1.4 2005-09-28 16:29:39 ddelon Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
135,21 → 135,22
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
fichier::fichier($chemin.$ligne->pd_lien, $this->_db) ;
$this->_id = $ligne->pd_id ;
if (is_object ($this->_type_mime)) $this->_type_mime->setCheminIcone ($chemin_icones) ;
$this->_id_proprietaire = $ligne->pd_ce_utilisateur ;
$this->_nom_long = $ligne->pd_nom ;
$this->_visibilite = $ligne->pd_visibilite ;
$this->_date_mise_a_jour = $ligne->pd_date_de_mise_a_jour ;
$this->_description = $ligne->pd_description ;
$this->_pd_lien = $ligne->pd_lien;
if ($this->_isRacine($ligne->pd_pere)) {
$this->_id_pere = 0 ;
} else {
$this->_id_pere = $ligne->pd_pere ;
}
if ($resultat->numRows()>0) {
fichier::fichier($chemin.$ligne->pd_lien, $this->_db) ;
$this->_id = $ligne->pd_id ;
if (is_object ($this->_type_mime)) $this->_type_mime->setCheminIcone ($chemin_icones) ;
$this->_id_proprietaire = $ligne->pd_ce_utilisateur ;
$this->_nom_long = $ligne->pd_nom ;
$this->_visibilite = $ligne->pd_visibilite ;
$this->_date_mise_a_jour = $ligne->pd_date_de_mise_a_jour ;
$this->_description = $ligne->pd_description ;
$this->_pd_lien = $ligne->pd_lien;
if ($this->_isRacine($ligne->pd_pere)) {
$this->_id_pere = 0 ;
} else {
$this->_id_pere = $ligne->pd_pere ;
}
}
}
} // end of member function document
162,8 → 163,10
* @return document
* @access public
*/
function __construct( $id_document, &$objetDB )
function __construct( $id_document = "", &$objetDB, $chemin = '', $chemin_icones = '' )
{
$this->document($id_document, $objetDB, $chemin, $chemin_icones);
} // end of member function __construct
 
269,15 → 272,19
*/
function _isRacine( $id_document )
{
$requete = "select pd_pere from projet_documents where pd_id=$id_document" ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
if ($ligne->pd_pere == null){
return true ;
}
if ($id_document) {
$requete = "select pd_pere from projet_documents where pd_id=".$id_document ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
if ($resultat->numRows() >0) {
if ($ligne->pd_pere == null){
return true ;
}
}
}
return false ;
} // end of member function _isRacine
 
319,19 → 326,22
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$chemin_rep_id_nom = array() ;
if ($ligne->pd_pere == 0) {
$tab = array ($ligne->pd_id, $ligne->pd_nom) ;
if ($resultat->numRows()>0) {
if ($ligne->pd_pere == 0) {
$tab = array ($ligne->pd_id, $ligne->pd_nom) ;
return $tab ;
} else {
$requete_pere = "select pd_id, pd_nom from projet_documents where pd_id=$ligne->pd_pere" ;
$resultat_pere = $objetDB->query ($requete_pere) ;
if (DB::isError($resultat_pere)) {
die ("Echec de la requete<br />".$resultat_pere->getMessage()."<br />".$resultat_pere->getDebugInfo()) ;
}
$ligne_pere = $resultat_pere->fetchRow (DB_FETCHMODE_OBJECT) ;
array_push ($chemin_rep_id_nom, $ligne->pd_id,$ligne->pd_nom) ;
$tab = document::getCheminIdRepertoire($ligne_pere->pd_id, $objetDB) ;
$chemin_rep_id_nom = array_merge ($chemin_rep_id_nom, $tab) ;
}
else {
$requete_pere = "select pd_id, pd_nom from projet_documents where pd_id=$ligne->pd_pere" ;
$resultat_pere = $objetDB->query ($requete_pere) ;
if (DB::isError($resultat_pere)) {
die ("Echec de la requete<br />".$resultat_pere->getMessage()."<br />".$resultat_pere->getDebugInfo()) ;
}
$ligne_pere = $resultat_pere->fetchRow (DB_FETCHMODE_OBJECT) ;
array_push ($chemin_rep_id_nom, $ligne->pd_id,$ligne->pd_nom) ;
$tab = document::getCheminIdRepertoire($ligne_pere->pd_id, $objetDB) ;
$chemin_rep_id_nom = array_merge ($chemin_rep_id_nom, $tab) ;
}
}
$tabl_resultat = array() ;
for ($i = 0; $i < count ($chemin_rep_id_nom); $i++) {