From a2e9832c8de767b925af7c676e15ffcc32f579c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Mar 2016 15:34:43 +0100 Subject: [PATCH] Revert "Corrected non-static usages of Form::multiselectarray function" This reverts commit 0a53cdd88fabd6fa7c8331208dea0acbdc940ad8. --- htdocs/adherents/card.php | 4 ++-- htdocs/contact/card.php | 4 ++-- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formactions.class.php | 2 +- htdocs/product/card.php | 4 ++-- htdocs/public/test/test_forms.php | 2 +- htdocs/societe/soc.php | 8 ++++---- htdocs/user/card.php | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 0fc3b38c641..2ab8640460b 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -913,7 +913,7 @@ else { print '' . fieldLabel('Categories', 'memcars') . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1); - print Form::multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%'); + print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%'); print ""; } @@ -1173,7 +1173,7 @@ else foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print Form::multiselectarray('memcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); + print $form->multiselectarray('memcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); print ""; } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 045bcf6afd3..b1e48a42d50 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -662,7 +662,7 @@ else if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { print '' . fieldLabel( 'Categories', 'contcats' ) . ''; $cate_arbo = $form->select_all_categories( Categorie::TYPE_CONTACT, null, 'parent', null, null, 1 ); - print Form::multiselectarray( 'contcats', $cate_arbo, GETPOST( 'contcats', 'array' ), null, null, null, + print $form->multiselectarray( 'contcats', $cate_arbo, GETPOST( 'contcats', 'array' ), null, null, null, null, '90%' ); print ""; } @@ -922,7 +922,7 @@ else foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print Form::multiselectarray( 'contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' ); + print $form->multiselectarray( 'contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' ); print ""; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 11bb69bef89..a6161ba4fed 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4853,7 +4853,7 @@ class Form * @return string HTML multiselect string * @see selectarray */ - public static function multiselectarray($htmlname, array $array, array $selected = array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='',$elemtype='') + static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='',$elemtype='') { global $conf, $langs; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index d3189b87d61..0316fb461cf 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -273,7 +273,7 @@ class FormActions if (! empty($multiselect)) { if(!is_array($selected) && !empty($selected)) $selected = explode(',', $selected); - print Form::multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0); + print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0); } else { diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c5b20cd08bb..63dbe9f3846 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1040,7 +1040,7 @@ else // Categories print ''.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); - print Form::multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); + print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); print ""; } @@ -1343,7 +1343,7 @@ else foreach($cats as $cat) { $arrayselected[] = $cat->id; } - print Form::multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); + print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); print ""; } diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index cb30e5129c7..c126a4d0c14 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -86,7 +86,7 @@ print '

'."\n"; print "Test 5c: a multiselect
\n"; $array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3'); $arrayselected=array(1,3); -print Form::multiselectarray('testmulti', $array, $arrayselected, '', 0, '', 0, 250); +print $form->multiselectarray('testmulti', $array, $arrayselected, '', 0, '', 0, 250); llxFooter(); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 8616c771151..4c36c378e08 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1242,7 +1242,7 @@ else if ($object->prospect || $object->client) { print '' . fieldLabel('CustomersCategoriesShort', 'custcats') . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); - print Form::multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, + print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); print ""; } @@ -1251,7 +1251,7 @@ else if ($object->fournisseur) { print '' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); - print Form::multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null, + print $form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null, null, "90%"); print ""; } @@ -1800,7 +1800,7 @@ else foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print Form::multiselectarray('custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); + print $form->multiselectarray('custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); print ""; } @@ -1814,7 +1814,7 @@ else foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print Form::multiselectarray('suppcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); + print $form->multiselectarray('suppcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); print ""; } } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 2b2d40692f3..228526a9b5e 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1087,7 +1087,7 @@ if (($action == 'create') || ($action == 'adduserldap')) { print '' . fieldLabel( 'Categories', 'usercats' ) . ''; $cate_arbo = $form->select_all_categories( Categorie::TYPE_USER, null, 'parent', null, null, 1 ); - print Form::multiselectarray( 'usercats', $cate_arbo, GETPOST( 'usercats', 'array' ), null, null, null, + print $form->multiselectarray( 'usercats', $cate_arbo, GETPOST( 'usercats', 'array' ), null, null, null, null, '90%' ); print ""; } @@ -2231,7 +2231,7 @@ else foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print Form::multiselectarray( 'usercats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' ); + print $form->multiselectarray( 'usercats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' ); print ""; }