From a5f7bf390366bffc62535cf1798b82bfac5e62f3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 30 Aug 2011 17:51:12 +0000 Subject: [PATCH] Fix: more simple --- htdocs/core/class/html.form.class.php | 5 ++++- htdocs/core/tpl/freeproductline_create.tpl.php | 2 +- htdocs/core/tpl/freeproductline_edit.tpl.php | 2 +- htdocs/core/tpl/predefinedproductline_create.tpl.php | 9 ++------- htdocs/core/tpl/predefinedproductline_edit.tpl.php | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8e926354841..c3ec8400510 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -897,6 +897,8 @@ class Form function select_produits($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$status=1,$finished=2,$selected_input_value='',$hidelabel=0) { global $langs,$conf; + + $price_level = (! empty($price_level) ? $price_level : 0); if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { @@ -911,12 +913,13 @@ class Form print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; - print '
'; } else { $this->select_produits_do($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0); } + + print '
'; } /** diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index bd1b8e77672..e329b0e669d 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -49,7 +49,7 @@ if (is_object($hookmanager)) { $parameters=array(); - $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); + echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); } // Editor wysiwyg diff --git a/htdocs/core/tpl/freeproductline_edit.tpl.php b/htdocs/core/tpl/freeproductline_edit.tpl.php index b2b4e7d2ce0..a17b510fc21 100644 --- a/htdocs/core/tpl/freeproductline_edit.tpl.php +++ b/htdocs/core/tpl/freeproductline_edit.tpl.php @@ -41,7 +41,7 @@ if (is_object($hookmanager)) { $parameters=array('fk_parent_line'=>$line->fk_parent_line); - $hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); + echo $hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); } // editeur wysiwyg diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index 59fe2756602..4660a93589d 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -50,18 +50,13 @@ > global->PRODUIT_MULTIPRICES) - $html->select_produits('','idprod','',$conf->product->limit_size,$buyer->price_level); - else - $html->select_produits('','idprod','',$conf->product->limit_size); - if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) echo '
'; + $html->select_produits('','idprod','',$conf->product->limit_size,$buyer->price_level); if (is_object($hookmanager)) { $parameters=array('fk_parent_line'=>$_POST["fk_parent_line"]); - $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); + echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); } // Editor wysiwyg diff --git a/htdocs/core/tpl/predefinedproductline_edit.tpl.php b/htdocs/core/tpl/predefinedproductline_edit.tpl.php index 938390e214d..d417c6bb36d 100644 --- a/htdocs/core/tpl/predefinedproductline_edit.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_edit.tpl.php @@ -51,7 +51,7 @@ { $fk_parent_line = ($_POST["fk_parent_line"] ? $_POST["fk_parent_line"] : $line->fk_parent_line); $parameters=array('fk_parent_line'=>$fk_parent_line); - $hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); + echo $hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); } // editeur wysiwyg