Пример #1
0
 public function executeIndex(sfWebRequest $request)
 {
     $dpu = new sfDoctrinePagerUtil('Task', 10);
     $sort = $dpu->getSort($request);
     $tasks = Doctrine_Core::getTable('Task')->queryIncompleteByUserId($sort);
     $this->pager = $this->_getPager(array('query' => $tasks, 'request' => $request, 'pager' => $dpu));
 }
Пример #2
0
 public function executeIndex(sfWebRequest $request)
 {
     $dpu = new sfDoctrinePagerUtil('Client', 10);
     $sort = $dpu->getSort($request);
     $clients = Doctrine_Query::create()->from('Client c, c.User u')->orderBy('c.' . $sort);
     $fields = array('id' => array('Client'));
     $pagerOptions = array('query' => $clients, 'request' => $request, 'fields' => $fields);
     $this->pager = $dpu->getPager($pagerOptions);
 }
Пример #3
0
 public function executeIndex(sfWebRequest $request)
 {
     $dpu = new sfDoctrinePagerUtil('Staff', 10);
     $sort = $dpu->getSort($request);
     $staff = Doctrine_Query::create()->from('Staff s, s.User u')->orderBy('s.' . $sort);
     $fields = array('id' => array('Employee', 'staff', null), 'title' => array('Title', 'staff', 'getTitle'));
     $pagerOptions = array('query' => $staff, 'request' => $request, 'fields' => $fields);
     $this->pager = $dpu->getPager($pagerOptions);
 }
Пример #4
0
 public function executeIndex(sfWebRequest $request)
 {
     $dpu = new sfDoctrinePagerUtil('AccountInvoice', 10);
     $sort = $dpu->getSort($request);
     if (!$this->getUser()->isClient()) {
         $invoices = Doctrine_Core::getTable('AccountInvoice')->queryAll($sort);
     } else {
         $invoices = Doctrine_Core::getTable('AccountInvoice')->queryAllByAccountId($sort);
     }
     $this->pager = $this->_getPager(array('query' => $invoices, 'request' => $request, 'pager' => $dpu));
 }
Пример #5
0
 public function executeIndex(sfWebRequest $request)
 {
     $dpu = new sfDoctrinePagerUtil('Task', 10);
     $sort = $dpu->getSort($request);
     if ($this->getUser()->isSuperAdmin()) {
         $tasks = Doctrine_Core::getTable('Task')->queryAll($sort);
     } else {
         $tasks = Doctrine_Core::getTable('Task')->queryAllByUserId($sort);
     }
     $this->pager = $this->_getPager(array('query' => $tasks, 'request' => $request, 'pager' => $dpu));
 }