From 42bd4d227c787ea1233e5ee223dc4fbb59859da4 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 12 Feb 2010 18:34:33 +0000 Subject: [PATCH] Upgrades to historylog_widget: - Allow array for options of a 1:N record, as documented in bo_tracking - Allow passing in a filter parameter, and pass it on to historylog->search --- etemplate/inc/class.historylog_widget.inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.historylog_widget.inc.php b/etemplate/inc/class.historylog_widget.inc.php index ed1377fc7f..ed83d74af6 100644 --- a/etemplate/inc/class.historylog_widget.inc.php +++ b/etemplate/inc/class.historylog_widget.inc.php @@ -85,9 +85,17 @@ class historylog_widget foreach($type as $n => $t) { $opt = ''; + if(is_array($t)) { + $sel_options = $t; + } list($t,$opt) = explode(':',$t); + if(is_array($sel_options)) { + $t = 'select'; + } $child = etemplate::empty_cell($t,$cell['name']."[$n]",array('readonly' => true,'no_lang' => true,'size' => $opt)); + $child['sel_options'] = $sel_options; etemplate::add_child($cell,$child); + unset($sel_options); unset($child); } } @@ -103,11 +111,12 @@ class historylog_widget $app = is_array($value) ? $value['app'] : $GLOBALS['egw_info']['flags']['currentapp']; $status_widgets = is_array($value) && isset($value['status-widgets']) ? $value['status-widgets'] : null; $id = is_array($value) ? $value['id'] : $value; + $filter = is_array($value) ? $value['filter'] : array(); $historylog = new historylog($app); if (!$id || method_exists($historylog,'search')) { - $value = $id ? $historylog->search($id) : false; + $value = $id ? $historylog->search($filter ? array('history_record_id'=>$id) + $filter : $id) : false; } unset($historylog);