/** * Show completed tickets * * @param void * @return null */ function archive() { if ($this->request->isApiCall()) { $this->serveData(Tickets::findCompletedByProject($this->active_project, STATE_VISIBLE, $this->logged_user->getVisibility()), 'tickets'); } else { $this->wireframe->addBreadCrumb(lang('Archive'), assemble_url('project_tickets_archive', array('project_id' => $this->active_project->getId()))); $per_page = 50; $page = (int) $this->request->get('page'); if ($page < 1) { $page = 1; } // if if ($this->active_category->isLoaded()) { list($tickets, $pagination) = Tickets::paginateCompletedByCategory($this->active_category, $page, $per_page, STATE_VISIBLE, $this->logged_user->getVisibility()); } else { list($tickets, $pagination) = Tickets::paginateCompletedByProject($this->active_project, $page, $per_page, STATE_VISIBLE, $this->logged_user->getVisibility()); } // if $this->smarty->assign(array('tickets' => $tickets, 'pagination' => $pagination, 'categories' => Categories::findByModuleSection($this->active_project, TICKETS_MODULE, 'tickets'))); } // if }