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.6 2007-01-04 17:03:04 alexandre_tb Exp $ |
// CVS : $Id: document.class.php,v 1.7 2007-04-19 09:22:29 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.7 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
562,7 → 562,7 |
*/ |
function getDocumentsRecents( $nombre = 10, &$objetDB, $chemin, $chemin_icones, $id_projet = '', $visible = true) |
{ |
// on recherche les documents, hors répertoire |
// on recherche les documents, hors repertoire |
$requete = 'select pd_id from projet_documents where pd_ce_type<>0 '; |
if ($id_projet != '') $requete .= ' and pd_ce_projet='.$id_projet.' '; |
if (!$visible) $requete .= ' and pd_visibilite="public" '; |
579,7 → 579,41 |
return $tableau_document ; |
} // end of member function getDocumentsRecents |
|
/** |
* Renvoie les documents du projet passe en parametre sous forme d arbre d objet document |
* |
* @param int l identifiant du projet |
* @return Array |
* @static |
* @access public |
*/ |
function getArbreDocument($id_projet, $objetDB = '') { |
$requete = 'select pd_id, pd_nom, pd_ce_type, pd_pere from projet_documents where pd_ce_projet='.$id_projet; |
$resultat = $GLOBALS['projet_db']->getAll($requete, null, DB_FETCHMODE_OBJECT); |
if (DB::isError ($resultat)) { |
return ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ; |
} |
|
return $resultat; |
} |
/** |
* Renvoie la taille du document formatee avec une unite adapte |
* |
* @return string La taille formate |
* @access public |
*/ |
function getTailleFormatee($precision = 1) { |
$taille = $this->getTaille(); |
if ($taille > 1000000) { |
$diviseur = 1000000; |
$unite = 'Mo'; |
} else { |
$diviseur = 1000 ; |
$unite = 'Ko'; |
} |
return round ($taille / $diviseur, $precision).' '.$unite; |
} |
|
} // end of document |
|
|