コード例 #1
0
ファイル: items.php プロジェクト: mined-gatech/hubzero-cms
 /**
  * Displays a list of groups
  *
  * @return  void
  */
 public function displayTask()
 {
     // Instantiate a new view
     $this->view->store_enabled = $this->config->get('store_enabled');
     // Get paging variables
     $this->view->filters = array('limit' => Request::getState($this->_option . '.items.limit', 'limit', Config::get('list_limit'), 'int'), 'start' => Request::getState($this->_option . '.items.limitstart', 'limitstart', 0, 'int'), 'filterby' => Request::getState($this->_option . '.items.filterby', 'filterby', 'all'), 'sortby' => Request::getState($this->_option . '.items.sortby', 'sortby', 'date'));
     $obj = new Store($this->database);
     $this->view->total = $obj->getItems('count', $this->view->filters, $this->config);
     $this->view->rows = $obj->getItems('retrieve', $this->view->filters, $this->config);
     // how many times ordered?
     if ($this->view->rows) {
         $oi = new OrderItem($this->database);
         foreach ($this->view->rows as $o) {
             // Active orders
             $o->activeorders = $oi->countActiveItemOrders($o->id);
             // All orders
             $o->allorders = $oi->countAllItemOrders($o->id);
         }
     }
     // Output the HTML
     $this->view->display();
 }