This commit is contained in:
Laurent Destailleur 2022-07-25 18:45:02 +02:00
parent bd0d932213
commit 66c27139e1
6 changed files with 14 additions and 17 deletions

View File

@ -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

View File

@ -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>";
}

View File

@ -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
*/

View File

@ -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)
{

View File

@ -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);

View File

@ -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);