/**
  * (non-PHPdoc)
  * @see StaticsPageAbstract::getData()
  */
 public function getData($sender, $param)
 {
     $results = $errors = array();
     try {
         $timeRange = $this->_getXnames();
         $names = array_keys($timeRange);
         $series = array();
         $series[] = array('name' => 'All', 'data' => $this->_getSeries($timeRange, $timeRange[$names[0]]['from'], $timeRange[$names[count($names) - 1]]['to']));
         foreach (OrderStatus::getAll() as $status) {
             $series[] = array('name' => $status->getName(), 'data' => $this->_getSeries($timeRange, $timeRange[$names[0]]['from'], $timeRange[$names[count($names) - 1]]['to'], array($status->getId())));
         }
         $results = array('chart' => array('type' => 'line'), 'title' => array('text' => 'BPC: Monthly Order Trend', 'x' => -20), 'subtitle' => array('text' => 'This is just order trend from last 12 month', 'x' => -20), 'xAxis' => array('categories' => $names), 'yAxis' => array('title' => array('text' => 'No of Orders')), 'series' => $series);
     } catch (Exception $ex) {
         $errors[] = $ex->getMessage();
     }
     $param->ResponseData = StringUtilsAbstract::getJson($results, $errors);
 }
Exemple #2
0
 public function getOrderAccessedStatusIds(Role $role)
 {
     if (isset(self::$_cache['list'])) {
         switch ($_cache->getId()) {
             case Role::ID_WAREHOUSE:
                 return array(OrderStatus::ID_ETA, OrderStatus::ID_STOCK_CHECKED_BY_PURCHASING);
             case Role::ID_PURCHASING:
                 return array(OrderStatus::ID_NEW, OrderStatus::ID_INSUFFICIENT_STOCK);
             case Role::ID_STORE_MANAGER:
             case Role::ID_ACCOUNTING:
                 return array_map(create_function('$a', 'return $a->getId();'), OrderStatus::getAll());
             case Role::ID_SYSTEM_ADMIN:
                 return array();
         }
     }
 }