Fix get mode

This commit is contained in:
Laurent Destailleur 2021-03-29 22:05:04 +02:00
parent 843e0a2c39
commit 41ec8893e4

View File

@ -49,6 +49,7 @@ require '../../main.inc.php';
$htmlname = GETPOST('htmlname', 'aZ09');
$socid = GETPOST('socid', 'int');
$mode = GETPOST('mode', 'aZ09');
$discard_closed = GETPOST('discardclosed', 'int');
// Security check
@ -71,7 +72,7 @@ if (empty($htmlname) && !GETPOST('mode', 'aZ09')) {
}
// Mode to get list of projects
if (!GETPOST('mode', 'aZ09') || GETPOST('mode', 'aZ09') != 'gettasks') {
if (empty($mode) || $mode != 'gettasks') {
// When used from jQuery, the search term is added as GET param "term".
$searchkey = (GETPOSTISSET($htmlname) ? GETPOST($htmlname, 'aZ09') : '');
@ -80,7 +81,7 @@ if (!GETPOST('mode', 'aZ09') || GETPOST('mode', 'aZ09') != 'gettasks') {
}
// Mode to get list of tasks
if (GETPOST('mode', 'aZ09') == 'gettasks') {
if ($mode == 'gettasks') {
$formproject = new FormProjets($db);
$formproject->selectTasks((!empty($$socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), '');
return;