/** * Action shows filters and datagrid. * @return ActionResponse */ public function index() { $orderGroups = array(array('ID' => self::TYPE_ALL, 'rootID' => self::TYPE_ROOT, 'name' => $this->translate('_all_orders')), array('ID' => self::TYPE_CURRENT, 'name' => $this->translate('_current_orders'), 'rootID' => self::TYPE_ALL), array('ID' => self::TYPE_NEW, 'name' => $this->translate('_new_orders'), 'rootID' => self::TYPE_CURRENT), array('ID' => self::TYPE_PROCESSING, 'name' => $this->translate('_processing_orders'), 'rootID' => self::TYPE_CURRENT), array('ID' => self::TYPE_AWAITING, 'name' => $this->translate('_awaiting_shipment_orders'), 'rootID' => self::TYPE_CURRENT)); if (CustomerOrder::hasRecurringOrder()) { $orderGroups = array_merge($orderGroups, array(array('ID' => self::TYPE_RECURRING, 'rootID' => self::TYPE_ALL, 'name' => $this->translate('_recurring')), array('ID' => self::TYPE_RECURRING_ALL, 'rootID' => self::TYPE_RECURRING, 'name' => $this->translate('_recurring_all')), array('ID' => self::TYPE_RECURRING_EXPIRED, 'rootID' => self::TYPE_RECURRING, 'name' => $this->translate('_recurring_expired')), array('ID' => self::TYPE_RECURRING_CANCELLED, 'rootID' => self::TYPE_RECURRING, 'name' => $this->translate('_recurring_canceled')))); } $orderGroups = array_merge($orderGroups, array(array('ID' => self::TYPE_SHIPPED, 'name' => $this->translate('_shipped_orders'), 'rootID' => self::TYPE_ALL), array('ID' => self::TYPE_RETURNED, 'name' => $this->translate('_returned_orders'), 'rootID' => self::TYPE_ALL), array('ID' => self::TYPE_CANCELLED, 'name' => $this->translate('_cancelled_orders'), 'rootID' => self::TYPE_ALL), array('ID' => self::TYPE_CARTS, 'name' => $this->translate('_shopping_carts'), 'rootID' => self::TYPE_ROOT))); return new ActionResponse('orderGroups', $orderGroups); }