X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=1889962d28b56e30ee65f724de901a523e3a73c0;hb=5a96d27422f2eb4b45738ad54894a032e0495cb4;hp=9717a95ca34c151ac41b1f6211fd0244cbea4c4e;hpb=c7d6d081bc0512018f8bfc6851e698f752b042b7;p=fa-stable.git
diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc
index 9717a95c..1889962d 100644
--- a/includes/ui/ui_input.inc
+++ b/includes/ui/ui_input.inc
@@ -247,17 +247,24 @@ function submit_return($name, $value, $title=false)
}
}
-function submit_js_confirm($name, $msg) {
- add_js_source(
- "_validate.$name=function(){ return confirm('"
- . strtr($msg, array("\n"=>'\\n')) . "');};");
-};
+function submit_js_confirm($name, $msg, $set = true) {
+ global $Ajax;
+ $js = "_validate.$name=".($set ? "function(){ return confirm('"
+ . strtr($msg, array("\n"=>'\\n')) . "');};"
+ : 'null;');
+ if (in_ajax()) {
+ $Ajax->addScript(true, $js);
+ } else
+ add_js_source($js);
+}
//-----------------------------------------------------------------------------------
function set_icon($icon, $title=false)
{
global $path_to_root;
- return "
\n";
+ if (basename($icon) === $icon) // standard icons does not contain path separator
+ $icon = "$path_to_root/themes/".user_theme()."/images/$icon";
+ return "
\n";
}
function button($name, $value, $title=false, $icon=false, $aspect='')
@@ -899,4 +906,29 @@ function inactive_control_column(&$th) {
$Ajax->activate('_page_body');
}
}
+
+function customer_credit_row($customer, $credit, $parms='')
+{
+ global $path_to_root;
+
+ label_row( _("Current Credit:"),
+ ""
+ . price_format($credit)
+ ."", $parms);
+}
+
+function supplier_credit_row($supplier, $credit, $parms='')
+{
+ global $path_to_root;
+
+ label_row( _("Current Credit:"),
+ ""
+ . price_format($credit)
+ ."", $parms);
+}
+
?>
\ No newline at end of file