Fix: Use correct case for class name

This commit is contained in:
Laurent Destailleur 2011-11-23 15:19:44 +01:00
parent 1086e1a212
commit 237cd163d9
8 changed files with 62 additions and 51 deletions

View File

@ -97,7 +97,7 @@ if ($action=='purge' && ! preg_match('/^confirm/i',$choice) && ($choice != 'allf
if ($conf->ecm->enabled && $choice=='allfiles')
{
require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
$ecmdirstatic = new ECMDirectory($db);
$ecmdirstatic = new EcmDirectory($db);
$result = $ecmdirstatic->refreshcachenboffile(1);
}
}

View File

@ -51,11 +51,11 @@ class EcmDirectory // extends CommonObject
/**
* Constructor
*
* @param DoliDB $DB Database handler
* @param DoliDB $db Database handler
*/
function EcmDirectory($DB)
function EcmDirectory($db)
{
$this->db = $DB;
$this->db = $db;
return 1;
}
@ -86,14 +86,14 @@ class EcmDirectory // extends CommonObject
$relativepath=$this->label;
if ($this->fk_parent)
{
$parent = new ECMDirectory($this->db);
$parent = new EcmDirectory($this->db);
$parent->fetch($this->fk_parent);
$relativepath=$parent->getRelativePath().$relativepath;
}
$relativepath=preg_replace('/([\/])+/i','/',$relativepath); // Avoid duplicate / or \
//print $relativepath.'<br>';
$cat = new ECMDirectory($this->db);
$cat = new EcmDirectory($this->db);
$cate_arbo = $cat->get_full_arbo(1);
$pathfound=0;
foreach ($cate_arbo as $key => $categ)
@ -174,10 +174,11 @@ class EcmDirectory // extends CommonObject
}
/**
* \brief Update database
* \param user User that modify
* \param notrigger 0=no, 1=yes (no update trigger)
* \return int <0 if KO, >0 if OK
* Update database
*
* @param User $user User that modify
* @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK
*/
function update($user=0, $notrigger=0)
{
@ -235,9 +236,10 @@ class EcmDirectory // extends CommonObject
/**
* Update cache of nb of documents into database
* @param sign '+' or '-'
* @return int <0 if KO, >0 if OK
* Update cache of nb of documents into database
*
* @param string $sign '+' or '-'
* @return int <0 if KO, >0 if OK
*/
function changeNbOfFiles($sign)
{
@ -262,9 +264,10 @@ class EcmDirectory // extends CommonObject
/**
* \brief Load object in memory from database
* \param id id object
* \return int <0 if KO, 0 if not found, >0 if OK
* Load object in memory from database
*
* @param int $id Id of object
* @return int <0 if KO, 0 if not found, >0 if OK
*/
function fetch($id)
{
@ -315,9 +318,10 @@ class EcmDirectory // extends CommonObject
/**
* \brief Delete object on database and on disk
* \param user User that delete
* \return int <0 if KO, >0 if OK
* Delete object on database and on disk
*
* @param User $user User that delete
* @return int <0 if KO, >0 if OK
*/
function delete($user)
{
@ -391,10 +395,12 @@ class EcmDirectory // extends CommonObject
/**
* \brief Return directory name you can click (and picto)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \param option Sur quoi pointe le lien
* \return string Chaine avec URL
* Return directory name you can click (and picto)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param string $option Sur quoi pointe le lien
* @param int $max Max length
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$option='',$max=0)
{
@ -423,8 +429,9 @@ class EcmDirectory // extends CommonObject
/**
* Return relative path of a directory on disk
* @param force Force reload of full arbo even if already loaded
* @return string Relative physical path
*
* @param int $force Force reload of full arbo even if already loaded
* @return string Relative physical path
*/
function getRelativePath($force=0)
{
@ -461,8 +468,9 @@ class EcmDirectory // extends CommonObject
}
/**
* \brief Load this->motherof that is array(id_son=>id_parent, ...)
* \return int <0 if KO, >0 if OK
* Load this->motherof that is array(id_son=>id_parent, ...)
*
* @return int <0 if KO, >0 if OK
*/
function load_motherof()
{
@ -488,7 +496,7 @@ class EcmDirectory // extends CommonObject
}
else
{
dol_print_error ($this->db);
dol_print_error($this->db);
return -1;
}
}
@ -509,8 +517,9 @@ class EcmDirectory // extends CommonObject
* fullrelativename Full path name (Added by build_path_from_id_categ call)
* fulllabel Full label (Added by build_path_from_id_categ call)
* level Level of line (Added by build_path_from_id_categ call)
* @param force Force reload of full arbo even if already loaded in cache $this->cats
* @return array Tableau de array
*
* @param int $force Force reload of full arbo even if already loaded in cache $this->cats
* @return array Tableau de array
*/
function get_full_arbo($force=0)
{
@ -576,7 +585,7 @@ class EcmDirectory // extends CommonObject
}
else
{
dol_print_error ($this->db);
dol_print_error($this->db);
return -1;
}
@ -594,10 +603,12 @@ class EcmDirectory // extends CommonObject
}
/**
* \brief Calcule les proprietes fullpath, fullrelativename, fulllabel d'un repertoire
* du tableau this->cats et de toutes ces enfants
* \param id_categ id_categ entry to update
* \param protection Deep counter to avoid infinite loop
* Calcule les proprietes fullpath, fullrelativename, fulllabel d'un repertoire
* du tableau this->cats et de toutes ces enfants.
*
* @param int $id_categ id_categ entry to update
* @param int $protection Deep counter to avoid infinite loop
* @return void
*/
function build_path_from_id_categ($id_categ,$protection=0)
{
@ -635,10 +646,10 @@ class EcmDirectory // extends CommonObject
}
/**
* \brief Refresh value for cachenboffile
* \param directory Directory to scan
* \param all 0=refresh this id , 1=refresh this entity
* \return int <0 if KO, Nb of files in directory if OK
* Refresh value for cachenboffile
*
* @param int $all 0=refresh this id , 1=refresh this entity
* @return int <0 if KO, Nb of files in directory if OK
*/
function refreshcachenboffile($all=0)
{

View File

@ -57,7 +57,7 @@ class FormEcm
if ($select_name=="") $select_name="catParent";
$cat = new ECMDirectory($this->db);
$cat = new EcmDirectory($this->db);
$cate_arbo = $cat->get_full_arbo();
$output = '<select class="flat" name="'.$select_name.'">';

View File

@ -61,7 +61,7 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="label";
$ecmdir = new ECMDirectory($db);
$ecmdir = new EcmDirectory($db);
if (! empty($_GET["section"]))
{
$result=$ecmdir->fetch($_GET["section"]);

View File

@ -72,7 +72,7 @@ if (! $urlfile)
}
// Load ecm object
$ecmdir = new ECMDirectory($db);
$ecmdir = new EcmDirectory($db);
$result=$ecmdir->fetch(GETPOST("section"));
if (! $result > 0)
{
@ -176,7 +176,7 @@ if ($_GET["action"] == 'edit')
print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
$s='';
$tmpecmdir=new ECMDirectory($db); // Need to create a new one
$tmpecmdir=new EcmDirectory($db); // Need to create a new one
$tmpecmdir->fetch($ecmdir->id);
$result = 1;
$i=0;

View File

@ -62,7 +62,7 @@ if (! $section)
// Load ecm object
$ecmdir = new ECMDirectory($db);
$ecmdir = new EcmDirectory($db);
$result=$ecmdir->fetch(GETPOST("section"));
if (! $result > 0)
{
@ -232,7 +232,7 @@ if ($_GET["action"] == 'edit')
print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
$s='';
$tmpecmdir=new ECMDirectory($db); // Need to create a new one
$tmpecmdir=new EcmDirectory($db); // Need to create a new one
$tmpecmdir->fetch($ecmdir->id);
$result = 1;
$i=0;

View File

@ -68,7 +68,7 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="label";
$ecmdir = new ECMDirectory($db);
$ecmdir = new EcmDirectory($db);
if (GETPOST("section"))
{
$result=$ecmdir->fetch(GETPOST("section"));
@ -80,7 +80,7 @@ if (GETPOST("section"))
}
$form=new Form($db);
$ecmdirstatic = new ECMDirectory($db);
$ecmdirstatic = new EcmDirectory($db);
$userstatic = new User($db);
@ -253,7 +253,7 @@ if (GETPOST("action") == 'refreshmanual')
if ($fk_parent >= 0)
{
$ecmdirtmp=new ECMDirectory($db);
$ecmdirtmp=new EcmDirectory($db);
$ecmdirtmp->ref = 'NOTUSEDYET';
$ecmdirtmp->label = basename($dirdesc['fullname']);
$ecmdirtmp->description = '';
@ -445,7 +445,7 @@ else
if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete')
{
$userstatic = new User($db);
$ecmdirstatic = new ECMDirectory($db);
$ecmdirstatic = new EcmDirectory($db);
// Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section')

View File

@ -65,7 +65,7 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="label";
$ecmdir = new ECMDirectory($db);
$ecmdir = new EcmDirectory($db);
if (! empty($_REQUEST["section"]))
{
$result=$ecmdir->fetch($_REQUEST["section"]);
@ -96,7 +96,7 @@ if (! empty($_REQUEST["section"]))
llxHeader();
$form=new Form($db);
$ecmdirstatic = new ECMDirectory($db);
$ecmdirstatic = new EcmDirectory($db);
$userstatic = new User($db);