Skip to content

Commit

Permalink
Merge branch 'develop' of [email protected]:Dolibarr/dolibarr.git into n…
Browse files Browse the repository at this point in the history
…ew_dev_module_rights_enhancement
  • Loading branch information
hregis committed Mar 31, 2024
2 parents 5bf3b37 + 027cf37 commit e725081
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions htdocs/holiday/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'holidaylist'; // To manage different context of search
$mode = GETPOST('mode', 'alpha'); // for switch mode view result

$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')

Expand Down Expand Up @@ -83,7 +82,7 @@
$sortfield = "cp.ref";
}

$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_ref = GETPOST('search_ref', 'alphanohtml');
$search_day_create = GETPOST('search_day_create', 'int');
$search_month_create = GETPOST('search_month_create', 'int');
Expand All @@ -94,10 +93,10 @@
$search_day_end = GETPOST('search_day_end', 'int');
$search_month_end = GETPOST('search_month_end', 'int');
$search_year_end = GETPOST('search_year_end', 'int');
$search_employee = GETPOSTINT('search_employee');
$search_valideur = GETPOSTINT('search_valideur');
$search_employee = GETPOST('search_employee', 'intcomma');
$search_valideur = GETPOST('search_valideur', 'intcomma');
$search_status = GETPOST('search_status', 'intcomma');
$search_type = GETPOSTINT('search_type');
$search_type = GETPOST('search_type', 'intcomma');

// Initialize technical objects
$object = new Holiday($db);
Expand Down Expand Up @@ -322,8 +321,8 @@
$sql .= " WHERE cp.entity IN (".getEntity('holiday').")";
$sql .= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau
// Search all
if (!empty($sall)) {
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
if (!empty($search_all)) {
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
}
// Ref
if (!empty($search_ref)) {
Expand Down Expand Up @@ -552,14 +551,14 @@
$trackid = 'leav'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';

if ($sall) {
if ($search_all) {
$setupstring = '';
foreach ($fieldstosearchall as $key => $val) {
$fieldstosearchall[$key] = $langs->trans($val);
$setupstring .= $key."=".$val.";";
}
print '<!-- Search done like if HOLIDAY_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).implode(', ', $fieldstosearchall).'</div>';
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>';
}

$moreforfilter = '';
Expand Down

0 comments on commit e725081

Please sign in to comment.