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

This commit is contained in:
Laurent Destailleur 2023-05-03 04:54:15 +02:00
commit 12f4c1d421
3 changed files with 12 additions and 4 deletions

View File

@ -8760,9 +8760,10 @@ class Form
<input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '">
</dt> </dt>
<dd class="dropdowndd"> <dd class="dropdowndd">
<div class="multiselectcheckbox' . $htmlname . '"> <div class="multiselectcheckbox'.$htmlname.'">
<ul class="' . $htmlname . ($pos == '1' ? 'left' : '') . '"> <ul class="'.$htmlname.($pos == '1' ? 'left' : '').'">
' . $listoffieldsforselection . ' <li><input class="inputsearch_dropdownselectedfields width90p minwidth200" style="width:90%;" type="text" placeholder="'.$langs->trans('Search').'"></li>
'.$listoffieldsforselection.'
</ul> </ul>
</div> </div>
</dd> </dd>
@ -8785,6 +8786,12 @@ class Form
// Now, we submit page // Now, we submit page
//$(this).parents(\'form:first\').submit(); //$(this).parents(\'form:first\').submit();
}); });
$("input.inputsearch_dropdownselectedfields").on("keyup", function() {
var value = $(this).val().toLowerCase();
$(\'.multiselectcheckbox'.$htmlname.' li > label\').filter(function() {
$(this).parent().toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
}); });

View File

@ -153,6 +153,7 @@ if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) {
// Click onto the link "link to" or "hamburger", toggle dropdown // Click onto the link "link to" or "hamburger", toggle dropdown
$(document).on(\'click\', \'.dropdown dt a\', function () { $(document).on(\'click\', \'.dropdown dt a\', function () {
console.log("toggle dropdown dt a"); console.log("toggle dropdown dt a");
setTimeout(() => { $(\'.inputsearch_dropdownselectedfields\').focus(); }, 200);
//$(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\'); //$(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\');
$(".ulselectedfields").removeClass("open"); $(".ulselectedfields").removeClass("open");

View File

@ -1814,7 +1814,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '<td class="nowraponall">'; print '<td class="nowraponall">';
$durationtouse = (GETPOST('timespent_duration') ? GETPOST('timespent_duration') : ''); $durationtouse = (GETPOST('timespent_duration') ? GETPOST('timespent_duration') : '');
if (GETPOSTISSET('timespent_durationhour') || GETPOSTISSET('timespent_durationmin')) { if (GETPOSTISSET('timespent_durationhour') || GETPOSTISSET('timespent_durationmin')) {
$durationtouse = (GETPOST('timespent_durationhour') * 3600 + GETPOST('timespent_durationmin') * 60); $durationtouse = ((int) GETPOST('timespent_durationhour') * 3600 + (int) GETPOST('timespent_durationmin') * 60);
} }
print $form->select_duration('timespent_duration', $durationtouse, 0, 'text'); print $form->select_duration('timespent_duration', $durationtouse, 0, 'text');
print '</td>'; print '</td>';