From be1d2d6c4c5623c6af59cf72e74e0335d1aa6cb5 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 10 Jul 2011 22:46:30 +0000 Subject: improved the way the history messages are shown --- .../Application/Controllers/SpecialController.php | 49 ++++++++++++++++------ 1 file changed, 36 insertions(+), 13 deletions(-) (limited to 'h-source/Application/Controllers/SpecialController.php') diff --git a/h-source/Application/Controllers/SpecialController.php b/h-source/Application/Controllers/SpecialController.php index 6f17c2c..6ef632a 100644 --- a/h-source/Application/Controllers/SpecialController.php +++ b/h-source/Application/Controllers/SpecialController.php @@ -40,17 +40,17 @@ class SpecialController extends BaseController { switch ($action) { - case 'modifications': - $data['title'] = 'last modifications - '.Website::$generalName; - - $whereClauseArray = array( - 'gr' => 'registered', - 'type' => 'hardware', - ); - - $viewFile = 'modifications'; - - break; +// case 'modifications': +// $data['title'] = 'last modifications - '.Website::$generalName; +// +// $whereClauseArray = array( +// 'gr' => 'registered', +// 'type' => 'hardware', +// ); +// +// $viewFile = 'modifications'; +// +// break; case 'modactions': $data['title'] = 'last moderations - '.Website::$generalName; $data['viewTitle'] = 'List of actions carried out by moderators'; @@ -99,7 +99,30 @@ class SpecialController extends BaseController { $this->shift(1); - $this->last($lang = 'en','modifications'); + $data['title'] = 'last modifications - '.Website::$generalName; + + $whereClauseArray = array( + 'gr' => 'registered', + 'type' => 'hardware', + 'approved' => 'yes', + ); + + $this->helper('Pages','special/'.$this->action.'/'.$this->lang,'page'); + + $this->m['HistoryModel']->clear()->inner('hardware')->on('hardware.id_hard=history.id')->select()->where($whereClauseArray)->orderBy('id_history desc'); + + $recordNumber = $this->m['HistoryModel']->rowNumber(); + $page = $this->viewArgs['page']; + + $this->m['HistoryModel']->limit = $this->h['Pages']->getLimit($page,$recordNumber,30); + + $data['table'] = $this->m['HistoryModel']->send(); + + $data['pageList'] = $this->h['Pages']->render($page-5,11); + + $this->append($data); + $this->load('modifications'); + $this->right(); } public function modactions($lang = 'en') @@ -122,7 +145,7 @@ class SpecialController extends BaseController protected function pagelist($lang = 'en', $type) { - switch($type) + switch ($type) { case 'deleted': $whereArray = array('-deleted'=>'yes','approved'=>'yes'); -- cgit v1.2.3