added cat_access

This commit is contained in:
bettina 2001-03-27 06:32:13 +00:00
parent 0953acb424
commit 88e2bbd08d
7 changed files with 41 additions and 26 deletions

View File

@ -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,10 +51,10 @@
$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);

View File

@ -1,6 +1,6 @@
<?php
/**************************************************************************\
* phpGroupWare - Inventory *
* phpGroupWare - Addressbook categories *
* http://www.phpgroupware.org *
* Written by Bettina Gille [ceb@phpgroupware.org] *
* ----------------------------------------------- *
@ -11,11 +11,10 @@
\**************************************************************************/
/* $Id$ */
$phpgw_info["flags"] = array("currentapp" => "addressbook",
"enable_nextmatchs_class" => True,
"enable_categories_class" => True);
$phpgw_info["flags"] = array('currentapp' => 'addressbook',
'enable_nextmatchs_class' => True);
include("../header.inc.php");
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']);
$space = '&nbsp;&nbsp;';
if ($categories[$i]['parent'] > 0) { $name = $space . $phpgw->strip_html($categories[$i]['name']); }
$descr = $phpgw->strip_html($categories[$i]['description']);
if (! $descr) { $descr = '&nbsp;'; }
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,
@ -120,7 +124,6 @@
}
$t->parse('list','cat_list',True);
}
}
// ---------------------------- end record declaration -----------------------------------------
$t->parse('out','cat_list_t',True);

View File

@ -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'];

View File

@ -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 -->

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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)); }