X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_view.inc;h=65a9f39341ab8cfcb491ee0aa7b9857d678ff006;hb=c935a4090e3f152dd5549217d69b5b5036197024;hp=9f0e445092c0f99f8ad9eb1965788eed1fb705f3;hpb=15adf0b69c4d0c07d6dcf07e104a73595bc113b0;p=fa-stable.git diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 9f0e4450..65a9f393 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -1,6 +1,7 @@ activate('get_rate'); } else $rate = get_exchange_rate_from_to($to_currency, $from_currency, $date_); $rate = number_format2($rate, user_exrate_dec()); - label_row(_("Exchange Rate:"),"1 " . $from_currency . " = " . $rate . " " . $to_currency . - ($buttons?" " . submit('get_rate',_("Get"), false):"")); + label_row(_("Exchange Rate:"),"1 " . $from_currency . " = " . $rate . " " . $to_currency . + ($buttons?" " . submit('get_rate',_("Get"), false, $hint, true):"")); + if($buttons) { + $Ajax->addUpdate('get_rate','_ex_rate', $rate); + } } } @@ -312,7 +319,7 @@ function is_voided_display($type, $id, $label) echo "$label
"; echo "" . _("Date Voided:") . " " . sql2date($void_entry["date_"]) . "
"; if (strlen($void_entry["memo_"]) > 0) - echo "
" . _("Memo:") . " " . $void_entry["memo_"] . "
"; + echo "
" . _("Memo:") . " " . $void_entry["memo_"] . "

"; echo ""; end_table(1); @@ -453,7 +460,6 @@ function display_edit_tax_items($taxes, $columns, $tax_included, $leftspan=0) function display_footer_exit() { - global $path_to_root; br(2); end_page(); exit; @@ -522,22 +528,6 @@ function display_allocations_from($person_type, $person_id, $type, $type_no, $to } } -function get_js_go_back() -{ - $js = "\n\n"; - return $js; -} - function get_js_open_window($width, $height) { $js = "\n\n"; return $js; } -function get_js_form_entry($edit_name, $sel_name, $next_name) -{ - $js = "\n\n"; - return $js; +/* + Setting focus on element $name in $form. + If $form<0 $name is element id. +*/ +function set_focus($name, $form_no=0) { + global $Ajax; + $Ajax->addFocus(true, $name); + $_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) { + if (!isset($_POST['_focus'])) { + set_focus($name); + } } function get_js_png_fix() @@ -633,29 +590,20 @@ function get_js_png_fix() function get_js_date_picker() { - global $dateseps, $date_system; - - $how = user_date_format(); // 0 = us/ca, 1 = eu, au, nz, 2 = jp, sw - $sep = $dateseps[user_date_sep()]; // date separator - $wstart = (($date_system == 1 || $date_system == 2) ? 6 : ($how == 0 ? 0 : 1)); // weekstart (sun = 0, mon = 1) - $months = array(_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December")); - $wdays = array(_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")); - $back = _("Back"); - if ($date_system == 1) - list($cyear, $cmon, $cday) = gregorian_to_jalali(date("Y"), date("n"), date("j")); - else if ($date_system == 2) - list($cyear, $cmon, $cday) = gregorian_to_islamic(date("Y"), date("n"), date("j")); + global $comp_path; + $fpath = $comp_path.'/'.user_company().'/js_cache/'.'date_picker.js'; $js = " "; - $js .= " -"; - return $js; -} -// -// Javascript conversions to/from user numeric format. -// -function add_js_user_num() { - global $thoseps, $decseps; - $ts = $thoseps[user_tho_sep()]; - $ds = $decseps[user_dec_sep()]; - - $js = - ""; - add_js_source($js); -} +document.write(\"
\");"; -function add_js_allocate() { - $source = - ""; - add_js_user_num(); - add_js_source($source); + cache_js_file($fpath, $js); + } + add_js_ufile($fpath); + + return ''; } function alert($msg)