diff --git a/admin/inc/class.uicategories.inc.php b/admin/inc/class.uicategories.inc.php index 6181cabb60..13232e4dbb 100644 --- a/admin/inc/class.uicategories.inc.php +++ b/admin/inc/class.uicategories.inc.php @@ -427,19 +427,27 @@ if ($GLOBALS['HTTP_POST_VARS']['confirm']) { - switch ($GLOBALS['HTTP_POST_VARS']['subs']) + if ($GLOBALS['HTTP_POST_VARS']['subs']) { - case 'move': - $this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True)); - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); - break; - case 'drop': - $this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True)); - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); - break; - default: - $error_msg = lang('Please choose one of the methods to handle the subcategories'); - break; + switch ($GLOBALS['HTTP_POST_VARS']['subs']) + { + case 'move': + $this->bo->delete(array('cat_id' => $this->cat_id, 'modify_subs' => True)); + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); + break; + case 'drop': + $this->bo->delete(array('cat_id' => $this->cat_id, 'drop_subs' => True)); + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); + break; + default: + $error_msg = lang('Please choose one of the methods to handle the subcategories'); + break; + } + } + else + { + $this->bo->delete(array('cat_id' => $this->cat_id)); + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); } } diff --git a/preferences/inc/class.uicategories.inc.php b/preferences/inc/class.uicategories.inc.php index 12812e4372..b8ca4d9e24 100644 --- a/preferences/inc/class.uicategories.inc.php +++ b/preferences/inc/class.uicategories.inc.php @@ -531,19 +531,27 @@ if (get_var('confirm',array('POST'))) { - switch (get_var('subs',array('POST'))) + if (get_var('subs',array('POST'))) { - case 'move': - $this->bo->delete(array('cat_id' => $this->cat_id,'modify_subs' => True)); - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); - break; - case 'drop': - $this->bo->delete(array('cat_id' => $this->cat_id,'drop_subs' => True)); - Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); - break; - default: - $error_msg = lang('Please choose one of the methods to handle the subcategories'); - break; + switch (get_var('subs',array('POST'))) + { + case 'move': + $this->bo->delete(array('cat_id' => $this->cat_id,'modify_subs' => True)); + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); + break; + case 'drop': + $this->bo->delete(array('cat_id' => $this->cat_id,'drop_subs' => True)); + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); + break; + default: + $error_msg = lang('Please choose one of the methods to handle the subcategories'); + break; + } + } + else + { + $this->bo->delete(array('cat_id' => $this->cat_id)); + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php',$link_data)); } }