From 9034ef788c08fa2f7bfb17cf4b6baa903d325478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Wei=C3=9F?= Date: Sat, 12 Feb 2005 17:32:38 +0000 Subject: [PATCH] some bugfixes related to empty database --- resources/inc/class.so_resources.inc.php | 2 +- resources/inc/class.ui_resources.inc.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/inc/class.so_resources.inc.php b/resources/inc/class.so_resources.inc.php index 3c7190bca3..9c1e840409 100755 --- a/resources/inc/class.so_resources.inc.php +++ b/resources/inc/class.so_resources.inc.php @@ -47,7 +47,7 @@ class so_resources { $wherecats .= ($wherecats ? " OR " : " AND ( " ) .'cat_id' . "='".$cat_id."'"; } - $wherecats .= " ) "; + $wherecats .= $wherecats ? " ) " : ""; $this->db->query( 'SELECT '.$select." FROM ".$this->rs_table." WHERE ".$where.$wherecats. ($order_by != '' ? " ORDER BY $order_by" : ''),__LINE__,__FILE__); diff --git a/resources/inc/class.ui_resources.inc.php b/resources/inc/class.ui_resources.inc.php index 81696578a5..c2a38672e9 100755 --- a/resources/inc/class.ui_resources.inc.php +++ b/resources/inc/class.ui_resources.inc.php @@ -70,8 +70,7 @@ class ui_resources $content['nm']['no_filter'] = False; $content['nm']['filter_label'] = lang('Category'); $content['nm']['filter_help'] = lang('Select a category'); // is this used??? - $content['nm']['options-filter']= array('0' => lang('all categories')); - $content['nm']['options-filter']+= $this->bo->acl->get_cats(PHPGW_ACL_READ); + $content['nm']['options-filter']= array('0'=>lang('all categories'))+(array)$this->bo->acl->get_cats(PHPGW_ACL_READ); $content['nm']['no_filter2'] = True; $content['nm']['no_cat'] = True;