mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 17:38:19 +01:00
added level_value to categories_preferences
This commit is contained in:
parent
12e7072673
commit
49f29fb0f5
@ -24,6 +24,7 @@
|
||||
. "<input type=\"hidden\" name=\"start\" value=\"$start\">\n"
|
||||
. "<input type=\"hidden\" name=\"cats_app\" value=\"$cats_app\">\n"
|
||||
. "<input type=\"hidden\" name=\"extra\" value=\"$extra\">\n"
|
||||
. "<input type=\"hidden\" name=\"cats_level\" value=\"$cats_level\">\n"
|
||||
. "<input type=\"hidden\" name=\"filter\" value=\"$filter\">\n";
|
||||
|
||||
|
||||
@ -59,27 +60,34 @@
|
||||
}
|
||||
|
||||
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('actionurl',$phpgw->link('/preferences/addcategory.php'));
|
||||
$t->set_var('title_categories',lang('Add x category for',$cats_app));
|
||||
$t->set_var('doneurl',$phpgw->link('/preferences/categories.php'));
|
||||
$t->set_var('user_name',$phpgw_info['user']['fullname']);
|
||||
$t->set_var('hidden_vars',$hidden_vars);
|
||||
$t->set_var('font',$phpgw_info['theme']['font']);
|
||||
|
||||
$t->set_var('lang_main',lang('Main category'));
|
||||
$t->set_var('lang_new_main',lang('New main category'));
|
||||
$t->set_var('font',$phpgw_info['theme']['font']);
|
||||
$t->set_var('main_category_list',$c->formated_list('select','mains',$cat_main));
|
||||
$t->set_var('category_list',$c->formated_list('select','all',$cat_parent));
|
||||
$t->set_var('hidden_vars',$hidden_vars);
|
||||
$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 x category for",$cats_app));
|
||||
$t->set_var('actionurl',$phpgw->link('/preferences/addcategory.php'));
|
||||
$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'));
|
||||
|
||||
if ($cats_level) {
|
||||
$category_list = $c->formated_list('select','all',$cat_parent);
|
||||
$t->set_var('category_select','<select name="cat_parent"><option value="">' . lang('Select parent category') . '</option>' . $category_list .'</select>');
|
||||
$t->set_var('lang_parent',lang('Parent category'));
|
||||
}
|
||||
else {
|
||||
$t->set_var('lang_parent','');
|
||||
$t->set_var('category_select','');
|
||||
}
|
||||
|
||||
$t->set_var('lang_access',lang('Private'));
|
||||
if ($access) { $t->set_var('access', '<input type="checkbox" name="access" value="True" checked>'); }
|
||||
else { $t->set_var('access', '<input type="checkbox" name="access" value="True">'); }
|
||||
|
||||
$t->set_var('lang_name',lang('Name'));
|
||||
$t->set_var('lang_descr',lang('Description'));
|
||||
$t->set_var('cat_name',$cat_name);
|
||||
@ -103,4 +111,4 @@
|
||||
$t->pparse('addhandle','add');
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
?>
|
@ -30,23 +30,24 @@
|
||||
. "<input type=\"hidden\" name=\"start\" value=\"$start\">\n"
|
||||
. "<input type=\"hidden\" name=\"cats_app\" value=\"$cats_app\">\n"
|
||||
. "<input type=\"hidden\" name=\"extra\" value=\"$extra\">\n"
|
||||
. "<input type=\"hidden\" name=\"cats_level\" value=\"$cats_level\">\n"
|
||||
. "<input type=\"hidden\" name=\"filter\" value=\"$filter\">\n";
|
||||
|
||||
$t->set_var('font',$phpgw_info["theme"]["font"]);
|
||||
$t->set_var('user_name',$phpgw_info["user"]["fullname"]);
|
||||
$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'));
|
||||
$t->set_var('add_action',$phpgw->link('/preferences/addcategory.php',"cats_app=$cats_app&extra=$extra"));
|
||||
$t->set_var('add_action',$phpgw->link('/preferences/addcategory.php',"cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
$t->set_var('lang_add',lang('Add'));
|
||||
$t->set_var('lang_search',lang('Search'));
|
||||
$t->set_var('actionurl',$phpgw->link('/preferences/categories.php',"cats_app=$cats_app&extra=$extra"));
|
||||
$t->set_var('actionurl',$phpgw->link('/preferences/categories.php',"cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
$t->set_var('lang_done',lang('Done'));
|
||||
$t->set_var('doneurl',$phpgw->link('/preferences/'));
|
||||
|
||||
if (! $start) { $start = 0; }
|
||||
|
||||
if($phpgw_info["user"]["preferences"]["common"]["maxmatchs"] && $phpgw_info["user"]["preferences"]["common"]["maxmatchs"] > 0) {
|
||||
$limit = $phpgw_info["user"]["preferences"]["common"]["maxmatchs"];
|
||||
if($phpgw_info['user']['preferences']['common']['maxmatchs'] && $phpgw_info['user']['preferences']['common']['maxmatchs'] > 0) {
|
||||
$limit = $phpgw_info['user']['preferences']['common']['maxmatchs'];
|
||||
}
|
||||
else { $limit = 15; }
|
||||
|
||||
@ -56,26 +57,26 @@
|
||||
|
||||
//--------------------------------- nextmatch --------------------------------------------
|
||||
|
||||
$left = $phpgw->nextmatchs->left('/preferences/categories.php',$start,$c->total_records,"&cats_app=$cats_app&extra=$extra");
|
||||
$right = $phpgw->nextmatchs->right('/preferences/categories.php',$start,$c->total_records,"&cats_app=$cats_app&extra=$extra");
|
||||
$left = $phpgw->nextmatchs->left('/preferences/categories.php',$start,$c->total_records,"&cats_app=$cats_app&extra=$extra&cats_level=$cats_level");
|
||||
$right = $phpgw->nextmatchs->right('/preferences/categories.php',$start,$c->total_records,"&cats_app=$cats_app&extra=$extra&cats_level=$cats_level");
|
||||
$t->set_var('left',$left);
|
||||
$t->set_var('right',$right);
|
||||
|
||||
if ($c->total_records > $limit) {
|
||||
$t->set_var('lang_showing',lang("showing x - x of x",($start + 1),($start + $limit),$c->total_records));
|
||||
$t->set_var('lang_showing',lang('showing x - x of x',($start + 1),($start + $limit),$c->total_records));
|
||||
}
|
||||
else { $t->set_var('lang_showing',lang("showing x",$c->total_records)); }
|
||||
else { $t->set_var('lang_showing',lang('showing x',$c->total_records)); }
|
||||
|
||||
// ------------------------------ end nextmatch ------------------------------------------
|
||||
|
||||
//------------------- list header variable template-declarations -------------------------
|
||||
|
||||
$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&extra=$extra"));
|
||||
$t->set_var('sort_description',$phpgw->nextmatchs->show_sort_order($sort,'cat_description',$order,'/preferences/categories.php',lang('Description'),"&cats_app=$cats_app&extra=$extra"));
|
||||
$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&extra=$extra&cats_level=$cats_level"));
|
||||
$t->set_var('sort_description',$phpgw->nextmatchs->show_sort_order($sort,'cat_description',$order,'/preferences/categories.php',lang('Description'),"&cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
if ($extra) {
|
||||
$t->set_var('sort_data','<td bgcolor="' . $phpgw_info["theme"][th_bg] . '"><font face="' . $phpgw_info["theme"]["font"] . '">'
|
||||
. $phpgw->nextmatchs->show_sort_order($sort,'cat_data',$order,'/preferences/categories.php',lang($extra),"&cats_app=$cats_app&extra=$extra") . '</td>');
|
||||
$t->set_var('sort_data','<td bgcolor="' . $phpgw_info['theme']['th_bg'] . '"><font face="' . $phpgw_info['theme']['font'] . '">'
|
||||
. $phpgw->nextmatchs->show_sort_order($sort,'cat_data',$order,'/preferences/categories.php',lang($extra),"&cats_app=$cats_app&extra=$extra&cats_level=$cats_level") . '</td>');
|
||||
}
|
||||
else { $t->set_var('sort_data',''); }
|
||||
|
||||
@ -88,7 +89,7 @@
|
||||
for ($i=0;$i<count($categories);$i++) {
|
||||
|
||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||
$t->set_var(tr_color,$tr_color);
|
||||
$t->set_var('tr_color',$tr_color);
|
||||
|
||||
$cat_id = $categories[$i]['id'];
|
||||
$owner = $categories[$i]['owner'];
|
||||
@ -106,7 +107,7 @@
|
||||
if ($extra) {
|
||||
$data = $categories[$i]['data'];
|
||||
if (! $data) { $data = ' '; }
|
||||
$t->set_var('td_data','<td><font face=' . $phpgw_info["theme"]["font"] . '>' . $data . '</font></td>');
|
||||
$t->set_var('td_data','<td><font face=' . $phpgw_info['theme']['font'] . '>' . $data . '</font></td>');
|
||||
}
|
||||
else { $t->set_var('td_data',''); }
|
||||
|
||||
@ -124,16 +125,16 @@
|
||||
|
||||
$t->set_var('app_url',$phpgw->link('/' . $phpgw_info['flags']['currentapp'] . '/index.php',"cat_id=$cat_id"));
|
||||
|
||||
if ($categories[$i]["owner"] == $phpgw_info["user"]["account_id"]) {
|
||||
$t->set_var('edit',$phpgw->link('/preferences/editcategory.php',"cat_id=$cat_id&cats_app=$cats_app&extra=$extra"));
|
||||
if ($categories[$i]['owner'] == $phpgw_info['user']['account_id']) {
|
||||
$t->set_var('edit',$phpgw->link('/preferences/editcategory.php',"cat_id=$cat_id&cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
$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('/preferences/deletecategory.php',"cat_id=$cat_id&cats_app=$cats_app&extra=$extra"));
|
||||
if ($categories[$i]['owner'] == $phpgw_info['user']['account_id']) {
|
||||
$t->set_var('delete',$phpgw->link('/preferences/deletecategory.php',"cat_id=$cat_id&cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
$t->set_var('lang_delete_entry',lang('Delete'));
|
||||
}
|
||||
else {
|
||||
|
@ -26,23 +26,24 @@
|
||||
$c->app_name = $cats_app;
|
||||
|
||||
if (! $cat_id) {
|
||||
Header('Location: ' . $phpgw->link('/preferences/categories.php',"cats_app=$cats_app&extra=$extra"));
|
||||
Header('Location: ' . $phpgw->link('/preferences/categories.php',"cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
}
|
||||
|
||||
if ($confirm) {
|
||||
if ($subs) { $c->delete($cat_id,'True'); }
|
||||
else { $c->delete($cat_id); }
|
||||
Header('Location: ' . $phpgw->link('/preferences/categories.php',"cats_app=$cats_app&extra=$extra"));
|
||||
Header('Location: ' . $phpgw->link('/preferences/categories.php',"cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
}
|
||||
else {
|
||||
$hidden_vars = "<input type=\"hidden\" name=\"cat_id\" value=\"$cat_id\">\n"
|
||||
. "<input type=\"hidden\" name=\"cats_app\" value=\"$cats_app\">\n"
|
||||
. "<input type=\"hidden\" name=\"cats_level\" value=\"$cats_level\">\n"
|
||||
. "<input type=\"hidden\" name=\"extra\" value=\"$extra\">\n";
|
||||
|
||||
$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"]);
|
||||
$t->set_var('font',$phpgw_info['theme']['font']);
|
||||
$t->set_var('hidden_vars',$hidden_vars);
|
||||
|
||||
$exists = $c->exists('subs',$cat_name='',$cat_id);
|
||||
@ -55,10 +56,10 @@
|
||||
$t->set_var('subs', '');
|
||||
}
|
||||
|
||||
$t->set_var('nolink',$phpgw->link('/preferences/categories.php',"cat_id=$cat_id&cats_app=$cats_app&extra=$extra"));
|
||||
$t->set_var('nolink',$phpgw->link('/preferences/categories.php',"cat_id=$cat_id&cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
$t->set_var('lang_no',lang('No'));
|
||||
|
||||
$t->set_var('action_url',$phpgw->link('/preferences/deletecategory.php',"cat_id=$cat_id$cats_app=$cats_app&extra=$extra"));
|
||||
$t->set_var('action_url',$phpgw->link('/preferences/deletecategory.php',"cat_id=$cat_id$cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
$t->set_var('lang_yes',lang('Yes'));
|
||||
|
||||
$t->pparse('out','category_delete');
|
||||
|
@ -24,11 +24,12 @@
|
||||
. "<input type=\"hidden\" name=\"cats_app\" value=\"$cats_app\">\n"
|
||||
. "<input type=\"hidden\" name=\"cat_id\" value=\"$cat_id\">\n"
|
||||
. "<input type=\"hidden\" name=\"extra\" value=\"$extra\">\n"
|
||||
. "<input type=\"hidden\" name=\"cats_level\" value=\"$cats_level\">\n"
|
||||
. "<input type=\"hidden\" name=\"filter\" value=\"$filter\">\n";
|
||||
|
||||
if (! $cat_id) {
|
||||
Header('Location: ' . $phpgw->link('/preferences/categories.php',"sort=$sort&order=$order&query=$query&start=$start"
|
||||
. "&filter=$filter&cats_app=$cats_app&extra=$extra"));
|
||||
. "&filter=$filter&cats_app=$cats_app&extra=$extra&cats_level=$cats_level"));
|
||||
}
|
||||
|
||||
$t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('preferences'));
|
||||
@ -65,8 +66,18 @@
|
||||
$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_parent = $cats[0]['parent'];
|
||||
$t->set_var('category_list',$c->formated_list('select','all',$cat_parent));
|
||||
|
||||
if ($cats_level) {
|
||||
$cat_parent = $cats[0]['parent'];
|
||||
$category_list = $c->formated_list('select','all',$cat_parent);
|
||||
$t->set_var('category_select','<select name="cat_parent"><option value="">' . lang('Select parent category') . '</option>' . $category_list .'</select>');
|
||||
$t->set_var('lang_parent',lang('Parent category'));
|
||||
}
|
||||
else {
|
||||
$t->set_var('lang_parent','');
|
||||
$t->set_var('category_select','');
|
||||
}
|
||||
|
||||
$t->set_var('font',$phpgw_info['theme']['font']);
|
||||
$t->set_var('user_name',$phpgw_info['user']['fullname']);
|
||||
$t->set_var('title_categories',lang('Edit x category for',$cats_app));
|
||||
@ -74,10 +85,8 @@
|
||||
$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_parent',lang('Parent category'));
|
||||
$t->set_var('lang_name',lang('Name'));
|
||||
$t->set_var('lang_descr',lang('Description'));
|
||||
$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', '<input type="checkbox" name="access" value="True" checked>'); }
|
||||
else { $t->set_var('access', '<input type="checkbox" name="access" value="True"'); }
|
||||
@ -107,4 +116,4 @@
|
||||
$t->pparse('edithandle','edit');
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
?>
|
@ -15,7 +15,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font face="{font}">{lang_parent}</font></td>
|
||||
<td><font face="{font}"><select name="cat_parent"><option value="">{lang_select_parent}</option>{category_list}</select></font></td>
|
||||
<td><font face="{font}">{category_select}</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font face="{font}">{lang_name}</font></td>
|
||||
|
Loading…
Reference in New Issue
Block a user