From b1aa23e5d04a507ec187a44da8eb2eef394b4446 Mon Sep 17 00:00:00 2001 From: ceb Date: Tue, 24 Jun 2003 22:33:40 +0000 Subject: [PATCH] fix --- phpgwapi/inc/class.categories.inc.php | 14 +++---- preferences/inc/class.uicategories.inc.php | 35 ++++++++-------- .../templates/default/category_form.tpl | 42 +++++++++---------- preferences/templates/default/listcats.tpl | 16 +++---- 4 files changed, 52 insertions(+), 55 deletions(-) diff --git a/phpgwapi/inc/class.categories.inc.php b/phpgwapi/inc/class.categories.inc.php index 87e7493890..32cc52c78b 100644 --- a/phpgwapi/inc/class.categories.inc.php +++ b/phpgwapi/inc/class.categories.inc.php @@ -440,24 +440,24 @@ if ($format == 'select') { - for ($i=0;$istrip_html($cats[$i]['name']); - if ($cats[$i]['app_name'] == 'phpgw') + $s .= $GLOBALS['phpgw']->strip_html($cat['name']); + if ($cat['app_name'] == 'phpgw') { $s .= ' <' . lang('Global') . '>'; } - if ($cats[$i]['owner'] == '-1') + if ($cat['owner'] == '-1') { $s .= ' <' . lang('Global') . ' ' . lang($this->app_name) . '>'; } diff --git a/preferences/inc/class.uicategories.inc.php b/preferences/inc/class.uicategories.inc.php index 11edd01917..acc97626ee 100644 --- a/preferences/inc/class.uicategories.inc.php +++ b/preferences/inc/class.uicategories.inc.php @@ -31,7 +31,7 @@ function uicategories() { - $cats_app = get_var('cats_app',array('POST','GET')); + $cats_app = get_var('cats_app',array('GET','POST')); $this->bo = CreateObject('preferences.bocategories',$cats_app); $this->nextmatchs = CreateObject('phpgwapi.nextmatchs'); @@ -70,6 +70,7 @@ $GLOBALS['phpgw']->template->set_var('user_name',$this->user); $GLOBALS['phpgw']->template->set_var('lang_search',lang('Search')); $GLOBALS['phpgw']->template->set_var('lang_done',lang('Done')); + $GLOBALS['phpgw']->template->set_var('lang_cancel',lang('cancel')); $GLOBALS['phpgw']->template->set_var('lang_sub',lang('Add sub')); $GLOBALS['phpgw']->template->set_var('lang_edit',lang('Edit')); $GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete')); @@ -92,10 +93,10 @@ function index() { - $cats_app = get_var('cats_app',array('POST','GET')); - $extra = get_var('extra',array('POST','GET')); - $global_cats = get_var('global_cats',array('POST','GET')); - $cats_level = get_var('cats_level',array('POST','GET')); + $cats_app = get_var('cats_app',array('GET','POST')); + $extra = get_var('extra',array('GET','POST')); + $global_cats = get_var('global_cats',array('GET','POST')); + $cats_level = get_var('cats_level',array('GET','POST')); $link_data = array ( @@ -130,7 +131,6 @@ $global_cats = False; } - $this->bo->cats->app_name = $cats_app; $cats = $this->bo->get_list($global_cats); //--------------------------------- nextmatch -------------------------------------------- @@ -290,7 +290,7 @@ $parent = get_var('parent',array('GET')); $cat_data = get_var('cat_data',array('POST')); - if (get_var('submit',Array('POST'))) + if ($_POST['save']) { if (is_array($cat_data)) { @@ -315,7 +315,7 @@ } $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Add %1 category for', - $GLOBALS['phpgw_info']['apps'][$cats_app]['title']).': '.$this->user; + $GLOBALS['phpgw_info']['apps'][$cats_app]['title']).': '.$this->user; $GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->template->set_file(array('cat_form' => 'category_form.tpl')); @@ -375,7 +375,7 @@ } $link_data['menuaction'] = 'preferences.uicategories.index'; - $GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',$link_data)); + $GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php',$link_data)); $GLOBALS['phpgw']->template->parse('buttons','add'); $GLOBALS['phpgw']->template->fp('phpgw_body','form'); @@ -409,7 +409,7 @@ $GLOBALS['phpgw_info']['apps'][$cats_app]['title']).': '.$this->user; $GLOBALS['phpgw']->common->phpgw_header(); - if (get_var('submit',Array('POST'))) + if ($_POST['save']) { if (is_array($cat_data)) { @@ -447,7 +447,7 @@ $GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit %1 category for',lang($cats_app))); $GLOBALS['phpgw']->template->set_var('message',$message); $GLOBALS['phpgw']->template->set_var('lang_app',lang($cats_app)); - $GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',$link_data)); + $GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php',$link_data)); $link_data['menuaction'] = 'preferences.uicategories.edit'; $link_data['cat_id'] = $this->cat_id; @@ -474,7 +474,8 @@ $GLOBALS['phpgw']->template->set_var('category_list',$this->bo->cats->formatted_list(array('format' => 'select', 'type' => $type, 'selected' => $cats['parent'], - 'globals' => $global_cats))); + 'globals' => $global_cats, + 'self' => $this->cat_id))); $GLOBALS['phpgw']->template->set_var('access',$cats['access'] == 'private'?' checked':''); @@ -495,7 +496,7 @@ $GLOBALS['phpgw']->template->set_var('rows',''); } - if ($cats[0]['owner'] == $this->account) + if ($cats['owner'] == $this->account) { $link_data['menuaction'] = 'preferences.uicategories.delete'; $GLOBALS['phpgw']->template->set_var('delete','
- - {lang_parent} + + {lang_parent} - {lang_name} + {lang_name} - {lang_descr} + {lang_descr} - {lang_access} + {lang_access} {rows} - {buttons} + - - - - - + + + -
 
+
+
- - + + - + + + -
- -
-
{delete}
{delete}
+ - - {lang_data} + + {lang_data} {td_data} diff --git a/preferences/templates/default/listcats.tpl b/preferences/templates/default/listcats.tpl index d99e9f6ed9..c93063d389 100644 --- a/preferences/templates/default/listcats.tpl +++ b/preferences/templates/default/listcats.tpl @@ -39,18 +39,18 @@ {rows} - - +
+ - + -
- -
-
- + +
+
+
+