CODE STYLE, checking in detail (PART 2)
FILES: workflow/engine/classes/model/InputDocument.php workflow/engine/classes/model/StepTrigger.php workflow/engine/classes/model/Users.php workflow/engine/methods/setup/webServicesAjax.php
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* InputDocument.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
@@ -38,16 +39,19 @@ require_once 'classes/model/Content.php';
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class InputDocument extends BaseInputDocument {
|
||||
class InputDocument extends BaseInputDocument
|
||||
{
|
||||
|
||||
/**
|
||||
* This value goes in the content table
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $inp_doc_title = '';
|
||||
|
||||
/**
|
||||
* This value goes in the content table
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $inp_doc_description = '';
|
||||
@@ -61,19 +65,16 @@ class InputDocument extends BaseInputDocument {
|
||||
{
|
||||
try {
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK( $sInpDocUid );
|
||||
if (!is_null($oInputDocument))
|
||||
{
|
||||
if (! is_null( $oInputDocument )) {
|
||||
$aFields = $oInputDocument->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$aFields['INP_DOC_TITLE'] = $oInputDocument->getInpDocTitle();
|
||||
$aFields['INP_DOC_DESCRIPTION'] = $oInputDocument->getInpDocDescription();
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
return $aFields;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -82,33 +83,37 @@ class InputDocument extends BaseInputDocument {
|
||||
{
|
||||
try {
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK( $sInpDocUid );
|
||||
if( is_null($oInputDocument))
|
||||
if (is_null( $oInputDocument )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$aFields = $oInputDocument->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$aFields['INP_DOC_TITLE'] = $oInputDocument->getInpDocTitle();
|
||||
$aFields['INP_DOC_DESCRIPTION'] = $oInputDocument->getInpDocDescription();
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
return $aFields;
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the application document registry
|
||||
*
|
||||
* @param array $aData
|
||||
* @return string
|
||||
**/
|
||||
*
|
||||
*/
|
||||
public function create ($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection( InputDocumentPeer::DATABASE_NAME );
|
||||
try {
|
||||
if ( isset ( $aData['INP_DOC_UID'] ) && $aData['INP_DOC_UID']== '' )
|
||||
if (isset( $aData['INP_DOC_UID'] ) && $aData['INP_DOC_UID'] == '') {
|
||||
unset( $aData['INP_DOC_UID'] );
|
||||
if ( !isset ( $aData['INP_DOC_UID'] ) )
|
||||
}
|
||||
if (! isset( $aData['INP_DOC_UID'] )) {
|
||||
$aData['INP_DOC_UID'] = G::generateUniqueID();
|
||||
}
|
||||
$oInputDocument = new InputDocument();
|
||||
$oInputDocument->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($oInputDocument->validate()) {
|
||||
@@ -122,8 +127,7 @@ class InputDocument extends BaseInputDocument {
|
||||
$iResult = $oInputDocument->save();
|
||||
$oConnection->commit();
|
||||
return $aData['INP_DOC_UID'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oInputDocument->getValidationFailures();
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
@@ -131,8 +135,7 @@ class InputDocument extends BaseInputDocument {
|
||||
}
|
||||
throw (new Exception( 'The registry cannot be created!<br />' . $sMessage ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
@@ -140,32 +143,30 @@ class InputDocument extends BaseInputDocument {
|
||||
|
||||
/**
|
||||
* Update the application document registry
|
||||
*
|
||||
* @param array $aData
|
||||
* @return string
|
||||
**/
|
||||
*
|
||||
*/
|
||||
public function update ($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection( InputDocumentPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK( $aData['INP_DOC_UID'] );
|
||||
if (!is_null($oInputDocument))
|
||||
{
|
||||
if (! is_null( $oInputDocument )) {
|
||||
$oInputDocument->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($oInputDocument->validate()) {
|
||||
$oConnection->begin();
|
||||
if (isset($aData['INP_DOC_TITLE']))
|
||||
{
|
||||
if (isset( $aData['INP_DOC_TITLE'] )) {
|
||||
$oInputDocument->setInpDocTitle( $aData['INP_DOC_TITLE'] );
|
||||
}
|
||||
if (isset($aData['INP_DOC_DESCRIPTION']))
|
||||
{
|
||||
if (isset( $aData['INP_DOC_DESCRIPTION'] )) {
|
||||
$oInputDocument->setInpDocDescription( $aData['INP_DOC_DESCRIPTION'] );
|
||||
}
|
||||
$iResult = $oInputDocument->save();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oInputDocument->getValidationFailures();
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
@@ -173,12 +174,10 @@ class InputDocument extends BaseInputDocument {
|
||||
}
|
||||
throw (new Exception( 'The registry cannot be updated!<br />' . $sMessage ));
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
@@ -186,28 +185,27 @@ class InputDocument extends BaseInputDocument {
|
||||
|
||||
/**
|
||||
* Remove the application document registry
|
||||
*
|
||||
* @param array $aData
|
||||
* @return string
|
||||
**/
|
||||
*
|
||||
*/
|
||||
public function remove ($sInpDocUid)
|
||||
{
|
||||
$oConnection = Propel::getConnection( InputDocumentPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK( $sInpDocUid );
|
||||
if (!is_null($oInputDocument))
|
||||
{
|
||||
if (! is_null( $oInputDocument )) {
|
||||
$oConnection->begin();
|
||||
Content::removeContent( 'INP_DOC_TITLE', '', $oInputDocument->getInpDocUid() );
|
||||
Content::removeContent( 'INP_DOC_DESCRIPTION', '', $oInputDocument->getInpDocUid() );
|
||||
$iResult = $oInputDocument->delete();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
@@ -215,6 +213,7 @@ class InputDocument extends BaseInputDocument {
|
||||
|
||||
/**
|
||||
* Get the [inp_doc_title] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInpDocTitle ()
|
||||
@@ -222,8 +221,7 @@ class InputDocument extends BaseInputDocument {
|
||||
if ($this->inp_doc_title == '') {
|
||||
try {
|
||||
$this->inp_doc_title = Content::load( 'INP_DOC_TITLE', '', $this->getInpDocUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en') );
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -246,8 +244,7 @@ class InputDocument extends BaseInputDocument {
|
||||
$this->inp_doc_title = $sValue;
|
||||
|
||||
$iResult = Content::addContent( 'INP_DOC_TITLE', '', $this->getInpDocUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en'), $this->inp_doc_title );
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$this->inp_doc_title = '';
|
||||
throw ($oError);
|
||||
}
|
||||
@@ -256,6 +253,7 @@ class InputDocument extends BaseInputDocument {
|
||||
|
||||
/**
|
||||
* Get the [inp_doc_comment] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInpDocDescription ()
|
||||
@@ -263,8 +261,7 @@ class InputDocument extends BaseInputDocument {
|
||||
if ($this->inp_doc_description == '') {
|
||||
try {
|
||||
$this->inp_doc_description = Content::load( 'INP_DOC_DESCRIPTION', '', $this->getInpDocUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en') );
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -287,8 +284,7 @@ class InputDocument extends BaseInputDocument {
|
||||
$this->inp_doc_description = $sValue;
|
||||
|
||||
$iResult = Content::addContent( 'INP_DOC_DESCRIPTION', '', $this->getInpDocUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en'), $this->inp_doc_description );
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$this->inp_doc_description = '';
|
||||
throw ($oError);
|
||||
}
|
||||
@@ -301,20 +297,20 @@ class InputDocument extends BaseInputDocument {
|
||||
* @param string $sUid the uid of the Prolication
|
||||
*/
|
||||
|
||||
function InputExists ( $sUid ) {
|
||||
function InputExists ($sUid)
|
||||
{
|
||||
$con = Propel::getConnection( InputDocumentPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oObj = InputDocumentPeer::retrieveByPk( $sUid );
|
||||
if (is_object( $oObj ) && get_class( $oObj ) == 'InputDocument') {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
}
|
||||
// InputDocument
|
||||
|
||||
} // InputDocument
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* StepTrigger.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
@@ -26,7 +27,6 @@
|
||||
|
||||
require_once 'classes/model/om/BaseStepTrigger.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'STEP_TRIGGER' table.
|
||||
*
|
||||
@@ -38,12 +38,13 @@ require_once 'classes/model/om/BaseStepTrigger.php';
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class StepTrigger extends BaseStepTrigger {
|
||||
class StepTrigger extends BaseStepTrigger
|
||||
{
|
||||
|
||||
function create ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
try
|
||||
{
|
||||
try {
|
||||
//delete old StepTrigger Rows, because is not safe insert previous verify old rows.
|
||||
$criteria = new Criteria();
|
||||
$criteria->add( StepTriggerPeer::STEP_UID, $aData['STEP_UID'] );
|
||||
@@ -64,103 +65,88 @@ class StepTrigger extends BaseStepTrigger {
|
||||
$this->setStType( $aData['ST_TYPE'] );
|
||||
$this->setStCondition( "" );
|
||||
$this->setStPosition( "" );
|
||||
if($this->validate())
|
||||
{
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function load ($StepUid, $TasUid, $TriUid, $StType)
|
||||
{
|
||||
try {
|
||||
$oRow = StepTriggerPeer::retrieveByPK( $StepUid, $TasUid, $TriUid, $StType );
|
||||
if (!is_null($oRow))
|
||||
{
|
||||
if (! is_null( $oRow )) {
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew( false );
|
||||
return $aFields;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw (new Exception( "The row '$StepUid, $TasUid, $TriUid, $StType' in table StepTrigger doesn't exist!" ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
function update ($fields)
|
||||
{
|
||||
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
try
|
||||
{
|
||||
try {
|
||||
$con->begin();
|
||||
$this->load( $fields['STEP_UID'], $fields['TAS_UID'], $fields['TRI_UID'], $fields['ST_TYPE'] );
|
||||
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
if($this->validate())
|
||||
{
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
function remove ($StepUid, $TasUid, $TriUid, $StType)
|
||||
{
|
||||
$oConnection = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oStepTrigger = StepTriggerPeer::retrieveByPK( $StepUid, $TasUid, $TriUid, $StType );
|
||||
if (!is_null($oStepTrigger))
|
||||
{
|
||||
if (! is_null( $oStepTrigger )) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oStepTrigger->delete();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw (new Exception( "The row '$StepUid, $TasUid, $TriUid, $StType' in table StepTrigger doesn't exist!" ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
function stepTriggerExists ($StepUid, $TasUid, $TriUid, $StType) {
|
||||
function stepTriggerExists ($StepUid, $TasUid, $TriUid, $StType)
|
||||
{
|
||||
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oObj = StepTriggerPeer::retrieveByPk( $StepUid, $TasUid, $TriUid, $StType );
|
||||
if (is_object( $oObj ) && get_class( $oObj ) == 'StepTrigger') {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -168,8 +154,7 @@ class StepTrigger extends BaseStepTrigger {
|
||||
function removeTrigger ($TriUid)
|
||||
{
|
||||
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
try
|
||||
{
|
||||
try {
|
||||
$criteria = new Criteria();
|
||||
//$criteria->add(StepTriggerPeer::STEP_UID, $step_uid);
|
||||
//$criteria->add(StepTriggerPeer::TAS_UID, $tas_uid);
|
||||
@@ -177,20 +162,19 @@ class StepTrigger extends BaseStepTrigger {
|
||||
//$criteria->add(StepTriggerPeer::ST_TYPE, $st_type);
|
||||
$objects = StepTriggerPeer::doSelect( $criteria, $con );
|
||||
$con->begin();
|
||||
foreach($objects as $v)
|
||||
{
|
||||
foreach ($objects as $v) {
|
||||
$this->remove( $v->getStepUid, $v->getTasUid, $v->getTriUid, $v->getStType );
|
||||
}
|
||||
$con->commit();
|
||||
return count( $objects );
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
function getNextPosition($sStepUID, $sType) {
|
||||
|
||||
function getNextPosition ($sStepUID, $sType)
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( '(COUNT(*) + 1) AS POSITION' );
|
||||
@@ -201,12 +185,13 @@ class StepTrigger extends BaseStepTrigger {
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
return (int) $aRow['POSITION'];
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
function reOrder($sStepUID, $sTaskUID, $sType, $iPosition) {
|
||||
|
||||
function reOrder ($sStepUID, $sTaskUID, $sType, $iPosition)
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( StepTriggerPeer::STEP_UID, $sStepUID );
|
||||
@@ -222,12 +207,13 @@ class StepTrigger extends BaseStepTrigger {
|
||||
$oStep->save();
|
||||
$oDataset->next();
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
function up($sStepUID = '', $sTaskUID = '', $sTriggerUID = '', $sType = '', $iPosition = 0) {
|
||||
|
||||
function up ($sStepUID = '', $sTaskUID = '', $sTriggerUID = '', $sType = '', $iPosition = 0)
|
||||
{
|
||||
try {
|
||||
if ($iPosition > 1) {
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
@@ -247,13 +233,13 @@ class StepTrigger extends BaseStepTrigger {
|
||||
$oCriteria2->add( StepTriggerPeer::ST_TYPE, $sType );
|
||||
BasePeer::doUpdate( $oCriteria2, $oCriteria1, Propel::getConnection( 'workflow' ) );
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
|
||||
function down($sStepUID = '', $sTaskUID = '', $sTriggerUID = '', $sType = '', $iPosition = 0) {
|
||||
function down ($sStepUID = '', $sTaskUID = '', $sTriggerUID = '', $sType = '', $iPosition = 0)
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'COUNT(*) AS MAX_POSITION' );
|
||||
@@ -282,8 +268,7 @@ class StepTrigger extends BaseStepTrigger {
|
||||
$oCriteria2->add( StepTriggerPeer::ST_TYPE, $sType );
|
||||
BasePeer::doUpdate( $oCriteria2, $oCriteria1, Propel::getConnection( 'workflow' ) );
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
@@ -291,12 +276,10 @@ class StepTrigger extends BaseStepTrigger {
|
||||
function createRow ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
try
|
||||
{
|
||||
try {
|
||||
$con->begin();
|
||||
$this->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if($this->validate())
|
||||
{
|
||||
if ($this->validate()) {
|
||||
$this->setStepUid( $aData['STEP_UID'] );
|
||||
$this->setTasUid( $aData['TAS_UID'] );
|
||||
$this->setTriUid( $aData['TRI_UID'] );
|
||||
@@ -307,19 +290,17 @@ class StepTrigger extends BaseStepTrigger {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
} // StepTrigger
|
||||
}
|
||||
// StepTrigger
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Users.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
@@ -40,28 +41,24 @@ require_once 'classes/model/IsoLocation.php';
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class Users extends BaseUsers {
|
||||
class Users extends BaseUsers
|
||||
{
|
||||
|
||||
function create ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( UsersPeer::DATABASE_NAME );
|
||||
try
|
||||
{
|
||||
try {
|
||||
$this->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if($this->validate())
|
||||
{
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -71,15 +68,12 @@ public function userExists($UsrUid)
|
||||
{
|
||||
try {
|
||||
$oRow = UsersPeer::retrieveByPK( $UsrUid );
|
||||
if (!is_null($oRow))
|
||||
{
|
||||
if (! is_null( $oRow )) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -88,26 +82,23 @@ public function userExists($UsrUid)
|
||||
{
|
||||
try {
|
||||
$oRow = UsersPeer::retrieveByPK( $UsrUid );
|
||||
if (!is_null($oRow))
|
||||
{
|
||||
if (! is_null( $oRow )) {
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew( false );
|
||||
return $aFields;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw (new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
|
||||
}
|
||||
}
|
||||
catch (PropelException $e){ //capture invalid birthday date and replace by null
|
||||
} catch (PropelException $e) {
|
||||
//capture invalid birthday date and replace by null
|
||||
$msg = $e->getMessage();
|
||||
if (strpos( 'Unable to parse value of [usr_birthday]', $msg ) != - 1) {
|
||||
$oRow->setUsrBirthday( null );
|
||||
$oRow->save();
|
||||
return $this->load( $UsrUid );
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -123,13 +114,11 @@ public function userExists($UsrUid)
|
||||
$result['USR_FULLNAME'] = $oUser->getUsrFirstname() . ' ' . $oUser->getUsrLastname();
|
||||
$result['USR_EMAIL'] = $oUser->getUsrEmail();
|
||||
return $result;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// return $result;
|
||||
throw (new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
@@ -147,11 +136,7 @@ public function userExists($UsrUid)
|
||||
|
||||
$aIsoCountry = IsoCountry::findById( $aFields['USR_COUNTRY'] );
|
||||
$aIsoSubdivision = IsoSubdivision::findById( $aFields['USR_COUNTRY'], $aFields['USR_CITY'] );
|
||||
$aIsoLocation = IsoLocation::findById(
|
||||
$aFields['USR_COUNTRY'],
|
||||
$aFields['USR_CITY'],
|
||||
$aFields['USR_LOCATION']
|
||||
);
|
||||
$aIsoLocation = IsoLocation::findById( $aFields['USR_COUNTRY'], $aFields['USR_CITY'], $aFields['USR_LOCATION'] );
|
||||
|
||||
$aFields['USR_COUNTRY_NAME'] = $aIsoCountry['IC_NAME'];
|
||||
$aFields['USR_CITY_NAME'] = $aIsoSubdivision['IS_NAME'];
|
||||
@@ -172,42 +157,34 @@ public function userExists($UsrUid)
|
||||
public function update ($fields)
|
||||
{
|
||||
$con = Propel::getConnection( UsersPeer::DATABASE_NAME );
|
||||
try
|
||||
{
|
||||
try {
|
||||
$con->begin();
|
||||
$this->load( $fields['USR_UID'] );
|
||||
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
if($this->validate())
|
||||
{
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
function remove ($UsrUid)
|
||||
{
|
||||
$con = Propel::getConnection( UsersPeer::DATABASE_NAME );
|
||||
try
|
||||
{
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setUsrUid( $UsrUid );
|
||||
$result = $this->delete();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -227,7 +204,8 @@ public function userExists($UsrUid)
|
||||
return $c;
|
||||
}
|
||||
|
||||
function loadByUsernameInArray($sUsername){
|
||||
function loadByUsernameInArray ($sUsername)
|
||||
{
|
||||
$c = $this->loadByUsername( $sUsername );
|
||||
$rs = UsersPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
@@ -329,13 +307,11 @@ public function userExists($UsrUid)
|
||||
$oCriteria->add( UsersPeer::USR_STATUS, 'ACTIVE' );
|
||||
|
||||
return $oCriteria;
|
||||
}
|
||||
catch (exception $oError) {
|
||||
} catch (exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all Active users
|
||||
*
|
||||
@@ -353,22 +329,7 @@ public function userExists($UsrUid)
|
||||
$criteria->addAscendingOrderByColumn( UsersPeer::USR_LASTNAME );
|
||||
|
||||
if ($search) {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(
|
||||
UsersPeer::USR_USERNAME,
|
||||
"%$search%", Criteria::LIKE
|
||||
)->addOr(
|
||||
$criteria->getNewCriterion(
|
||||
UsersPeer::USR_FIRSTNAME,
|
||||
"%$search%", Criteria::LIKE
|
||||
)
|
||||
)->addOr(
|
||||
$criteria->getNewCriterion(
|
||||
UsersPeer::USR_LASTNAME,
|
||||
"%$search%", Criteria::LIKE
|
||||
)
|
||||
)
|
||||
);
|
||||
$criteria->add( $criteria->getNewCriterion( UsersPeer::USR_USERNAME, "%$search%", Criteria::LIKE )->addOr( $criteria->getNewCriterion( UsersPeer::USR_FIRSTNAME, "%$search%", Criteria::LIKE ) )->addOr( $criteria->getNewCriterion( UsersPeer::USR_LASTNAME, "%$search%", Criteria::LIKE ) ) );
|
||||
}
|
||||
|
||||
$c = clone $criteria;
|
||||
@@ -378,20 +339,24 @@ public function userExists($UsrUid)
|
||||
$dataset->next();
|
||||
$rowCount = $dataset->getRow();
|
||||
|
||||
if( is_array($rowCount) )
|
||||
if (is_array( $rowCount )) {
|
||||
$totalCount = $rowCount[0];
|
||||
}
|
||||
|
||||
if( $start )
|
||||
if ($start) {
|
||||
$criteria->setOffset( $start );
|
||||
if( $limit )
|
||||
}
|
||||
if ($limit) {
|
||||
$criteria->setLimit( $limit );
|
||||
}
|
||||
|
||||
$rs = UsersPeer::doSelectRS( $criteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$rows = Array ();
|
||||
while( $rs->next() )
|
||||
while ($rs->next()) {
|
||||
$rows[] = $rs->getRow();
|
||||
}
|
||||
|
||||
$result->data = $rows;
|
||||
$result->totalCount = $totalCount;
|
||||
@@ -414,6 +379,6 @@ public function userExists($UsrUid)
|
||||
} while ($aFields['USR_STATUS'] != 'ACTIVE');
|
||||
return $aFields;
|
||||
}
|
||||
} // Users
|
||||
}
|
||||
// Users
|
||||
|
||||
?>
|
||||
|
||||
@@ -198,26 +198,32 @@ try {
|
||||
|
||||
if (is_array( $result )) {
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->name ))
|
||||
}
|
||||
if (isset( $item->name )) {
|
||||
$name = $item->name;
|
||||
}
|
||||
}
|
||||
|
||||
$rows[] = array ('guid' => $guid,'name' => $name
|
||||
);
|
||||
@@ -256,26 +262,32 @@ try {
|
||||
if (is_array( $result )) {
|
||||
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->name ))
|
||||
}
|
||||
if (isset( $item->name )) {
|
||||
$name = $item->name;
|
||||
}
|
||||
}
|
||||
|
||||
$rows[] = array ('guid' => $guid,'name' => $name
|
||||
);
|
||||
@@ -313,26 +325,32 @@ try {
|
||||
);
|
||||
if (is_array( $result )) {
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->name ))
|
||||
}
|
||||
if (isset( $item->name )) {
|
||||
$name = $item->name;
|
||||
}
|
||||
}
|
||||
|
||||
$rows[] = array ('guid' => $guid,'name' => $name
|
||||
);
|
||||
@@ -372,38 +390,49 @@ try {
|
||||
|
||||
if (is_array( $result )) {
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
if ($val->key == 'status')
|
||||
}
|
||||
if ($val->key == 'status') {
|
||||
$status = $val->value;
|
||||
if ($val->key == 'delIndex')
|
||||
}
|
||||
if ($val->key == 'delIndex') {
|
||||
$delIndex = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
if ($val->key == 'status')
|
||||
}
|
||||
if ($val->key == 'status') {
|
||||
$status = $val->value;
|
||||
if ($val->key == 'delIndex')
|
||||
}
|
||||
if ($val->key == 'delIndex') {
|
||||
$delIndex = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->name ))
|
||||
}
|
||||
if (isset( $item->name )) {
|
||||
$name = $item->name;
|
||||
if (isset( $item->status ))
|
||||
}
|
||||
if (isset( $item->status )) {
|
||||
$status = $item->status;
|
||||
if (isset( $item->delIndex ))
|
||||
}
|
||||
if (isset( $item->delIndex )) {
|
||||
$delIndex = $item->delIndex;
|
||||
|
||||
}
|
||||
}
|
||||
$rows[] = array ('guid' => $guid,'name' => $name,'status' => $status,'delIndex' => $delIndex
|
||||
);
|
||||
@@ -446,32 +475,41 @@ try {
|
||||
|
||||
if (is_array( $result )) {
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
if ($val->key == 'delIndex')
|
||||
}
|
||||
if ($val->key == 'delIndex') {
|
||||
$delIndex = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
if ($val->key == 'delIndex')
|
||||
}
|
||||
if ($val->key == 'delIndex') {
|
||||
$delIndex = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->name ))
|
||||
}
|
||||
if (isset( $item->name )) {
|
||||
$name = $item->name;
|
||||
if (isset( $item->delIndex ))
|
||||
}
|
||||
if (isset( $item->delIndex )) {
|
||||
$delIndex = $item->delIndex;
|
||||
}
|
||||
}
|
||||
$rows[] = array ('guid' => $guid,'name' => $name,'delIndex' => $delIndex
|
||||
);
|
||||
}
|
||||
@@ -510,26 +548,32 @@ try {
|
||||
if (is_array( $result )) {
|
||||
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->name ))
|
||||
}
|
||||
if (isset( $item->name )) {
|
||||
$name = $item->name;
|
||||
}
|
||||
}
|
||||
|
||||
$rows[] = array ('guid' => $guid,'name' => $name
|
||||
);
|
||||
@@ -788,26 +832,32 @@ try {
|
||||
if (is_array( $result )) {
|
||||
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->name ))
|
||||
}
|
||||
if (isset( $item->name )) {
|
||||
$name = $item->name;
|
||||
}
|
||||
}
|
||||
|
||||
$rows[] = array ('guid' => $guid,'name' => $name
|
||||
);
|
||||
@@ -846,32 +896,41 @@ try {
|
||||
|
||||
if (is_array( $result )) {
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
if ($val->key == 'processId')
|
||||
}
|
||||
if ($val->key == 'processId') {
|
||||
$processId = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
if ($val->key == 'processId')
|
||||
}
|
||||
if ($val->key == 'processId') {
|
||||
$processId = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->name ))
|
||||
}
|
||||
if (isset( $item->name )) {
|
||||
$name = $item->name;
|
||||
if (isset( $item->processId ))
|
||||
}
|
||||
if (isset( $item->processId )) {
|
||||
$processId = $item->processId;
|
||||
}
|
||||
}
|
||||
$rows[] = array ('guid' => $guid,'name' => $name,'processId' => $processId
|
||||
);
|
||||
}
|
||||
@@ -881,13 +940,14 @@ try {
|
||||
|
||||
foreach ($rows as $key => $row) {
|
||||
$proId = $row['processId'];
|
||||
if (isset( $_DBArray['process'] ) && is_array( $_DBArray['process'] ))
|
||||
if (isset( $_DBArray['process'] ) && is_array( $_DBArray['process'] )) {
|
||||
foreach ($_DBArray['process'] as $pkey => $prow) {
|
||||
if ($proId == $prow['guid']) {
|
||||
$rows[$key]['processId'] = $prow['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_DBArray['triggers'] = $rows;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
@@ -926,62 +986,86 @@ try {
|
||||
|
||||
if (is_array( $result )) {
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'filename')
|
||||
}
|
||||
if ($val->key == 'filename') {
|
||||
$filename = $val->value;
|
||||
if ($val->key == 'docId')
|
||||
}
|
||||
if ($val->key == 'docId') {
|
||||
$docId = $val->value;
|
||||
if ($val->key == 'version')
|
||||
}
|
||||
if ($val->key == 'version') {
|
||||
$version = $val->value;
|
||||
if ($val->key == 'createDate')
|
||||
}
|
||||
if ($val->key == 'createDate') {
|
||||
$createDate = $val->value;
|
||||
if ($val->key == 'createBy')
|
||||
}
|
||||
if ($val->key == 'createBy') {
|
||||
$createBy = $val->value;
|
||||
if ($val->key == 'type')
|
||||
}
|
||||
if ($val->key == 'type') {
|
||||
$type = $val->value;
|
||||
if ($val->key == 'link')
|
||||
}
|
||||
if ($val->key == 'link') {
|
||||
$link = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'filename')
|
||||
}
|
||||
if ($val->key == 'filename') {
|
||||
$filename = $val->value;
|
||||
if ($val->key == 'docId')
|
||||
}
|
||||
if ($val->key == 'docId') {
|
||||
$docId = $val->value;
|
||||
if ($val->key == 'version')
|
||||
}
|
||||
if ($val->key == 'version') {
|
||||
$version = $val->value;
|
||||
if ($val->key == 'createDate')
|
||||
}
|
||||
if ($val->key == 'createDate') {
|
||||
$createDate = $val->value;
|
||||
if ($val->key == 'createBy')
|
||||
}
|
||||
if ($val->key == 'createBy') {
|
||||
$createBy = $val->value;
|
||||
if ($val->key == 'type')
|
||||
}
|
||||
if ($val->key == 'type') {
|
||||
$type = $val->value;
|
||||
if ($val->key == 'link')
|
||||
}
|
||||
if ($val->key == 'link') {
|
||||
$link = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->filename ))
|
||||
}
|
||||
if (isset( $item->filename )) {
|
||||
$filename = $item->filename;
|
||||
if (isset( $item->docId ))
|
||||
}
|
||||
if (isset( $item->docId )) {
|
||||
$docId = $item->docId;
|
||||
if (isset( $item->version ))
|
||||
}
|
||||
if (isset( $item->version )) {
|
||||
$version = $item->version;
|
||||
if (isset( $item->createDate ))
|
||||
}
|
||||
if (isset( $item->createDate )) {
|
||||
$createDate = $item->createDate;
|
||||
if (isset( $item->createBy ))
|
||||
}
|
||||
if (isset( $item->createBy )) {
|
||||
$createBy = $item->createBy;
|
||||
if (isset( $item->type ))
|
||||
}
|
||||
if (isset( $item->type )) {
|
||||
$type = $item->type;
|
||||
if (isset( $item->link ))
|
||||
}
|
||||
if (isset( $item->link )) {
|
||||
$link = $item->link;
|
||||
}
|
||||
}
|
||||
$rows[] = array ('guid' => $guid,'filename' => $filename,'docId' => $docId,'version' => $version,'createDate' => $createDate,'createBy' => $createBy,'type' => $type,'link' => $link
|
||||
);
|
||||
}
|
||||
@@ -992,16 +1076,22 @@ try {
|
||||
$documentArray = array ();
|
||||
$documentArray[] = array ('guid' => 'char','filename' => 'char'
|
||||
);
|
||||
if (isset( $_DBArray['inputDocument'] ))
|
||||
foreach ($_DBArray['inputDocument'] as $key => $val)
|
||||
if ($key != 0 && isset( $val['filename'] ))
|
||||
if (isset( $_DBArray['inputDocument'] )) {
|
||||
foreach ($_DBArray['inputDocument'] as $key => $val) {
|
||||
if ($key != 0 && isset( $val['filename'] )) {
|
||||
$documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
|
||||
);
|
||||
if (isset( $_DBArray['outputDocument'] ))
|
||||
foreach ($_DBArray['outputDocument'] as $key => $val)
|
||||
if ($key != 0 && isset( $val['filename'] ))
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset( $_DBArray['outputDocument'] )) {
|
||||
foreach ($_DBArray['outputDocument'] as $key => $val) {
|
||||
if ($key != 0 && isset( $val['filename'] )) {
|
||||
$documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
$_DBArray['documents'] = $documentArray;
|
||||
$_DBArray['WS_TMP_CASE_UID'] = $frm["CASE_ID"];
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
@@ -1036,32 +1126,41 @@ try {
|
||||
);
|
||||
if (is_array( $result )) {
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
if ($val->key == 'description')
|
||||
}
|
||||
if ($val->key == 'description') {
|
||||
$description = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'name')
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
if ($val->key == 'description')
|
||||
}
|
||||
if ($val->key == 'description') {
|
||||
$description = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->name ))
|
||||
}
|
||||
if (isset( $item->name )) {
|
||||
$name = $item->name;
|
||||
if (isset( $item->description ))
|
||||
}
|
||||
if (isset( $item->description )) {
|
||||
$description = $item->description;
|
||||
}
|
||||
}
|
||||
$rows[] = array ('guid' => $guid,'name' => $name,'description' => $description
|
||||
);
|
||||
}
|
||||
@@ -1101,62 +1200,86 @@ try {
|
||||
if (is_array( $result )) {
|
||||
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'filename')
|
||||
}
|
||||
if ($val->key == 'filename') {
|
||||
$filename = $val->value;
|
||||
if ($val->key == 'docId')
|
||||
}
|
||||
if ($val->key == 'docId') {
|
||||
$docId = $val->value;
|
||||
if ($val->key == 'version')
|
||||
}
|
||||
if ($val->key == 'version') {
|
||||
$version = $val->value;
|
||||
if ($val->key == 'createDate')
|
||||
}
|
||||
if ($val->key == 'createDate') {
|
||||
$createDate = $val->value;
|
||||
if ($val->key == 'createBy')
|
||||
}
|
||||
if ($val->key == 'createBy') {
|
||||
$createBy = $val->value;
|
||||
if ($val->key == 'type')
|
||||
}
|
||||
if ($val->key == 'type') {
|
||||
$type = $val->value;
|
||||
if ($val->key == 'link')
|
||||
}
|
||||
if ($val->key == 'link') {
|
||||
$link = $val->value;
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
}
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
if ($val->key == 'filename')
|
||||
}
|
||||
if ($val->key == 'filename') {
|
||||
$filename = $val->value;
|
||||
if ($val->key == 'docId')
|
||||
}
|
||||
if ($val->key == 'docId') {
|
||||
$docId = $val->value;
|
||||
if ($val->key == 'version')
|
||||
}
|
||||
if ($val->key == 'version') {
|
||||
$version = $val->value;
|
||||
if ($val->key == 'createDate')
|
||||
}
|
||||
if ($val->key == 'createDate') {
|
||||
$createDate = $val->value;
|
||||
if ($val->key == 'createBy')
|
||||
}
|
||||
if ($val->key == 'createBy') {
|
||||
$createBy = $val->value;
|
||||
if ($val->key == 'type')
|
||||
}
|
||||
if ($val->key == 'type') {
|
||||
$type = $val->value;
|
||||
if ($val->key == 'link')
|
||||
}
|
||||
if ($val->key == 'link') {
|
||||
$link = $val->value;
|
||||
}
|
||||
else {
|
||||
if (isset( $item->guid ))
|
||||
}
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
if (isset( $item->filename ))
|
||||
}
|
||||
if (isset( $item->filename )) {
|
||||
$filename = $item->filename;
|
||||
if (isset( $item->docId ))
|
||||
}
|
||||
if (isset( $item->docId )) {
|
||||
$docId = $item->docId;
|
||||
if (isset( $item->version ))
|
||||
}
|
||||
if (isset( $item->version )) {
|
||||
$version = $item->version;
|
||||
if (isset( $item->createDate ))
|
||||
}
|
||||
if (isset( $item->createDate )) {
|
||||
$createDate = $item->createDate;
|
||||
if (isset( $item->createBy ))
|
||||
}
|
||||
if (isset( $item->createBy )) {
|
||||
$createBy = $item->createBy;
|
||||
if (isset( $item->type ))
|
||||
}
|
||||
if (isset( $item->type )) {
|
||||
$type = $item->type;
|
||||
if (isset( $item->link ))
|
||||
}
|
||||
if (isset( $item->link )) {
|
||||
$link = $item->link;
|
||||
}
|
||||
}
|
||||
$rows[] = array ('guid' => $guid,'filename' => $filename,'docId' => $docId,'version' => $version,'createDate' => $createDate,'createBy' => $createBy,'type' => $type,'link' => $link
|
||||
);
|
||||
}
|
||||
@@ -1166,16 +1289,22 @@ try {
|
||||
$documentArray = array ();
|
||||
$documentArray[] = array ('guid' => 'char','filename' => 'char'
|
||||
);
|
||||
if (isset( $_DBArray['inputDocument'] ))
|
||||
foreach ($_DBArray['inputDocument'] as $key => $val)
|
||||
if ($key != 0 && isset( $val['filename'] ))
|
||||
if (isset( $_DBArray['inputDocument'] )) {
|
||||
foreach ($_DBArray['inputDocument'] as $key => $val) {
|
||||
if ($key != 0 && isset( $val['filename'] )) {
|
||||
$documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
|
||||
);
|
||||
if (isset( $_DBArray['outputDocument'] ))
|
||||
foreach ($_DBArray['outputDocument'] as $key => $val)
|
||||
if ($key != 0 && isset( $val['filename'] ))
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset( $_DBArray['outputDocument'] )) {
|
||||
foreach ($_DBArray['outputDocument'] as $key => $val) {
|
||||
if ($key != 0 && isset( $val['filename'] )) {
|
||||
$documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
$_DBArray['documents'] = $documentArray;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
@@ -1251,7 +1380,7 @@ try {
|
||||
if (is_array( $result )) {
|
||||
|
||||
foreach ($result as $key => $item) {
|
||||
if (isset( $item->item ))
|
||||
if (isset( $item->item )) {
|
||||
foreach ($item->item as $index => $val) {
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
@@ -1260,18 +1389,17 @@ try {
|
||||
$name = $val->value;
|
||||
}
|
||||
}
|
||||
else if (is_array( $item ))
|
||||
} elseif (is_array( $item )) {
|
||||
foreach ($item as $index => $val) {
|
||||
if ($val->key == 'guid')
|
||||
if ($val->key == 'guid') {
|
||||
$guid = $val->value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($val->key == 'name') {
|
||||
$name = $val->value;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
} else {
|
||||
if (isset( $item->guid )) {
|
||||
$guid = $item->guid;
|
||||
}
|
||||
@@ -1294,9 +1422,8 @@ try {
|
||||
$c->setDBArrayTable( 'taskCases' );
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrTaskCase', $c );
|
||||
} else
|
||||
|
||||
if (is_object( $result )) {
|
||||
} elseif (is_object( $result ))
|
||||
{
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -1307,8 +1434,6 @@ try {
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case "wsSendFiles":
|
||||
|
||||
|
||||
if (isset( $_FILES['form'] )) {
|
||||
foreach ($_FILES['form']['name'] as $sFieldName => $vValue) {
|
||||
if ($_FILES['form']['error'][$sFieldName] == 0) {
|
||||
@@ -1379,12 +1504,15 @@ try {
|
||||
break;
|
||||
default:
|
||||
|
||||
|
||||
print_r( $_POST );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
global $_DBArray;
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user