From e7a279a1f368120e9e60a981178d05181ec8ffca Mon Sep 17 00:00:00 2001 From: bettina Date: Sun, 1 Apr 2001 02:58:04 +0000 Subject: [PATCH] included files to edit apps categories. each app can use the files in preferences dir --- preferences/addcategory.php | 15 ++++--- preferences/categories.php | 13 ++++-- preferences/deletecategory.php | 10 ++--- preferences/editcategory.php | 13 +++--- .../templates/default/category_form.tpl | 42 ++++++++++--------- preferences/templates/default/delete.tpl | 6 +-- preferences/templates/default/listcats.tpl | 25 +++++------ 7 files changed, 71 insertions(+), 53 deletions(-) diff --git a/preferences/addcategory.php b/preferences/addcategory.php index 33206ed8d2..9394936c74 100644 --- a/preferences/addcategory.php +++ b/preferences/addcategory.php @@ -1,6 +1,6 @@ set_var('message',lang("Category $cat_name has been added !")); } if ((! $submit) && (! $error) && (! $errorcount)) { $t->set_var('message',''); } + + $t->set_var('font',$phpgw_info["theme"]["font"]); $t->set_var('category_list',$c->formated_list('select','all',$cat_parent,'False')); $t->set_var('hidden_vars',$hidden_vars); - $t->set_var('font',$font); $t->set_var('user_name',$phpgw_info["user"]["fullname"]); $t->set_var('doneurl',$phpgw->link('/preferences/categories.php')); $t->set_var('title_categories',lang('Add category for')); $t->set_var('actionurl',$phpgw->link('/preferences/addcategory.php')); - $t->set_var('lang_choose',lang('Choose the category')); + $t->set_var('lang_parent',lang('Parent category')); $t->set_var('lang_select_parent',lang('Select parent category')); $t->set_var('lang_access',lang('Private')); + $t->set_var('lang_data',lang('Data')); 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('lang_name',lang('Name')); + $t->set_var('lang_descr',lang('Description')); $t->set_var('cat_name',$cat_name); $t->set_var('cat_description',$cat_description); + $t->set_var('cat_data',$cat_data); $t->set_var('lang_add',lang('Add')); $t->set_var('lang_reset',lang('Clear Form')); $t->set_var('lang_done',lang('Done')); @@ -81,4 +84,4 @@ $t->pparse('addhandle','add'); $phpgw->common->phpgw_footer(); -?> +?> \ No newline at end of file diff --git a/preferences/categories.php b/preferences/categories.php index 22056ae1bc..19d96615bd 100644 --- a/preferences/categories.php +++ b/preferences/categories.php @@ -31,6 +31,7 @@ . "\n" . "\n"; + $t->set_var('font',$phpgw_info["theme"]["font"]); $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')); @@ -71,6 +72,7 @@ $t->set_var('th_bg',$phpgw_info["theme"][th_bg]); $t->set_var('sort_name',$phpgw->nextmatchs->show_sort_order($sort,'cat_name',$order,'/preferences/categories.php',lang('Name'),"&cats_app=$cats_app")); $t->set_var('sort_description',$phpgw->nextmatchs->show_sort_order($sort,'cat_description',$order,'/preferences/categories.php',lang('Description'),"&cats_app=$cats_app")); + $t->set_var('sort_data',$phpgw->nextmatchs->show_sort_order($sort,'cat_data',$order,'/preferences/categories.php',lang('Data'),"&cats_app=$cats_app")); $t->set_var('lang_app',lang($cats_app)); $t->set_var('lang_edit',lang('Edit')); $t->set_var('lang_delete',lang('Delete')); @@ -90,15 +92,20 @@ $descr = $phpgw->strip_html($categories[$i]['description']); if (! $descr) { $descr = ' '; } + $data = $categories[$i]['data']; + if (! $data) { $data = ' '; } + if ($categories[$i]['parent'] == 0) { $name = '' . $phpgw->strip_html($categories[$i]['name']) . ''; $descr = '' . $descr . ''; + $data = '' . $data . ''; } -//-------------------------- template declaration for list records --------------------------- - +//-------------------------- template declaration for list records --------------------------- + $t->set_var(array('name' => $name, - 'descr' => $descr)); + 'descr' => $descr, + 'data' => $data)); $t->set_var('app_url',$phpgw->link('/' . $phpgw_info['flags']['currentapp'] . '/index.php',"cat_id=$cat_id")); diff --git a/preferences/deletecategory.php b/preferences/deletecategory.php index 1162c20c81..0acdb56b88 100644 --- a/preferences/deletecategory.php +++ b/preferences/deletecategory.php @@ -1,6 +1,6 @@ app_name = $cats_app; if (! $cat_id) { - Header('Location: ' . $phpgw->link('/preferences/categories.php')); + Header('Location: ' . $phpgw->link('/preferences/categories.php',"cats_app=$cats_app")); } if ($confirm) { - $c->delete($cat_id); + $c->delete($cat_id); Header('Location: ' . $phpgw->link('/preferences/categories.php',"cats_app=$cats_app")); } else { @@ -40,7 +40,7 @@ $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('preferences')); $t->set_file(array('category_delete' => 'delete.tpl')); $t->set_var('deleteheader',lang('Are you sure you want to delete this category ?')); - + $t->set_var('font',$phpgw_info["theme"]["font"]); $nolinkf = $phpgw->link('/preferences/categories.php',"cat_id=$cat_id&cats_app=$cats_app"); $nolink = "" . lang('No') .""; $t->set_var("nolink",$nolink); diff --git a/preferences/editcategory.php b/preferences/editcategory.php index 48a8f533e1..f846f4df63 100644 --- a/preferences/editcategory.php +++ b/preferences/editcategory.php @@ -27,8 +27,8 @@ if (! $cat_id) { Header('Location: ' . $phpgw->link('/preferences/categories.php',"sort=$sort&order=$order&query=$query&start=$start" - . "&filter=$filter")); - } + . "&filter=$filter&cats_app=$cats_app")); + } $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('preferences')); $t->set_file(array('form' => 'category_form.tpl')); @@ -67,7 +67,7 @@ $cat_parent = $cats[0]['parent']; $t->set_var('category_list',$c->formated_list('select','all',$cat_parent,'False')); - $t->set_var('font',$font); + $t->set_var('font',$phpgw_info["theme"]["font"]); $t->set_var('user_name',$phpgw_info["user"]["fullname"]); $t->set_var('title_categories',lang('Edit category for')); $t->set_var('lang_action',lang('Edit category')); @@ -75,8 +75,10 @@ $t->set_var('actionurl',$phpgw->link('/preferences/editcategory.php')); $t->set_var('deleteurl',$phpgw->link('/preferences/deletecategory.php')); $t->set_var('hidden_vars',$hidden_vars); - $t->set_var('lang_name',lang('Category name')); - $t->set_var('lang_descr',lang('Category description')); + $t->set_var('lang_parent',lang('Parent category')); + $t->set_var('lang_name',lang('Name')); + $t->set_var('lang_descr',lang('Description')); + $t->set_var('lang_data',lang('Data')); $t->set_var('lang_select_parent',lang('Select parent category')); $t->set_var('lang_access',lang('Private')); if ($cats[0]['access']=='private') { $t->set_var('access', ''); } @@ -86,6 +88,7 @@ $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('cat_data',$cats[0]['data']); $t->set_var('lang_edit',lang('Edit')); $t->set_var('lang_delete',lang('Delete')); diff --git a/preferences/templates/default/category_form.tpl b/preferences/templates/default/category_form.tpl index 0c1f446d90..24535a9adf 100644 --- a/preferences/templates/default/category_form.tpl +++ b/preferences/templates/default/category_form.tpl @@ -3,26 +3,30 @@
- +
{title_categories}: {user_name}{title_categories}: {user_name}
-{message} +{message} - - + + - - + + - - + + - + + + + +
 {lang_parent}:
{lang_name}:{lang_name}:
{lang_descr}:{lang_descr}:
{lang_access}:{lang_data}:
{lang_access}: {access}
@@ -30,15 +34,15 @@ - - + + +
+ {hidden_vars} - - +
{hidden_vars} -
@@ -48,17 +52,17 @@ - + - + +
+ {hidden_vars} -
{hidden_vars} -
+
{hidden_vars} -
diff --git a/preferences/templates/default/delete.tpl b/preferences/templates/default/delete.tpl index 816dd8e170..107108be38 100644 --- a/preferences/templates/default/delete.tpl +++ b/preferences/templates/default/delete.tpl @@ -3,14 +3,14 @@
- + diff --git a/preferences/templates/default/listcats.tpl b/preferences/templates/default/listcats.tpl index e2c61b0293..e82f39e5be 100644 --- a/preferences/templates/default/listcats.tpl +++ b/preferences/templates/default/listcats.tpl @@ -2,10 +2,10 @@
{deleteheader}{deleteheader}
- - + +
{nolink}{yeslink}{nolink}{yeslink}
- + -
{title_categories}: {user_name}{title_categories}: {user_name}
+ {left} @@ -23,31 +23,33 @@ - - - - - + + + + + + + - + - -
{sort_name}{sort_description}{lang_app}{lang_edit}{lang_delete}{sort_name}{sort_description}{sort_data}{lang_app}{lang_edit}{lang_delete}
{name} {descr}{data} {lang_app} {lang_edit_entry}{lang_delete_entry}{lang_delete_entry}
+
{hidden_vars}
+
{hidden_vars} @@ -56,5 +58,4 @@
- - + \ No newline at end of file