Source for file DBMS_FIELD_INT.phpclass
Documentation is available at DBMS_FIELD_INT.phpclass
* Class file DBMS_FIELD_INT.phpclass
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
if (!isset
($GLOBALS['OCSP']['DBMSFLD_PATH']))
require_once $GLOBALS['OCSP']['DBMSFLD_PATH'].
"DBMS_FIELD.phpclass";
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @var string $unit added to the output
* @var boolean $hideUnitInLst
* @var boolean $null2zero save NULL values as zero (0)
* source file of the class
* @var string $classSrcFile
* @var string $inputAdd overwrite default
// ###########################################################
// 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>)
* @version pk-07-03-05 (hideUnitInLst)
$a_ret=
parent::editTbl_getFieldEditArr($debug);
$a_ret['LAYOUT']['UNIT']=
array(
'FLDVAL' =>
"<input name=\"UNIT\" type=\"input\" value=\"".
$this->unit.
"\" size=\"10\"><input name=\"hideUnitInLst\" type=\"checkbox\" value=\"1\" ".
($this->hideUnitInLst ?
"checked" :
"").
"> in Liste nicht anzeigen"
$a_ret['VALCHECKS']['NULL2ZERO']=
array(
'FLDLAB' =>
"NULL zu Null (0):",
'FLDVAL' =>
'<input name="null2zero" type="checkbox" value="1" '.
($this->null2zero ?
'checked' :
'').
'> ja NULL-Werte als 0 speichern'
* echos the filed definition form
* @param boolean $showSize obsulet
* @param boolean $showUnit obsulet
* @param boolean $showNull obsulet
* @deprecated since pk-06-06-29
function editTblForm($showSize=
FALSE,$showUnit=
TRUE,$showNull=
TRUE) {
* @version pk-07-03-05 (hideUnitInLst)
$this->null2zero =
((isset
($_POST['null2zero']) &&
intval($_POST['null2zero'])) ?
TRUE :
FALSE);
$this->unit=
(isset
($_POST['UNIT']) ?
$_POST['UNIT'] :
"");
$this->hideUnitInLst=
((isset
($_POST['hideUnitInLst']) &&
intval($_POST['hideUnitInLst'])) ?
TRUE :
FALSE);
// ###########################################################
// 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
if ((strtoupper($aValue) ==
"NULL") ||
(empty($aValue) &&
(strval($aValue) !==
"0"))) { // <pk-06-08-06>
$this->inputAdd.=
" onkeypress=\"return jOCSP.ocspFormFldEvents.keyNumber(event,true);\"";
// ################################################
// ################################################
* echos a compare type select for search forms
* returns the html code for the search compare type select
$ret =
"<select name=\"".
$arrName.
"[".
$this->myName.
"][COMPTYPE]\">";
$ret.=
" <option value=\"=\">=</option>";
$ret.=
" <option value=\"<\"><</option>";
$ret.=
" <option value=\">\">></option>";
$ret.=
" <option value=\"<>\"><></option>";
$ret.=
" <option value=\"=0\">=0</option>";
* returns the where statement part for the field
* @param array $aArr form input array
if ($debug) echo
"<p><b>DMBS_FIELD_INT::searchWhere($aArr,$debug)</b> (".
get_class($this).
")</p>";
if (!intval($aArr['VALUE']) &&
($aArr['COMPTYPE']!=
"=0")) return "";
if ($debug) {echo
"<blockquote><pre>";print_r($aArr);echo
"</pre></blockquote>";}
if (!empty($aArr['ANDOR'])) { /* <pk-04-02-25 />*/
$ret=
($aArr['ANDOR'] ==
"OR" ?
" OR " :
" AND ");
switch($aArr['COMPTYPE']) { // check input
// ###########################################################
// OBJECT VALUE CHECK/RETURN METHODS
// ###########################################################
* adds unit to parent::getScreenValue()
* @param mixed $aValue the falue
* @param string $arrName name of the global array holding data values
* @param bool $debug show debug info
* @return mixed the html representation of the field
return $aValue.
" ".
$this->unit;
* returns the html representation of the field in a list (table col)
* @param mixed $aValue the falue
* @param string $arrName name of the global array holding data values
* @param bool $debug show debug info
* @returns string the html representation of the field
function getListValue($aValue=
NULL,$arrName=
"DBVAL",$debug=
FALSE) {
* 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}
function getValue($aValue,&$err,$arrName=
"DBVAL",$debug=
FALSE) {
if ($debug) echo
"<hr><p><b>DBMS_FIELD_INT::getValue($aValue,$err,$arrName,$debug)</b> (".
get_class($this).
"/".
$this->myName.
")</p>";
if ((intval($aValue)) ||
($aValue ===
0) ||
($aValue ===
"0")) {
if ($debug) echo
"<p>dbDesc:</p><pre>".
print_r($this->dbDesc,TRUE).
"</pre>";
if ($this->dbDesc['AUTO_INCREMENT']) {
// assume we have a new row
if ($debug) echo
"<p>assuming new</p>";
} else if ($this->null2zero) { /* <pk-04-12-02 /> */
if ($debug) echo
"<blockquote>ERROR:<pre>".
print_r($err,TRUE).
"</pre>";
* 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_INT::slashedValue($aValue,$err,$arrName,$debug)</b> (".
get_class($this).
"/".
$this->myName.
")</p>";
return $this->getValue($aValue,$err,$arrName,$debug);
Documentation generated on Thu, 08 Jan 2009 17:42:10 +0100 by phpDocumentor 1.4.0a2