Source for file CLI_PROFILE_ENTRY.phpclass
Documentation is available at CLI_PROFILE_ENTRY.phpclass
* Class file CLI_PROFILE_ENTRY.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
// ---------------------------------------------------------
// ---------------------------------------------------------
* Class file CLI_PROFILE_ENTRY.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* @constant string CLASS_SRC_FILE
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
/*** class vars ------------------------------------------------------ */
/*** class methods --------------------------------------------------- */
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
/*** compostion --------------------------------------------------- */
* @var CLI_PROFILE $myProfile
/*** attributes -------------------------------------------------- */
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* init the object and populate if an id is submitted
* @param int $clpId Profile ID
* @param int $id the row id
* sets the profile object
* @param CLI_PROFILE $profile
if ($debug) echoDebug(__FILE__
,"<blockqoute><b>CHANGING TABLE</b></blockqoute>");
$this->init($debug,TRUE);
* returns the profle object
* if a new object is created this->myTable is set and $this->init is called
* returns the id of the profile
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* sets post array with form checks
* @param DBMS_FORM $frmObj a formObj as ref
* @param array $dbVal array with data
* @param boolean $asPopulate
* @param boolean $strict only set columns of $this->myTable and "OBJVALS_".$this->myTable
function setFORMPOST(&$frmObj,$dbval,$debug=
FALSE,$asPopulate=
TRUE,$strict=
FALSE) {
if (isset
($dbval['CLP_ID']) &&
(intval($dbval['CLP_ID']))) {
} else if (isset
($_POST['PFFORM_CLP_ID']) &&
intval($_POST['PFFORM_CLP_ID'])) {
$this->getProfileObj(); // ensure it is set propper and the object is initialized
$o_frmObj->setDBMSValues($frmObj);
$GLOBALS['DBMS_FORMS'][$o_frmObj->getId()]=
$o_frmObj;
$frmObj=
&$GLOBALS['DBMS_FORMS'][$o_frmObj->getId()];
$frmObj->setError(array('LABEL'=>
"Profil",'MSG'=>
"Profil konnte nicht ermittelt werden"),'CLP_ID');
// check if the foreign key is set
if (isset
($_POST['PFFORM_FK_VAL']) &&
intval($_POST['PFFORM_FK_VAL'])) {
return parent::setFORMPOST($frmObj,$dbval,$debug,$asPopulate,$strict);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* an array of all key fields
if (!isset
($arr_ret['CLP_ID']) && isset
($this->myFields['CLP_ID']))
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"adding key CLP_ID");
$arr_ret['CLP_ID']=
array(
'NAME' =>
$this->myFields['CLP_ID']['COLNAME'],
'TYPE' =>
$this->myFields['CLP_ID']['TYPE'],
'AUTO_INCREMENT' =>
FALSE
'AUTO_INCREMENT' =>
FALSE
* @param string $gDBIDX GLOBAL ARRAY INDEX OF DB OBJECT
* @param boolean $debug SHOW DEBUG INFO
function dbSave($debug=
FALSE) {
// does we have an insert or update or overwrite of a row
$this->getProfileObj(); // ensure $this->myProfile is set propper
if ($debug) echo
"<p>ERROR: no profile set</p>";
$s_query =
"SELECT * FROM ".
$this->myTable;
if ($a_row=
$this->myDBObj->quickQuery($s_query)) {
* inserts a new row to the table
* @param string $gDBIDX Index of $GLOBALS to the db object
* @param bool $debug show debug info
* @global array $OCSP_OBJ
* @returns int returns the autoIncFld ID if exists or 1 on success
$this->setDBField('CLP_CTIME',"CURRENT_TIMESTAMP");
$this->setDBField('CLP_CUSER',$OCSP_OBJ['USER']->getId());
$this->setDBField('CLP_UTIME',"CURRENT_TIMESTAMP");
$this->setDBField('CLP_UUSER',$OCSP_OBJ['USER']->getId());
$this->setDBField('CLP_RADDR',$_SERVER['REMOTE_ADDR']);
$this->setDBField('CLP_HVIA',$_SERVER['HTTP_VIA']);
$this->setDBField('CLP_HX_FORWD',$_SERVER['HTTP_X_FORWARDED_FOR']);
* replaces a row in the table
* @param boolean $debug show debug info
* @param boolean $ignorPopulated (if false the table MUST have been populated)
function dbReplace($debug=
FALSE,$ignorPopulated=
FALSE) {
$this->setDBField('CLP_UTIME',"CURRENT_TIMESTAMP");
$this->setDBField('CLP_UUSER',$GLOBALS['USER']->getId());
$this->setDBField('CLP_RADDR',$_SERVER['REMOTE_ADDR']);
$this->setDBField('CLP_HVIA',$_SERVER['HTTP_VIA']);
$this->setDBField('CLP_HX_FORWD',$_SERVER['HTTP_X_FORWARDED_FOR']);
return parent::dbReplace($debug,$ignorPopulated);
* deletes the row from the database
* @param boolean $backupData
function dbDelete($backupData=
FALSE,$debug=
FALSE) {
if (isset
($dbval['CLP_ID']) &&
(intval($dbval['CLP_ID']))) {
} else if (isset
($_POST['PFFORM_CLP_ID']) &&
intval($_POST['PFFORM_CLP_ID'])) {
$this->getProfileObj(); // ensure it is set propper and the object is initialized
return parent::dbDelete($backupData,$debug);
* @param mixed $form (string) form name (int) form id
* @return CLI_PROFILE_FORM
* @requires CLI_PROFILE_FORM.phpclass
function &getForm($mode=
FRM_MODE_READONLY,$form=
'',$frmClass=
'CLI_PROFILE_FORM',$debug=
FALSE)
ocsp_logError(__FILE__
,__LINE__
,"could not get profile",E_ERROR);
$obj_form=
parent::getForm($mode,$form,$frmClass,$debug);
Documentation generated on Thu, 08 Jan 2009 17:38:06 +0100 by phpDocumentor 1.4.0a2