Merge pull request #21572 from FHenry/15_fix_filter_status_on_peruser

fix: filter Status Not applicable into is not correctly manage on Agenda list
This commit is contained in:
Laurent Destailleur 2022-07-25 19:41:55 +02:00 committed by GitHub
commit 6d2363d0d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View File

@ -109,7 +109,7 @@ $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m");
$week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W");
$day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d");
$pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3);
$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo'
$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1
$type = GETPOSTISSET("search_type", 'aZ09') ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09');
$maxprint = GETPOSTISSET("maxprint") ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW;
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
@ -760,12 +760,14 @@ if ($type) {
if ($status == '0') {
$sql .= " AND a.percent = 0";
}
if ($status == '-1') {
if ($status == '-1' || $status == 'na') {
// Not applicable
$sql .= " AND a.percent = -1";
} // Not applicable
}
if ($status == '50') {
// Running already started
$sql .= " AND (a.percent > 0 AND a.percent < 100)";
} // Running already started
}
if ($status == 'done' || $status == '100') {
$sql .= " AND (a.percent = 100)";
}

View File

@ -99,7 +99,7 @@ $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m");
$week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W");
$day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d");
$pid = GETPOST("search_projectid", "int", 3) ?GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3);
$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo'
$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1
$type = GETPOST("search_type", 'alpha') ?GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha');
$maxprint = ((GETPOST("maxprint", 'int') != '') ?GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
@ -626,12 +626,14 @@ if ($type) {
if ($status == '0') {
$sql .= " AND a.percent = 0";
}
if ($status == '-1') {
if ($status == '-1' || $status == 'na') {
// Not applicable
$sql .= " AND a.percent = -1";
} // Not applicable
}
if ($status == '50') {
// Running already started
$sql .= " AND (a.percent > 0 AND a.percent < 100)";
} // Running already started
}
if ($status == 'done' || $status == '100') {
$sql .= " AND (a.percent = 100)";
}