mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
added cat_access
This commit is contained in:
parent
0953acb424
commit
88e2bbd08d
@ -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','<input type="hidden" name="cat_id" value="' . $cat_id . '">');
|
||||
$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', '<input type="checkbox" name="private" value="True" checked>'); }
|
||||
else { $t->set_var('access', '<input type="checkbox" name="private" value="True"'); }
|
||||
$t->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');
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Inventory *
|
||||
* phpGroupWare - Addressbook categories *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Bettina Gille [ceb@phpgroupware.org] *
|
||||
* ----------------------------------------------- *
|
||||
@ -10,12 +10,11 @@
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
/* $Id$ */
|
||||
|
||||
$phpgw_info["flags"] = array("currentapp" => "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;$i<count($categories);$i++) {
|
||||
|
||||
if ($categories[$i]['owner'] == $phpgw_info["user"]["account_id"]) {
|
||||
|
||||
$tr_color = $phpgw->nextmatchs->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 = '<font color=FF0000><b>' . $phpgw->strip_html($categories[$i]['name']) . '</b></font>';
|
||||
$descr = '<font color=FF0000><b>' . $descr . '</b></font>';
|
||||
}
|
||||
|
||||
//-------------------------- 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);
|
||||
|
@ -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', '<input type="checkbox" name="private" value="True" checked>'); }
|
||||
else { $t->set_var('access', '<input type="checkbox" name="private" value="True"'); }
|
||||
|
||||
$cat_id = $cats[0]['id'];
|
||||
|
||||
|
@ -21,6 +21,10 @@
|
||||
<td>{lang_descr}:</td>
|
||||
<td colspan=2><textarea name="cat_description" rows="4" cols="50" wrap="virtual">{cat_description}</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{lang_access}:</td>
|
||||
<td colspan=2>{access}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- BEGIN add -->
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
||||
|
||||
for ($i=0;$i<count($categories);$i++) {
|
||||
|
||||
if ($categories[$i]['owner'] == $phpgw_info["user"]["account_id"]) {
|
||||
if ($categories[$i]['owner'] == $phpgw_info["user"]["account_id"] && $categories[$i]['app_name'] == 'phpgw') {
|
||||
|
||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||
$t->set_var(tr_color,$tr_color);
|
||||
|
@ -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)); }
|
||||
|
Loading…
Reference in New Issue
Block a user