Esempio n. 1
0
 /**
  * Give an a-z listing of clients
  */
 public function indexAction()
 {
     $this->view->clientPagerName = 'client-page';
     $this->view->relationship = $this->_getParam('relation', 'Customer');
     $this->view->clientLetters = $this->clientService->getClientTitleLetters($this->view->relationship);
     $currentLetter = ifset($this->_getAllParams(), $this->view->clientPagerName, ifset($this->view->clientLetters, 0, 'A'));
     $obj = new Client();
     $this->view->relationships = $obj->constraints['relationship']->getValues();
     if ($this->view->relationship == "ALL") {
         $this->view->clients = $this->clientService->getClients(array('title like ' => $currentLetter . '%'), 'title asc');
         // , $currentPage, za()->getConfig('project_list_size'));
     } else {
         $this->view->clients = $this->clientService->getClients(array('relationship=' => $this->view->relationship, 'title like ' => $currentLetter . '%'), 'title asc');
         // , $currentPage, za()->getConfig('project_list_size'));
     }
     if ($this->_getParam('_ajax')) {
         $this->renderRawView('client/list.php');
     } else {
         $this->renderView('client/list.php');
     }
 }