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.1 2005-09-22 14:02:48 ddelon Exp $ |
// CVS : $Id: document.class.php,v 1.2 2005-09-26 20:18:27 ddelon Exp $ |
/** |
* Application projet |
* |
31,7 → 31,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ |
*@version $Revision: 1.2 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
135,7 → 135,7 |
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ; |
|
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) ; |
151,6 → 151,7 |
$this->_id_pere = $ligne->pd_pere ; |
} |
} |
} |
|
} // end of member function document |
|
162,9 → 163,11 |
* @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" ; |
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,10 → 326,12 |
} |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ; |
$chemin_rep_id_nom = array() ; |
if ($resultat->numRows()>0) { |
if ($ligne->pd_pere == 0) { |
$tab = array ($ligne->pd_id, $ligne->pd_nom) ; |
return $tab ; |
} else { |
} |
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)) { |
333,6 → 342,7 |
$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++) { |
$val1 = array_pop ($chemin_rep_id_nom) ; |