mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Formatting
This commit is contained in:
parent
2f3662b936
commit
19eec8895a
@ -11,7 +11,7 @@
|
||||
\**************************************************************************/
|
||||
/* $Id$ */
|
||||
|
||||
$phpgw_info["flags"]["currentapp"] = 'addressbook';
|
||||
$phpgw_info['flags']['currentapp'] = 'addressbook';
|
||||
include('../header.inc.php');
|
||||
|
||||
if(!$phpgw->acl->check('run',1,'admin'))
|
||||
@ -27,7 +27,8 @@
|
||||
$t->set_block('form','add','addhandle');
|
||||
$t->set_block('form','edit','edithandle');
|
||||
|
||||
if ($submit) {
|
||||
if ($submit)
|
||||
{
|
||||
$errorcount = 0;
|
||||
|
||||
if (!$field_name)
|
||||
|
@ -26,8 +26,8 @@
|
||||
}
|
||||
|
||||
$this = CreateObject('phpgwapi.contacts');
|
||||
$fields = $this->read_single_entry($ab_id,array("owner" => "owner"));
|
||||
//$record_owner = $fields[0]["owner"];
|
||||
$fields = $this->read_single_entry($ab_id,array('owner' => 'owner'));
|
||||
//$record_owner = $fields[0]['owner'];
|
||||
|
||||
if (! $this->check_perms($this->grants[$fields[0]['owner']],PHPGW_ACL_DELETE) && $fields[0]['owner'] != $phpgw_info['user']['account_id'])
|
||||
{
|
||||
@ -37,26 +37,30 @@
|
||||
}
|
||||
|
||||
$t = new Template(PHPGW_APP_TPL);
|
||||
$t->set_file(array("delete" => "delete.tpl"));
|
||||
$t->set_file(array('delete' => 'delete.tpl'));
|
||||
|
||||
if ($confirm != "true") {
|
||||
if ($confirm != 'true')
|
||||
{
|
||||
$phpgw->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
|
||||
$t->set_var(lang_sure,lang("Are you sure you want to delete this entry ?"));
|
||||
$t->set_var(no_link,$phpgw->link("/addressbook/index.php",
|
||||
$t->set_var('lang_sure',lang('Are you sure you want to delete this entry ?'));
|
||||
$t->set_var('no_link',$phpgw->link('/addressbook/index.php',
|
||||
"ab_id=$ab_id&order=$order&sort=$sort&filter=$filter&start=$start&query=$query&cat_id=$cat_id"));
|
||||
$t->set_var(lang_no,lang("NO"));
|
||||
$t->set_var(yes_link,$phpgw->link("/addressbook/delete.php",
|
||||
$t->set_var('lang_no',lang('NO'));
|
||||
$t->set_var('yes_link',$phpgw->link('/addressbook/delete.php',
|
||||
"ab_id=$ab_id&confirm=true&order=$order&sort=$sort&filter=$filter&start=$start&query=$query&cat_id=$cat_id"));
|
||||
$t->set_var(lang_yes,lang("YES"));
|
||||
$t->pparse("out","delete");
|
||||
$t->set_var('lang_yes',lang('YES'));
|
||||
$t->pparse('out','delete');
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
} else {
|
||||
$this->account_id=$phpgw_info["user"]["account_id"];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->account_id = $phpgw_info['user']['account_id'];
|
||||
$this->delete($ab_id);
|
||||
@Header("Location: " . $phpgw->link("/addressbook/index.php",
|
||||
|
||||
@Header('Location: ' . $phpgw->link('/addressbook/index.php',
|
||||
"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query&cat_id=$cat_id"));
|
||||
}
|
||||
?>
|
||||
|
@ -2,7 +2,7 @@
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Addressbook *
|
||||
* (http://www.phpgroupware.org) *
|
||||
* Written by Bettina Gille [ceb@phpgroupware.org] *
|
||||
* Written by Bettina Gille [ceb@phpgroupware.org] *
|
||||
* ----------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
@ -11,49 +11,52 @@
|
||||
\**************************************************************************/
|
||||
/* $Id$ */
|
||||
|
||||
if ($confirm) {
|
||||
$phpgw_info["flags"] = array(
|
||||
if ($confirm)
|
||||
{
|
||||
$phpgw_info['flags'] = array(
|
||||
'noheader' => True,
|
||||
'nonavbar' => True
|
||||
);
|
||||
}
|
||||
|
||||
$phpgw_info["flags"]["currentapp"] = 'addressbook';
|
||||
$phpgw_info['flags']['currentapp'] = 'addressbook';
|
||||
include('../header.inc.php');
|
||||
|
||||
if (!$field) {
|
||||
if (!$field)
|
||||
{
|
||||
Header('Location: ' . $phpgw->link('/addressbook/fields.php'));
|
||||
}
|
||||
|
||||
if ($confirm) {
|
||||
if ($confirm)
|
||||
{
|
||||
save_custom_field($field);
|
||||
Header('Location: ' . $phpgw->link('/addressbook/fields.php',"start=$start&query=$query&sort=$sort"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$hidden_vars = "<input type=\"hidden\" name=\"sort\" value=\"$sort\">\n"
|
||||
. "<input type=\"hidden\" name=\"order\" value=\"$order\">\n"
|
||||
. "<input type=\"hidden\" name=\"query\" value=\"$query\">\n"
|
||||
. "<input type=\"hidden\" name=\"start\" value=\"$start\">\n"
|
||||
. "<input type=\"hidden\" name=\"field\" value=\"$field\">\n";
|
||||
$hidden_vars = '<input type="hidden" name="sort" value="' . $sort . '">' . "\n"
|
||||
. '<input type="hidden" name="order" value="' . $order .'">' . "\n"
|
||||
. '<input type="hidden" name="query" value="' . $query .'">' . "\n"
|
||||
. '<input type="hidden" name="start" value="' . $start .'">' . "\n"
|
||||
. '<input type="hidden" name="field" value="' . $field .'">' . "\n";
|
||||
|
||||
$t = new Template(PHPGW_APP_TPL);
|
||||
$t->set_file(array('field_delete' => 'delete_common.tpl'));
|
||||
$t->set_var('messages',lang('Are you sure you want to delete this field?'));
|
||||
|
||||
$nolinkf = $phpgw->link('/addressbook/fields.php',"field_id=$field_id&start=$start&query=$query&sort=$sort");
|
||||
$nolink = "<a href=\"$nolinkf\">" . lang('No') ."</a>";
|
||||
$nolink = '<a href="' . $nolinkf . '">' . lang('No') . '</a>';
|
||||
$t->set_var('no',$nolink);
|
||||
|
||||
$yeslinkf = $phpgw->link('/addressbook/deletefield.php',"field_id=$field_id&confirm=True");
|
||||
$yeslinkf = "<FORM method=\"POST\" name=yesbutton action=\"".$phpgw->link('/addressbook/deletefield.php') . "\">"
|
||||
$yeslinkf = $phpgw->link('/addressbook/deletefield.php','field_id=' . $field_id . '&confirm=True');
|
||||
$yeslinkf = '<form method="POST" name="yesbutton" action="' . $phpgw->link('/addressbook/deletefield.php') . '\">'
|
||||
. $hidden_vars
|
||||
. "<input type=hidden name=field_id value=$field_id>"
|
||||
. "<input type=hidden name=confirm value=True>"
|
||||
. "<input type=submit name=yesbutton value=Yes>"
|
||||
. "</FORM><SCRIPT>document.yesbutton.yesbutton.focus()</SCRIPT>";
|
||||
. '<input type="hidden" name="field_id" value="' . $field_id . '">'
|
||||
. '<input type="hidden" name="confirm" value="True">'
|
||||
. '<input type="submit" name="yesbutton" value="Yes">'
|
||||
. '</form><script>document.yesbutton.yesbutton.focus()</script>';
|
||||
|
||||
$yeslink = "<a href=\"$yeslinkf\">" . lang('Yes') ."</a>";
|
||||
$yeslink = '<a href="' . $yeslinkf . '">' . lang('Yes') . '</a>';
|
||||
$yeslink = $yeslinkf;
|
||||
$t->set_var('yes',$yeslink);
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
\**************************************************************************/
|
||||
/* $Id$ */
|
||||
|
||||
$phpgw_info["flags"]["currentapp"] = 'addressbook';
|
||||
$phpgw_info['flags']['currentapp'] = 'addressbook';
|
||||
include('../header.inc.php');
|
||||
|
||||
if(!$phpgw->acl->check('run',1,'admin'))
|
||||
@ -22,7 +22,8 @@
|
||||
|
||||
}
|
||||
|
||||
if (!$field) {
|
||||
if (!$field)
|
||||
{
|
||||
Header('Location: ' . $phpgw->link('/addressbook/fields.php',"sort=$sort&query=$query&start=$start"));
|
||||
}
|
||||
|
||||
@ -31,12 +32,13 @@
|
||||
$t->set_block('form','add','addhandle');
|
||||
$t->set_block('form','edit','edithandle');
|
||||
|
||||
$hidden_vars = "<input type=\"hidden\" name=\"sort\" value=\"$sort\">\n"
|
||||
. "<input type=\"hidden\" name=\"query\" value=\"$query\">\n"
|
||||
. "<input type=\"hidden\" name=\"start\" value=\"$start\">\n"
|
||||
. "<input type=\"hidden\" name=\"field\" value=\"$field\">\n";
|
||||
$hidden_vars = '<input type="hidden" name="sort" value="' . $sort . '">' . "\n"
|
||||
. '<input type="hidden" name="query" value="' . $query . '">' . "\n"
|
||||
. '<input type="hidden" name="start" value="' . $start . '">' . "\n"
|
||||
. '<input type="hidden" name="field" value="' . $field . '">' . "\n";
|
||||
|
||||
if ($submit) {
|
||||
if ($submit)
|
||||
{
|
||||
$errorcount = 0;
|
||||
if (!$field_name) { $error[$errorcount++] = lang('Please enter a name for that field!'); }
|
||||
|
||||
@ -48,9 +50,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ($errorcount) { $t->set_var('message',$phpgw->common->error_list($error)); }
|
||||
if (($submit) && (! $error) && (! $errorcount)) { $t->set_var('message',lang("Field x has been updated !", $field_name)); }
|
||||
if ((! $submit) && (! $error) && (! $errorcount)) { $t->set_var('message',''); }
|
||||
if ($errorcount)
|
||||
{
|
||||
$t->set_var('message',$phpgw->common->error_list($error));
|
||||
}
|
||||
if (($submit) && (! $error) && (! $errorcount))
|
||||
{
|
||||
$t->set_var('message',lang('Field x has been updated !', $field_name));
|
||||
}
|
||||
if ((! $submit) && (! $error) && (! $errorcount))
|
||||
{
|
||||
$t->set_var('message','');
|
||||
}
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user