Fix: Use correct case for class name
This commit is contained in:
parent
1086e1a212
commit
237cd163d9
@ -97,7 +97,7 @@ if ($action=='purge' && ! preg_match('/^confirm/i',$choice) && ($choice != 'allf
|
|||||||
if ($conf->ecm->enabled && $choice=='allfiles')
|
if ($conf->ecm->enabled && $choice=='allfiles')
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
|
||||||
$ecmdirstatic = new ECMDirectory($db);
|
$ecmdirstatic = new EcmDirectory($db);
|
||||||
$result = $ecmdirstatic->refreshcachenboffile(1);
|
$result = $ecmdirstatic->refreshcachenboffile(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,11 +51,11 @@ class EcmDirectory // extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* 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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,14 +86,14 @@ class EcmDirectory // extends CommonObject
|
|||||||
$relativepath=$this->label;
|
$relativepath=$this->label;
|
||||||
if ($this->fk_parent)
|
if ($this->fk_parent)
|
||||||
{
|
{
|
||||||
$parent = new ECMDirectory($this->db);
|
$parent = new EcmDirectory($this->db);
|
||||||
$parent->fetch($this->fk_parent);
|
$parent->fetch($this->fk_parent);
|
||||||
$relativepath=$parent->getRelativePath().$relativepath;
|
$relativepath=$parent->getRelativePath().$relativepath;
|
||||||
}
|
}
|
||||||
$relativepath=preg_replace('/([\/])+/i','/',$relativepath); // Avoid duplicate / or \
|
$relativepath=preg_replace('/([\/])+/i','/',$relativepath); // Avoid duplicate / or \
|
||||||
//print $relativepath.'<br>';
|
//print $relativepath.'<br>';
|
||||||
|
|
||||||
$cat = new ECMDirectory($this->db);
|
$cat = new EcmDirectory($this->db);
|
||||||
$cate_arbo = $cat->get_full_arbo(1);
|
$cate_arbo = $cat->get_full_arbo(1);
|
||||||
$pathfound=0;
|
$pathfound=0;
|
||||||
foreach ($cate_arbo as $key => $categ)
|
foreach ($cate_arbo as $key => $categ)
|
||||||
@ -174,10 +174,11 @@ class EcmDirectory // extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Update database
|
* Update database
|
||||||
* \param user User that modify
|
*
|
||||||
* \param notrigger 0=no, 1=yes (no update trigger)
|
* @param User $user User that modify
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user=0, $notrigger=0)
|
function update($user=0, $notrigger=0)
|
||||||
{
|
{
|
||||||
@ -235,9 +236,10 @@ class EcmDirectory // extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update cache of nb of documents into database
|
* Update cache of nb of documents into database
|
||||||
* @param sign '+' or '-'
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @param string $sign '+' or '-'
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function changeNbOfFiles($sign)
|
function changeNbOfFiles($sign)
|
||||||
{
|
{
|
||||||
@ -262,9 +264,10 @@ class EcmDirectory // extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load object in memory from database
|
* Load object in memory from database
|
||||||
* \param id id object
|
*
|
||||||
* \return int <0 if KO, 0 if not found, >0 if OK
|
* @param int $id Id of object
|
||||||
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
function fetch($id)
|
||||||
{
|
{
|
||||||
@ -315,9 +318,10 @@ class EcmDirectory // extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Delete object on database and on disk
|
* Delete object on database and on disk
|
||||||
* \param user User that delete
|
*
|
||||||
* \return int <0 if KO, >0 if OK
|
* @param User $user User that delete
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
function delete($user)
|
||||||
{
|
{
|
||||||
@ -391,10 +395,12 @@ class EcmDirectory // extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return directory name you can click (and picto)
|
* 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
|
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||||
* \return string Chaine avec URL
|
* @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)
|
function getNomUrl($withpicto=0,$option='',$max=0)
|
||||||
{
|
{
|
||||||
@ -423,8 +429,9 @@ class EcmDirectory // extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return relative path of a directory on disk
|
* 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)
|
function getRelativePath($force=0)
|
||||||
{
|
{
|
||||||
@ -461,8 +468,9 @@ class EcmDirectory // extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load this->motherof that is array(id_son=>id_parent, ...)
|
* Load this->motherof that is array(id_son=>id_parent, ...)
|
||||||
* \return int <0 if KO, >0 if OK
|
*
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function load_motherof()
|
function load_motherof()
|
||||||
{
|
{
|
||||||
@ -488,7 +496,7 @@ class EcmDirectory // extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error ($this->db);
|
dol_print_error($this->db);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -509,8 +517,9 @@ class EcmDirectory // extends CommonObject
|
|||||||
* fullrelativename Full path name (Added by build_path_from_id_categ call)
|
* fullrelativename Full path name (Added by build_path_from_id_categ call)
|
||||||
* fulllabel Full label (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)
|
* 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)
|
function get_full_arbo($force=0)
|
||||||
{
|
{
|
||||||
@ -576,7 +585,7 @@ class EcmDirectory // extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error ($this->db);
|
dol_print_error($this->db);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -594,10 +603,12 @@ class EcmDirectory // extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Calcule les proprietes fullpath, fullrelativename, fulllabel d'un repertoire
|
* Calcule les proprietes fullpath, fullrelativename, fulllabel d'un repertoire
|
||||||
* du tableau this->cats et de toutes ces enfants
|
* 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
|
* @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)
|
function build_path_from_id_categ($id_categ,$protection=0)
|
||||||
{
|
{
|
||||||
@ -635,10 +646,10 @@ class EcmDirectory // extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Refresh value for cachenboffile
|
* Refresh value for cachenboffile
|
||||||
* \param directory Directory to scan
|
*
|
||||||
* \param all 0=refresh this id , 1=refresh this entity
|
* @param int $all 0=refresh this id , 1=refresh this entity
|
||||||
* \return int <0 if KO, Nb of files in directory if OK
|
* @return int <0 if KO, Nb of files in directory if OK
|
||||||
*/
|
*/
|
||||||
function refreshcachenboffile($all=0)
|
function refreshcachenboffile($all=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class FormEcm
|
|||||||
|
|
||||||
if ($select_name=="") $select_name="catParent";
|
if ($select_name=="") $select_name="catParent";
|
||||||
|
|
||||||
$cat = new ECMDirectory($this->db);
|
$cat = new EcmDirectory($this->db);
|
||||||
$cate_arbo = $cat->get_full_arbo();
|
$cate_arbo = $cat->get_full_arbo();
|
||||||
|
|
||||||
$output = '<select class="flat" name="'.$select_name.'">';
|
$output = '<select class="flat" name="'.$select_name.'">';
|
||||||
|
|||||||
@ -61,7 +61,7 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="label";
|
if (! $sortfield) $sortfield="label";
|
||||||
|
|
||||||
$ecmdir = new ECMDirectory($db);
|
$ecmdir = new EcmDirectory($db);
|
||||||
if (! empty($_GET["section"]))
|
if (! empty($_GET["section"]))
|
||||||
{
|
{
|
||||||
$result=$ecmdir->fetch($_GET["section"]);
|
$result=$ecmdir->fetch($_GET["section"]);
|
||||||
|
|||||||
@ -72,7 +72,7 @@ if (! $urlfile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load ecm object
|
// Load ecm object
|
||||||
$ecmdir = new ECMDirectory($db);
|
$ecmdir = new EcmDirectory($db);
|
||||||
$result=$ecmdir->fetch(GETPOST("section"));
|
$result=$ecmdir->fetch(GETPOST("section"));
|
||||||
if (! $result > 0)
|
if (! $result > 0)
|
||||||
{
|
{
|
||||||
@ -176,7 +176,7 @@ if ($_GET["action"] == 'edit')
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
||||||
$s='';
|
$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);
|
$tmpecmdir->fetch($ecmdir->id);
|
||||||
$result = 1;
|
$result = 1;
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|||||||
@ -62,7 +62,7 @@ if (! $section)
|
|||||||
|
|
||||||
|
|
||||||
// Load ecm object
|
// Load ecm object
|
||||||
$ecmdir = new ECMDirectory($db);
|
$ecmdir = new EcmDirectory($db);
|
||||||
$result=$ecmdir->fetch(GETPOST("section"));
|
$result=$ecmdir->fetch(GETPOST("section"));
|
||||||
if (! $result > 0)
|
if (! $result > 0)
|
||||||
{
|
{
|
||||||
@ -232,7 +232,7 @@ if ($_GET["action"] == 'edit')
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
||||||
$s='';
|
$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);
|
$tmpecmdir->fetch($ecmdir->id);
|
||||||
$result = 1;
|
$result = 1;
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="label";
|
if (! $sortfield) $sortfield="label";
|
||||||
|
|
||||||
$ecmdir = new ECMDirectory($db);
|
$ecmdir = new EcmDirectory($db);
|
||||||
if (GETPOST("section"))
|
if (GETPOST("section"))
|
||||||
{
|
{
|
||||||
$result=$ecmdir->fetch(GETPOST("section"));
|
$result=$ecmdir->fetch(GETPOST("section"));
|
||||||
@ -80,7 +80,7 @@ if (GETPOST("section"))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
$ecmdirstatic = new ECMDirectory($db);
|
$ecmdirstatic = new EcmDirectory($db);
|
||||||
$userstatic = new User($db);
|
$userstatic = new User($db);
|
||||||
|
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ if (GETPOST("action") == 'refreshmanual')
|
|||||||
|
|
||||||
if ($fk_parent >= 0)
|
if ($fk_parent >= 0)
|
||||||
{
|
{
|
||||||
$ecmdirtmp=new ECMDirectory($db);
|
$ecmdirtmp=new EcmDirectory($db);
|
||||||
$ecmdirtmp->ref = 'NOTUSEDYET';
|
$ecmdirtmp->ref = 'NOTUSEDYET';
|
||||||
$ecmdirtmp->label = basename($dirdesc['fullname']);
|
$ecmdirtmp->label = basename($dirdesc['fullname']);
|
||||||
$ecmdirtmp->description = '';
|
$ecmdirtmp->description = '';
|
||||||
@ -445,7 +445,7 @@ else
|
|||||||
if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete')
|
if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete')
|
||||||
{
|
{
|
||||||
$userstatic = new User($db);
|
$userstatic = new User($db);
|
||||||
$ecmdirstatic = new ECMDirectory($db);
|
$ecmdirstatic = new EcmDirectory($db);
|
||||||
|
|
||||||
// Confirmation de la suppression d'une ligne categorie
|
// Confirmation de la suppression d'une ligne categorie
|
||||||
if ($_GET['action'] == 'delete_section')
|
if ($_GET['action'] == 'delete_section')
|
||||||
|
|||||||
@ -65,7 +65,7 @@ $pagenext = $page + 1;
|
|||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="label";
|
if (! $sortfield) $sortfield="label";
|
||||||
|
|
||||||
$ecmdir = new ECMDirectory($db);
|
$ecmdir = new EcmDirectory($db);
|
||||||
if (! empty($_REQUEST["section"]))
|
if (! empty($_REQUEST["section"]))
|
||||||
{
|
{
|
||||||
$result=$ecmdir->fetch($_REQUEST["section"]);
|
$result=$ecmdir->fetch($_REQUEST["section"]);
|
||||||
@ -96,7 +96,7 @@ if (! empty($_REQUEST["section"]))
|
|||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
$ecmdirstatic = new ECMDirectory($db);
|
$ecmdirstatic = new EcmDirectory($db);
|
||||||
$userstatic = new User($db);
|
$userstatic = new User($db);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user