From c8cc7884e46fbb90c7045f5ef19ba74f7aa49370 Mon Sep 17 00:00:00 2001 From: Florent Poinsaut Date: Mon, 26 Aug 2024 15:45:38 +0200 Subject: [PATCH] NEW #22848 Fix CI --- htdocs/categories/viewcat.php | 1 + htdocs/commande/card.php | 6 +++--- htdocs/commande/class/commande.class.php | 9 ++++---- htdocs/core/class/html.form.class.php | 25 +++++++++++----------- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/core/modules/modCategorie.class.php | 4 ++-- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 7901570c4a0..ed0593a13d9 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -1460,6 +1460,7 @@ if ($type == Categorie::TYPE_ORDER) { print '
'; $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Orders"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, $newcardbutton, '', $limit); print "\n"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b557bb7b06b..5c0c6f0dc50 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -565,7 +565,7 @@ if (empty($reshook)) { $action = ''; } - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $categories = GETPOST('categories', 'array'); if (method_exists($object, 'setCategories')) { $object->setCategories($categories); @@ -698,7 +698,7 @@ if (empty($reshook)) { // $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2)); //} elseif ($action == 'setremiseabsolue' && $usercancreate) { // $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2)); - } elseif ($action == 'settags' && isModEnabled('categorie') && $usercancreate) { + } elseif ($action == 'settags' && isModEnabled('category') && $usercancreate) { $result = $object->setCategories(GETPOST('categories', 'array')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -2864,7 +2864,7 @@ if ($action == 'create' && $usercancreate) { } // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'; print '
'; print $langs->trans("Categories"); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5acae07046c..1332dff25d6 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -854,14 +854,15 @@ class Commande extends CommonOrder } /** - * Sets object to supplied categories. + * Sets object to given categories. * - * Deletes object from existing categories not supplied. * Adds it to non existing supplied categories. + * Deletes object from existing categories not supplied. * Existing categories are left untouch. * - * @param int[]|int $categories Category or categories IDs - * @return void + * @param int[]|int $categories Category ID or array of Categories IDs + * + * @return int Return integer <0 if KO, >0 if OK */ public function setCategories($categories) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 269151b89cf..c9e5f0a2265 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -11281,18 +11281,19 @@ class Form /** - * Output a combo list with orders qualified for a third party + * Output a combo list with orders qualified for a third party * - * @param int $selected Id order preselected - * @param string $htmlname Name of HTML select - * @param int $maxlength Maximum length of label - * @param int $option_only Return only html options lines without the select tag - * @param string $show_empty Add an empty line ('1' or string to show for empty line) - * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable) - * @param int $forcefocus Force focus on field (works with javascript only) - * @param int $disabled Disabled - * @param string $morecss More css added to the select component - * @return int Nbr of project if OK, <0 if KO + * @param string $selected Id order preselected + * @param string $htmlname Name of HTML select + * @param int $maxlength Maximum length of label + * @param int $option_only Return only html options lines without the select tag + * @param string $show_empty Add an empty line ('1' or string to show for empty line) + * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable) + * @param int $forcefocus Force focus on field (works with javascript only) + * @param int $disabled Disabled + * @param string $morecss More css added to the select component + * + * @return int Nbr of project if OK, <0 if KO */ public function selectOrder($selected = '', $htmlname = 'orderid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500') { @@ -11315,7 +11316,7 @@ class Form // Use select2 selector if (!empty($conf->use_javascript_ajax)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); + $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); $out .= $comboenhancement; $morecss = 'minwidth200imp maxwidth500'; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index d4560cba34f..602fb1a9d39 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1400,7 +1400,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=16", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index a592d387047..f46d818989f 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -669,7 +669,7 @@ class modCategorie extends DolibarrModules * @param int $cat_id Categorie id * @param string $class Class of the linked object * @param string $enabled Condition to enable this export - * @param string $permission Permission to export the linked object + * @param array $permission Permission to export the linked object * @param array $fields_list Additional fields of the linked object to export * * @return void @@ -757,7 +757,7 @@ class modCategorie extends DolibarrModules int $cat_id, string $class_file, string $class, - string $element, + string $element ) { $cat_type = Categorie::$MAP_ID_TO_CODE[$cat_id];