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

@ -19,26 +19,36 @@ function stormticket_list() {
unset($_SESSION['stormticket_list_filter']['project_nid']);
unset($_SESSION['stormticket_list_filter']['task_nid']);
}
if (array_key_exists('project_nid', $_GET)) {
if ($_SESSION['stormticket_list_filter']['project_nid'] != $_GET['project_nid']) {
$_SESSION['stormticket_list_filter']['project_nid'] = $_GET['project_nid'];
}
$p = node_load($_GET['project_nid']);
$_SESSION['stormticket_list_filter']['organization_nid'] = $p->organization_nid;
unset($_SESSION['stormticket_list_filter']['task_nid']);
}
if (array_key_exists('task_nid', $_GET)) {
if ($_SESSION['stormticket_list_filter']['task_nid'] != $_GET['task_nid']) {
$_SESSION['stormticket_list_filter']['task_nid'] = $_GET['task_nid'];
}
$t = node_load($_GET['task_nid']);
$_SESSION['stormticket_list_filter']['organization_nid'] = $t->organization_nid;
$_SESSION['stormticket_list_filter']['project_nid'] = $t->project_nid;
}
if (array_key_exists('view', $_GET) && $_GET['view'] == 'all') {
$_SESSION['stormticket_list_filter']['ticketcategory'] = '-';
$_SESSION['stormticket_list_filter']['ticketstatus'] = '-';
$_SESSION['stormticket_list_filter']['ticketpriority'] = '-';
unset($_SESSION['stormticket_list_filter']['datebeginfrom']);
unset($_SESSION['stormticket_list_filter']['datebeginto']);
unset($_SESSION['stormticket_list_filter']['dateendfrom']);
unset($_SESSION['stormticket_list_filter']['dateendto']);
unset($_SESSION['stormticket_list_filter']['assigned_to']);
$_SESSION['stormticket_list_filter']['billable'] = '-';
$_SESSION['stormticket_list_filter']['billed'] = '-';
}
$i = new stdClass();
$i->type = 'stormticket';