From b83af98a7ff98a18e8e0e3b450128d640be92752 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 22 Mar 2003 09:37:40 +0000 Subject: [PATCH] skwashd's patch to: - name2id return system-global cats too - return_array use strlen now to differ between not set and 0 parent_cat_id --- phpgwapi/inc/class.categories.inc.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.categories.inc.php b/phpgwapi/inc/class.categories.inc.php index ff85a66897..4661d92636 100644 --- a/phpgwapi/inc/class.categories.inc.php +++ b/phpgwapi/inc/class.categories.inc.php @@ -22,7 +22,6 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * \**************************************************************************/ /* $Id$ */ - /* $Source$ */ /*! @class categories @@ -138,7 +137,7 @@ @param $globals True or False, includes the global phpgroupware categories or not @result $cats array */ - function return_array($type,$start,$limit = True,$query = '',$sort = '',$order = '',$globals = False, $parent_id = '## undef ##') + function return_array($type,$start,$limit = True,$query = '',$sort = '',$order = '',$globals = False, $parent_id = '') { if ($globals) { @@ -183,7 +182,7 @@ } } - if ($parent_id != '## undef ##') + if (strlen($parent_id) != 0) { $parent_filter = " AND cat_parent='$parent_id'"; } @@ -731,7 +730,7 @@ function name2id($cat_name) { $this->db->query("SELECT cat_id FROM phpgw_categories WHERE cat_name='" . $this->db->db_addslashes($cat_name) . "' " - ."AND cat_appname='" . $this->app_name . "' AND cat_owner=" . $this->account_id,__LINE__,__FILE__); + ."AND cat_appname='" . $this->app_name . "' AND (cat_owner=" . $this->account_id ." OR cat_owner=-1)",__LINE__,__FILE__); if(!$this->db->num_rows()) {