Standard checkbox helper use.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 15 Jan 2009 14:54:33 +0000 (14:54 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 15 Jan 2009 14:54:33 +0000 (14:54 +0000)
sales/inquiry/sales_orders_view.php

index b174688deba3d91dbb64b41af46f7a2f4abfc9b6..abe17b41b17b94c00d45f0c25895efbf2783ea08 100644 (file)
@@ -115,15 +115,13 @@ function delivery_link($row)
 function tmpl_checkbox($row)
 {
        $name = "chgtpl" .$row['order_no'];
-       $value = $row['type'] ? ' checked' : '';
-
- return "<input $value type='checkbox' name='$name' value='1'"
-     ." onclick='JsHttpRequest.request(\"_{$name}_update\", this.form);'"
-     ." title='"._('Set this order as a template for direct deliveries/invoices')
-     ."' >"
-// add also old checkbox name+value for check after 'Update'
-        ."<input name='last[".$row['order_no']."]' type='hidden' value='"
-        .($row['type'] ? 1 : 0)."'>\n";
+       $value = $row['type'] ? 1:0;
+
+// save also in hidden field for testing during 'Update'
+
+ return checkbox(null, $name, $value, true,
+       _('Set this order as a template for direct deliveries/invoices'))
+       . hidden('last['.$row['order_no'].']', $value, false);
 }
 //---------------------------------------------------------------------------------------------
 // Update db record if respective checkbox value has changed.