From 19eec8895aebb8bc24dd3a7153595b98b88f8d80 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Mon, 21 May 2001 08:18:40 +0000 Subject: [PATCH] Formatting --- addressbook/addfield.php | 5 +++-- addressbook/delete.php | 30 +++++++++++++++------------ addressbook/deletefield.php | 41 ++++++++++++++++++++----------------- addressbook/editfield.php | 31 +++++++++++++++++++--------- 4 files changed, 63 insertions(+), 44 deletions(-) diff --git a/addressbook/addfield.php b/addressbook/addfield.php index 2c3716ae33..1cbb97f1bd 100644 --- a/addressbook/addfield.php +++ b/addressbook/addfield.php @@ -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) diff --git a/addressbook/delete.php b/addressbook/delete.php index 7884b93b0d..bc66c3ac41 100755 --- a/addressbook/delete.php +++ b/addressbook/delete.php @@ -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")); } ?> diff --git a/addressbook/deletefield.php b/addressbook/deletefield.php index bc4d4928d2..a392f55a73 100644 --- a/addressbook/deletefield.php +++ b/addressbook/deletefield.php @@ -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 = "\n" - . "\n" - . "\n" - . "\n" - . "\n"; + $hidden_vars = '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\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 = "" . lang('No') .""; + $nolink = '' . lang('No') . ''; $t->set_var('no',$nolink); - $yeslinkf = $phpgw->link('/addressbook/deletefield.php',"field_id=$field_id&confirm=True"); - $yeslinkf = "
link('/addressbook/deletefield.php') . "\">" + $yeslinkf = $phpgw->link('/addressbook/deletefield.php','field_id=' . $field_id . '&confirm=True'); + $yeslinkf = '' . $hidden_vars - . "" - . "" - . "" - . "
"; + . '' + . '' + . '' + . ''; - $yeslink = "" . lang('Yes') .""; + $yeslink = '' . lang('Yes') . ''; $yeslink = $yeslinkf; $t->set_var('yes',$yeslink); diff --git a/addressbook/editfield.php b/addressbook/editfield.php index ee078ff85c..525ef9a530 100644 --- a/addressbook/editfield.php +++ b/addressbook/editfield.php @@ -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 = "\n" - . "\n" - . "\n" - . "\n"; + $hidden_vars = '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\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) {