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/HistoryController.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'h-source/Application/Controllers/HistoryController.php') diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php index a92f906..3b6e1d2 100644 --- a/h-source/Application/Controllers/HistoryController.php +++ b/h-source/Application/Controllers/HistoryController.php @@ -275,6 +275,7 @@ class HistoryController extends BaseController 'field_name' => '-deleted', 'actions' => array('devicehide','deviceshow'), 'group' => 'admin', + 'types_to_show' => 'device_app,device', ), @@ -467,8 +468,15 @@ class HistoryController extends BaseController if (in_array($clean['group'],$this->s['registered']->status['groups'])) { $clean['type'] = $this->types[$type]['clean_type']; + $clean['typeInWhereClause'] = "'".$clean['type']."'"; - switch ($clean['type']) { + if (array_key_exists('types_to_show',$this->types[$type])) + { + $clean['typeInWhereClause'] = "'".implode("','",explode(',',$this->types[$type]['types_to_show']))."'"; + } + + switch ($clean['type']) + { case 'user': $data['object'] = 'user'; $data['box_class'] = 'details_of_actions_inner_user'; @@ -499,7 +507,17 @@ class HistoryController extends BaseController break; } - $data['res'] = $this->m['HistoryModel']->select()->where(array('id'=>$clean['id'],'type'=>$clean['type'],'gr'=>$clean['group']))->send(); + $data['res'] = $this->m['HistoryModel'] + ->select() + ->where( + array + ( + 'id'=>$clean['id'], + 'type'=>"in(".$clean['typeInWhereClause'].")", + 'gr'=>$clean['group']) + ) + ->send(); +// echo $this->m['HistoryModel']->getQuery(); $data['md_action'] = array( 'hide' => 'hidden', -- cgit v1.2.3