From 4e31fd74b18825d8ac35f4a38b96ef33a08c2025 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Sun, 7 Dec 2008 10:29:28 +0000 Subject: [PATCH] Better layout. Copyright notes. Mailto links. (2. run) --- CHANGELOG.txt | 14 ++++++++++++++ admin/company_preferences.php | 22 ++++++++++++++-------- admin/display_prefs.php | 20 +++++++++++--------- admin/gl_setup.php | 11 +++++++---- admin/users.php | 4 ++-- includes/ui/ui_controls.inc | 28 ++++++++++++++++++++++++++-- includes/ui/ui_input.inc | 16 ++++++++++++++++ inventory/manage/locations.php | 2 +- purchasing/manage/suppliers.php | 20 ++++++-------------- sales/manage/customer_branches.php | 25 ++++++++----------------- sales/manage/customers.php | 18 ++++++------------ sales/manage/sales_people.php | 4 ++-- 12 files changed, 113 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8c981527..b8aecd5d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,20 @@ Legend: ! -> Note $ -> Affected files +07-Dec-2008 Joe Hunt +! Better layout. Copyright notes. Mailto links. +$ /admin/company_preferences.php + /admin/display_prefs.php + /gl_setup.php + /admin/users.php + /includes/ui_controls.inc + /includes/ui_input.inc + /inventory/manage/locations.php + /purchasing/manage/suppliers.php + /sales/manage/customer_branches.php + /sales/manage/customers.php + /sales/manage/sales_people.php + 05-Dec-2008 Joe Hunt + New fields in suppliers, phone, fax, vat no, contact and credit limit $ /purchasing/suppliers.php diff --git a/admin/company_preferences.php b/admin/company_preferences.php index 96efb030..5f2b8d6b 100644 --- a/admin/company_preferences.php +++ b/admin/company_preferences.php @@ -124,23 +124,28 @@ $_POST['custom3_value'] = $myrow["custom3_value"]; $_POST['curr_default'] = $myrow["curr_default"]; $_POST['f_year'] = $myrow["f_year"]; -start_table($table_style2); +start_outer_table($table_style2); + +table_section(1); text_row_ex(_("Name (to appear on reports):"), 'coy_name', 42, 50); +textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 35, 5); + +text_row_ex(_("Phone Number:"), 'phone', 25, 55); +text_row_ex(_("Fax Number:"), 'fax', 25); +email_row_ex(_("Email Address:"), 'email', 25, 55); + text_row_ex(_("Official Company Number:"), 'coy_no', 25); -text_row_ex(_("Tax Authority Reference:"), 'gst_no', 25); +text_row_ex(_("GSTNo:"), 'gst_no', 25); text_row_ex(_("Tax Periods:"), 'tax_prd', 10, 10, '', null, null, _('Months.')); text_row_ex(_("Tax Last Period:"), 'tax_last', 10, 10, '', null, null, _('Months back.')); currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']); -fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']); -textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 35, 5); +table_section(2); -text_row_ex(_("Telephone Number:"), 'phone', 25, 55); -text_row_ex(_("Facsimile Number:"), 'fax', 25); -text_row_ex("" . _("E-mail Address:") . "", 'email', 25, 55); +fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']); label_row(_("Company Logo:"), $_POST['coy_logo']); label_row(_("New Company Logo (.jpg)") . ":", ""); @@ -173,7 +178,8 @@ text_cells(null, 'custom3_name', $_POST['custom3_name'], 25, 25); text_cells(null, 'custom3_value', $_POST['custom3_value'], 30, 30); end_row(); -end_table(1); +end_outer_table(1); + hidden('coy_logo', $_POST['coy_logo']); submit_center('update', _("Update"), true, '', true); diff --git a/admin/display_prefs.php b/admin/display_prefs.php index d23363e1..b6031727 100644 --- a/admin/display_prefs.php +++ b/admin/display_prefs.php @@ -52,8 +52,10 @@ if (isset($_POST['setprefs'])) } start_form(); -start_table($table_style2); +start_outer_table($table_style2); + +table_section(1); table_section_title(_("Decimal Places")); text_row_ex(_("Prices/Amounts:"), 'prices', 5, 5, '', user_price_dec()); @@ -79,7 +81,14 @@ decseps_list_row(_("Decimal Separator:"), "dec_sep", user_dec_sep()); /* The array $decseps is set up in config.php for modifications possible separators can be added by modifying the array definition by editing that file */ +if (!isset($_POST['language'])) + $_POST['language'] = $_SESSION['language']->code; + +table_section_title(_("Language")); + +languages_list_row(_("Language:"), 'language', $_POST['language']); +table_section(2); table_section_title(_("Miscellaneous")); check_row(_("Show hints for new users:"), 'show_hints', user_hints()); @@ -112,14 +121,7 @@ check_row(_("Use icons instead of text links:"), 'graphic_links', user_graphic_l text_row_ex(_("Query page size:"), 'query_size', 5, 5, '', user_query_size()); -table_section_title(_("Language")); - -if (!isset($_POST['language'])) - $_POST['language'] = $_SESSION['language']->code; - -languages_list_row(_("Language:"), 'language', $_POST['language']); - -end_table(1); +end_outer_table(1); submit_center('setprefs', _("Update"), true, '', true); diff --git a/admin/gl_setup.php b/admin/gl_setup.php index e457da5c..6a9ad9cd 100644 --- a/admin/gl_setup.php +++ b/admin/gl_setup.php @@ -78,7 +78,10 @@ if (isset($_POST['submit']) && can_process()) //------------------------------------------------------------------------------------------------- start_form(); -start_table("class='tablestyle'"); + +start_outer_table("class='tablestyle'"); + +table_section(1); $myrow = get_company_prefs(); @@ -156,14 +159,14 @@ percent_row(_("Invoice Over-Charge Allowance:"), 'po_over_charge'); // Not used in FA2.0. //gl_all_accounts_list_row(_("Goods Received Clearing Account:"), 'grn_act', $_POST['grn_act']); +//--------------- +table_section(2); table_section_title(_("Suppliers and Purchasing Defaults")); gl_all_accounts_list_row(_("Payable Account:"), 'creditors_act', $_POST['creditors_act']); gl_all_accounts_list_row(_("Purchase Discount Account:"), 'pyt_discount_act', $_POST['pyt_discount_act']); -//--------------- - table_section_title(_("Inventory")); check_row(_("Allow Negative Inventory:"), 'allow_negative_stock', null); @@ -193,7 +196,7 @@ text_row(_("Dimension Required By After:"), 'default_dim_required', $_POST['defa //---------------- -end_table(1); +end_outer_table(1); submit_center('submit', _("Update"), true, '', true); diff --git a/admin/users.php b/admin/users.php index 941129fb..57e4e405 100644 --- a/admin/users.php +++ b/admin/users.php @@ -125,7 +125,7 @@ while ($myrow = db_fetch($result)) label_cell($myrow["user_id"]); label_cell($myrow["real_name"]); label_cell($myrow["phone"]); - label_cell("" . $myrow["email"]. ""); + email_cell($myrow["email"]); label_cell($last_visit_date, "nowrap"); label_cell($security_headings[$myrow["full_access"]]); edit_button_cell("Edit".$myrow["user_id"], _("Edit")); @@ -190,7 +190,7 @@ text_row_ex(_("Full Name").":", 'real_name', 50); text_row_ex(_("Telephone No.:"), 'phone', 30); -text_row_ex("" . _("Email Address:") . "", 'email', 50); +email_row_ex(_("Email Address:"), 'email', 50); security_headings_list_row(_("Access Level:"), 'Access', null); diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index 5d9f6113..6b8f02d6 100644 --- a/includes/ui/ui_controls.inc +++ b/includes/ui/ui_controls.inc @@ -56,6 +56,30 @@ function end_table($breaks=0) br($breaks); } +function start_outer_table($extra="", $padding='2', $spacing='0') +{ + br(); + start_table($extra, $padding, $spacing); + echo "\n"; // outer table +} + +function table_section($number=1) +{ + if ($number == 2) + { + echo "\n"; + echo "\n"; // outer table + } + echo "\n"; +} + +function end_outer_table($breaks=0) +{ + echo "
\n"; + echo "\n"; + end_table($breaks); +} + function meta_forward($forward_to, $params="") { global $Ajax; @@ -172,9 +196,9 @@ function alt_table_row_color(&$k) } } -function table_section_title($msg) +function table_section_title($msg, $colspan=2) { - echo "$msg\n"; + echo "$msg\n"; } function table_header($labels) diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index aca6e1de..588f867c 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -312,6 +312,11 @@ function label_cell($label, $params="", $id=null) return $label; } +function email_cell($label, $params="", $id=null) +{ + label_cell("$label", $params, $id); +} + function amount_cell($label, $bold=false, $params="", $id=null) { if ($bold) @@ -428,6 +433,17 @@ function text_row_ex($label, $name, $size, $max=null, $title=null, $value=null, echo "\n"; } +//----------------------------------------------------------------------------------- +function email_row($label, $name, $value, $size, $max, $title=null, $params="", $post_label="") +{ + text_row("$label", $name, $value, $size, $max, $title, $params, $post_label); +} + +function email_row_ex($label, $name, $size, $max=null, $title=null, $value=null, $params=null, $post_label=null) +{ + text_row_ex("$label", $name, $size, $max, $title, $value, $params, $post_label); +} + //----------------------------------------------------------------------------------- function date_cells($label, $name, $title = null, $init=null, $inc_days=0, diff --git a/inventory/manage/locations.php b/inventory/manage/locations.php index 873e6bba..b39a6062 100644 --- a/inventory/manage/locations.php +++ b/inventory/manage/locations.php @@ -184,7 +184,7 @@ textarea_row(_("Address:"), 'delivery_address', null, 35, 5); text_row_ex(_("Telephone No:"), 'phone', 30, 30); text_row_ex(_("Facsimile No:"), 'fax', 30, 30); -text_row_ex("" . _("E-mail:") . "", 'email', 30); +email_row_ex(_("E-mail:"), 'email', 30); end_table(1); submit_add_or_update_center($selected_id == -1, '', true); diff --git a/purchasing/manage/suppliers.php b/purchasing/manage/suppliers.php index ecf97311..fb2a0594 100644 --- a/purchasing/manage/suppliers.php +++ b/purchasing/manage/suppliers.php @@ -166,11 +166,9 @@ else hidden('supplier_id', get_post('supplier_id')); } -br(); -start_table("$table_style2 width=65%", 5); -echo ""; // outer table +start_outer_table($table_style2, 5); -echo ""; +table_section(1); if (!$new_supplier) { @@ -217,22 +215,18 @@ else table_section_title(_("Name and Contact")); text_row(_("Supplier Name:"), 'supp_name', null, 42, 40); -text_row(_("Contact:"), 'contact', null, 42, 40); +text_row(_("Contact Person:"), 'contact', null, 42, 40); text_row(_("Phone Number:"), 'phone', null, 42, 40); text_row(_("Fax Number:"), 'fax', null, 42, 40); -text_row("" . _("E-mail:") . "", 'email', null, 35, 55); +email_row(_("E-mail:"), 'email', null, 35, 55); table_section_title(_("Addresses")); textarea_row(_("Mailing Address:"), 'address', null, 35, 5); textarea_row(_("Physical Address:"), 'supp_address', null, 35, 5); -echo "
"; - -echo ""; // outer table - -echo""; +table_section(2); table_section_title(_("Purchasing")); text_row(_("GSTNo:"), 'gst_no', null, 42, 40); @@ -274,9 +268,7 @@ if ($dim < 1) if ($dim < 2) hidden('dimension2_id', 0); -end_table(); - -end_table(1); +end_outer_table(1); div_start('controls'); if (!$new_supplier) diff --git a/sales/manage/customer_branches.php b/sales/manage/customer_branches.php index 5b4ea585..7401941b 100644 --- a/sales/manage/customer_branches.php +++ b/sales/manage/customer_branches.php @@ -209,7 +209,7 @@ if ($num_branches) label_cell($myrow["description"]); label_cell($myrow["phone"]); label_cell($myrow["fax"]); - label_cell("" . $myrow["email"]. ""); + email_cell($myrow["email"]); label_cell($myrow["tax_group_name"]); if (count($_SESSION['Context'])) edit_button_cell("Select".$myrow["branch_code"], _("Select")); @@ -223,12 +223,9 @@ if ($num_branches) else display_note(_("The selected customer does not have any branches. Please create at least one branch.")); -echo "
"; -start_table("$table_style2 width=70%", 5); -echo "
"; // outer table - -echo ""; +start_outer_table($table_style2, 5); +table_section(1); $_POST['email'] = ""; if ($selected_id != -1) @@ -301,7 +298,7 @@ text_row(_("Contact Person:"), 'contact_name', null, 35, 40); text_row(_("Phone Number:"), 'phone', null, 20, 20); text_row(_("Fax Number:"), 'fax', null, 20, 20); -text_row("" . _("E-mail:") . "", 'email', null, 35, 55); +email_row(_("E-mail:"), 'email', null, 35, 55); table_section_title(_("Sales")); @@ -309,6 +306,8 @@ sales_persons_list_row( _("Sales Person:"), 'salesman', null); sales_areas_list_row( _("Sales Area:"), 'area', null); +sales_groups_list_row(_("Sales Group:"), 'group_no', null, true); + locations_list_row(_("Default Inventory Location:"), 'default_location', null); shippers_list_row(_("Default Shipping Company:"), 'default_ship_via', null); @@ -317,13 +316,7 @@ tax_groups_list_row(_("Tax Group:"), 'tax_group_id', null); yesno_list_row(_("Disable this Branch:"), 'disable_trans', null); -sales_groups_list_row(_("Sales Group:"), 'group_no', null, true); - -echo "
"; - -echo "
"; // outer table - -echo""; +table_section(2); table_section_title(_("GL Accounts")); @@ -342,9 +335,7 @@ textarea_row(_("Mailing Address:"), 'br_post_address', null, 35, 5); textarea_row(_("Billing Address:"), 'br_address', null, 35, 5); -end_table(); - -end_table(1); // outer table +end_outer_table(1); submit_add_or_update_center($selected_id == -1, '', true); diff --git a/sales/manage/customers.php b/sales/manage/customers.php index 415aa584..55435959 100644 --- a/sales/manage/customers.php +++ b/sales/manage/customers.php @@ -198,11 +198,9 @@ else hidden('customer_id'); } -br(); -start_table($table_style2, 5); -echo "
"; // outer table +start_outer_table($table_style2, 5); -echo ""; +table_section(1); if ($new_customer) { @@ -245,11 +243,10 @@ table_section_title(_("Name and Address")); text_row(_("Customer Name:"), 'CustName', $_POST['CustName'], 40, 40); textarea_row(_("Address:"), 'address', $_POST['address'], 35, 5); -text_row("" . _("E-mail:") . "", 'email', null, 40, 40); +email_row(_("E-mail:"), 'email', null, 40, 40); text_row(_("GSTNo:"), 'tax_id', null, 40, 40); -// Sherifoz 23.09.03 currency can't be changed if editing if ($new_customer) { currencies_list_row(_("Customer's Currency:"), 'curr_code', $_POST['curr_code']); @@ -259,11 +256,8 @@ else label_row(_("Customer's Currency:"), $_POST['curr_code']); hidden('curr_code', $_POST['curr_code']); } -end_table(); -echo "
"; // outer table - -echo""; +table_section(2); table_section_title(_("Sales")); @@ -292,9 +286,9 @@ if (!$new_customer) { "debtor_no=".$_POST['customer_id']); end_row(); } -end_table(); -end_table(1); // outer table +end_outer_table(1); + div_start('controls'); if ($new_customer) { diff --git a/sales/manage/sales_people.php b/sales/manage/sales_people.php index 6002f7d4..aef3ad25 100644 --- a/sales/manage/sales_people.php +++ b/sales/manage/sales_people.php @@ -127,7 +127,7 @@ while ($myrow = db_fetch($result)) label_cell($myrow["salesman_name"]); label_cell($myrow["salesman_phone"]); label_cell($myrow["salesman_fax"]); - label_cell("" . $myrow["salesman_email"]. ""); + email_cell($myrow["salesman_email"]); label_cell(percent_format($myrow["provision"])." %", "nowrap align=right"); amount_cell($myrow["break_pt"]); label_cell(percent_format($myrow["provision2"])." %", "nowrap align=right"); @@ -176,7 +176,7 @@ start_table("$table_style2 width=60%"); text_row_ex(_("Sales person name:"), 'salesman_name', 30); text_row_ex(_("Telephone number:"), 'salesman_phone', 20); text_row_ex(_("Fax number:"), 'salesman_fax', 20); -text_row_ex("" . _("E-mail:") . "", 'salesman_email', 40); +email_row_ex(_("E-mail:"), 'salesman_email', 40); percent_row(_("Provision").':', 'provision'); amount_row(_("Break Pt.:"), 'break_pt'); percent_row(_("Provision")." 2:", 'provision2'); -- 2.30.2