Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0

This commit is contained in:
Laurent Destailleur 2017-05-05 09:16:30 +02:00
commit 382fcb53fa
4 changed files with 12 additions and 6 deletions

View File

@ -889,7 +889,6 @@ if ($action == 'create')
$object = new Facture($db); // Source invoice $object = new Facture($db); // Source invoice
$product_static = new Product($db); $product_static = new Product($db);
$formproject = new FormProjets($db);
if ($object->fetch($id, $ref) > 0) if ($object->fetch($id, $ref) > 0)
{ {

View File

@ -965,18 +965,23 @@ class Form
} }
// mode 1 // mode 1
$urloption='htmlname='.$htmlname.'&outjson=1&filter='.$filter; $urloption='htmlname='.$htmlname.'&outjson=1&filter='.$filter;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); $out.= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
$out.='<style type="text/css">
.ui-autocomplete {
z-index: 150;
}
</style>';
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : '; if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
else if ($hidelabel > 1) { else if ($hidelabel > 1) {
if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"'; if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"';
else $placeholder=' title="'.$langs->trans("RefOrLabel").'"'; else $placeholder=' title="'.$langs->trans("RefOrLabel").'"';
if ($hidelabel == 2) { if ($hidelabel == 2) {
print img_picto($langs->trans("Search"), 'search'); $out.= img_picto($langs->trans("Search"), 'search');
} }
} }
print '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; $out.= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
if ($hidelabel == 3) { if ($hidelabel == 3) {
print img_picto($langs->trans("Search"), 'search'); $out.= img_picto($langs->trans("Search"), 'search');
} }
} }
else else

View File

@ -151,7 +151,7 @@ function length_accounta($accounta)
if ($accounta < 0 || empty($accounta)) return ''; if ($accounta < 0 || empty($accounta)) return '';
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account; if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $accounta;
$a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT; $a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT;
if (! empty($a)) { if (! empty($a)) {

View File

@ -181,10 +181,12 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
}); });
} }
console.log("ajax_autocompleter new value selected, we trigger change on original component so field #search_'.$htmlname.'"); console.log("ajax_autocompleter new value selected, we trigger change on original component so field #search_'.$htmlname.'");
$("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code. $("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code.
} }
,delay: 500 ,delay: 500
}).data("ui-autocomplete")._renderItem = function( ul, item ) { }).data("ui-autocomplete")._renderItem = function( ul, item ) {
return $("<li>") return $("<li>")
.data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0 .data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0
.append( \'<a><span class="tag">\' + item.label + "</span></a>" ) .append( \'<a><span class="tag">\' + item.label + "</span></a>" )