Skip to content
Snippets Groups Projects
Commit ab5a6423 authored by Jared Hancock's avatar Jared Hancock
Browse files

filters: Restrict ticket statuses to derivatives of open and closed

parent 23839c95
Branches
Tags
No related merge requests found
...@@ -437,7 +437,10 @@ class FA_SetStatus extends TriggerAction { ...@@ -437,7 +437,10 @@ class FA_SetStatus extends TriggerAction {
function getConfigurationOptions() { function getConfigurationOptions() {
$choices = array(); $choices = array();
foreach (TicketStatusList::getStatuses() as $S) { foreach (TicketStatusList::getStatuses(array(
'states' => array('open', 'closed')
))
as $S) {
// TODO: Move this to TicketStatus::getName // TODO: Move this to TicketStatus::getName
$name = $S->getName(); $name = $S->getName();
if (!($isenabled = $S->isEnabled())) if (!($isenabled = $S->isEnabled()))
......
...@@ -1129,11 +1129,22 @@ class TicketSourceChoiceField extends ChoiceField { ...@@ -1129,11 +1129,22 @@ class TicketSourceChoiceField extends ChoiceField {
} }
} }
class OpenClosedTicketStatusList extends TicketStatusList {
function getItems($criteria=array()) {
$rv = array();
$base = parent::getItems($criteria);
foreach ($base as $idx=>$S) {
if (in_array($S->state, array('open', 'closed')))
$rv[$idx] = $S;
}
return $rv;
}
}
class TicketStatusChoiceField extends SelectionField { class TicketStatusChoiceField extends SelectionField {
static $widget = 'ChoicesWidget'; static $widget = 'ChoicesWidget';
function getList() { function getList() {
return new TicketStatusList( return new OpenClosedTicketStatusList(
DynamicList::lookup( DynamicList::lookup(
array('type' => 'ticket-status')) array('type' => 'ticket-status'))
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment