Source for file DBMS_FIELD_FLOAT.phpclass
Documentation is available at DBMS_FIELD_FLOAT.phpclass
* Class file DBMS_FIELD_FLOAT.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
require_once dirname(__FILE__
).
_OCSP_DIRSEP_.
"DBMS_FIELD.phpclass";
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* source file of the class
* @var string $classSrcFile
* @var string $pMask printf mask
* @var string $inputAdd overwrite default
protected $inputAdd=
"style=\"text-align:right;\"";
// ###########################################################
// OBJECT SETTINGS METHODS
// ###########################################################
// ###########################################################
// FIELD DEFINITION DATA METHODS
// ###########################################################
* returns an array of field to bie shown in the edit form
* by using editTbl_echoForm
* the array is in the form:
* [FLDLAB] (complete html code with <td></td>)
* [FLDVAL] (complete html code with <td></td>)
$a_ret=
parent::editTbl_getFieldEditArr($debug);
$a_ret['LAYOUT']['UNIT']=
array(
'FLDVAL'=>
"<input name=\"UNIT\" type=\"input\" value=\"".
$this->unit.
"\" size=\"10\">"
$a_ret['LAYOUT']['PFMASK']=
array(
'FLDLAB'=>
"printf Mask <a href=\"http://www.php.net/sprintf\" target=\"_blank\">?</a>",
'FLDVAL'=>
"<input name=\"pMask\" type=\"input\" value=\"".
$this->pMask.
"\" size=\"10\">"
* echos the filed definition form
* @deprecated since pk-06-05-18
###############################
* saves the field definition
$this->unit=
(isset
($_POST['UNIT']) ?
$_POST['UNIT'] :
$this->unit);
$this->pMask=
(isset
($_POST['pMask']) ?
$_POST['pMask'] :
$this->pMask);
// ###########################################################
// OBJECT HTML FORM METHODS
// ###########################################################
* adds $this->unit to to parent::getInputTag()
* @param mixed $aValue the value to set
* @param string $nameAdd append something to name like "[VALUE]" for search forms
$this->inputAdd.=
" onkeypress=\"return ocsp_form_keyNumber(event,false);\"";
* returns the html code for the field value input / show
* adds $this->myName to ${$this->myDataArrName}['_DBMS_FIELDS']
function getFieldTag($mode,$aValue=
NULL,$debug=
FALSE) {
global $
{$this->myDataArrName};
return "<div style=\"text-align:right;\">".
parent::getFieldTag($mode,$aValue,$debug).
"</div>";
* echos the html representation of the field
function writeField($mode,$aValue=
"",$arrName=
"DBVAL") {
$ret=
parent::writeField($mode,$aValue,$arrName);
* returns the field value
* @param string $aValue the value
* @param array $err error array
* @param string $arrName name of the array to access fieldsarray gloabl ${$arrName}
* @version pk-05-11-19 check for ,
function getValue($aValue,&$err,$arrName=
"DBVAL",$debug=
FALSE) {
if ($debug) echo
"<hr><p><b>DBMS_FIELD_FLOAT::getValue($aValue,$err,$arrName,$debug)</b> (".
get_class($this).
"/".
$this->myName.
")</p>";
if (strstr($aValue,",")) { // <pk-05-11-19>
if (($aValue ==
0) ||
(doubleval($aValue))) {
} else if (empty($aValue)) {
return $GLOBALS[$this->getGlobalDBObjIdx()]->qs_getNullStmt();
$err[$this->myName]['MSG']=
"NULL_NOT_ALLOWED";
$err[$this->myName]['MSG'] =
"NO_NUMBER";
* add slashes to the value to add it to a sql command
* @param string $aValue the value
* @param array $err error array
* @param string $arrName name of the global array to access field gloabl ${$arrName}
function slashedValue($aValue,&$err,$arrName=
"DBVAL",$debug=
FALSE) {
if ($debug) echo
"<hr><p><b>DBMS_FIELD_FLOAT::slashedValue($aValue,$err,$arrName,$debug)</b> (".
get_class($this).
"/".
$this->myName.
")</p>";
return $this->getValue($aValue,$err,$arrName,$debug);
* returns the html representation of the field
* @param mixed $aValue the falue
* @param string $arrName name of the global array holding data values
* @param boolean $debug show debug info
* @return mixed the html representation of the field
* @version pk-05-11-19 unit added
if ($debug) echo
"<p><b>DBMS_FIELD_FLOAT::getScreenValue(".
$aValue.
",...)</b> (".
get_class($this).
"/".
$this->myName.
")</p>\n";
if (!empty($this->pMask)) {
return trim("<nobr>".
$aValue.
" ".
$this->unit.
"</nobr>");
Documentation generated on Thu, 08 Jan 2009 17:41:38 +0100 by phpDocumentor 1.4.0a2