From 054086b33dad4c4f7089cf2ebf0f52eed1d7a023 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Mon, 28 May 2012 15:28:35 +0000 Subject: administrators can now view the actions of a single user in a compact format --- h-source/Application/Controllers/SpecialController.php | 17 +++++++++++------ h-source/Application/Models/HistoryModel.php | 1 + .../Application/Views/Desktop/Special/modactions.php | 11 +++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) (limited to 'h-source/Application') diff --git a/h-source/Application/Controllers/SpecialController.php b/h-source/Application/Controllers/SpecialController.php index 9298ad3..a118211 100644 --- a/h-source/Application/Controllers/SpecialController.php +++ b/h-source/Application/Controllers/SpecialController.php @@ -33,7 +33,9 @@ class SpecialController extends BaseController $data['title'] = gtext('last modifications').' - '.Website::$generalName; $this->append($data); - $this->setArgKeys(array('page:forceNat'=>1)); + Params::$nullQueryValue = 'undef'; + + $this->setArgKeys(array('page:forceNat'=>1,'username:sanitizeAll'=>'undef')); } protected function last($lang = 'en',$action = 'modifications') @@ -78,11 +80,12 @@ class SpecialController extends BaseController break; } - + $whereClauseArray['username'] = $this->viewArgs['username']; + $this->helper('Pages','special/'.$this->action.'/'.$this->lang,'page'); - - $this->m['HistoryModel']->clear()->select()->where($whereClauseArray)->orderBy('id_history desc'); - + + $this->m['HistoryModel']->clear()->left('regusers')->on('history.created_by=regusers.id_user')->select("history.*,regusers.username")->where($whereClauseArray)->orderBy('id_history desc'); + $recordNumber = $this->m['HistoryModel']->rowNumber(); $page = $this->viewArgs['page']; @@ -90,6 +93,8 @@ class SpecialController extends BaseController $data['table'] = $this->m['HistoryModel']->send(); +// echo $this->m['HistoryModel']->getQuery(); + $data['pageList'] = $this->h['Pages']->render($page-5,11); $this->append($data); @@ -120,7 +125,7 @@ class SpecialController extends BaseController $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); diff --git a/h-source/Application/Models/HistoryModel.php b/h-source/Application/Models/HistoryModel.php index cf63dbe..d94f745 100644 --- a/h-source/Application/Models/HistoryModel.php +++ b/h-source/Application/Models/HistoryModel.php @@ -30,6 +30,7 @@ class HistoryModel extends Model_Tree { 'approved' => 'hardware', 'deleted' => 'hardware', 'cleared' => 'hardware', + 'username' => 'regusers', ); $this->orderBy = 'history.id_history'; diff --git a/h-source/Application/Views/Desktop/Special/modactions.php b/h-source/Application/Views/Desktop/Special/modactions.php index 4539aee..43c7a44 100644 --- a/h-source/Application/Views/Desktop/Special/modactions.php +++ b/h-source/Application/Views/Desktop/Special/modactions.php @@ -42,6 +42,17 @@ NOTE + +   +   +   +   +   +   + action,'usersactions') !== 0) { ?> +   + + -- cgit v1.2.3