X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=c1091b3702c63a76df24ae2e5c621167fd64578a;hb=3b06c6c4718610a408cae2e9b76c3134ca30b84c;hp=ace6aa3fb3ef90412eb4ca7f023eb229fb7e5823;hpb=c86494c341822ce632f8db23d508227270521d62;p=fa-stable.git diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index ace6aa3f..c1091b37 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 @@ -113,6 +114,7 @@ function hidden($name, $value=null, $echo=true) '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 */ @@ -604,7 +606,7 @@ function link_row_ex($label, $name, $size, $max=null, $title=null, $value=null, function date_cells($label, $name, $title = null, $check=null, $inc_days=0, $inc_months=0, $inc_years=0, $params=null, $submit_on_change=false) { - global $use_date_picker, $path_to_root, $Ajax; + global $path_to_root, $Ajax; if (!isset($_POST[$name]) || $_POST[$name] == "") { @@ -622,9 +624,13 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0, $_POST[$name] = $dd; } } - if ($use_date_picker) + if (user_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 = ""; @@ -633,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"; @@ -885,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) . ''; } } @@ -937,10 +943,30 @@ 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:"),