cleanup field editing

This commit is contained in:
Miles Lott 2001-04-21 13:21:08 +00:00
parent 7ef9e171fb
commit 927ddfdd2b
6 changed files with 23 additions and 11 deletions

View File

@ -29,6 +29,7 @@
$field = ereg_replace(' ','_',$field);
$ofield = ereg_replace(' ','_',$ofield);
$t->set_var('title',lang('addressbook').' '.lang('custom fields'));
$t->set_var('font',$font);
$t->set_var('note',$note);
$t->set_var('lang_add',lang('Add'));

View File

@ -30,7 +30,8 @@
"row" => "custom_field_list_row.tpl"
));
$phpgw->template->set_var("message",$message);
$phpgw->template->set_var("title",lang('addressbook').' '.lang('custom fields'));
$phpgw->template->set_var("message",'');
$phpgw->template->set_var("sort_name",lang("Name"));
$phpgw->template->set_var("lang_edit",lang("Edit"));
$phpgw->template->set_var("lang_delete",lang("Delete"));
@ -38,20 +39,26 @@
$phpgw->preferences->read_repository();
while (list($col,$descr) = each($phpgw_info["user"]["preferences"]["addressbook"])) {
if ( substr($col,0,6) == 'extra_' ) {
while (list($col,$descr) = each($phpgw_info["user"]["preferences"]["addressbook"]))
{
if ( substr($col,0,6) == 'extra_' )
{
$fields[$i] = ereg_replace('extra_','',$col);
$fields[$i] = ereg_replace(' ','_',$fields[$i]);
echo "<br>".$i.": '".$fields[$i]."'";
} else {
//echo "<br>".$i.": '".$fields[$i]."'";
}
else
{
$fields[$i] = '';
}
$i++;
}
reset($fields);
for($i=0;$i<count($fields);$i++) {
if ($fields[$i]) {
for($i=0;$i<count($fields);$i++)
{
if ($fields[$i])
{
$found = True;
$phpgw->nextmatchs->template_alternate_row_color(&$phpgw->template);
@ -70,7 +77,8 @@
$phpgw->template->parse("rows","row",True);
}
}
if (!$found) {
if (!$found)
{
$phpgw->nextmatchs->template_alternate_row_color(&$phpgw->template);
$phpgw->template->set_var("field_name",'&nbsp;');
$phpgw->template->set_var("field_edit",'&nbsp;');
@ -82,7 +90,6 @@
. $phpgw->link("/addressbook/field_edit.php","method=add")
. '">' . lang("Add") . '</a>');
$phpgw->template->pparse("out","row");
$phpgw->template->pparse("out","body");
$phpgw->common->phpgw_footer();
?>

View File

@ -1,4 +1,5 @@
<br>
<center>{title}</center><p>
<center>{message}</center><p>
<table border="0" align="center" width="60%">
<tr bgcolor="{th_bg}">

View File

@ -1,6 +1,7 @@
<!-- BEGIN form -->
<br><br>
<center>
{title}<br>
{message}<br>
<form action="{actionurl}" method="POST">
{hidden_vars}

View File

@ -1,4 +1,5 @@
<br>
<center>{title}</center><p>
<center>{message}</center><p>
<table border="0" align="center" width="60%">
<tr bgcolor="{th_bg}">

View File

@ -1,6 +1,7 @@
<!-- BEGIN form -->
<br><br>
<center>
{title}<br>
{message}<br>
<form action="{actionurl}" method="POST">
{hidden_vars}