public function index() { $filter = $this->get('filter', ''); $ticket = new APP_Model_Ticket(); $aTicketParams = array(); // If we're filtering by cat if ($filter === 'cat' && ($repo = $this->get($filter, '')) !== '') { $aTicketParams['filter_type'] = 'cat'; $aTicketParams['filter'] = str_replace('-', ' ', $repo); $sFilter = str_replace('-', ' ', $this->get($filter)); } // If we're filtering by 'mine' if ($filter === 'mine' && $this->isLoggedIn() === true) { $aTicketParams['filter_type'] = 'mine'; $aTicketParams['filter'] = $this->getAuthData(false)->id; $sFilter = 'mine'; } // If we're filtering by version if ($filter === 'version' && ($version = $this->get($filter)) !== '') { $aTicketParams['filter_type'] = 'version'; $aTicketParams['filter'] = $version; $sFilter = 'version ' . $version; } $aTicketParams['repo'] = $repo; $tickets = $ticket->getTickets($aTicketParams); $this->addStylesheet('ticket-table.css'); $this->load('ticket/index', compact('tickets', 'sFilter')); }
function search() { if (($keyword = $this->get('keyword', '')) == '') { $this->redirect(''); } $oTicket = new APP_Model_Ticket(); $tickets = $oTicket->getTickets(compact('keyword')); $this->load('home/index', compact('tickets', 'keyword')); }
/** * AdminController::userList() * List all the users * @return void */ protected function ticketList() { $oTicket = new APP_Model_Ticket(); $aParams = array(); if (($sSearchKeyword = $this->post('keyword', '')) != '') { $aParams['keyword'] = $sSearchKeyword; } $tickets = $oTicket->getTickets($aParams); $this->adminLoad('admin/ticket_list', array('tickets' => $tickets, 'leftMenu' => true, 'pageTitle' => 'Tickets')); }