diff --git a/addressbook/addcategory.php b/addressbook/addcategory.php
index e956ce4b2b..4d388aaf0c 100644
--- a/addressbook/addcategory.php
+++ b/addressbook/addcategory.php
@@ -32,8 +32,10 @@
if (! $error) {
$cat_name = addslashes($cat_name);
$cat_description = addslashes($cat_description);
+ if ($access) { $cat_access = 'private'; }
+ else { $cat_access = 'public'; }
- $c->add($cat_name,$cat_parent,$cat_description,$cat_data);
+ $c->add($cat_name,$cat_parent,$cat_description,$cat_data,$cat_access);
}
}
@@ -49,17 +51,17 @@
$t->set_var('actionurl',$phpgw->link('/addressbook/addcategory.php'));
$t->set_var('hidden_vars','');
$t->set_var('lang_choose',lang('Choose the category'));
- $t->set_var('lang_main_cat',lang('Category'));
$t->set_var('lang_select_parent',lang('Select parent category'));
-
- $t->set_var('main_cat_list',$c->formated_list('select','mains'));
+ $t->set_var('lang_access',lang('Private'));
+ if ($access) { $t->set_var('access', ''); }
+ else { $t->set_var('access', 'set_var('lang_name',lang('Category name'));
$t->set_var('lang_descr',lang('Category description'));
$t->set_var('cat_name',$cat_name);
$t->set_var('cat_description',$cat_description);
$t->set_var('lang_add',lang('Add'));
$t->set_var('lang_reset',lang('Clear Form'));
- $t->set_var('lang_done',lang('Done'));
+ $t->set_var('lang_done',lang('Done'));
$t->set_var('edithandle','');
$t->set_var('addhandle','');
$t->pparse('out','form');
diff --git a/addressbook/categories.php b/addressbook/categories.php
index b0e64c7ae2..00c885aa5f 100644
--- a/addressbook/categories.php
+++ b/addressbook/categories.php
@@ -1,6 +1,6 @@
"addressbook",
- "enable_nextmatchs_class" => True,
- "enable_categories_class" => True);
- include("../header.inc.php");
+ $phpgw_info["flags"] = array('currentapp' => 'addressbook',
+ 'enable_nextmatchs_class' => True);
+
+ include('../header.inc.php');
$t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('addressbook'));
@@ -38,10 +37,10 @@
$t->set_var('user_name',$phpgw_info["user"]["fullname"]);
$t->set_var('title_categories',lang('Categories for'));
$t->set_var('lang_action',lang('Category list'));
- $t->set_var('add_action',$phpgw->link("/addressbook/addcategory.php"));
+ $t->set_var('add_action',$phpgw->link('/addressbook/addcategory.php'));
$t->set_var('lang_add',lang('Add'));
$t->set_var('lang_search',lang('Search'));
- $t->set_var('actionurl',$phpgw->link("/addressbook/categories.php"));
+ $t->set_var('actionurl',$phpgw->link('/addressbook/categories.php'));
$t->set_var('lang_done',lang('Done'));
$t->set_var('doneurl',$phpgw->link('/preferences/'));
@@ -83,17 +82,22 @@
for ($i=0;$inextmatchs->alternate_row_color($tr_color);
$t->set_var(tr_color,$tr_color);
$cat_id = $categories[$i]['id'];
$owner = $categories[$i]['owner'];
- $name = $phpgw->strip_html($categories[$i]['name']);
- $descr = $phpgw->strip_html($categories[$i]['description']);
+ $space = ' ';
+ if ($categories[$i]['parent'] > 0) { $name = $space . $phpgw->strip_html($categories[$i]['name']); }
+
+ $descr = $phpgw->strip_html($categories[$i]['description']);
if (! $descr) { $descr = ' '; }
+ if ($categories[$i]['parent'] == 0) {
+ $name = '' . $phpgw->strip_html($categories[$i]['name']) . '';
+ $descr = '' . $descr . '';
+ }
+
//-------------------------- template declaration for list records ---------------------------
$t->set_var(array('name' => $name,
@@ -105,22 +109,21 @@
if ($categories[$i]["owner"] == $phpgw_info["user"]["account_id"]) {
$t->set_var('edit',$phpgw->link('/addressbook/editcategory.php',"cat_id=$cat_id"));
$t->set_var('lang_edit_entry',lang('Edit'));
- }
+ }
else {
$t->set_var('edit','');
$t->set_var('lang_edit_entry',' ');
- }
+ }
if ($categories[$i]["owner"] == $phpgw_info["user"]["account_id"]) {
$t->set_var('delete',$phpgw->link('/addressbook/deletecategory.php',"cat_id=$cat_id"));
$t->set_var('lang_delete_entry',lang('Delete'));
- }
+ }
else {
$t->set_var('delete','');
$t->set_var('lang_delete_entry',' ');
- }
- $t->parse('list','cat_list',True);
- }
}
+ $t->parse('list','cat_list',True);
+ }
// ---------------------------- end record declaration -----------------------------------------
$t->parse('out','cat_list_t',True);
diff --git a/addressbook/editcategory.php b/addressbook/editcategory.php
index 67436604fb..9de831bdd2 100644
--- a/addressbook/editcategory.php
+++ b/addressbook/editcategory.php
@@ -37,6 +37,7 @@
$cat_name = addslashes($cat_name);
$cat_description = addslashes($cat_description);
+
if (! $error) { $c->edit($cat_id,$cat_parent,$cat_name,$cat_description,$cat_data); }
}
@@ -59,6 +60,9 @@
$t->set_var('lang_name',lang('Category name'));
$t->set_var('lang_descr',lang('Category description'));
$t->set_var('lang_select_parent',lang('Select parent category'));
+ $t->set_var('lang_access',lang('Private'));
+ if ($access) { $t->set_var('access', ''); }
+ else { $t->set_var('access', '{lang_descr}:
|
+
+ {lang_access}: |
+ {access} |
+
diff --git a/admin/addcategory.php b/admin/addcategory.php
index 1b83b8bbc3..b3c87f8b3d 100644
--- a/admin/addcategory.php
+++ b/admin/addcategory.php
@@ -33,8 +33,9 @@
if (! $error) {
$cat_name = addslashes($cat_name);
$cat_description = addslashes($cat_description);
+ $cat_access = 'public';
- $c->add($cat_name,$cat_parent,$cat_description,$cat_data);
+ $c->add($cat_name,$cat_parent,$cat_description,$cat_data,$cat_access);
}
}
diff --git a/admin/categories.php b/admin/categories.php
index 660f8ee0b4..727e8d82c2 100644
--- a/admin/categories.php
+++ b/admin/categories.php
@@ -75,7 +75,7 @@
for ($i=0;$inextmatchs->alternate_row_color($tr_color);
$t->set_var(tr_color,$tr_color);
diff --git a/admin/editcategory.php b/admin/editcategory.php
index ae572eca64..0827b7cdba 100644
--- a/admin/editcategory.php
+++ b/admin/editcategory.php
@@ -43,8 +43,9 @@
$cat_name = addslashes($cat_name);
$cat_description = addslashes($cat_description);
+ $cat_access = 'public';
- if (! $error) { $c->edit($cat_id,$cat_parent,$cat_name,$cat_description,$cat_data); }
+ if (! $error) { $c->edit($cat_id,$cat_parent,$cat_name,$cat_description,$cat_data,$cat_access); }
}
if ($errorcount) { $t->set_var('message',$phpgw->common->error_list($error)); }