Added is_object()
This commit is contained in:
@@ -104,7 +104,7 @@ class Groups
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oGrp = GroupUserPeer::retrieveByPk($GrpUid, $UsrUid);
|
$oGrp = GroupUserPeer::retrieveByPk($GrpUid, $UsrUid);
|
||||||
if (get_class($oGrp) == 'GroupUser') {
|
if (is_object($oGrp) && get_class($oGrp) == 'GroupUser') {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$oGrp = new GroupUser();
|
$oGrp = new GroupUser();
|
||||||
@@ -303,7 +303,7 @@ class Groups
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oGrp = GroupUserPeer::retrieveByPk($GrpUid, $UsrUid);
|
$oGrp = GroupUserPeer::retrieveByPk($GrpUid, $UsrUid);
|
||||||
if (get_class($oGrp) == 'GroupUser') {
|
if (is_object($oGrp) && get_class($oGrp) == 'GroupUser') {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ class propelTable
|
|||||||
if(is_object($value)){
|
if(is_object($value)){
|
||||||
$value = '';
|
$value = '';
|
||||||
}
|
}
|
||||||
$this->tpl->assign( "value" , (eregi('^[[:space:]]', $value) && (substr($fieldName,0,3)!="PRO"))? str_ireplace(" "," ",$htmlField):$htmlField );
|
$this->tpl->assign( "value" , (preg_match('^[[:space:]]^', $value) && (substr($fieldName,0,3)!="PRO"))? str_ireplace(" "," ",$htmlField):$htmlField );
|
||||||
}
|
}
|
||||||
return $this->fields[$r]['Type'];
|
return $this->fields[$r]['Type'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ class Application extends BaseApplication {
|
|||||||
$con = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
|
$con = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oApplication = ApplicationPeer::retrieveByPk( $AppUid );
|
$oApplication = ApplicationPeer::retrieveByPk( $AppUid );
|
||||||
if ( get_class ($oApplication) == 'Application' ) {
|
if (is_object($oApplication) && get_class ($oApplication) == 'Application' ) {
|
||||||
$aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME);
|
$aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
|
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
|
||||||
|
|
||||||
@@ -393,7 +393,7 @@ class Application extends BaseApplication {
|
|||||||
try {
|
try {
|
||||||
$con->begin();
|
$con->begin();
|
||||||
$oApp = ApplicationPeer::retrieveByPK( $aData['APP_UID'] );
|
$oApp = ApplicationPeer::retrieveByPK( $aData['APP_UID'] );
|
||||||
if ( get_class ($oApp) == 'Application' ) {
|
if (is_object($oApp) && get_class ($oApp) == 'Application' ) {
|
||||||
$oApp->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
$oApp->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||||
if ($oApp->validate()) {
|
if ($oApp->validate()) {
|
||||||
if ( isset ( $aData['APP_TITLE'] ) )
|
if ( isset ( $aData['APP_TITLE'] ) )
|
||||||
|
|||||||
@@ -863,7 +863,7 @@ class CaseScheduler extends BaseCaseScheduler {
|
|||||||
function Exists( $sUid ) {
|
function Exists( $sUid ) {
|
||||||
try {
|
try {
|
||||||
$oObj = CaseSchedulerPeer::retrieveByPk( $sUid );
|
$oObj = CaseSchedulerPeer::retrieveByPk( $sUid );
|
||||||
return (get_class($oObj) == 'CaseScheduler');
|
return (is_object($oObj) && get_class($oObj) == 'CaseScheduler');
|
||||||
}
|
}
|
||||||
catch (Exception $oError) {
|
catch (Exception $oError) {
|
||||||
throw($oError);
|
throw($oError);
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ class CaseTracker extends BaseCaseTracker {
|
|||||||
function caseTrackerExists ( $sUid ) {
|
function caseTrackerExists ( $sUid ) {
|
||||||
try {
|
try {
|
||||||
$oObj = CaseTrackerPeer::retrieveByPk($sUid);
|
$oObj = CaseTrackerPeer::retrieveByPk($sUid);
|
||||||
return (get_class($oObj) == 'CaseTracker');
|
return (is_object($oObj) && get_class($oObj) == 'CaseTracker');
|
||||||
}
|
}
|
||||||
catch (Exception $oError) {
|
catch (Exception $oError) {
|
||||||
throw($oError);
|
throw($oError);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class CaseTrackerObject extends BaseCaseTrackerObject {
|
|||||||
$oConnection = Propel::getConnection(CaseTrackerObjectPeer::DATABASE_NAME);
|
$oConnection = Propel::getConnection(CaseTrackerObjectPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oCaseTobj = CaseTrackerObjectPeer::retrieveByPK($sCTOUID);
|
$oCaseTobj = CaseTrackerObjectPeer::retrieveByPK($sCTOUID);
|
||||||
if (get_class($oCaseTobj) == 'CaseTrackerObject')
|
if (is_object($oCaseTobj) && get_class($oCaseTobj) == 'CaseTrackerObject')
|
||||||
{
|
{
|
||||||
$oConnection->begin();
|
$oConnection->begin();
|
||||||
$iResult = $oCaseTobj->delete();
|
$iResult = $oCaseTobj->delete();
|
||||||
@@ -143,7 +143,7 @@ class CaseTrackerObject extends BaseCaseTrackerObject {
|
|||||||
function caseTrackerObjectExists ( $Uid ) {
|
function caseTrackerObjectExists ( $Uid ) {
|
||||||
try {
|
try {
|
||||||
$oObj = CaseTrackerObjectPeer::retrieveByPk( $Uid );
|
$oObj = CaseTrackerObjectPeer::retrieveByPk( $Uid );
|
||||||
if ( get_class ($oObj) == 'CaseTrackerObject' ) {
|
if (is_object($oObj) && get_class ($oObj) == 'CaseTrackerObject' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -140,6 +140,6 @@ class Configuration extends BaseConfiguration {
|
|||||||
public function exists($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid)
|
public function exists($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid)
|
||||||
{
|
{
|
||||||
$oRow = ConfigurationPeer::retrieveByPK( $CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid );
|
$oRow = ConfigurationPeer::retrieveByPK( $CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid );
|
||||||
return ( get_class ($oRow) == 'Configuration' && $oRow != '');
|
return (is_object($oRow) && get_class ($oRow) == 'Configuration');
|
||||||
}
|
}
|
||||||
} // Configuration
|
} // Configuration
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ class Content extends BaseContent {
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oPro = ContentPeer::retrieveByPk($ConCategory, $ConParent, $ConId, $ConLang);
|
$oPro = ContentPeer::retrieveByPk($ConCategory, $ConParent, $ConId, $ConLang);
|
||||||
if ( get_class ($oPro) == 'Content' ) {
|
if (is_object($oPro) && get_class ($oPro) == 'Content' ) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class DbSource extends BaseDbSource
|
|||||||
function Exists ( $Uid ) {
|
function Exists ( $Uid ) {
|
||||||
try {
|
try {
|
||||||
$oPro = DbSourcePeer::retrieveByPk( $Uid );
|
$oPro = DbSourcePeer::retrieveByPk( $Uid );
|
||||||
if ( get_class ($oPro) == 'DbSource' ) {
|
if (is_object($oPro) && get_class ($oPro) == 'DbSource' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ protected $depo_title = '';
|
|||||||
try {
|
try {
|
||||||
$con->begin();
|
$con->begin();
|
||||||
$oPro = DepartmentPeer::retrieveByPK( $aData['DEP_UID'] );
|
$oPro = DepartmentPeer::retrieveByPK( $aData['DEP_UID'] );
|
||||||
if ( get_class ($oPro) == 'Department' ) {
|
if (is_object($oPro) && get_class ($oPro) == 'Department' ) {
|
||||||
$oPro->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
$oPro->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||||
if ($oPro->validate()) {
|
if ($oPro->validate()) {
|
||||||
if ( isset ( $aData['DEPO_TITLE'] ) )
|
if ( isset ( $aData['DEPO_TITLE'] ) )
|
||||||
@@ -251,7 +251,7 @@ protected $depo_title = '';
|
|||||||
$aFields['USR_UID'] = $aRow['USR_UID'];
|
$aFields['USR_UID'] = $aRow['USR_UID'];
|
||||||
$aFields['DEP_UID'] = '';
|
$aFields['DEP_UID'] = '';
|
||||||
$oDepto = UsersPeer::retrieveByPk($aFields['USR_UID']);
|
$oDepto = UsersPeer::retrieveByPk($aFields['USR_UID']);
|
||||||
if (get_class($oDepto) == 'UsersPeer') {
|
if (is_object($oDepto) && get_class($oDepto) == 'UsersPeer') {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$oDepto = new Users();
|
$oDepto = new Users();
|
||||||
@@ -290,7 +290,7 @@ protected $depo_title = '';
|
|||||||
function existsDepartment( $DepUid ) {
|
function existsDepartment( $DepUid ) {
|
||||||
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
|
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
|
||||||
$oPro = DepartmentPeer::retrieveByPk( $DepUid );
|
$oPro = DepartmentPeer::retrieveByPk( $DepUid );
|
||||||
if ( get_class ($oPro) == 'Department' ) {
|
if (is_object($oPro) && get_class ($oPro) == 'Department' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -301,7 +301,7 @@ protected $depo_title = '';
|
|||||||
function existsUserInDepartment( $depId, $userId ) {
|
function existsUserInDepartment( $depId, $userId ) {
|
||||||
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
|
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
|
||||||
$oUser = UsersPeer::retrieveByPk( $userId );
|
$oUser = UsersPeer::retrieveByPk( $userId );
|
||||||
if ( get_class ($oUser) == 'Users' ) {
|
if (is_object($oUser) && get_class ($oUser) == 'Users' ) {
|
||||||
if ( $oUser->getDepUid() == $depId )
|
if ( $oUser->getDepUid() == $depId )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -313,7 +313,7 @@ protected $depo_title = '';
|
|||||||
$managerId = '';
|
$managerId = '';
|
||||||
$depParent = '';
|
$depParent = '';
|
||||||
$oDept = DepartmentPeer::retrieveByPk( $depId );
|
$oDept = DepartmentPeer::retrieveByPk( $depId );
|
||||||
if ( get_class ($oDept) == 'Department' ) {
|
if (is_object($oDept) && get_class ($oDept) == 'Department' ) {
|
||||||
$managerId = $oDept->getDepManager( );
|
$managerId = $oDept->getDepManager( );
|
||||||
$depParent = $oDept->getDepParent( );
|
$depParent = $oDept->getDepParent( );
|
||||||
}
|
}
|
||||||
@@ -331,10 +331,10 @@ protected $depo_title = '';
|
|||||||
|
|
||||||
// update manager's manager, getting the manager of PARENT DEPARTMENT in order to enable scalating
|
// update manager's manager, getting the manager of PARENT DEPARTMENT in order to enable scalating
|
||||||
$oUser = UsersPeer::retrieveByPk( $managerId );
|
$oUser = UsersPeer::retrieveByPk( $managerId );
|
||||||
if ( get_class ($oUser) == 'Users' ) {
|
if (is_object($oUser) && get_class ($oUser) == 'Users' ) {
|
||||||
$oDept = DepartmentPeer::retrieveByPk( $depParent );
|
$oDept = DepartmentPeer::retrieveByPk( $depParent );
|
||||||
$oUser->setUsrReportsTo( '' ); //by default no manager
|
$oUser->setUsrReportsTo( '' ); //by default no manager
|
||||||
if ( get_class ($oDept) == 'Department' ) {
|
if (is_object($oUser) && get_class ($oDept) == 'Department' ) {
|
||||||
$managerParentId = $oDept->getDepManager( );
|
$managerParentId = $oDept->getDepManager( );
|
||||||
if ( trim($managerParentId) != '' ) {
|
if ( trim($managerParentId) != '' ) {
|
||||||
$oUser->setUsrReportsTo( $managerParentId );
|
$oUser->setUsrReportsTo( $managerParentId );
|
||||||
@@ -352,7 +352,7 @@ protected $depo_title = '';
|
|||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
while ( $aRow = $oDataset->getRow() ) {
|
while ( $aRow = $oDataset->getRow() ) {
|
||||||
$oUser = UsersPeer::retrieveByPk($aRow['DEP_MANAGER']);
|
$oUser = UsersPeer::retrieveByPk($aRow['DEP_MANAGER']);
|
||||||
if (get_class($oUser) == 'Users') {
|
if (is_object($oUser) && get_class($oUser) == 'Users') {
|
||||||
$oUser->setUsrReportsTo ( $managerId );
|
$oUser->setUsrReportsTo ( $managerId );
|
||||||
$oUser->save();
|
$oUser->save();
|
||||||
}
|
}
|
||||||
@@ -366,7 +366,7 @@ protected $depo_title = '';
|
|||||||
try {
|
try {
|
||||||
//update the field in user table
|
//update the field in user table
|
||||||
$oUser = UsersPeer::retrieveByPk( $userId );
|
$oUser = UsersPeer::retrieveByPk( $userId );
|
||||||
if ( get_class ($oUser) == 'Users' ) {
|
if (is_object($oUser) && get_class ($oUser) == 'Users' ) {
|
||||||
$oUser->setDepUid( $depId );
|
$oUser->setDepUid( $depId );
|
||||||
$oUser->save();
|
$oUser->save();
|
||||||
}
|
}
|
||||||
@@ -374,7 +374,7 @@ protected $depo_title = '';
|
|||||||
//if the user is a manager update Department Table
|
//if the user is a manager update Department Table
|
||||||
if ( $manager ) {
|
if ( $manager ) {
|
||||||
$oDept = DepartmentPeer::retrieveByPk( $depId );
|
$oDept = DepartmentPeer::retrieveByPk( $depId );
|
||||||
if ( get_class ($oDept) == 'Department' ) {
|
if (is_object($oDept) && get_class ($oDept) == 'Department' ) {
|
||||||
$oDept->setDepManager( $userId );
|
$oDept->setDepManager( $userId );
|
||||||
$oDept->save();
|
$oDept->save();
|
||||||
}
|
}
|
||||||
@@ -486,7 +486,7 @@ protected $depo_title = '';
|
|||||||
$aFields = array ('USR_UID'=> $UsrUid,'DEP_UID'=> '', 'USR_REPORTS_TO' => '');
|
$aFields = array ('USR_UID'=> $UsrUid,'DEP_UID'=> '', 'USR_REPORTS_TO' => '');
|
||||||
try {
|
try {
|
||||||
$oUser = UsersPeer::retrieveByPk( $UsrUid );
|
$oUser = UsersPeer::retrieveByPk( $UsrUid );
|
||||||
if ( get_class($oUser) == 'Users' ) {
|
if (is_object($oUser) && get_class($oUser) == 'Users' ) {
|
||||||
//$oDepto = new Users();
|
//$oDepto = new Users();
|
||||||
$oUser->setDepUid ( '');
|
$oUser->setDepUid ( '');
|
||||||
$oUser->setUsrReportsTo ( '');
|
$oUser->setUsrReportsTo ( '');
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ class Dynaform extends BaseDynaform {
|
|||||||
$con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
|
$con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oPro = DynaformPeer::retrieveByPk( $ProUid );
|
$oPro = DynaformPeer::retrieveByPk( $ProUid );
|
||||||
if ( get_class ($oPro) == 'Dynaform' ) {
|
if (is_object($oPro) && get_class ($oPro) == 'Dynaform' ) {
|
||||||
$aFields = $oPro->toArray(BasePeer::TYPE_FIELDNAME);
|
$aFields = $oPro->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
|
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
|
||||||
$aFields['DYN_TITLE'] = $oPro->getDynTitle();
|
$aFields['DYN_TITLE'] = $oPro->getDynTitle();
|
||||||
@@ -346,7 +346,7 @@ class Dynaform extends BaseDynaform {
|
|||||||
try {
|
try {
|
||||||
$con->begin();
|
$con->begin();
|
||||||
$oPro = DynaformPeer::retrieveByPK( $aData['DYN_UID'] );
|
$oPro = DynaformPeer::retrieveByPK( $aData['DYN_UID'] );
|
||||||
if ( get_class ($oPro) == 'Dynaform' ) {
|
if (is_object($oPro) && get_class ($oPro) == 'Dynaform' ) {
|
||||||
$oPro->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
$oPro->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||||
if ($oPro->validate()) {
|
if ($oPro->validate()) {
|
||||||
if ( isset ( $aData['DYN_TITLE'] ) )
|
if ( isset ( $aData['DYN_TITLE'] ) )
|
||||||
@@ -416,7 +416,7 @@ class Dynaform extends BaseDynaform {
|
|||||||
public function exists($DynUid)
|
public function exists($DynUid)
|
||||||
{
|
{
|
||||||
$oPro = DynaformPeer::retrieveByPk( $DynUid );
|
$oPro = DynaformPeer::retrieveByPk( $DynUid );
|
||||||
return ( get_class ($oPro) == 'Dynaform' );
|
return (is_object($oPro) && get_class ($oPro) == 'Dynaform' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -429,7 +429,7 @@ class Dynaform extends BaseDynaform {
|
|||||||
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
|
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oDyn = DynaformPeer::retrieveByPk( $DynUid );
|
$oDyn = DynaformPeer::retrieveByPk( $DynUid );
|
||||||
if ( get_class ($oDyn) == 'Dynaform' ) {
|
if (is_object($oDyn) && get_class ($oDyn) == 'Dynaform' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class FieldCondition extends BaseFieldCondition {
|
|||||||
try {
|
try {
|
||||||
if( isset($aData['FCD_UID']) && trim($aData['FCD_UID']) != '' ) {
|
if( isset($aData['FCD_UID']) && trim($aData['FCD_UID']) != '' ) {
|
||||||
$obj = FieldConditionPeer::retrieveByPk( $aData['FCD_UID'] );
|
$obj = FieldConditionPeer::retrieveByPk( $aData['FCD_UID'] );
|
||||||
if( get_class($obj) != 'FieldCondition') {
|
if(is_object($obj) && get_class($obj) != 'FieldCondition') {
|
||||||
$obj = new FieldCondition();
|
$obj = new FieldCondition();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -335,7 +335,7 @@ class FieldCondition extends BaseFieldCondition {
|
|||||||
function Exists ( $sUid ) {
|
function Exists ( $sUid ) {
|
||||||
try {
|
try {
|
||||||
$obj = FieldConditionPeer::retrieveByPk( $sUid );
|
$obj = FieldConditionPeer::retrieveByPk( $sUid );
|
||||||
return( get_class($obj) == 'FieldCondition') ;
|
return(is_object($obj) && get_class($obj) == 'FieldCondition') ;
|
||||||
}
|
}
|
||||||
catch (Exception $oError) {
|
catch (Exception $oError) {
|
||||||
throw($oError);
|
throw($oError);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class ObjectPermission extends BaseObjectPermission {
|
|||||||
function Exists ( $Uid ) {
|
function Exists ( $Uid ) {
|
||||||
try {
|
try {
|
||||||
$oPro = ObjectPermissionPeer::retrieveByPk( $Uid );
|
$oPro = ObjectPermissionPeer::retrieveByPk( $Uid );
|
||||||
if ( get_class ($oPro) == 'ObjectPermission' ) {
|
if (is_object($oPro) && get_class ($oPro) == 'ObjectPermission' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -70,7 +70,7 @@ class ObjectPermission extends BaseObjectPermission {
|
|||||||
$con = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
|
$con = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oObjPer = ObjectPermissionPeer::retrieveByPK($Uid);
|
$oObjPer = ObjectPermissionPeer::retrieveByPK($Uid);
|
||||||
if (get_class($oObjPer) == 'ObjectPermission')
|
if (is_object($oObjPer) && get_class($oObjPer) == 'ObjectPermission')
|
||||||
{
|
{
|
||||||
$con->begin();
|
$con->begin();
|
||||||
$iResult = $oObjPer->delete();
|
$iResult = $oObjPer->delete();
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ class Process extends BaseProcess {
|
|||||||
$con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
|
$con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oPro = ProcessPeer::retrieveByPk( $ProUid );
|
$oPro = ProcessPeer::retrieveByPk( $ProUid );
|
||||||
if ( get_class ($oPro) == 'Process' ) {
|
if (is_object ($oPro) && get_class ($oPro) == 'Process' ) {
|
||||||
$aFields = $oPro->toArray(BasePeer::TYPE_FIELDNAME);
|
$aFields = $oPro->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
|
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
|
||||||
//optimized to avoid double and multiple execution of the same query
|
//optimized to avoid double and multiple execution of the same query
|
||||||
@@ -301,7 +301,7 @@ class Process extends BaseProcess {
|
|||||||
$aFields['PRO_CATEGORY_LABEL']=G::LoadTranslation("ID_PROCESS_NO_CATEGORY");
|
$aFields['PRO_CATEGORY_LABEL']=G::LoadTranslation("ID_PROCESS_NO_CATEGORY");
|
||||||
if($aFields['PRO_CATEGORY']!=""){
|
if($aFields['PRO_CATEGORY']!=""){
|
||||||
$oProCat = ProcessCategoryPeer::retrieveByPk( $aFields['PRO_CATEGORY'] );
|
$oProCat = ProcessCategoryPeer::retrieveByPk( $aFields['PRO_CATEGORY'] );
|
||||||
if ( get_class ($oProCat) == 'ProcessCategory' ) {
|
if (is_object ($oProCat) && get_class ($oProCat) == 'ProcessCategory' ) {
|
||||||
$aFields['PRO_CATEGORY_LABEL']=$oProCat->getCategoryName();
|
$aFields['PRO_CATEGORY_LABEL']=$oProCat->getCategoryName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -336,7 +336,7 @@ class Process extends BaseProcess {
|
|||||||
try {
|
try {
|
||||||
$con->begin();
|
$con->begin();
|
||||||
$oPro = ProcessPeer::retrieveByPK( $aData['PRO_UID'] );
|
$oPro = ProcessPeer::retrieveByPK( $aData['PRO_UID'] );
|
||||||
if ( get_class ($oPro) == 'Process' ) {
|
if (is_object ($oPro) && get_class ($oPro) == 'Process' ) {
|
||||||
$oPro->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
$oPro->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||||
if ($oPro->validate()) {
|
if ($oPro->validate()) {
|
||||||
if ( isset ( $aData['PRO_TITLE'] ) )
|
if ( isset ( $aData['PRO_TITLE'] ) )
|
||||||
@@ -454,7 +454,7 @@ class Process extends BaseProcess {
|
|||||||
public function exists($ProUid)
|
public function exists($ProUid)
|
||||||
{
|
{
|
||||||
$oPro = ProcessPeer::retrieveByPk( $ProUid );
|
$oPro = ProcessPeer::retrieveByPk( $ProUid );
|
||||||
return ( get_class ($oPro) == 'Process' );
|
return (is_object ($oPro) && get_class ($oPro) == 'Process' );
|
||||||
}
|
}
|
||||||
|
|
||||||
//new functions
|
//new functions
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class ProcessUser extends BaseProcessUser {
|
|||||||
function Exists ( $sUid ) {
|
function Exists ( $sUid ) {
|
||||||
try {
|
try {
|
||||||
$oObj = ProcessUserPeer::retrieveByPk($sUid);
|
$oObj = ProcessUserPeer::retrieveByPk($sUid);
|
||||||
return (get_class($oObj) == 'ProcessUser');
|
return (is_object($oObj) && get_class($oObj) == 'ProcessUser');
|
||||||
}
|
}
|
||||||
catch (Exception $oError) {
|
catch (Exception $oError) {
|
||||||
throw($oError);
|
throw($oError);
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ class ReportTable extends BaseReportTable {
|
|||||||
$con = Propel::getConnection(ReportTablePeer::DATABASE_NAME);
|
$con = Propel::getConnection(ReportTablePeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oRepTabUid = ReportTablePeer::retrieveByPk( $RepTabUid );
|
$oRepTabUid = ReportTablePeer::retrieveByPk( $RepTabUid );
|
||||||
if ( get_class ($oRepTabUid) == 'ReportTable' ) {
|
if (is_object($oRepTabUid) && get_class ($oRepTabUid) == 'ReportTable' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class Route extends BaseRoute {
|
|||||||
$con = Propel::getConnection(RoutePeer::DATABASE_NAME);
|
$con = Propel::getConnection(RoutePeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oRouUid = RoutePeer::retrieveByPk( $sRouUid );
|
$oRouUid = RoutePeer::retrieveByPk( $sRouUid );
|
||||||
if ( get_class ($oRouUid) == 'Route' ) {
|
if (is_object($oRouUid) && get_class ($oRouUid) == 'Route' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ class Stage extends BaseStage {
|
|||||||
function Exists ( $sUid ) {
|
function Exists ( $sUid ) {
|
||||||
try {
|
try {
|
||||||
$oObj = StagePeer::retrieveByPk($sUid);
|
$oObj = StagePeer::retrieveByPk($sUid);
|
||||||
return (get_class($oObj) == 'Stage');
|
return (is_object($oObj) && get_class($oObj) == 'Stage');
|
||||||
}
|
}
|
||||||
catch (Exception $oError) {
|
catch (Exception $oError) {
|
||||||
throw($oError);
|
throw($oError);
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ class Step extends BaseStep {
|
|||||||
$con = Propel::getConnection(StepPeer::DATABASE_NAME);
|
$con = Propel::getConnection(StepPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oObj = StepPeer::retrieveByPk( $sUid );
|
$oObj = StepPeer::retrieveByPk( $sUid );
|
||||||
if ( get_class ($oObj) == 'Step' ) {
|
if (is_object($oObj) && get_class ($oObj) == 'Step' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class StepSupervisor extends BaseStepSupervisor {
|
|||||||
function Exists ( $Uid ) {
|
function Exists ( $Uid ) {
|
||||||
try {
|
try {
|
||||||
$oPro = StepSupervisorPeer::retrieveByPk( $Uid );
|
$oPro = StepSupervisorPeer::retrieveByPk( $Uid );
|
||||||
if ( get_class ($oPro) == 'StepSupervisor' ) {
|
if (is_object($oPro) && get_class ($oPro) == 'StepSupervisor' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ class StepTrigger extends BaseStepTrigger {
|
|||||||
$con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
|
$con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oObj = StepTriggerPeer::retrieveByPk($StepUid, $TasUid, $TriUid, $StType);
|
$oObj = StepTriggerPeer::retrieveByPk($StepUid, $TasUid, $TriUid, $StType);
|
||||||
if ( get_class ($oObj) == 'StepTrigger' ) {
|
if (is_object($oObj) && get_class ($oObj) == 'StepTrigger' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ class SubProcess extends BaseSubProcess {
|
|||||||
$con = Propel::getConnection(SubProcessPeer::DATABASE_NAME);
|
$con = Propel::getConnection(SubProcessPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oObj = SubProcessPeer::retrieveByPk( $sUid );
|
$oObj = SubProcessPeer::retrieveByPk( $sUid );
|
||||||
if ( get_class ($oObj) == 'SubProcess' ) {
|
if (is_object($oObj) && get_class ($oObj) == 'SubProcess' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ public function kgetassigType($pro_uid, $tas){
|
|||||||
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
|
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oPro = TaskPeer::retrieveByPk( $TasUid );
|
$oPro = TaskPeer::retrieveByPk( $TasUid );
|
||||||
if ( get_class ($oPro) == 'Task' ) {
|
if ( is_object($oPro) && get_class ($oPro) == 'Task' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class TaskUser extends BaseTaskUser {
|
|||||||
$con = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
|
$con = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oTaskUser = TaskUserPeer::retrieveByPk($sTasUid, $sUserUid, $iType, $iRelation);
|
$oTaskUser = TaskUserPeer::retrieveByPk($sTasUid, $sUserUid, $iType, $iRelation);
|
||||||
if ( get_class ($oTaskUser) == 'TaskUser' ) {
|
if ( is_object($oTaskUser) && get_class ($oTaskUser) == 'TaskUser' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ class Triggers extends BaseTriggers {
|
|||||||
$con = Propel::getConnection(TriggersPeer::DATABASE_NAME);
|
$con = Propel::getConnection(TriggersPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oObj = TriggersPeer::retrieveByPk( $sUid );
|
$oObj = TriggersPeer::retrieveByPk( $sUid );
|
||||||
if ( get_class ($oObj) == 'Triggers' ) {
|
if (is_object($oObj) && get_class ($oObj) == 'Triggers' ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class UsersProperties extends BaseUsersProperties {
|
|||||||
$oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID);
|
$oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID);
|
||||||
var_dump($oUserProperty);
|
var_dump($oUserProperty);
|
||||||
var_dump($sUserUID);
|
var_dump($sUserUID);
|
||||||
if (get_class($oUserProperty) == 'UsersProperties' && $oUserProperty != '') {
|
if (is_object($oUserProperty) && get_class($oUserProperty) == 'UsersProperties') {
|
||||||
echo"inside";
|
echo"inside";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ try {
|
|||||||
//getting the user and department
|
//getting the user and department
|
||||||
$oDepInfo = new Department();
|
$oDepInfo = new Department();
|
||||||
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
|
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
|
||||||
if ( get_class ($oUser) == 'Users' ) {
|
if ( is_object($oUser) && get_class ($oUser) == 'Users' ) {
|
||||||
$userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
$userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
|
$aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ try {
|
|||||||
//getting the user and department
|
//getting the user and department
|
||||||
$oDepInfo = new Department();
|
$oDepInfo = new Department();
|
||||||
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
|
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
|
||||||
if ( get_class ($oUser) == 'Users' ) {
|
if (is_object($oUser) && get_class ($oUser) == 'Users' ) {
|
||||||
$userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
$userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
|
$aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ try {
|
|||||||
//getting the user and department
|
//getting the user and department
|
||||||
$oDepInfo = new Department();
|
$oDepInfo = new Department();
|
||||||
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
|
$oUser = UsersPeer::retrieveByPk( $aFields['USR_REPORTS_TO'] );
|
||||||
|
if ($oUser != '')
|
||||||
if ( get_class ($oUser) == 'Users' ) {
|
if ( get_class ($oUser) == 'Users' ) {
|
||||||
$userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
$userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
|
$aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
|
||||||
|
|||||||
Reference in New Issue
Block a user