Laurent Destailleur 2 tahun lalu
induk
melakukan
66c27139e1

+ 1 - 1
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

+ 3 - 5
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 = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
 		}

+ 5 - 6
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
 	 */

+ 3 - 3
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)
 	{

+ 1 - 1
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);

+ 1 - 1
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);