Fix compatibility account->bank_account

This commit is contained in:
Laurent Destailleur 2020-02-29 12:46:52 +01:00
parent a6c7463c27
commit 9def29054d
2 changed files with 7 additions and 10 deletions

View File

@ -167,7 +167,8 @@ class Categorie extends CommonObject
'member' => 'adherent', 'member' => 'adherent',
'contact' => 'socpeople', 'contact' => 'socpeople',
'user' => 'user', 'user' => 'user',
'account' => 'bank_account', 'account' => 'bank_account', // old for bank account
'bank_account' => 'bank_account',
'project' => 'projet', 'project' => 'projet',
'warehouse'=> 'entrepot', 'warehouse'=> 'entrepot',
'actioncomm' => 'actioncomm', 'actioncomm' => 'actioncomm',
@ -774,7 +775,7 @@ class Categorie extends CommonObject
/** /**
* Return list of fetched instance of elements having this category * Return list of fetched instance of elements having this category
* *
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', ...)
* @param int $onlyids Return only ids of objects (consume less memory) * @param int $onlyids Return only ids of objects (consume less memory)
* @param int $limit Limit * @param int $limit Limit
* @param int $offset Offset * @param int $offset Offset

View File

@ -182,17 +182,13 @@ foreach ($fulltree as $key => $val)
$li = $categstatic->getNomUrl(1, '', 60); $li = $categstatic->getNomUrl(1, '', 60);
$desc = dol_htmlcleanlastbr($val['description']); $desc = dol_htmlcleanlastbr($val['description']);
$counter = ""; $counter = '';
if($conf->global->CATEGORY_SHOW_COUNTS) if($conf->global->CATEGORY_SHOW_COUNTS)
{ {
// we need only a count of the elements, so it is enough to consume only the id's from the database // we need only a count of the elements, so it is enough to consume only the id's from the database
$elements = $categstatic->getObjectsInCateg($type, 1);
$elements = $type == Categorie::TYPE_ACCOUNT $counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
: $categstatic->getObjectsInCateg($type, 1);
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : "0")."</td>";
} }
$data[] = array( $data[] = array(