From 25c29211f57d7e60c3e225d3c2edc757df4bf248 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 30 Jan 2010 23:54:08 +0000 Subject: [PATCH] adapting for changed categories class --- calendar/inc/class.calendar_bo.inc.php | 5 ++--- etemplate/inc/class.select_widget.inc.php | 13 +++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index 6bb70c11b9..5bb9fb53ef 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -572,7 +572,7 @@ class calendar_bo { $is_private = (bool)ExecMethod2($app_data,$id,$event); } - //echo '

'.__METHOD__."($app,$id,) returning ".array2string($is_private)."

\n"; + //echo '

'.__METHOD__."($app,$id,) app_data=".array2string($app_data).' returning '.array2string($is_private)."

\n"; return $is_private; } @@ -1393,8 +1393,7 @@ class calendar_bo if (!isset($id2cat[$cat_id])) { - list($id2cat[$cat_id]) = $this->categories->return_single($cat_id); - $id2cat[$cat_id]['data'] = unserialize($id2cat[$cat_id]['data']); + $id2cat[$cat_id] = categories::read($cat_id); } $cat = $id2cat[$cat_id]; diff --git a/etemplate/inc/class.select_widget.inc.php b/etemplate/inc/class.select_widget.inc.php index 7973ba9cb4..8011cdf909 100644 --- a/etemplate/inc/class.select_widget.inc.php +++ b/etemplate/inc/class.select_widget.inc.php @@ -102,7 +102,7 @@ class select_widget */ function pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl) { - list($rows,$type,$type2,$type3,$type4) = explode(',',$cell['size']); + list($rows,$type,$type2,$type3,$type4,$type5) = explode(',',$cell['size']); $extension_data['type'] = $cell['type']; @@ -158,7 +158,7 @@ class select_widget $cell['no_lang'] = True; break; - case 'select-cat': // !$type == globals cats too, $type2: extraStyleMultiselect, $type3: application, if not current-app, $type4: parent-id + case 'select-cat': // !$type == globals cats too, $type2: extraStyleMultiselect, $type3: application, if not current-app, $type4: parent-id, $type5=owner (-1=global) if ($readonly) // for readonly we dont need to fetch all cat's, nor do we need to indent them by level { $cell['no_lang'] = True; @@ -179,20 +179,21 @@ class select_widget } break; } - if (!$type3 || $type3 === $GLOBALS['egw']->categories->app_name) + if ((!$type3 || $type3 === $GLOBALS['egw']->categories->app_name) && + (!$type5 || $type5 == $GLOBALS['egw']->categories->account_id)) { $categories = $GLOBALS['egw']->categories; } else // we need to instanciate a new cat object for the correct application { - $categories = new categories('',$type3); + $categories = new categories($type5,$type3); } // we cast $type4 (parent) to int, to get default of 0 if omitted - foreach((array)$categories->return_sorted_array(0,False,'','','',!$type,(int)$type4) as $cat) + foreach((array)$categories->return_sorted_array(0,False,'','','',!$type,(int)$type4,true) as $cat) { $s = str_repeat(' ',$cat['level']) . stripslashes($cat['name']); - if ($cat['app_name'] == 'phpgw' || $cat['owner'] == '-1') + if ($cat['app_name'] == categories::GLOBAL_APPNAME || $cat['owner'] == categories::GLOBAL_ACCOUNT) { $s .= ' ♦'; }