diff --git a/admin/addcategory.php b/admin/addcategory.php
index 41e1f9e96c..f8f4ccbd04 100644
--- a/admin/addcategory.php
+++ b/admin/addcategory.php
@@ -36,21 +36,25 @@
$cat_description = addslashes($cat_description);
$cat_access = 'public';
- $c->add($cat_name,$cat_parent,$cat_description,$cat_data,$cat_access);
+ $c->add($cat_name,$cat_parent,$cat_description,$cat_data,$cat_access,$cat_main);
}
}
if ($errorcount) { $t->set_var('message',$phpgw->common->error_list($error)); }
- if (($submit) && (! $error) && (! $errorcount)) { $t->set_var('message',lang("Category x has been added !", $cat_name)); }
+ if (($submit) && (! $error) && (! $errorcount)) { $t->set_var('message',lang('Category x has been added !', $cat_name)); }
if ((! $submit) && (! $error) && (! $errorcount)) { $t->set_var('message',''); }
$t->set_var('title_categories',lang('Add global category'));
$t->set_var('actionurl',$phpgw->link('/admin/addcategory.php'));
$t->set_var('doneurl',$phpgw->link('/admin/categories.php'));
$t->set_var('hidden_vars','');
- $t->set_var('lang_select_parent',lang('Select parent category'));
- $t->set_var('category_list',$c->formated_list('select','all',$cat_parent,'False'));
+ $t->set_var('lang_main',lang('Main category'));
+ $t->set_var('lang_new_main',lang('New main category'));
+ $t->set_var('main_category_list',$c->formated_list('select','mains',$cat_main));
+ $t->set_var('lang_parent',lang('Parent category'));
+ $t->set_var('lang_select_parent',lang('Select parent category'));
+ $t->set_var('category_list',$c->formated_list('select','all',$cat_parent));
$t->set_var('lang_name',lang('Category name'));
$t->set_var('lang_descr',lang('Category description'));
$t->set_var('cat_name',$cat_name);
diff --git a/admin/categories.php b/admin/categories.php
index 727e8d82c2..2de1df23c8 100644
--- a/admin/categories.php
+++ b/admin/categories.php
@@ -82,15 +82,20 @@
$cat_id = $categories[$i]['id'];
$owner = $categories[$i]['owner'];
- $space = " ";
- if ($categories[$i]['parent'] > 0) { $name = $space . $phpgw->strip_html($categories[$i]['name']); }
+ $space = ' ';
+ $level = $categories[$i]['level'];
+
+ if ($level > 0) {
+ $spaceset = str_repeat($space,$level);
+ $name = $spaceset . $phpgw->strip_html($categories[$i]['name']);
+ }
$descr = $phpgw->strip_html($categories[$i]['description']);
- if (! $descr) { $descr = " "; }
+ if (! $descr) { $descr = ' '; }
- if ($categories[$i]['parent'] == 0) {
- $name = "" . $phpgw->strip_html($categories[$i]['name']) . "";
- $descr = "" . $descr . "";
+ if ($level == 0) {
+ $name = '' . $phpgw->strip_html($categories[$i]['name']) . '';
+ $descr = '' . $descr . '';
}
//-------------------------- template declaration for list records ---------------------------
diff --git a/admin/editcategory.php b/admin/editcategory.php
index 49499caefb..8334d642f0 100644
--- a/admin/editcategory.php
+++ b/admin/editcategory.php
@@ -51,12 +51,13 @@
}
if ($errorcount) { $t->set_var('message',$phpgw->common->error_list($error)); }
- if (($submit) && (! $error) && (! $errorcount)) { $t->set_var('message',lang("Category x has been updated !",$cat_name)); }
+ if (($submit) && (! $error) && (! $errorcount)) { $t->set_var('message',lang('Category x has been updated !',$cat_name)); }
if ((! $submit) && (! $error) && (! $errorcount)) { $t->set_var('message',''); }
$cats = $c->return_single($cat_id);
$t->set_var('title_categories',lang('Edit global category'));
+ $t->set_var('lang_parent',lang('Parent category'));
$t->set_var('lang_select_parent',lang('Select parent category'));
$t->set_var('actionurl',$phpgw->link('/admin/editcategory.php'));
$t->set_var('deleteurl',$phpgw->link('/admin/deletecategory.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter"));
@@ -69,12 +70,15 @@
$t->set_var('lang_edit',lang('Edit'));
$t->set_var('lang_delete',lang('Delete'));
+ $cat_main = $cats[0]['main'];
+ $t->set_var('lang_main',lang('Main category'));
+ $t->set_var('lang_new_main',lang('New main category'));
+ $t->set_var('main_category_list',$c->formated_list('select','mains',$cat_main));
$cat_id = $cats[0]['id'];
$cat_parent = $cats[0]['parent'];
-
$t->set_var('cat_name',$phpgw->strip_html($cats[0]['name']));
$t->set_var('cat_description',$phpgw->strip_html($cats[0]['description']));
- $t->set_var('category_list',$c->formated_list('select','all',$cat_parent,'False'));
+ $t->set_var('category_list',$c->formated_list('select','all',$cat_parent));
$t->set_var('edithandle','');
$t->set_var('addhandle','');
@@ -83,4 +87,4 @@
$t->pparse('edithandle','edit');
$phpgw->common->phpgw_footer();
-?>
+?>
\ No newline at end of file
diff --git a/admin/templates/default/category_form.tpl b/admin/templates/default/category_form.tpl
index 691f5dae2c..dca5aa06c6 100644
--- a/admin/templates/default/category_form.tpl
+++ b/admin/templates/default/category_form.tpl
@@ -10,7 +10,11 @@
-
+
\ No newline at end of file
diff --git a/admin/templates/idsociety/category_form.tpl b/admin/templates/idsociety/category_form.tpl
index 691f5dae2c..dca5aa06c6 100644
--- a/admin/templates/idsociety/category_form.tpl
+++ b/admin/templates/idsociety/category_form.tpl
@@ -10,7 +10,11 @@
-
+
\ No newline at end of file
diff --git a/admin/templates/verdilak/category_form.tpl b/admin/templates/verdilak/category_form.tpl
index 691f5dae2c..dca5aa06c6 100644
--- a/admin/templates/verdilak/category_form.tpl
+++ b/admin/templates/verdilak/category_form.tpl
@@ -10,7 +10,11 @@