X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=a6537a83c8bd2a06ae407c980154ecaf1a6f3a6a;hb=53d942f2a0d20cce5e9c409c6485867ce0869e4d;hp=1889962d28b56e30ee65f724de901a523e3a73c0;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index 1889962d..a6537a83 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -37,6 +37,7 @@ function find_submit($prefix, $numeric=true) } return $numeric ? -1 : null; } + //------------------------------------------------------------------------------ // // Helper function for simple db table editor pages @@ -112,6 +113,7 @@ function hidden($name, $value=null, $echo=true) 'selector' - ditto with closing current popup editor window 'cancel' - cancel form entry on Escape press; dflt ICON_CANCEL 'process' - displays progress bar during call; optional icon + 'nonajax' - ditto, non-ajax submit $atype can contain also multiply type selectors separated by space, however make sense only combination of 'process' and one of defualt/selector/cancel @@ -141,6 +143,9 @@ function submit($name, $value, $echo=true, $title=false, $atype=false, $icon=fal case 'cancel': if ($icon===false) $icon=ICON_ESCAPE; break; + + case 'nonajax': + $atype = false; } } } @@ -379,7 +384,10 @@ function check_row($label, $name, $value=null, $submit_on_change=false, $title=f } //----------------------------------------------------------------------------------- -function radio($label, $name, $value, $selected, $submit_on_change=false) { +function radio($label, $name, $value, $selected=null, $submit_on_change=false) +{ + if (!isset($selected)) + $selected = get_post($name) == $value; if ($submit_on_change === true) $submit_on_change = @@ -617,8 +625,12 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0, } } if ($use_date_picker) + { + $calc_image = (file_exists("$path_to_root/themes/".user_theme()."/images/cal.gif")) ? + "$path_to_root/themes/".user_theme()."/images/cal.gif" : "$path_to_root/themes/default/images/cal.gif"; $post_label = "" - . " "._(\n"; + . " "._(\n"; + } else $post_label = ""; @@ -627,15 +639,15 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0, echo ""; - $class = $submit_on_change ? 'class="searchbox"' : ''; + $class = $submit_on_change ? 'date active' : 'date'; $aspect = $check ? 'aspect="cdate"' : ''; if ($check && (get_post($name) != Today())) $aspect .= ' style="color:#FF0000"'; default_focus($name); - - echo "3)?11:10; + echo " $post_label"; echo "\n"; @@ -879,7 +891,7 @@ function inactive_control_cell($id, $value, $table, $key) get_post('Update')) && (check_value('Inactive'.$id) != $value)) { update_record_status($id, !$value, $table, $key); } - echo ''. checkbox(null, $name, $value, true, '', "align='center'") + echo ''. checkbox(null, $name, $value, true, '') . hidden("LInact[$id]", $value, false) . ''; } } @@ -931,4 +943,38 @@ function supplier_credit_row($supplier, $credit, $parms='') ."", $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"; + } +} + +function bank_balance_row($bank_acc, $parms='') +{ + global $path_to_root; + + $to = add_days(Today(), 1); + $bal = get_balance_before_for_bank_account($bank_acc, $to); + label_row( _("Bank Balance:"), + " " + . price_format($bal) + ."", $parms); +} + ?> \ No newline at end of file