X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=b27f5fde11ae787a486fc4fa73ecce2556dca591;hb=9478a0cdeaf9201d2f3947e11e58d90354050025;hp=2ae54e80aa82db5ee29d987e4b2853d782ce2aed;hpb=8f7ac519b7aaf8ec219862597e878d3a28316ac6;p=fa-stable.git diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index 2ae54e80..b27f5fde 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -75,7 +75,7 @@ function simple_page_mode($numeric_id = true) // // Read numeric value from user formatted input // -function input_num($postname=null, $dflt=null) +function input_num($postname=null, $dflt=0) { if (!isset($_POST[$postname]) || $_POST[$postname] == "") return $dflt; @@ -154,9 +154,9 @@ function submit($name, $value, $echo=true, $title=false, $atype=false, $icon=fal function submit_center($name, $value, $echo=true, $title=false, $async=false, $icon=false) { - echo "
"; + if ($echo) echo "
"; submit($name, $value, $echo, $title, $async, $icon); - echo "
"; + if ($echo) echo "
"; } function submit_center_first($name, $value, $title=false, $async=false, $icon=false) @@ -241,7 +241,8 @@ function submit_return($name, $value, $title=false) function submit_js_confirm($name, $msg) { add_js_source( - "_validate.$name=function(){ return confirm('$msg');};"); + "_validate.$name=function(){ return confirm('" + . strtr($msg, array("\n"=>'\\n')) . "');};"); }; //----------------------------------------------------------------------------------- @@ -386,6 +387,12 @@ function email_cell($label, $params="", $id=null) label_cell("$label", $params, $id); } +function amount_decimal_cell($label, $params="", $id=null) +{ + $dec = 0; + label_cell(price_decimal_format($label, $dec), "nowrap align=right ".$params, $id); +} + function amount_cell($label, $bold=false, $params="", $id=null) { if ($bold)