Clean the filters for lists linked by SuiteDesk nodes shortcuts

This commit is contained in:
Manuel Cillero 2017-09-05 21:27:33 +02:00
parent 1371a4bec5
commit c3e1439b06
11 changed files with 85 additions and 34 deletions

View file

@ -16,26 +16,31 @@ function stormevent_list() {
unset($_SESSION['stormevent_list_filter']['project_nid']);
unset($_SESSION['stormevent_list_filter']['task_nid']);
}
if (array_key_exists('project_nid', $_GET)) {
if ($_SESSION['stormevent_list_filter']['project_nid'] != $_GET['project_nid']) {
$_SESSION['stormevent_list_filter']['project_nid'] = $_GET['project_nid'];
}
$p = node_load($_GET['project_nid']);
$_SESSION['stormevent_list_filter']['organization_nid'] = $p->organization_nid;
unset($_SESSION['stormevent_list_filter']['task_nid']);
}
if (array_key_exists('task_nid', $_GET)) {
if ($_SESSION['stormevent_list_filter']['task_nid'] != $_GET['task_nid']) {
$_SESSION['stormevent_list_filter']['task_nid'] = $_GET['task_nid'];
}
$t = node_load($_GET['task_nid']);
$_SESSION['stormevent_list_filter']['organization_nid'] = $t->organization_nid;
$_SESSION['stormevent_list_filter']['project_nid'] = $t->project_nid;
}
if (array_key_exists('view', $_GET) && $_GET['view'] == 'all') {
$_SESSION['stormevent_list_filter']['eventtype'] = '-';
$_SESSION['stormevent_list_filter']['title'] = '';
unset($_SESSION['stormevent_list_filter']['datebeginfrom']);
unset($_SESSION['stormevent_list_filter']['datebeginto']);
unset($_SESSION['stormevent_list_filter']['dateendfrom']);
unset($_SESSION['stormevent_list_filter']['dateendto']);
}
$i = new stdClass();
$i->type = 'stormevent';