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
No related branches found
No related tags found
No related merge requests found
......@@ -437,7 +437,10 @@ class FA_SetStatus extends TriggerAction {
function getConfigurationOptions() {
$choices = array();
foreach (TicketStatusList::getStatuses() as $S) {
foreach (TicketStatusList::getStatuses(array(
'states' => array('open', 'closed')
))
as $S) {
// TODO: Move this to TicketStatus::getName
$name = $S->getName();
if (!($isenabled = $S->isEnabled()))
......
......@@ -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 {
static $widget = 'ChoicesWidget';
function getList() {
return new TicketStatusList(
return new OpenClosedTicketStatusList(
DynamicList::lookup(
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