Example #1
0
 public function taskFilterAction()
 {
     $this->_helper->layout->disableLayout();
     $task_type = $this->_getParam('task_type');
     $task_filter = $this->_getParam('filter');
     $matterModel = new Application_Model_Matter();
     if ($task_type == 'open') {
         $this->view->open_tasks = $matterModel->getUserOpenTasks(null, 0, $task_filter);
     } else {
         $this->view->open_tasks = $matterModel->getUserOpenTasks(null, 1, $task_filter);
     }
 }
Example #2
0
 /**
  * navigates through matter list either full list or filtered list
  * *
  */
 public function matterNavAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $rid = $this->_getParam('rid');
     $mfs = new Zend_Session_Namespace('matter_filter');
     $filter_array = $mfs->filter_array;
     $sort_field = $mfs->sort_field;
     $sort_dir = $mfs->sort_dir;
     $post_data = $mfs->multi_sort;
     $matterModel = new Application_Model_Matter();
     $matters = $matterModel->fetchMatters($filter_array, $sort_field, $sort_dir, $post_data, $mfs->category_display, false);
     $mcount = count($matters);
     if (preg_match("/matter/", $rid)) {
         $rid_array = explode("-", $rid);
         $position = 0;
         foreach ($matters as $matter) {
             if ($matter['ID'] == $rid_array[2]) {
                 if ($rid_array[1] == "previous") {
                     $rid = $position - 1;
                 }
                 if ($rid_array[1] == "next") {
                     $rid = $position + 1;
                 }
             }
             $position++;
         }
     }
     if ($mcount > 0) {
         $rid = $rid % $mcount;
     }
     if ($rid < 0) {
         $rid = $mcount - 1;
     }
     $matter_id = $matters[$rid]['ID'];
     $this->_redirect('/matter/view/id/' . $matter_id . "/rid/" . $rid);
 }