X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=b27f5fde11ae787a486fc4fa73ecce2556dca591;hb=9478a0cdeaf9201d2f3947e11e58d90354050025;hp=65ac068fd5acea5f2850e137973a53e05057a085;hpb=5ceece3a1a031ad1dbfbcb11d3aabfca97a56f6b;p=fa-stable.git
diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc
index 65ac068f..b27f5fde 100644
--- a/includes/ui/ui_input.inc
+++ b/includes/ui/ui_input.inc
@@ -1,9 +1,14 @@
.
+***********************************************************************/
//
// Sets local POST value and adds Value to ajax posting if needed
//
@@ -42,18 +47,21 @@ function simple_page_mode($numeric_id = true)
$default = $numeric_id ? -1 : '';
$selected_id = get_post('selected_id', $default);
- foreach (array('ADD_ITEM', 'UPDATE_ITEM', 'RESET') as $m) {
+ foreach (array('ADD_ITEM', 'UPDATE_ITEM', 'RESET', 'CLONE') as $m) {
if (isset($_POST[$m])) {
$Ajax->activate('_page_body');
- if ($m == 'RESET')
+ if ($m == 'RESET' || $m == 'CLONE')
$selected_id = $default;
+ unset($_POST['_focus']);
$Mode = $m; return;
}
}
foreach (array('Edit', 'Delete') as $m) {
foreach ($_POST as $p => $pvar) {
if (strpos($p, $m) === 0) {
- $selected_id = substr($p, strlen($m));
+// $selected_id = strtr(substr($p, strlen($m)), array('%2E'=>'.'));
+ unset($_POST['_focus']); // focus on first form entry
+ $selected_id = quoted_printable_decode(substr($p, strlen($m)));
$Ajax->activate('_page_body');
$Mode = $m;
return;
@@ -67,9 +75,9 @@ function simple_page_mode($numeric_id = true)
//
// Read numeric value from user formatted input
//
-function input_num($postname=null, $dflt=null)
+function input_num($postname=null, $dflt=0)
{
- if (!isset($_POST[$postname]))
+ if (!isset($_POST[$postname]) || $_POST[$postname] == "")
return $dflt;
return user_numeric($_POST[$postname]);
@@ -91,86 +99,120 @@ function hidden($name, $value=null, $echo=true)
else
return $ret;
}
-
-//---------------------------------------------------------------------------------
-// Submit button.
-// $async parameter can have 3 values:
-// null - fallback button not visible in js enabled mode
-// false - normal submit via form action
-// true - when js is on submition via ajax call
-// 'process' - ditto with processing indicator in msgbox
-//
-function submit($name, $value, $echo=true, $title=false, $async=false)
-{
-
- default_focus($name);
- $submit_str = "\n";
+ .">"
+ .($icon ? "
" : '')
+ ."$value"
+ ."\n";
if ($echo)
echo $submit_str;
else
return $submit_str;
}
-function submit_center($name, $value, $echo=true, $title=false, $async=false)
+function submit_center($name, $value, $echo=true, $title=false, $async=false, $icon=false)
{
- echo "