X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=59a3676ef5664ed7ccc7bd004411ac37c2c824aa;hb=2bcdab793e406bb5a44d2c4e079ec7cc2a1aa857;hp=400e3be0a66879985f0f22176011c357f40895f5;hpb=39b26e9dfcf1e30819cb7023e58de5be64653f33;p=fa-stable.git diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index 400e3be0..59a3676e 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -37,6 +37,14 @@ function find_submit($prefix, $numeric=true) } return $numeric ? -1 : null; } +/* + Helper function. + Returns true if input $name with $submit_on_change option set is subject to update. +*/ +function input_changed($name) +{ + return isset($_POST['_'.$name.'_changed']); +} //------------------------------------------------------------------------------ // @@ -120,6 +128,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 */ @@ -150,6 +159,7 @@ function submit($name, $value, $echo=true, $title=false, $atype=false, $icon=fal if ($icon===false) $icon=ICON_ESCAPE; break; case 'nonajax': + case 'download': $atype = false; } } @@ -193,6 +203,7 @@ function submit_center_last($name, $value, $title=false, $async=false, $icon=fal /* For following controls: 'both' - use both Ctrl-Enter and Escape hotkeys + 'upgrade' - use Ctrl-Enter with progress ajax indicator and Escape hotkeys. Nonajax request for OK option is performed. 'cancel' - apply to 'RESET' button */ function submit_add_or_update($add=true, $title=false, $async=false, $clone=false) @@ -201,10 +212,13 @@ function submit_add_or_update($add=true, $title=false, $async=false, $clone=fals if ($async === 'both') { $async = 'default'; $cancel = 'cancel'; - } - else if ($async === 'default') + } + elseif ($async === 'upgrade') { + $async = 'default nonajax process'; $cancel = 'cancel'; + } + elseif ($async === 'default') $cancel = true; - else if ($async === 'cancel') + elseif ($async === 'cancel') $async = true; if ($add) @@ -274,7 +288,7 @@ function set_icon($icon, $title=false) global $path_to_root; if (basename($icon) === $icon) // standard icons does not contain path separator $icon = "$path_to_root/themes/".user_theme()."/images/$icon"; - return "\n"; + return "\n"; } function button($name, $value, $title=false, $icon=false, $aspect='') @@ -291,7 +305,7 @@ function button($name, $value, $title=false, $icon=false, $aspect='') if ($value == _("Delete")) // Helper during implementation $icon = ICON_DELETE; return "