From edc9286de9c57a7a5dee54c006dae6ee188add37 Mon Sep 17 00:00:00 2001 From: ceb Date: Sat, 12 Oct 2002 18:43:58 +0000 Subject: [PATCH] update edit_cats to move the subtree with the cat if the parent changes --- admin/inc/class.uicategories.inc.php | 17 +++++++---------- preferences/inc/class.uicategories.inc.php | 11 +++++------ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/admin/inc/class.uicategories.inc.php b/admin/inc/class.uicategories.inc.php index 9d63520471..7e82ed0a2f 100644 --- a/admin/inc/class.uicategories.inc.php +++ b/admin/inc/class.uicategories.inc.php @@ -282,23 +282,20 @@ else { $this->bo->save_cat($values); - $GLOBALS['phpgw']->template->set_var('message',lang('Category x has been added !', $cat_name)); + $GLOBALS['phpgw']->template->set_var('message',lang('Category x has been added !', $values['name'])); } } $link_data['menuaction'] = 'admin.uicategories.add'; $GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data)); - $GLOBALS['phpgw']->template->set_var('category_list',$this->bo->formatted_list(array - ( - 'select' => 'select', - 'all' => 'all', - 'cat_parent' => $cat_parent, - 'global_cats' => $global_cats - ))); + $GLOBALS['phpgw']->template->set_var('category_list',$this->bo->formatted_list(array('select' => 'select', + 'all' => 'all', + 'parent' => $values['parent'], + 'global_cats' => $global_cats))); - $GLOBALS['phpgw']->template->set_var('cat_name',$cat_name); - $GLOBALS['phpgw']->template->set_var('cat_description',$cat_description); + $GLOBALS['phpgw']->template->set_var('cat_name',$values['name']); + $GLOBALS['phpgw']->template->set_var('cat_description',$values['descr']); $GLOBALS['phpgw']->template->parse('buttons','add'); $GLOBALS['phpgw']->template->fp('phpgw_body','form'); diff --git a/preferences/inc/class.uicategories.inc.php b/preferences/inc/class.uicategories.inc.php index bccca867b5..6ec81bdd24 100644 --- a/preferences/inc/class.uicategories.inc.php +++ b/preferences/inc/class.uicategories.inc.php @@ -328,12 +328,11 @@ $type = 'mains'; } - $GLOBALS['phpgw']->template->set_var('category_list',$this->bo->cats->formated_list('select',$type,$cat_parent,$global_cats)); - $GLOBALS['phpgw']->template->set_var('cat_name',$cat_name); - $GLOBALS['phpgw']->template->set_var('cat_description',$cat_description); + $GLOBALS['phpgw']->template->set_var('category_list',$this->bo->cats->formated_list('select',$type,$values['parent'],$global_cats)); + $GLOBALS['phpgw']->template->set_var('cat_name',$values['name']); + $GLOBALS['phpgw']->template->set_var('cat_description',$values['descr']); - $GLOBALS['phpgw']->template->set_var('access',''); + $GLOBALS['phpgw']->template->set_var('access',$values['access'] == 'private'?' checked':''); if ($extra) { @@ -442,7 +441,7 @@ $GLOBALS['phpgw']->template->set_var('category_list',$this->bo->cats->formated_list('select',$type,$cats['parent'],$global_cats)); - $GLOBALS['phpgw']->template->set_var('access',$cats['access'] == 'private' ?' checked':''); + $GLOBALS['phpgw']->template->set_var('access',$cats['access'] == 'private'?' checked':''); if ($extra) {