diff --git a/include/class.filter_action.php b/include/class.filter_action.php index b78a8de313ae127a9037be9d29a2a46915b0caaa..2e57ba5303d858bc773e982c52b6ac9f87763817 100644 --- a/include/class.filter_action.php +++ b/include/class.filter_action.php @@ -288,10 +288,9 @@ class FA_RouteDepartment extends TriggerAction { ), 'choices' => Dept::getDepartments() + - array(':new:' => '— '.__('Add New').' —') - , - 'validators' => function($self) { - if ($self->getClean() === ':new:') + array(':new:' => '— '.__('Add New').' —'), + 'validators' => function($self, $clean) { + if ($clean === ':new:') $self->addError(__('Select a department')); } )), @@ -368,12 +367,11 @@ class FA_AssignTeam extends TriggerAction { 'prompt' => __('Unchanged'), 'data' => array('quick-add' => 'team'), ), - 'choices' => array_merge( - $choices, - array(':new:' => '— '.__('Add New').' —') - ), - 'validators' => function($self) { - if ($self->getClean() === ':new:') + 'choices' => + Team::getTeams() + + array(':new:' => '— '.__('Add New').' —'), + 'validators' => function($self, $clean) { + if ($clean === ':new:') $self->addError(__('Select a team')); } )),