modified exists() to check apps_sub_cats to a global parent_cat

This commit is contained in:
bettina 2001-05-11 00:45:14 +00:00
parent 8764e4aec8
commit 3883ba049a

View File

@ -250,7 +250,7 @@
$s .= '>' . $phpgw->strip_html($cats[$i]['name']); $s .= '>' . $phpgw->strip_html($cats[$i]['name']);
if ($cats[$i]['app_name'] == 'phpgw') if ($cats[$i]['app_name'] == 'phpgw')
{ {
$s .= '<' . lang('Global') . '>'; $s .= '<' . lang('Global') . '>';
} }
$s .= '</option>'; $s .= '</option>';
} }
@ -447,19 +447,18 @@
if ($cat_name) if ($cat_name)
{ {
$cat_exists = " AND cat_name='" . addslashes($cat_name) . "' "; $cat_exists = " cat_name='" . addslashes($cat_name) . "' ";
} }
if ($cat_id) if ($cat_id)
{ {
$cat_exists = " AND cat_parent='$cat_id' "; $cat_exists = " cat_parent='$cat_id' ";
} }
if ($cat_name && $cat_id) if ($cat_name && $cat_id)
{ {
$cat_exists = " AND cat_name='" . addslashes($cat_name) . "' AND cat_id != '$cat_id' "; $cat_exists = " cat_name='" . addslashes($cat_name) . "' AND cat_id != '$cat_id' ";
} }
$this->db->query("select count(*) from phpgw_categories where cat_appname='" $this->db->query("select count(*) from phpgw_categories where $cat_exists $filter",__LINE__,__FILE__);
. $this->app_name . "' $cat_exists $filter",__LINE__,__FILE__);
$this->db->next_record(); $this->db->next_record();