From aec907a8f8bae96e27d352415392bd47b4502441 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 8 Nov 2012 20:17:49 +0000 Subject: [PATCH] Use local category object specific to definition app to get permissions --- importexport/inc/class.importexport_export_csv.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/importexport/inc/class.importexport_export_csv.inc.php b/importexport/inc/class.importexport_export_csv.inc.php index 3816952952..f2d32c4ca1 100644 --- a/importexport/inc/class.importexport_export_csv.inc.php +++ b/importexport/inc/class.importexport_export_csv.inc.php @@ -371,13 +371,18 @@ class importexport_export_csv implements importexport_iface_export_record if($record->$name) $record->$name = ExecMethod($method, $record->$name); } + static $cat_object; + if(is_null($cat_object)) $cat_object = new categories(false,$appname); foreach((array)$fields['select-cat'] as $name) { if($record->$name) { $cats = array(); $ids = is_array($record->$name) ? $record->$name : explode(',', $record->$name); foreach($ids as $n => $cat_id) { - if ($cat_id && $GLOBALS['egw']->categories->check_perms(EGW_ACL_READ,$cat_id)) - $cats[] = $GLOBALS['egw']->categories->id2name($cat_id); + + if ($cat_id && $cat_object->check_perms(EGW_ACL_READ,$cat_id)) + { + $cats[] = $cat_object->id2name($cat_id); + } } $record->$name = implode(', ',$cats); }