Better layout. Copyright notes. Mailto links. (2. run)
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 7 Dec 2008 10:29:28 +0000 (10:29 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 7 Dec 2008 10:29:28 +0000 (10:29 +0000)
12 files changed:
CHANGELOG.txt
admin/company_preferences.php
admin/display_prefs.php
admin/gl_setup.php
admin/users.php
includes/ui/ui_controls.inc
includes/ui/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

index 8c9815277cc87bbc1334e85dda1558727a575ce6..b8aecd5d5d9b7dec2ec15ba09fde93de0d678410 100644 (file)
@@ -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
index 96efb030b2829913bda056ddacb55cbf1c680009..5f2b8d6bf61cf6aa147cacdb02284e96a9d92a0b 100644 (file)
@@ -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("<a href='Mailto:".$_POST['email']."'>" . _("E-mail Address:") . "</a>", '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)") . ":", "<input type='file' id='pic' name='pic'>");
 
@@ -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);
 
index d23363e161ad6fe14db490a09275faf32839b344..b603172795d022847c84f397029042805b1595fe 100644 (file)
@@ -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);
 
index e457da5cbb31d79089330ee25e9d3b0e4a2fa689..6a9ad9cd2e995e1088e76c9081882539e64097a3 100644 (file)
@@ -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);
 
index 941129fb817c0fd51a80f48a77bb1eca0bdd0db1..57e4e405e7341418aa7f04652dc3b6858b15e8fc 100644 (file)
@@ -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("<a href=mailto:" . $myrow["email"]. ">" . $myrow["email"]. "</a>");
+       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("<a href='Mailto:".$_POST['email']."'>" . _("Email Address:") . "</a>", 'email', 50);
+email_row_ex(_("Email Address:"), 'email', 50);
 
 security_headings_list_row(_("Access Level:"), 'Access', null); 
 
index 5d9f6113e5969273078d5bf44684fb69adfdf4c3..6b8f02d6ebd38b464e85ee30877973505bef9634 100644 (file)
@@ -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 "<tr valign=top><td>\n"; // outer table
+}
+
+function table_section($number=1)
+{
+       if ($number == 2)
+       {
+               echo "</table>\n";
+               echo "</td><td  class='tableseparator'>\n"; // outer table
+       }
+       echo "<table>\n";
+}      
+
+function end_outer_table($breaks=0)
+{
+       echo "</table>\n";
+       echo "</td></tr>\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 "<tr><td colspan=2 class='tableheader'>$msg</td><tr>\n";
+       echo "<tr><td colspan=$colspan class='tableheader'>$msg</td></tr>\n";
 }
 
 function table_header($labels)
index aca6e1deab9db00d1132d20f1178b70617598873..588f867c31ddd381387a3c6a90478d6457a6cc24 100644 (file)
@@ -312,6 +312,11 @@ function label_cell($label, $params="", $id=null)
        return $label;
 }
 
+function email_cell($label, $params="", $id=null)
+{
+       label_cell("<a href='mailto:$label'>$label</a>", $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 "</tr>\n";
 }
 
+//-----------------------------------------------------------------------------------
+function email_row($label, $name, $value, $size, $max, $title=null, $params="", $post_label="")
+{
+       text_row("<a href='Mailto:".$_POST[$name]."'>$label</a>", $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("<a href='Mailto:".$_POST[$name]."'>$label</a>", $name, $size, $max, $title, $value, $params, $post_label);
+}
+
 //-----------------------------------------------------------------------------------
 
 function date_cells($label, $name, $title = null, $init=null, $inc_days=0, 
index 873e6bba66a6b3e3456212e09d213ba5c993b039..b39a6062fc3a388f2c86fad13f1a39e0cfb4bfc9 100644 (file)
@@ -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("<a href='Mailto:".$_POST['email']."'>" . _("E-mail:") . "</a>", 'email', 30);
+email_row_ex(_("E-mail:"), 'email', 30);
 
 end_table(1);
 submit_add_or_update_center($selected_id == -1, '', true);
index ecf97311fe0ae6663196eb96eedc7149ec79b72f..fb2a05948f277a9ee449ffc997bc455667784b6e 100644 (file)
@@ -166,11 +166,9 @@ else
        hidden('supplier_id', get_post('supplier_id'));
 }
 
-br();
-start_table("$table_style2 width=65%", 5);
-echo "<tr valign=top><td>"; // outer table
+start_outer_table($table_style2, 5);
 
-echo "<table>";
+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("<a href='Mailto:".$_POST['email']."'>" . _("E-mail:") . "</a>", '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 "</table>";
-
-echo "</td><td  class='tableseparator'>"; // outer table
-
-echo"<table>";
+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) 
index 5b4ea58594a927dd1a19f0cf00ca9bf095a2f4f4..7401941b87d77b2950901379c3ab66cf0531c4bb 100644 (file)
@@ -209,7 +209,7 @@ if ($num_branches)
                label_cell($myrow["description"]);
                label_cell($myrow["phone"]);
                label_cell($myrow["fax"]);
-               label_cell("<a href=mailto:" . $myrow["email"]. ">" . $myrow["email"]. "</a>");
+               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 "<br>";
-start_table("$table_style2 width=70%", 5);
-echo "<tr valign=top><td>"; // outer table
-
-echo "<table>";
+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("<a href='Mailto:".$_POST['email']."'>" . _("E-mail:") . "</a>", '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 "</table>";
-
-echo "</td><td  class='tableseparator'>"; // outer table
-
-echo"<table>";
+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);
 
index 415aa584a9f5224d70864b2d49bd6de170a562f4..5543595908b05c8d7db201a11fa047b1866784f3 100644 (file)
@@ -198,11 +198,9 @@ else
        hidden('customer_id');
 }
 
-br();
-start_table($table_style2, 5);
-echo "<tr valign=top><td>"; // outer table     
+start_outer_table($table_style2, 5);
 
-echo "<table>";
+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("<a href='Mailto:".$_POST['email']."'>" . _("E-mail:") . "</a>", '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 "</td><td class='tableseparator'>"; // outer table
-
-echo"<table>";
+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)
 {
index 6002f7d44bcf6b5810e8361cce14ff8344768460..aef3ad25ae08772cd46f3bdb4c10b8ca8c025036 100644 (file)
@@ -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("<a href=mailto:" . $myrow["salesman_email"]. ">" . $myrow["salesman_email"]. "</a>");
+       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("<a href='Mailto:".$_POST['salesman_email']."'>" . _("E-mail:") . "</a>", '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');