diff --git a/include/class.filter.php b/include/class.filter.php index 08b42338bba5c5ca7f7bba5f69370dc314a37d3d..05f93c7845b7c713eac3690684d1e5815f022918 100644 --- a/include/class.filter.php +++ b/include/class.filter.php @@ -149,6 +149,7 @@ class Filter { else $this->ht['flags'] &= ~$flag; $vars['rules']= $this->getRules(); + $this->ht['pass'] = true; $this->update($this->ht, $errors); } @@ -538,6 +539,10 @@ class Filter { } function validate_actions($vars, &$errors) { + //allow the save if it is to set a filter flag + if ($vars['pass']) + return true; + if (!is_array(@$vars['actions'])) return; @@ -569,26 +574,29 @@ class Filter { } } - switch ($action->ht['type']) { - case 'dept': - $dept = Dept::lookup($config['dept_id']); - if (!$dept || !$dept->isActive()) { - $errors['err'] = sprintf(__('Unable to save: Please choose an active %s'), 'Department'); - } - break; - case 'topic': - $topic = Topic::lookup($config['topic_id']); - if (!$topic || !$topic->isActive()) { - $errors['err'] = sprintf(__('Unable to save: Please choose an active %s'), 'Help Topic'); - } - break; - default: - foreach ($config as $key => $value) { - if (!$value) { - $errors['err'] = sprintf(__('Unable to save: Please insert a value for %s'), ucfirst($action->ht['type'])); - } + // do not throw an error if we are deleting an action + if (substr($v, 0, 1) != 'D') { + switch ($action->ht['type']) { + case 'dept': + $dept = Dept::lookup($config['dept_id']); + if (!$dept || !$dept->isActive()) { + $errors['err'] = sprintf(__('Unable to save: Please choose an active %s'), 'Department'); + } + break; + case 'topic': + $topic = Topic::lookup($config['topic_id']); + if (!$topic || !$topic->isActive()) { + $errors['err'] = sprintf(__('Unable to save: Please choose an active %s'), 'Help Topic'); + } + break; + default: + foreach ($config as $key => $value) { + if (!$value) { + $errors['err'] = sprintf(__('Unable to save: Please insert a value for %s'), ucfirst($action->ht['type'])); + } + } + break; } - break; } } diff --git a/include/class.queue.php b/include/class.queue.php index b4343d43eb17a622c1af41083ed79fa4cb819b3e..8526de7005006f2310744bff29abf57ae133d4d8 100644 --- a/include/class.queue.php +++ b/include/class.queue.php @@ -667,7 +667,7 @@ class CustomQueue extends VerySimpleModel { "bits" => QueueColumn::FLAG_SORTABLE, "filter" => "link:ticketP", "annotations" => '[{"c":"TicketSourceDecoration","p":"b"}]', - "conditions" => '[{"crit":["isanswered","set",null],"prop":{"font-weight":"bold"}}]', + "conditions" => '[{"crit":["isanswered","nset",null],"prop":{"font-weight":"bold"}}]', )), QueueColumn::placeholder(array( "id" => 2, @@ -686,7 +686,7 @@ class CustomQueue extends VerySimpleModel { "bits" => QueueColumn::FLAG_SORTABLE, "filter" => "link:ticket", "annotations" => '[{"c":"TicketThreadCount","p":">"},{"c":"ThreadAttachmentCount","p":"a"},{"c":"OverdueFlagDecoration","p":"<"}]', - "conditions" => '[{"crit":["isanswered","set",null],"prop":{"font-weight":"bold"}}]', + "conditions" => '[{"crit":["isanswered","nset",null],"prop":{"font-weight":"bold"}}]', "truncate" => 'ellipsis', )), QueueColumn::placeholder(array(