From b3c76b04eaaa83be3044a4afe01c47049152fd67 Mon Sep 17 00:00:00 2001 From: Steve Robbins Date: Wed, 15 Jul 2015 10:43:27 -0700 Subject: [PATCH] Fixes #138, filtering grid by status --- app/code/community/Aoe/Scheduler/Model/Schedule.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/code/community/Aoe/Scheduler/Model/Schedule.php b/app/code/community/Aoe/Scheduler/Model/Schedule.php index 787f02d..88adc02 100644 --- a/app/code/community/Aoe/Scheduler/Model/Schedule.php +++ b/app/code/community/Aoe/Scheduler/Model/Schedule.php @@ -816,13 +816,18 @@ public function setCronExpr($expr) */ public function getStatuses() { - $statuses = clone $this->getCollection() + $schedules = clone $this->getCollection() ->setOrder('status', Zend_Db_Select::SQL_ASC); - $statuses->getSelect() + $schedules->getSelect() ->group('status') ->reset(Zend_Db_Select::COLUMNS) ->columns('status'); - return $statuses->getConnection() - ->fetchCol($statuses->getSelect()); + $statuses = $schedules->getConnection() + ->fetchCol($schedules->getSelect()); + $statusArray = array(); + foreach ($statuses as $status) { + $statusArray[$status] = $status; + } + return $statusArray; } }