diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index 79e23e90089..c3867839e84 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -50,10 +50,10 @@ function cronadmin_prepare_head() /** * Return array of tabs to used on a cron job * - * @param Object $object Object cron + * @param Cronjob $object Object cron * @return array Array of tabs */ -function cron_prepare_head($object) +function cron_prepare_head(Cronjob $object) { global $langs, $conf, $user; $h = 0; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index aaa69ec7f42..723660f1d9c 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -273,7 +273,6 @@ class Cronjob extends CommonObject */ function fetch($id) { - global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; @@ -655,15 +654,14 @@ class Cronjob extends CommonObject */ function delete($user, $notrigger=0) { - global $conf, $langs; $error=0; $this->db->begin(); - if (! $error) - { - if (! $notrigger) - { +// if (! $error) +// { +// if (! $notrigger) +// { // Uncomment this and change MYOBJECT to your own tag if you // want this action calls a trigger. @@ -673,18 +671,18 @@ class Cronjob extends CommonObject //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); //if ($result < 0) { $error++; $this->errors=$interface->errors; } //// End call triggers - } - } +// } +// } - if (! $error) - { +// if (! $error) +// { $sql = "DELETE FROM ".MAIN_DB_PREFIX."cronjob"; $sql.= " WHERE rowid=".$this->id; dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - } +// } // Commit or rollback if ($error) @@ -803,12 +801,10 @@ class Cronjob extends CommonObject /** * Load object information * - * @return void + * @return int */ function info() { - global $langs; - $sql = "SELECT"; $sql.= " f.rowid, f.datec, f.tms, f.fk_user_mod, f.fk_user_author"; $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as f"; @@ -849,7 +845,6 @@ class Cronjob extends CommonObject { global $langs, $conf; - $error=0; $now=dol_now(); $langs->load('cron'); @@ -935,7 +930,6 @@ class Cronjob extends CommonObject // Create Object for the call module $object = new $this->objectname($this->db); - $params_arr = array(); $params_arr = explode(", ",$this->params); if (!is_array($params_arr)) { @@ -978,7 +972,6 @@ class Cronjob extends CommonObject return -1; } dol_syslog(get_class($this) . "::run_jobs " . $this->libname . "::" . $this->methodename."(" . $this->params . ");", LOG_DEBUG); - $params_arr = array(); $params_arr = explode(", ", $this->params); if (!is_array($params_arr)) { @@ -1074,8 +1067,6 @@ class Cronjob extends CommonObject */ function reprogram_jobs($userlogin) { - global $langs, $conf; - dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG); require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 6c0de13d15b..d099d017ecd 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -244,8 +244,6 @@ class EcmDirectory // extends CommonObject */ function changeNbOfFiles($sign) { - global $conf, $langs; - // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET"; $sql.= " cachenbofdoc = cachenbofdoc ".$sign." 1"; @@ -320,7 +318,7 @@ class EcmDirectory // extends CommonObject * Delete object on database and/or on disk * * @param User $user User that delete - * @param int $mode 'all'=delete all, 'databaseonly'=only database entry, 'fileonly' (not implemented) + * @param string $mode 'all'=delete all, 'databaseonly'=only database entry, 'fileonly' (not implemented) * @return int <0 if KO, >0 if OK */ function delete($user, $mode='all') @@ -329,7 +327,6 @@ class EcmDirectory // extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $error=0; - $result=0; if ($mode != 'databaseonly') $relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3 diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index 58286371941..87b4af190ae 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -51,7 +51,7 @@ class FormEcm * @param string $select_name Nom formulaire HTML * @return string String with HTML select */ - function select_all_sections($selected='',$select_name='') + function select_all_sections($selected=0,$select_name='') { global $langs; $langs->load("ecm");