<?php
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU Affero General Public License,
+ AGPL, as published by the Free Software Foundation, either version
+ 3 of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
function get_post($name, $dflt='')
{
//
function input_num($postname=null, $dflt=null)
{
- if (!isset($_POST[$postname]))
+ if (!isset($_POST[$postname]) || $_POST[$postname] == "")
return $dflt;
return user_numeric($_POST[$postname]);
default_focus($name);
$submit_str = "<button class=\""
.($async ? 'ajaxsubmit' : 'inputsubmit')
- ."\""
- .($async === null ? (in_ajax() ? " style='display:none;'" : ' aspect="fallback"' ):
+ ."\" type=\"submit\""
+ .($async === null ? (fallback_mode() ? ' aspect="fallback"' : " style='display:none;'" ):
($async === 'process' ? 'aspect="process"' : '') )
." name=\"$name\" id=\"$name\" value=\"$value\""
.($title ? " title='$title'" : '')
."><span>$value</span>"
- .($icon ? "<img src='$path_to_root/themes/default/images/$icon'>" : '')
+ .($icon ? "<img src='$path_to_root/themes/".user_theme()."/images/$icon'>" : '')
."</button>\n";
if ($echo)
echo $submit_str;
}
}
//---------------------------------------------------------------------------------
-
+/*
function button($name, $value, $onclick, $title=false)
{
default_focus($name);
button($name, $value, $onclick, $title);
echo "</td>\n";
}
-
+*/
//-----------------------------------------------------------------------------------
function check_value($name)
// 2008-06-15. Changed
function qty_cell($label, $bold=false, $dec=null, $id=null)
{
- if ($dec == null)
+ if (!isset($dec))
$dec = get_qty_dec();
if ($bold)
label_cell("<b>".number_format2($label, $dec)."</b>", "nowrap align=right", $id);
echo "<input class='amount' type=\"text\" name=\"$name\" size=\"$size\" maxlength=\"$max\" dec=\"$dec\" value=\"" . $_POST[$name]. "\">";
- if ($post_label)
- echo " " . $post_label;
-
+ if ($post_label) {
+ echo "<span id='_{$name}_label'> $post_label</span>";
+ $Ajax->addUpdate($name, '_'.$name.'_label', $post_label);
+ }
echo "</td>\n";
$Ajax->addUpdate($name, $name, $_POST[$name]);
$Ajax->addAssign($name, $name, 'dec', $dec);