Added 2 functions in ui_input.inc, button and button_cell
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 18 Feb 2008 00:47:18 +0000 (00:47 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 18 Feb 2008 00:47:18 +0000 (00:47 +0000)
CHANGELOG.txt
includes/ui/ui_input.inc
reporting/includes/reporting.inc

index 9068c38e49bb049f196224da9c9dab64579e9050..7a0d12df920377b7cf794d26b96e5f6a5201fc59 100644 (file)
@@ -29,6 +29,8 @@ $ /reporting/includes/reporting.inc
 $ /sql/alter.sql
   /taxes/tax_types.php
   /taxes/db/tax_types_db.inc
++ Added 2 functions in ui_input.inc, button and button_cell
+  /includes/ui/ui_input.inc
 
 11-Feb-2008 Joe Hunt
 + Added file, update_db.php, for updating company databases from an SQL script.
index fdb55200bd2ef899ed913fb162402feba502e75f..7e122c3bb2abaad27e697e84ca33fb3e5781bf2b 100644 (file)
@@ -87,6 +87,20 @@ function submit_row($name, $value, $right=true, $extra="")
        submit_cells($name, $value, $extra);
        echo "</tr>\n";
 }
+//---------------------------------------------------------------------------------
+
+function button($name, $value, $onclick)
+{
+       echo "<input type=\"button\" class=\"inputsubmit\" name=\"$name\" value=\"$value\" onclick=\"$onclick\" />\n";
+}
+
+function button_cell($name, $value, $onclick)
+{
+       echo "<td>";
+       button($name, $value, $onclick);
+       echo "</td>\n";
+}
+
 //-----------------------------------------------------------------------------------
 
 function check_value($name)
index c3fbc5bdd712cabd769fc6746ace383ae2bdf1c3..183b59740c76056ab4fc6a8c3944369b28ae20e1 100644 (file)
@@ -75,8 +75,9 @@ function printDocument(docno) {
 // Ex. label_cell(print_document_link($myrow['order_no'], _("Print")));
 // or display_note(print_document_link($order_no, _("Print this order")));
 // or if a button
-// echo "<input type='button' name='button' value='"._("Print this order")."' onclick=\"".
-//             print_document_link($order_no, "", false)."\" class='inputsubmit' />\n";
+// button("button", _("Print this order"), print_document_link($order_no, "", false))";
+// or if a button inside a TD
+// button_cell("button", _("Print this order"), print_document_link($order_no, "", false))";
 
 function print_document_link($doc_no, $link_text, $link=true)
 {