diff options
-rw-r--r-- | muamba.handlers.inc | 15 | ||||
-rw-r--r-- | muamba.views.inc | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/muamba.handlers.inc b/muamba.handlers.inc index 2f5d9a7..37033ee 100644 --- a/muamba.handlers.inc +++ b/muamba.handlers.inc @@ -5,6 +5,9 @@ * Contains the muamba transaction status views field handler. */ +/** + * Field handler for muamba transaction status. + */ class views_handler_field_muamba_status extends views_handler_field { /** * Renders the field. @@ -13,3 +16,15 @@ class views_handler_field_muamba_status extends views_handler_field { return muamba_statuses($values->muamba_status); } } + +/** + * Filter by transaction status + */ +class views_handler_filter_muamba_status extends views_handler_filter_in_operator { + function get_value_options() { + if (!isset($this->value_options)) { + $this->value_title = t('Transaction status'); + $this->value_options = muamba_statuses(); + } + } +} diff --git a/muamba.views.inc b/muamba.views.inc index 05e2980..9eea803 100644 --- a/muamba.views.inc +++ b/muamba.views.inc @@ -99,7 +99,7 @@ function muamba_views_data() { 'click sortable' => TRUE, ), 'filter' => array( - 'handler' => 'views_handler_filter_numeric', + 'handler' => 'views_handler_filter_muamba_status', ), 'sort' => array( 'handler' => 'views_handler_sort', |