diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-07-10 22:46:30 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-07-10 22:46:30 +0000 |
commit | be1d2d6c4c5623c6af59cf72e74e0335d1aa6cb5 (patch) | |
tree | 746bf827e4e7845dffad02b39db9185461c710b6 /h-source/Application/Controllers/HistoryController.php | |
parent | 878f70432bdfdd12a5c9788cec3d04ed862eafa6 (diff) |
improved the way the history messages are shown
Diffstat (limited to 'h-source/Application/Controllers/HistoryController.php')
-rw-r--r-- | h-source/Application/Controllers/HistoryController.php | 22 |
1 files changed, 20 insertions, 2 deletions
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', |