diff --git a/admin/inc/class.bocategories.inc.php b/admin/inc/class.bocategories.inc.php index 0949997b77..c3ad5efdbf 100644 --- a/admin/inc/class.bocategories.inc.php +++ b/admin/inc/class.bocategories.inc.php @@ -138,7 +138,7 @@ } else { - if (!$values['cat_parent']) + if (!$values['parent']) { $exists = $this->exists(array ( diff --git a/admin/inc/class.uicategories.inc.php b/admin/inc/class.uicategories.inc.php index f5c86133b6..64c1fa57da 100644 --- a/admin/inc/class.uicategories.inc.php +++ b/admin/inc/class.uicategories.inc.php @@ -195,7 +195,6 @@ { $values = array ( - 'id' => '', 'parent' => $cat_parent, 'descr' => $cat_description, 'name' => $cat_name, diff --git a/preferences/inc/class.bocategories.inc.php b/preferences/inc/class.bocategories.inc.php index 80be7375c5..271edd557e 100644 --- a/preferences/inc/class.bocategories.inc.php +++ b/preferences/inc/class.bocategories.inc.php @@ -101,9 +101,9 @@ return $this->cats->exists($data['type'],$data['cat_name'],$data['cat_id']); } - function formatted_list($data) + function formatted_list($format,$type,$cat_parent,$public_cats) { - return $this->cats->formated_list($data['select'],$data['all'],$data['cat_parent']); + return $this->cats->formated_list($format,$type,$cat_parent,$public_cats); } function delete($cat_id,$subs) diff --git a/preferences/inc/class.uicategories.inc.php b/preferences/inc/class.uicategories.inc.php index b161440367..bc1981e49d 100644 --- a/preferences/inc/class.uicategories.inc.php +++ b/preferences/inc/class.uicategories.inc.php @@ -297,6 +297,11 @@ $cat_parent = $new_parent; } + if (!$global_cats) + { + $global_cats = False; + } + if ($submit) { $data = serialize($cat_data); @@ -328,28 +333,14 @@ if ($cats_level) { - if ($global_cats) - { - $cats_list = $this->bo->cats->formated_list('select','all',$cat_parent,True); - } - else - { - $cats_list = $this->bo->cats->formated_list('select','all',$cat_parent); - } + $type = 'all'; } else { - if ($global_cats) - { - $cats_list = $this->bo->cats->formated_list('select','mains',$cat_parent,True); - } - else - { - $cats_list = $this->bo->cats->formated_list('select','mains',$cat_parent); - } + $type = 'mains'; } - $this->t->set_var('category_list',$cats_list); + $this->t->set_var('category_list',$this->bo->cats->formated_list('select',$type,$cat_parent,$global_cats)); $this->t->set_var('cat_name',$cat_name); $this->t->set_var('cat_description',$cat_description); @@ -419,6 +410,11 @@ $cat_parent = $new_parent; } + if (!$global_cats) + { + $global_cats = False; + } + if ($submit) { $data = serialize($cat_data); @@ -455,30 +451,16 @@ $this->t->set_var('cat_name',$GLOBALS['phpgw']->strip_html($cats[0]['name'])); $this->t->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cats[0]['description'])); - if ($cats_level) + if ($cats_level) { - if ($global_cats) - { - $cats_list = $this->bo->cats->formated_list('select','all',$cats[0]['parent'],True); - } - else - { - $cats_list = $this->bo->cats->formated_list('select','all',$cats[0]['parent']); - } + $type = 'all'; } else { - if ($global_cats) - { - $cats_list = $this->bo->cats->formated_list('select','mains',$cats[0]['parent'],True); - } - else - { - $cats_list = $this->bo->cats->formated_list('select','mains',$cats[0]['parent']); - } + $type = 'mains'; } - $this->t->set_var('category_list',$cats_list); + $this->t->set_var('category_list',$this->bo->cats->formated_list('select',$type,$cats[0]['parent'],$global_cats)); $this->t->set_var('access','');