From 9def29054d6fa5c3bba44a1c7afb786fd19741b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Feb 2020 12:46:52 +0100 Subject: [PATCH] Fix compatibility account->bank_account --- htdocs/categories/class/categorie.class.php | 7 ++++--- htdocs/categories/index.php | 10 +++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 39f94db02eb..d2e1ba7e923 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -167,8 +167,9 @@ class Categorie extends CommonObject 'member' => 'adherent', 'contact' => 'socpeople', 'user' => 'user', - 'account' => 'bank_account', - 'project' => 'projet', + 'account' => 'bank_account', // old for bank account + 'bank_account' => 'bank_account', + 'project' => 'projet', 'warehouse'=> 'entrepot', 'actioncomm' => 'actioncomm', ); @@ -774,7 +775,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') + * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', ...) * @param int $onlyids Return only ids of objects (consume less memory) * @param int $limit Limit * @param int $offset Offset diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index abb0962b1d5..d96fddca150 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -182,17 +182,13 @@ foreach ($fulltree as $key => $val) $li = $categstatic->getNomUrl(1, '', 60); $desc = dol_htmlcleanlastbr($val['description']); - $counter = ""; + $counter = ''; 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 - - $elements = $type == Categorie::TYPE_ACCOUNT - ? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account" - : $categstatic->getObjectsInCateg($type, 1); - - $counter = "".(is_countable($elements) ? count($elements) : "0").""; + $elements = $categstatic->getObjectsInCateg($type, 1); + $counter = "".(is_countable($elements) ? count($elements) : '0').""; } $data[] = array(