X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=ee84f0fd61cb80b9925f9cab4ee7ac448662d2ae;hb=6ffe5f040543994725beaf9f8059c054919043d7;hp=9717a95ca34c151ac41b1f6211fd0244cbea4c4e;hpb=c7d6d081bc0512018f8bfc6851e698f752b042b7;p=fa-stable.git
diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc
index 9717a95c..ee84f0fd 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,50 @@ 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);
+}
+
+/*
+ Edit transaction link to be used in transaction inquires
+*/
+function edit_trans_link($trans_type, $trans_no, $url='')
+{
+ global $path_to_root, $trans_editors;
+
+ if (!$url) $url = @$trans_editors[$trans_type];
+
+ if (!$trans_no || !$url)
+ return '';
+
+ if (is_closed_trans($trans_type, $trans_no)) {
+ return set_icon(ICON_CLOSED, _('Closed'));
+ } else {
+ $link_text = user_graphic_links() ? set_icon(ICON_EDIT, _('Edit')) : _('Edit');
+ return "$link_text";
+ }
+
+}
+
?>
\ No newline at end of file