diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 82a6dadcfb8..824d326883d 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -48,8 +48,9 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt var options = '.json_encode($ajaxoptions).'; // Remove product id before select another product - $("input#search_'.$htmlname.'").change(function() { - $("#'.$htmlname.'").val("").trigger("change"); + // use keyup instead change to avoid loosing the product id + $("input#search_'.$htmlname.'").keyup(function() { + $("#'.$htmlname.'").val("").trigger("change"); }); // Check when keyup $("input#search_'.$htmlname.'").onDelayedKeyup({ handler: function() { @@ -163,7 +164,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt }).data( "autocomplete" )._renderItem = function( ul, item ) { return $( "
  • " ) .data( "item.autocomplete", item ) - .append( \'\' + item.label + "" ) + .append( \'\' + item.label + "" ) .appendTo(ul); }; });'; diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 17da725a80d..5b611768119 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -1,7 +1,7 @@ - * Copyright (C) 2010-2011 Laurent Destailleur - * Copyright (C) 2012 Christophe Battarel +/* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel * * 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 @@ -50,13 +50,10 @@   -
    " /> +" /> + + > global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> @@ -77,8 +74,9 @@ // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows=ROWS_2; + $enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - $doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,'dolibarr_details','',false,true,$enabled,$nbrows,70); $doleditor->Create(); ?> diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index a3dc4f412dc..601f463682d 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -78,7 +78,7 @@ jQuery(document).ready(function() { if (is_object($hookmanager)) { - $parameters=array('fk_parent_line'=>$_POST["fk_parent_line"]); + $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int')); $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); } @@ -87,8 +87,9 @@ jQuery(document).ready(function() { // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows=ROWS_2; + $enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - $doleditor=new DolEditor('np_desc',$_POST["np_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor=new DolEditor('np_desc',GETPOST('np_desc"'),'',100,'dolibarr_details','',false,true,$enabled,$nbrows,70); $doleditor->Create(); ?> @@ -99,9 +100,9 @@ $colspan = 4; if (! empty($conf->margin->enabled)) { ?> - - "> - + + "> + global->DISPLAY_MARGIN_RATES)) $colspan++; @@ -109,7 +110,9 @@ if (! empty($conf->margin->enabled)) { $colspan++; } ?> - " name="addline"> + + " name="addline"> + service->enabled) && $dateSelector) {