function populate() { $orders = new SOrderLineCollection(); if (empty($this->params['period'])) { $this->params['period'] = 'today'; } if (empty($this->params['type'])) { $this->params['type'] = 'O'; } $this->contents = $orders->getOrderItemSummary($this->params['period'], $this->params['type'], '', $this->limit); foreach ($this->params as $param => $value) { $this->params[$param] = $param . "=" . $value; } $this->contents['url'] = '/?module=sales_order&controller=sorders&action=orderitemsummary&' . implode('&', $this->params) . '&_target=sorders_item_overview'; }
public function orderitemsummary() { // Use by Ajax from within eglet $orderlines = new SOrderLineCollection(DataObjectFactory::Factory('SOrderLine')); $period = isset($this->_data['period']) ? $this->_data['period'] : ''; $type = isset($this->_data['type']) ? $this->_data['type'] : ''; $page = isset($this->_data['page']) ? $this->_data['page'] : ($page = ''); // prepare URL, we do this because this isn't an ordinary eglet, paging needs // to be handled manually, therefore we must pass the base URL through. $url_parts = array("module", "controller", "action", "period", "type", "_target"); $url = array(); foreach ($url_parts as $part) { $url[$part] = $part . "=" . $this->_data[$part]; } $ordersummary = $orderlines->getOrderItemSummary($period, $type, $page); $ordersummary['url'] = '/?' . implode('&', $url); $this->view->set('page_title', $this->getPageName('', 'items for despatch')); $this->view->set('content', $ordersummary); }