diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 6451f8bdde5..68b4c67ad72 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -10,6 +10,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Adolfo segura * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -79,6 +80,7 @@ if ($type === '0') { $contextpage='productlist'; if ($search_type=='') $search_t // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array($contextpage)); $extrafields = new ExtraFields($db); +$form=new Form($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('product'); @@ -120,6 +122,15 @@ if (! empty($conf->barcode->enabled)) { $fieldstosearchall['p.barcode']='Gencod'; } +if (empty($conf->global->PRODUIT_MULTIPRICES)) +{ + $titlesellprice=$langs->trans("SellingPrice"); + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + $titlesellprice=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer")); + } +} + // Definition of fields for lists $arrayfields=array( 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), @@ -176,7 +187,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP */ $htmlother=new FormOther($db); -$form=new Form($db); if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { @@ -402,16 +412,7 @@ else print ''; } - if (empty($conf->global->PRODUIT_MULTIPRICES)) - { - $titlesellprice=$langs->trans("SellingPrice"); - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) - { - $titlesellprice=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer")); - } - } - - $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '';