From b074cbf9240afca26f458a8e4e960415b2fda099 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 26 Feb 2004 12:18:44 +0000 Subject: [PATCH] fix for bug #843270: unkillable categories sub-cats should either be delete or made mains if there parent get deleted --- admin/inc/class.bocategories.inc.php | 2 +- preferences/inc/class.bocategories.inc.php | 4 ++-- preferences/inc/class.uicategories.inc.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/inc/class.bocategories.inc.php b/admin/inc/class.bocategories.inc.php index f669d1f9fa..f79f117174 100644 --- a/admin/inc/class.bocategories.inc.php +++ b/admin/inc/class.bocategories.inc.php @@ -129,7 +129,7 @@ function delete($cat_id,$subs=False) { - return $this->cats->delete($cat_id,$subs); + return $this->cats->delete($cat_id,$subs,!$subs); // either delete the subs or modify them } function check_values($values) diff --git a/preferences/inc/class.bocategories.inc.php b/preferences/inc/class.bocategories.inc.php index 4d025b0087..8626b190ff 100644 --- a/preferences/inc/class.bocategories.inc.php +++ b/preferences/inc/class.bocategories.inc.php @@ -106,9 +106,9 @@ return $this->cats->formated_list($format,$type,$cat_parent,$global_cats); } - function delete($cat_id,$drop_subs,$modify_subs=false) + function delete($cat_id,$subs) { - return $this->cats->delete($cat_id,$drop_subs,$modify_subs); + return $this->cats->delete($cat_id,$subs,!$subs); // either delete the subs or modify them } function check_values($values) diff --git a/preferences/inc/class.uicategories.inc.php b/preferences/inc/class.uicategories.inc.php index f039dd12be..1553be5b3f 100644 --- a/preferences/inc/class.uicategories.inc.php +++ b/preferences/inc/class.uicategories.inc.php @@ -551,7 +551,7 @@ } else { - $this->bo->delete($cat_id,False,True); + $this->bo->delete($cat_id); } $GLOBALS['phpgw']->redirect_link('/index.php',$link_data); }