diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 010d6da644f..bcfa5c541fd 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -827,7 +827,7 @@ class Categorie extends CommonObject /** * Return list of fetched instance of elements having this category * - * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', 'knowledge_management' ...) + * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', 'knowledge_management', ...) * @param int $onlyids Return only ids of objects (consume less memory) * @param int $limit Limit * @param int $offset Offset diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 238329a3486..7e8a1252095 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -381,7 +381,7 @@ if ($cats < 0) { $fulltree = $categstatic->get_full_arbo($type, $object->id, 1); // Load possible missing includes - if ($conf->global->CATEGORY_SHOW_COUNTS) { + if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) { if ($type == Categorie::TYPE_MEMBER) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } @@ -407,11 +407,9 @@ if ($cats < 0) { $desc = dol_htmlcleanlastbr($val['description']); $counter = ''; - if ($conf->global->CATEGORY_SHOW_COUNTS) { + if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) { // we need only a count of the elements, so it is enough to consume only the id's from the database - $elements = $type == Categorie::TYPE_ACCOUNT - ? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account" - : $categstatic->getObjectsInCateg($type, 1); + $elements = $categstatic->getObjectsInCateg($type, 1); $counter = "".(is_array($elements) ? count($elements) : '0').""; } diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 744ac1834aa..a84fa3109df 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -487,9 +487,9 @@ class Cronjob extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load object in memory from the database + * Load list of cron jobs in a memory array from the database + * @TODO Use object CronJob and not CronJobLine. * * @param string $sortorder sort order * @param string $sortfield sort field @@ -500,11 +500,8 @@ class Cronjob extends CommonObject * @param int $processing Processing or not * @return int <0 if KO, >0 if OK */ - public function fetch_all($sortorder = 'DESC', $sortfield = 't.rowid', $limit = 0, $offset = 0, $status = 1, $filter = '', $processing = -1) + public function fetchAll($sortorder = 'DESC', $sortfield = 't.rowid', $limit = 0, $offset = 0, $status = 1, $filter = '', $processing = -1) { - // phpcs:enable - global $langs; - $this->lines = array(); $sql = "SELECT"; @@ -1471,6 +1468,8 @@ class Cronjobline */ public $id; + public $entity; + /** * @var string Ref */ diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 0166c7f2017..ed003d85667 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -797,9 +797,9 @@ class Productcustomerprice extends CommonObject /** * Force update price on child companies so child company has same prices than parent. * - * @param User $user that modifies - * @param int $forceupdateaffiliate update price on each soc child - * @return int <0 if KO, 0 = action disabled, >0 if OK + * @param User $user User that modifies + * @param int $forceupdateaffiliate update price on each soc child + * @return int <0 if KO, 0 = action disabled, >0 if OK */ public function setPriceOnAffiliateThirdparty($user, $forceupdateaffiliate) { diff --git a/htdocs/public/cron/cron_run_jobs_by_url.php b/htdocs/public/cron/cron_run_jobs_by_url.php index fea2a2d7f82..fa81b8d8bd7 100644 --- a/htdocs/public/cron/cron_run_jobs_by_url.php +++ b/htdocs/public/cron/cron_run_jobs_by_url.php @@ -135,7 +135,7 @@ if (!empty($id)) { $filter['t.rowid'] = $id; } -$result = $object->fetch_all('ASC,ASC,ASC', 't.priority,t.entity,t.rowid', 0, 0, 1, $filter, 0); +$result = $object->fetchAll('ASC,ASC,ASC', 't.priority,t.entity,t.rowid', 0, 0, 1, $filter, 0); if ($result < 0) { echo "Error: ".$object->error; dol_syslog("cron_run_jobs.php fetch Error".$object->error, LOG_ERR); diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 820db6746ee..ee866203665 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -178,7 +178,7 @@ if (!empty($id)) { $filter['t.rowid'] = $id; } -$result = $object->fetch_all('ASC,ASC,ASC', 't.priority,t.entity,t.rowid', 0, 0, 1, $filter, 0); +$result = $object->fetchAll('ASC,ASC,ASC', 't.priority,t.entity,t.rowid', 0, 0, 1, $filter, 0); if ($result < 0) { echo "Error: ".$object->error; dol_syslog("cron_run_jobs.php fetch Error ".$object->error, LOG_ERR);