forked from Wavyzz/dolibarr
Fix bad usage of moreparam
This commit is contained in:
@@ -5953,7 +5953,7 @@ class Form
|
|||||||
$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
|
$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
|
||||||
|
|
||||||
// No immediate load of all database
|
// No immediate load of all database
|
||||||
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter).($moreparams ? $moreparams : '');
|
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
|
||||||
// Activate the auto complete using ajax call.
|
// Activate the auto complete using ajax call.
|
||||||
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
|
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
|
||||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||||
|
|||||||
@@ -41,9 +41,10 @@
|
|||||||
* - Ex: array('show'=> )
|
* - Ex: array('show'=> )
|
||||||
* - Ex: array('update_textarea'=> )
|
* - Ex: array('update_textarea'=> )
|
||||||
* - Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax)
|
* - Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax)
|
||||||
|
* @param string $moreparams More params provided to ajax call
|
||||||
* @return string Script
|
* @return string Script
|
||||||
*/
|
*/
|
||||||
function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array())
|
function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array(), $moreparams = '')
|
||||||
{
|
{
|
||||||
if (empty($minLength)) $minLength=1;
|
if (empty($minLength)) $minLength=1;
|
||||||
|
|
||||||
@@ -55,7 +56,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
|||||||
|
|
||||||
// Input search_htmlname is original field
|
// Input search_htmlname is original field
|
||||||
// Input htmlname is a second input field used when using ajax autocomplete.
|
// Input htmlname is a second input field used when using ajax autocomplete.
|
||||||
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.$selected.'" />';
|
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.$selected.'" '.($moreparams ? $moreparams : '').' />';
|
||||||
|
|
||||||
$script.= '<!-- Javascript code for autocomplete of field '.$htmlname.' -->'."\n";
|
$script.= '<!-- Javascript code for autocomplete of field '.$htmlname.' -->'."\n";
|
||||||
$script.= '<script>'."\n";
|
$script.= '<script>'."\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user