X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_view.inc;h=ddd62fef061c4a720122da39805cb9415ebf9c0b;hb=a96e9d18d632cc730a2b4f44d0774a73246915c5;hp=639aea0b9acdc661867b09e92dd9029d0e1432fc;hpb=d746d3fde3490592d30b75d31dd8622d09c997d0;p=fa-stable.git diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 639aea0b..ddd62fef 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -1,6 +1,7 @@ \n" - . "\n" - . "\n"; - return $js; +//$focus_on = array(); +/* + Setting focus on element $name in $form. + If $form<0 $name is element id. +*/ +function set_focus($name, $form_no=0) { +// global $focus_on; +// $focus_on['name'] = $name; +// $focus_on['form'] = $form_no; + $_POST['_focus'] = $name; } - -function get_js_set_focus($name) -{ - $js = "\n\n"; - return $js; +// +// Set default focus on first field $name if not set yet +// +function default_focus($name, $form_no=0) { +// global $focus_on; +// if (!isset($focus_on['name']) && (!isset($_POST['_focus']) || $_POST['_focus']=='') ) { +//echo "

$name

"; +// $focus_on['name'] = $name; +// $focus_on['form'] = $form_no; +// } + if (!isset($_POST['_focus'])) { + $_POST['_focus'] = $name; + } } - +/* +function set_js_focus() { + global $focus_on; + $js = ''; + +// if (isset($focus_on['name'])) { + + $js = ""; +// } + return $js; +} +*/ function get_js_png_fix() { $js = " -"; - return $js; +document.write(\"
\");"; + + cache_js_file($fpath, $js); + } + add_js_ufile($fpath); + + return ''; } -function get_js_allocate() { - return ""; + amount = get_amount('amount'+doc); + left = get_amount('left_to_allocate', 1); + total = get_amount('total_allocated', 1); + price_format('left_to_allocate',amount+left, ".user_price_dec().", 1); + price_format('amount'+doc, 0, ".user_price_dec()."); + price_format('total_allocated', total-amount, ".user_price_dec().", 1); + }"; + + cache_js_file($fpath, $js); + } + add_js_ufile($fpath); + add_js_user_num(); } function alert($msg)