diff --git a/app/Controller/AttributesController.php b/app/Controller/AttributesController.php index d269e2f00..1188bd2d9 100755 --- a/app/Controller/AttributesController.php +++ b/app/Controller/AttributesController.php @@ -658,6 +658,9 @@ class AttributesController extends AppController { // and store into session $this->Session->write('paginate_conditions',$this->paginate); + $this->Session->write('paginate_conditions_keyword',$keyword); + $this->Session->write('paginate_conditions_type',$type); + $this->Session->write('paginate_conditions_category',$category); // set the same view as the index page $this->render('index'); @@ -682,6 +685,15 @@ class AttributesController extends AppController { $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); $this->Attribute->recursive = 0; + // get from Session + $keyword = $this->Session->read('paginate_conditions_keyword'); + $type = $this->Session->read('paginate_conditions_type'); + $category = $this->Session->read('paginate_conditions_category'); + $this->set('keywordSearch', $keyword); + $this->set('typeSearch', $type); + $this->set('isSearch', 1); + $this->set('categorySearch', $category); + // re-get pagination $this->paginate = $this->Session->read('paginate_conditions'); $this->set('attributes', Sanitize::clean($this->paginate())); diff --git a/app/Controller/LogsController.php b/app/Controller/LogsController.php index 4f473ad3c..efab0a28d 100755 --- a/app/Controller/LogsController.php +++ b/app/Controller/LogsController.php @@ -43,6 +43,7 @@ class LogsController extends AppController { public function admin_index() { $this->Log->recursive = 0; $this->set('logs', Sanitize::clean($this->paginate())); + $this->set('isSearch', 0); } /** @@ -86,6 +87,7 @@ class LogsController extends AppController { $this->set('actionSearch', $action); $this->set('titleSearch', $title); $this->set('changeSearch', $change); + $this->set('isSearch', 1); // search the db $conditions = array(); @@ -106,7 +108,7 @@ class LogsController extends AppController { } $this->Log->recursive = 0; $this->paginate = array( - 'limit' => 60, + 'limit' => 6, 'maxLimit' => 9999, // LATER we will bump here on a problem once we have more than 9999 logs(?) 'conditions' => $conditions ); @@ -114,6 +116,11 @@ class LogsController extends AppController { // and store into session $this->Session->write('paginate_conditions_log', $this->paginate); + $this->Session->write('paginate_conditions_log_email', $email); + $this->Session->write('paginate_conditions_log_org', $org); + $this->Session->write('paginate_conditions_log_action', $action); + $this->Session->write('paginate_conditions_log_title', $title); + $this->Session->write('paginate_conditions_log_change', $change); // set the same view as the index page $this->render('admin_index'); @@ -128,8 +135,23 @@ class LogsController extends AppController { } else { $this->set('actionDefinitions', $this->Log->actionDefinitions); - $this->Log->recursive = 0; + // get from Session + $email = $this->Session->read('paginate_conditions_log_email'); + $org = $this->Session->read('paginate_conditions_log_org'); + $action = $this->Session->read('paginate_conditions_log_action'); + $title = $this->Session->read('paginate_conditions_log_title'); + $change = $this->Session->read('paginate_conditions_log_change'); + + // for info on what was searched for + $this->set('emailSearch', $email); + $this->set('orgSearch', $org); + $this->set('actionSearch', $action); + $this->set('titleSearch', $title); + $this->set('changeSearch', $change); + $this->set('isSearch', 1); + // re-get pagination + $this->Log->recursive = 0; $this->paginate = $this->Session->read('paginate_conditions_log'); $this->set('logs', Sanitize::clean($this->paginate())); diff --git a/app/View/Logs/admin_index.ctp b/app/View/Logs/admin_index.ctp index 63d38ca4e..8bc23082c 100755 --- a/app/View/Logs/admin_index.ctp +++ b/app/View/Logs/admin_index.ctp @@ -1,15 +1,16 @@

-

Results for all log entries - ".h($emailSearch)."\""; - if ($orgSearch!=null) echo " of the organisation \"".h($orgSearch)."\""; - if ($actionSearch!="ALL") echo " of type \"".h($actionSearch)."\""; - if ($titleSearch!=null) echo " with the title \"".h($titleSearch)."\""; - if ($changeSearch!=null) echo " including the change \"".h($changeSearch)."\""; - echo ":"; - ?> -

+ Results for all log entries"; + if ($emailSearch!=null) echo " for user \"".h($emailSearch)."\""; + if ($orgSearch!=null) echo " of the organisation \"".h($orgSearch)."\""; + if ($actionSearch!="ALL") echo " of type \"".h($actionSearch)."\""; + if ($titleSearch!=null) echo " with the title \"".h($titleSearch)."\""; + if ($changeSearch!=null) echo " including the change \"".h($changeSearch)."\""; + echo ":"; + } + ?>
Paginator->sort('id');?>