Source for file CLI_PROFILE_FORM.phpclass
Documentation is available at CLI_PROFILE_FORM.phpclass
* Class file CLI_PROFILE_FORM.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: CLI_PROFILE_FORM.phpclass,v 1.8 2008/11/25 16:24:07 peterkrebs Exp $
* Class CLI_PROFILE_FORM handels forms for client profiles
* overwrites DBMS_FORM database functions to store the form in
* a row of T_CLI_PROFILES instead of T_DBMS_FORM
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: CLI_PROFILE_FORM.phpclass,v 1.8 2008/11/25 16:24:07 peterkrebs Exp $
/*** class constants --------------------------------------------- */
* @constant string CLASS_SRC_FILE
* @var CLI_PROFILE $myProfile
* @var string $column the column in T_CLI_PROFILES where the form is stored
* @var boolean $profileTblObjInit
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* returns the profile object
if ($debug) echoDebug(__FILE__
,"<p>generate new profile object</p>");
* sets the profile object
* @param CLI_PROFILE $aProfile
$this->CLP_ID=
$aProfile->getId();
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* add some values to the forms (hidden) command fields
$arr_ret['CLP_SRC'] =
$this->myProfile->get_mySourceFile();
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* sets the tableobject class and include from $dataArr and
* tries to instantiate by calling $this->getMyTblObj
* if class is set in $dataArr and it could not be instantiated False is returned
* @param array $dataArr (normaly $_POST)
if (isset
($dataArr[get_class($this).
"_CMDS"]))
$str_valKey=
(isset
($dataArr['FRMARRAYNAME']) ?
$dataArr['FRMARRAYNAME'] :
"DBVAL");
if (isset
($dataArr[$str_valKey]['CLP_ID']) &&
intval($dataArr[$str_valKey]['CLP_ID']))
} else if (isset
($arr_frmCmds['CLP_ID']) &&
intval($arr_frmCmds['CLP_ID'])) {
if (isset
($arr_frmCmds['CLP_CLASS']) &&
!empty($arr_frmCmds['CLP_CLASS']))
if (!empty($arr_frmCmds['CLP_SRC']) &&
file_exists($arr_frmCmds['CLP_SRC']))
require_once $arr_frmCmds['CLP_SRC'];
$arr_frmCmds['CLP_CLASS']=
"CLI_PROFILE";
$arr_frmCmds['CLP_CLASS']=
"CLI_PROFILE";
$i_projId=
(isset
($dataArr[$str_valKey]['PROJ_ID']) ?
intval($dataArr[$str_valKey]['PROJ_ID']) :
0);
$str_cmd=
"\$this->myProfile=new ".
$arr_frmCmds['CLP_CLASS'].
"($i_projId,".
$this->getProfileId().
");";
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"PROFILE_CMD: ".
$str_cmd);
if (isset
($dataArr[$str_valKey]['CLP_IDX']))
$this->myTblObj->setDBField('CLP_IDX',$dataArr[$str_valKey]['CLP_IDX']);
* @param DBMS_TABLE_OBJ $tblObj
$obj_profile=
$this->myTblObj->getProfileObj();
if (intval($obj_profile->getId()))
* @param boolean $force (if false only $this->myTblObj is returned else it tries to instantiate a new object)
* @requires common/pcf_templates.phpinc
if ($debug) echoDebugLine(__FILE__
,__LINE__
,'Returning exisiting object');
if ($debug) echoDebugLine(__FILE__
,__LINE__
,'Returning new object');
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"<hr />Getting TblObj");
// generate a PROFILE ENTRY object
$this->myTblObj =
new CLI_PROFIL_ENTRY();
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"Getting TblObj done <hr />");
//if ($debug) echoDebugLine(__FILE__,__LINE__,"Returning ".($obj_ret->isPopulated() ? "<b>populated</b>" : "not populated")." Object of ".get_class($obj_ret));
* @abstract for child objects to init on checkSubmitData
* @param array $frmSettings
* @param string $dataArrName
* @param array $frmValues
if ($debug) echo
"<pre>frmSettings: \n".
print_r($frmSettings,True).
"</pre>";
if (!isset
($frmValues[$dataArrName]['CLP_ID']) ||
!intval($frmValues[$dataArrName]['CLP_ID']))
if (intval($frmSettings['FILTER']['CLP_ID']))
$frmValues[$dataArrName]['CLP_ID']=
intval($frmSettings['FILTER']['CLP_ID']);
if (!isset
($frmValues[$dataArrName]['CLP_IDX']) ||
!intval($frmValues[$dataArrName]['CLP_IDX']))
if (intval($frmSettings['FILTER']['CLP_IDX']))
$frmValues[$dataArrName]['CLP_IDX']=
$frmSettings['FILTER']['CLP_IDX'];
Documentation generated on Thu, 08 Jan 2009 17:38:09 +0100 by phpDocumentor 1.4.0a2