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 = '';
|
||||
@@ -57,174 +61,168 @@ class InputDocument extends BaseInputDocument {
|
||||
* @param string $sAppDocUid
|
||||
* @return variant
|
||||
*/
|
||||
public function load($sInpDocUid)
|
||||
public function load ($sInpDocUid)
|
||||
{
|
||||
try {
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK($sInpDocUid);
|
||||
if (!is_null($oInputDocument))
|
||||
{
|
||||
$aFields = $oInputDocument->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK( $sInpDocUid );
|
||||
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);
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
return $aFields;
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
}
|
||||
else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
public function getByUid($sInpDocUid)
|
||||
public function getByUid ($sInpDocUid)
|
||||
{
|
||||
try {
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK($sInpDocUid);
|
||||
if( is_null($oInputDocument))
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK( $sInpDocUid );
|
||||
if (is_null( $oInputDocument )) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$aFields = $oInputDocument->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$aFields = $oInputDocument->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$aFields['INP_DOC_TITLE'] = $oInputDocument->getInpDocTitle();
|
||||
$aFields['INP_DOC_DESCRIPTION'] = $oInputDocument->getInpDocDescription();
|
||||
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
return $aFields;
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the application document registry
|
||||
*
|
||||
* @param array $aData
|
||||
* @return string
|
||||
**/
|
||||
public function create($aData)
|
||||
*
|
||||
*/
|
||||
public function create ($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
|
||||
$oConnection = Propel::getConnection( InputDocumentPeer::DATABASE_NAME );
|
||||
try {
|
||||
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'] == '') {
|
||||
unset( $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);
|
||||
$oInputDocument->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($oInputDocument->validate()) {
|
||||
$oConnection->begin();
|
||||
if (isset($aData['INP_DOC_TITLE'])) {
|
||||
$oInputDocument->setInpDocTitle($aData['INP_DOC_TITLE']);
|
||||
if (isset( $aData['INP_DOC_TITLE'] )) {
|
||||
$oInputDocument->setInpDocTitle( $aData['INP_DOC_TITLE'] );
|
||||
}
|
||||
if (isset($aData['INP_DOC_DESCRIPTION'])) {
|
||||
$oInputDocument->setInpDocDescription($aData['INP_DOC_DESCRIPTION']);
|
||||
if (isset( $aData['INP_DOC_DESCRIPTION'] )) {
|
||||
$oInputDocument->setInpDocDescription( $aData['INP_DOC_DESCRIPTION'] );
|
||||
}
|
||||
$iResult = $oInputDocument->save();
|
||||
$oConnection->commit();
|
||||
return $aData['INP_DOC_UID'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oInputDocument->getValidationFailures();
|
||||
foreach($aValidationFailures as $oValidationFailure) {
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw(new Exception('The registry cannot be created!<br />'.$sMessage));
|
||||
throw (new Exception( 'The registry cannot be created!<br />' . $sMessage ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the application document registry
|
||||
*
|
||||
* @param array $aData
|
||||
* @return string
|
||||
**/
|
||||
public function update($aData)
|
||||
*
|
||||
*/
|
||||
public function update ($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
|
||||
$oConnection = Propel::getConnection( InputDocumentPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK($aData['INP_DOC_UID']);
|
||||
if (!is_null($oInputDocument))
|
||||
{
|
||||
$oInputDocument->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK( $aData['INP_DOC_UID'] );
|
||||
if (! is_null( $oInputDocument )) {
|
||||
$oInputDocument->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($oInputDocument->validate()) {
|
||||
$oConnection->begin();
|
||||
if (isset($aData['INP_DOC_TITLE']))
|
||||
{
|
||||
$oInputDocument->setInpDocTitle($aData['INP_DOC_TITLE']);
|
||||
if (isset( $aData['INP_DOC_TITLE'] )) {
|
||||
$oInputDocument->setInpDocTitle( $aData['INP_DOC_TITLE'] );
|
||||
}
|
||||
if (isset($aData['INP_DOC_DESCRIPTION']))
|
||||
{
|
||||
$oInputDocument->setInpDocDescription($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) {
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
|
||||
throw (new Exception( 'The registry cannot be updated!<br />' . $sMessage ));
|
||||
}
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
}
|
||||
else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the application document registry
|
||||
*
|
||||
* @param array $aData
|
||||
* @return string
|
||||
**/
|
||||
public function remove($sInpDocUid)
|
||||
*
|
||||
*/
|
||||
public function remove ($sInpDocUid)
|
||||
{
|
||||
$oConnection = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
|
||||
$oConnection = Propel::getConnection( InputDocumentPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK($sInpDocUid);
|
||||
if (!is_null($oInputDocument))
|
||||
{
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK( $sInpDocUid );
|
||||
if (! is_null( $oInputDocument )) {
|
||||
$oConnection->begin();
|
||||
Content::removeContent('INP_DOC_TITLE', '', $oInputDocument->getInpDocUid());
|
||||
Content::removeContent('INP_DOC_DESCRIPTION', '', $oInputDocument->getInpDocUid());
|
||||
Content::removeContent( 'INP_DOC_TITLE', '', $oInputDocument->getInpDocUid() );
|
||||
Content::removeContent( 'INP_DOC_DESCRIPTION', '', $oInputDocument->getInpDocUid() );
|
||||
$iResult = $oInputDocument->delete();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
}
|
||||
else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [inp_doc_title] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInpDocTitle()
|
||||
public function getInpDocTitle ()
|
||||
{
|
||||
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) {
|
||||
throw($oError);
|
||||
$this->inp_doc_title = Content::load( 'INP_DOC_TITLE', '', $this->getInpDocUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en') );
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
return $this->inp_doc_title;
|
||||
@@ -236,36 +234,35 @@ class InputDocument extends BaseInputDocument {
|
||||
* @param string $sValue new value
|
||||
* @return void
|
||||
*/
|
||||
public function setInpDocTitle($sValue)
|
||||
public function setInpDocTitle ($sValue)
|
||||
{
|
||||
if ($sValue !== null && !is_string($sValue)) {
|
||||
$sValue = (string)$sValue;
|
||||
if ($sValue !== null && ! is_string( $sValue )) {
|
||||
$sValue = (string) $sValue;
|
||||
}
|
||||
if ($this->inp_doc_title !== $sValue || $sValue === '') {
|
||||
try {
|
||||
$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) {
|
||||
$iResult = Content::addContent( 'INP_DOC_TITLE', '', $this->getInpDocUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en'), $this->inp_doc_title );
|
||||
} catch (Exception $oError) {
|
||||
$this->inp_doc_title = '';
|
||||
throw($oError);
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [inp_doc_comment] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInpDocDescription()
|
||||
public function getInpDocDescription ()
|
||||
{
|
||||
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) {
|
||||
throw($oError);
|
||||
$this->inp_doc_description = Content::load( 'INP_DOC_DESCRIPTION', '', $this->getInpDocUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en') );
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
return $this->inp_doc_description;
|
||||
@@ -277,20 +274,19 @@ class InputDocument extends BaseInputDocument {
|
||||
* @param string $sValue new value
|
||||
* @return void
|
||||
*/
|
||||
public function setInpDocDescription($sValue)
|
||||
public function setInpDocDescription ($sValue)
|
||||
{
|
||||
if ($sValue !== null && !is_string($sValue)) {
|
||||
$sValue = (string)$sValue;
|
||||
if ($sValue !== null && ! is_string( $sValue )) {
|
||||
$sValue = (string) $sValue;
|
||||
}
|
||||
if ($this->inp_doc_description !== $sValue || $sValue === '') {
|
||||
try {
|
||||
$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) {
|
||||
$iResult = Content::addContent( 'INP_DOC_DESCRIPTION', '', $this->getInpDocUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en'), $this->inp_doc_description );
|
||||
} catch (Exception $oError) {
|
||||
$this->inp_doc_description = '';
|
||||
throw($oError);
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,20 +297,20 @@ class InputDocument extends BaseInputDocument {
|
||||
* @param string $sUid the uid of the Prolication
|
||||
*/
|
||||
|
||||
function InputExists ( $sUid ) {
|
||||
$con = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
|
||||
function InputExists ($sUid)
|
||||
{
|
||||
$con = Propel::getConnection( InputDocumentPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oObj = InputDocumentPeer::retrieveByPk( $sUid );
|
||||
if (is_object($oObj) && get_class ($oObj) == 'InputDocument' ) {
|
||||
if (is_object( $oObj ) && get_class( $oObj ) == 'InputDocument') {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($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,288 +38,269 @@ require_once 'classes/model/om/BaseStepTrigger.php';
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class StepTrigger extends BaseStepTrigger {
|
||||
function create($aData)
|
||||
{
|
||||
$con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
|
||||
try
|
||||
class StepTrigger extends BaseStepTrigger
|
||||
{
|
||||
|
||||
function create ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
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'] );
|
||||
$criteria->add(StepTriggerPeer::TAS_UID, $aData['TAS_UID'] );
|
||||
$criteria->add(StepTriggerPeer::TRI_UID, $aData['TRI_UID'] );
|
||||
$criteria->add(StepTriggerPeer::ST_TYPE, $aData['ST_TYPE'] );
|
||||
$objects = StepTriggerPeer::doSelect($criteria, $con);
|
||||
$criteria->add( StepTriggerPeer::STEP_UID, $aData['STEP_UID'] );
|
||||
$criteria->add( StepTriggerPeer::TAS_UID, $aData['TAS_UID'] );
|
||||
$criteria->add( StepTriggerPeer::TRI_UID, $aData['TRI_UID'] );
|
||||
$criteria->add( StepTriggerPeer::ST_TYPE, $aData['ST_TYPE'] );
|
||||
$objects = StepTriggerPeer::doSelect( $criteria, $con );
|
||||
$con->begin();
|
||||
foreach($objects as $row) {
|
||||
$this->remove($row->getStepUid(), $row->getTasUid(), $row->getTriUid(), $row->getStType() );
|
||||
foreach ($objects as $row) {
|
||||
$this->remove( $row->getStepUid(), $row->getTasUid(), $row->getTriUid(), $row->getStType() );
|
||||
}
|
||||
$con->commit();
|
||||
|
||||
$con->begin();
|
||||
$this->setStepUid($aData['STEP_UID']);
|
||||
$this->setTasUid($aData['TAS_UID']);
|
||||
$this->setTriUid($aData['TRI_UID']);
|
||||
$this->setStType($aData['ST_TYPE']);
|
||||
$this->setStCondition("");
|
||||
$this->setStPosition("");
|
||||
if($this->validate())
|
||||
{
|
||||
$result=$this->save();
|
||||
$this->setStepUid( $aData['STEP_UID'] );
|
||||
$this->setTasUid( $aData['TAS_UID'] );
|
||||
$this->setTriUid( $aData['TRI_UID'] );
|
||||
$this->setStType( $aData['ST_TYPE'] );
|
||||
$this->setStCondition( "" );
|
||||
$this->setStPosition( "" );
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw( new Exception("Failed Validation in class ".get_class($this)."."));
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw($e);
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
public function load($StepUid, $TasUid, $TriUid, $StType)
|
||||
|
||||
public function load ($StepUid, $TasUid, $TriUid, $StType)
|
||||
{
|
||||
try {
|
||||
$oRow = StepTriggerPeer::retrieveByPK( $StepUid, $TasUid, $TriUid, $StType );
|
||||
if (!is_null($oRow))
|
||||
{
|
||||
$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
|
||||
$this->setNew(false);
|
||||
if (! is_null( $oRow )) {
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew( false );
|
||||
return $aFields;
|
||||
} else {
|
||||
throw (new Exception( "The row '$StepUid, $TasUid, $TriUid, $StType' in table StepTrigger doesn't exist!" ));
|
||||
}
|
||||
else {
|
||||
throw(new Exception( "The row '$StepUid, $TasUid, $TriUid, $StType' in table StepTrigger doesn't exist!" ));
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
function update($fields)
|
||||
{
|
||||
$con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
|
||||
try
|
||||
|
||||
function update ($fields)
|
||||
{
|
||||
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
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())
|
||||
{
|
||||
$result=$this->save();
|
||||
$this->load( $fields['STEP_UID'], $fields['TAS_UID'], $fields['TRI_UID'], $fields['ST_TYPE'] );
|
||||
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw(new Exception("Failed Validation in class ".get_class($this)."."));
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw($e);
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
function remove($StepUid, $TasUid, $TriUid, $StType)
|
||||
|
||||
function remove ($StepUid, $TasUid, $TriUid, $StType)
|
||||
{
|
||||
$oConnection = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
|
||||
$oConnection = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oStepTrigger = StepTriggerPeer::retrieveByPK($StepUid, $TasUid, $TriUid, $StType);
|
||||
if (!is_null($oStepTrigger))
|
||||
{
|
||||
$oStepTrigger = StepTriggerPeer::retrieveByPK( $StepUid, $TasUid, $TriUid, $StType );
|
||||
if (! is_null( $oStepTrigger )) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oStepTrigger->delete();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
} else {
|
||||
throw (new Exception( "The row '$StepUid, $TasUid, $TriUid, $StType' in table StepTrigger doesn't exist!" ));
|
||||
}
|
||||
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);
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
function stepTriggerExists ($StepUid, $TasUid, $TriUid, $StType) {
|
||||
$con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
|
||||
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' ) {
|
||||
$oObj = StepTriggerPeer::retrieveByPk( $StepUid, $TasUid, $TriUid, $StType );
|
||||
if (is_object( $oObj ) && get_class( $oObj ) == 'StepTrigger') {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
function removeTrigger($TriUid)
|
||||
{
|
||||
$con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
|
||||
try
|
||||
function removeTrigger ($TriUid)
|
||||
{
|
||||
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
try {
|
||||
$criteria = new Criteria();
|
||||
//$criteria->add(StepTriggerPeer::STEP_UID, $step_uid);
|
||||
//$criteria->add(StepTriggerPeer::TAS_UID, $tas_uid);
|
||||
$criteria->add(StepTriggerPeer::TRI_UID, $TriUid);
|
||||
$criteria->add( StepTriggerPeer::TRI_UID, $TriUid );
|
||||
//$criteria->add(StepTriggerPeer::ST_TYPE, $st_type);
|
||||
$objects = StepTriggerPeer::doSelect($criteria, $con);
|
||||
$objects = StepTriggerPeer::doSelect( $criteria, $con );
|
||||
$con->begin();
|
||||
foreach($objects as $v)
|
||||
{
|
||||
$this->remove($v->getStepUid,$v->getTasUid,$v->getTriUid,$v->getStType);
|
||||
foreach ($objects as $v) {
|
||||
$this->remove( $v->getStepUid, $v->getTasUid, $v->getTriUid, $v->getStType );
|
||||
}
|
||||
$con->commit();
|
||||
return count($objects);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return count( $objects );
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw($e);
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
function getNextPosition($sStepUID, $sType) {
|
||||
|
||||
function getNextPosition ($sStepUID, $sType)
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('(COUNT(*) + 1) AS POSITION');
|
||||
$oCriteria->add(StepTriggerPeer::STEP_UID, $sStepUID);
|
||||
$oCriteria->add(StepTriggerPeer::ST_TYPE, $sType);
|
||||
$oDataset = StepTriggerPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( '(COUNT(*) + 1) AS POSITION' );
|
||||
$oCriteria->add( StepTriggerPeer::STEP_UID, $sStepUID );
|
||||
$oCriteria->add( StepTriggerPeer::ST_TYPE, $sType );
|
||||
$oDataset = StepTriggerPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
return (int)$aRow['POSITION'];
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
return (int) $aRow['POSITION'];
|
||||
} 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);
|
||||
$oCriteria->add(StepTriggerPeer::TAS_UID, $sTaskUID);
|
||||
$oCriteria->add(StepTriggerPeer::ST_TYPE, $sType);
|
||||
$oCriteria->add(StepTriggerPeer::ST_POSITION, $iPosition, '>');
|
||||
$oDataset = StepTriggerPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( StepTriggerPeer::STEP_UID, $sStepUID );
|
||||
$oCriteria->add( StepTriggerPeer::TAS_UID, $sTaskUID );
|
||||
$oCriteria->add( StepTriggerPeer::ST_TYPE, $sType );
|
||||
$oCriteria->add( StepTriggerPeer::ST_POSITION, $iPosition, '>' );
|
||||
$oDataset = StepTriggerPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$oStep = StepTriggerPeer::retrieveByPK($aRow['STEP_UID'], $aRow['TAS_UID'], $aRow['TRI_UID'], $aRow['ST_TYPE']);
|
||||
$oStep->setStPosition(($aRow['ST_POSITION']) - 1);
|
||||
$oStep = StepTriggerPeer::retrieveByPK( $aRow['STEP_UID'], $aRow['TAS_UID'], $aRow['TRI_UID'], $aRow['ST_TYPE'] );
|
||||
$oStep->setStPosition( ($aRow['ST_POSITION']) - 1 );
|
||||
$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');
|
||||
$oCriteria1->add(StepTriggerPeer::ST_POSITION, $iPosition);
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->add(StepTriggerPeer::STEP_UID, $sStepUID);
|
||||
$oCriteria2->add(StepTriggerPeer::TAS_UID, $sTaskUID);
|
||||
$oCriteria2->add(StepTriggerPeer::ST_TYPE, $sType);
|
||||
$oCriteria2->add(StepTriggerPeer::ST_POSITION, ($iPosition - 1));
|
||||
BasePeer::doUpdate($oCriteria2, $oCriteria1, Propel::getConnection('workflow'));
|
||||
$oCriteria1 = new Criteria('workflow');
|
||||
$oCriteria1->add(StepTriggerPeer::ST_POSITION, ($iPosition - 1));
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->add(StepTriggerPeer::STEP_UID, $sStepUID);
|
||||
$oCriteria2->add(StepTriggerPeer::TAS_UID, $sTaskUID);
|
||||
$oCriteria2->add(StepTriggerPeer::TRI_UID, $sTriggerUID);
|
||||
$oCriteria2->add(StepTriggerPeer::ST_TYPE, $sType);
|
||||
BasePeer::doUpdate($oCriteria2, $oCriteria1, Propel::getConnection('workflow'));
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( StepTriggerPeer::ST_POSITION, $iPosition );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( StepTriggerPeer::STEP_UID, $sStepUID );
|
||||
$oCriteria2->add( StepTriggerPeer::TAS_UID, $sTaskUID );
|
||||
$oCriteria2->add( StepTriggerPeer::ST_TYPE, $sType );
|
||||
$oCriteria2->add( StepTriggerPeer::ST_POSITION, ($iPosition - 1) );
|
||||
BasePeer::doUpdate( $oCriteria2, $oCriteria1, Propel::getConnection( 'workflow' ) );
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( StepTriggerPeer::ST_POSITION, ($iPosition - 1) );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( StepTriggerPeer::STEP_UID, $sStepUID );
|
||||
$oCriteria2->add( StepTriggerPeer::TAS_UID, $sTaskUID );
|
||||
$oCriteria2->add( StepTriggerPeer::TRI_UID, $sTriggerUID );
|
||||
$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');
|
||||
$oCriteria->add(StepTriggerPeer::STEP_UID, $sStepUID);
|
||||
$oCriteria->add(StepTriggerPeer::TAS_UID, $sTaskUID);
|
||||
$oCriteria->add(StepTriggerPeer::ST_TYPE, $sType);
|
||||
$oDataset = StepTriggerPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'COUNT(*) AS MAX_POSITION' );
|
||||
$oCriteria->add( StepTriggerPeer::STEP_UID, $sStepUID );
|
||||
$oCriteria->add( StepTriggerPeer::TAS_UID, $sTaskUID );
|
||||
$oCriteria->add( StepTriggerPeer::ST_TYPE, $sType );
|
||||
$oDataset = StepTriggerPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
if ($iPosition < (int)$aRow['MAX_POSITION']) {
|
||||
$oCriteria1 = new Criteria('workflow');
|
||||
$oCriteria1->add(StepTriggerPeer::ST_POSITION, $iPosition);
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->add(StepTriggerPeer::STEP_UID, $sStepUID);
|
||||
$oCriteria2->add(StepTriggerPeer::TAS_UID, $sTaskUID);
|
||||
$oCriteria2->add(StepTriggerPeer::ST_TYPE, $sType);
|
||||
$oCriteria2->add(StepTriggerPeer::ST_POSITION, ($iPosition + 1));
|
||||
BasePeer::doUpdate($oCriteria2, $oCriteria1, Propel::getConnection('workflow'));
|
||||
$oCriteria1 = new Criteria('workflow');
|
||||
$oCriteria1->add(StepTriggerPeer::ST_POSITION, ($iPosition + 1));
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->add(StepTriggerPeer::STEP_UID, $sStepUID);
|
||||
$oCriteria2->add(StepTriggerPeer::TAS_UID, $sTaskUID);
|
||||
$oCriteria2->add(StepTriggerPeer::TRI_UID, $sTriggerUID);
|
||||
$oCriteria2->add(StepTriggerPeer::ST_TYPE, $sType);
|
||||
BasePeer::doUpdate($oCriteria2, $oCriteria1, Propel::getConnection('workflow'));
|
||||
if ($iPosition < (int) $aRow['MAX_POSITION']) {
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( StepTriggerPeer::ST_POSITION, $iPosition );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( StepTriggerPeer::STEP_UID, $sStepUID );
|
||||
$oCriteria2->add( StepTriggerPeer::TAS_UID, $sTaskUID );
|
||||
$oCriteria2->add( StepTriggerPeer::ST_TYPE, $sType );
|
||||
$oCriteria2->add( StepTriggerPeer::ST_POSITION, ($iPosition + 1) );
|
||||
BasePeer::doUpdate( $oCriteria2, $oCriteria1, Propel::getConnection( 'workflow' ) );
|
||||
$oCriteria1 = new Criteria( 'workflow' );
|
||||
$oCriteria1->add( StepTriggerPeer::ST_POSITION, ($iPosition + 1) );
|
||||
$oCriteria2 = new Criteria( 'workflow' );
|
||||
$oCriteria2->add( StepTriggerPeer::STEP_UID, $sStepUID );
|
||||
$oCriteria2->add( StepTriggerPeer::TAS_UID, $sTaskUID );
|
||||
$oCriteria2->add( StepTriggerPeer::TRI_UID, $sTriggerUID );
|
||||
$oCriteria2->add( StepTriggerPeer::ST_TYPE, $sType );
|
||||
BasePeer::doUpdate( $oCriteria2, $oCriteria1, Propel::getConnection( 'workflow' ) );
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
|
||||
function createRow($aData)
|
||||
{
|
||||
$con = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
|
||||
try
|
||||
function createRow ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
try {
|
||||
$con->begin();
|
||||
$this->fromArray($aData,BasePeer::TYPE_FIELDNAME);
|
||||
if($this->validate())
|
||||
{
|
||||
$this->setStepUid($aData['STEP_UID']);
|
||||
$this->setTasUid($aData['TAS_UID']);
|
||||
$this->setTriUid($aData['TRI_UID']);
|
||||
$this->setStType($aData['ST_TYPE']);
|
||||
$this->setStCondition($aData['ST_CONDITION']);
|
||||
$this->setStPosition($aData['ST_POSITION']);
|
||||
$this->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($this->validate()) {
|
||||
$this->setStepUid( $aData['STEP_UID'] );
|
||||
$this->setTasUid( $aData['TAS_UID'] );
|
||||
$this->setTriUid( $aData['TRI_UID'] );
|
||||
$this->setStType( $aData['ST_TYPE'] );
|
||||
$this->setStCondition( $aData['ST_CONDITION'] );
|
||||
$this->setStPosition( $aData['ST_POSITION'] );
|
||||
|
||||
$result=$this->save();
|
||||
$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);
|
||||
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);
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
} // StepTrigger
|
||||
}
|
||||
// StepTrigger
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Users.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
@@ -40,118 +41,102 @@ 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
|
||||
{
|
||||
$this->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if($this->validate())
|
||||
{
|
||||
$result=$this->save();
|
||||
}
|
||||
else
|
||||
{
|
||||
$e=new Exception("Failed Validation in class ".get_class($this).".");
|
||||
$e->aValidationFailures=$this->getValidationFailures();
|
||||
throw($e);
|
||||
$con = Propel::getConnection( UsersPeer::DATABASE_NAME );
|
||||
try {
|
||||
$this->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
} 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);
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function userExists($UsrUid)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public function load($UsrUid)
|
||||
public function load ($UsrUid)
|
||||
{
|
||||
try {
|
||||
$oRow = UsersPeer::retrieveByPK( $UsrUid );
|
||||
if (!is_null($oRow))
|
||||
{
|
||||
$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
|
||||
$this->setNew(false);
|
||||
if (! is_null( $oRow )) {
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew( false );
|
||||
return $aFields;
|
||||
} else {
|
||||
throw (new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
|
||||
}
|
||||
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);
|
||||
if (strpos( 'Unable to parse value of [usr_birthday]', $msg ) != - 1) {
|
||||
$oRow->setUsrBirthday( null );
|
||||
$oRow->save();
|
||||
return $this->load($UsrUid);
|
||||
return $this->load( $UsrUid );
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
public function loadDetails($UsrUid)
|
||||
public function loadDetails ($UsrUid)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$result = array ();
|
||||
$oUser = UsersPeer::retrieveByPK( $UsrUid );
|
||||
if (!is_null($oUser)) {
|
||||
if (! is_null( $oUser )) {
|
||||
$result['USR_UID'] = $oUser->getUsrUid();
|
||||
$result['USR_USERNAME'] = $oUser->getUsrUsername();
|
||||
$result['USR_FULLNAME'] = $oUser->getUsrFirstname() . ' ' . $oUser->getUsrLastname() ;
|
||||
$result['USR_FULLNAME'] = $oUser->getUsrFirstname() . ' ' . $oUser->getUsrLastname();
|
||||
$result['USR_EMAIL'] = $oUser->getUsrEmail();
|
||||
return $result;
|
||||
} else {
|
||||
// return $result;
|
||||
throw (new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
|
||||
}
|
||||
else {
|
||||
// return $result;
|
||||
throw(new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
public function loadDetailed($UsrUid)
|
||||
public function loadDetailed ($UsrUid)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$oUser = UsersPeer::retrieveByPK($UsrUid);
|
||||
$result = array ();
|
||||
$oUser = UsersPeer::retrieveByPK( $UsrUid );
|
||||
|
||||
if (!is_null($oUser)) {
|
||||
$aFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
|
||||
$this->setNew(false);
|
||||
if (! is_null( $oUser )) {
|
||||
$aFields = $oUser->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew( false );
|
||||
|
||||
$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']
|
||||
);
|
||||
$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'] );
|
||||
|
||||
$aFields['USR_COUNTRY_NAME'] = $aIsoCountry['IC_NAME'];
|
||||
$aFields['USR_CITY_NAME'] = $aIsoSubdivision['IS_NAME'];
|
||||
@@ -162,60 +147,52 @@ public function userExists($UsrUid)
|
||||
return $result;
|
||||
} else {
|
||||
//return $result;
|
||||
throw (new Exception("The row '" . $UsrUid . "' in table USER doesn't exist!"));
|
||||
throw (new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
public function update($fields)
|
||||
{
|
||||
$con = Propel::getConnection(UsersPeer::DATABASE_NAME);
|
||||
try
|
||||
public function update ($fields)
|
||||
{
|
||||
$con = Propel::getConnection( UsersPeer::DATABASE_NAME );
|
||||
try {
|
||||
$con->begin();
|
||||
$this->load($fields['USR_UID']);
|
||||
$this->fromArray($fields,BasePeer::TYPE_FIELDNAME);
|
||||
if($this->validate())
|
||||
{
|
||||
$result=$this->save();
|
||||
$this->load( $fields['USR_UID'] );
|
||||
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw(new Exception("Failed Validation in class ".get_class($this)."."));
|
||||
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
|
||||
{
|
||||
$con->begin();
|
||||
$this->setUsrUid($UsrUid);
|
||||
$result=$this->delete();
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
$con->rollback();
|
||||
throw($e);
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
function loadByUsername($sUsername)
|
||||
function remove ($UsrUid)
|
||||
{
|
||||
$c = new Criteria('workflow');
|
||||
$con = Propel::getConnection( UsersPeer::DATABASE_NAME );
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setUsrUid( $UsrUid );
|
||||
$result = $this->delete();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
function loadByUsername ($sUsername)
|
||||
{
|
||||
$c = new Criteria( 'workflow' );
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
|
||||
$c->clearSelectColumns();
|
||||
@@ -223,23 +200,24 @@ public function userExists($UsrUid)
|
||||
$c->addSelectColumn( UsersPeer::USR_USERNAME );
|
||||
$c->addSelectColumn( UsersPeer::USR_STATUS );
|
||||
|
||||
$c->add(UsersPeer::USR_USERNAME, $sUsername);
|
||||
$c->add( UsersPeer::USR_USERNAME, $sUsername );
|
||||
return $c;
|
||||
}
|
||||
|
||||
function loadByUsernameInArray($sUsername){
|
||||
$c = $this->loadByUsername($sUsername);
|
||||
$rs = UsersPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
function loadByUsernameInArray ($sUsername)
|
||||
{
|
||||
$c = $this->loadByUsername( $sUsername );
|
||||
$rs = UsersPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
return $row;
|
||||
}
|
||||
|
||||
public function getAllInformation($userUid)
|
||||
public function getAllInformation ($userUid)
|
||||
{
|
||||
if (!isset($userUid) || $userUid == "") {
|
||||
throw (new Exception("$userUid is empty."));
|
||||
if (! isset( $userUid ) || $userUid == "") {
|
||||
throw (new Exception( "$userUid is empty." ));
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -248,47 +226,47 @@ public function userExists($UsrUid)
|
||||
require_once ("classes/model/IsoSubdivision.php");
|
||||
require_once ("classes/model/Language.php");
|
||||
|
||||
G::LoadClass("calendar");
|
||||
G::LoadClass( "calendar" );
|
||||
|
||||
$aFields = $this->load($userUid);
|
||||
$aFields = $this->load( $userUid );
|
||||
|
||||
$c = new Criteria("workflow");
|
||||
$c->add(IsoCountryPeer::IC_UID, $aFields["USR_COUNTRY"]);
|
||||
$rs = IsoCountryPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$c = new Criteria( "workflow" );
|
||||
$c->add( IsoCountryPeer::IC_UID, $aFields["USR_COUNTRY"] );
|
||||
$rs = IsoCountryPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$rowC = $rs->getRow();
|
||||
|
||||
$c->clearSelectColumns();
|
||||
$c->add(IsoSubdivisionPeer::IC_UID, $aFields["USR_COUNTRY"]);
|
||||
$c->add(IsoSubdivisionPeer::IS_UID, $aFields["USR_CITY"]);
|
||||
$rs = IsoSubdivisionPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$c->add( IsoSubdivisionPeer::IC_UID, $aFields["USR_COUNTRY"] );
|
||||
$c->add( IsoSubdivisionPeer::IS_UID, $aFields["USR_CITY"] );
|
||||
$rs = IsoSubdivisionPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$rowS = $rs->getRow();
|
||||
|
||||
$c->clearSelectColumns();
|
||||
$c->add(IsoLocationPeer::IC_UID, $aFields["USR_COUNTRY"]);
|
||||
$c->add(IsoLocationPeer::IL_UID, $aFields["USR_LOCATION"]);
|
||||
$rs = IsoLocationPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$c->add( IsoLocationPeer::IC_UID, $aFields["USR_COUNTRY"] );
|
||||
$c->add( IsoLocationPeer::IL_UID, $aFields["USR_LOCATION"] );
|
||||
$rs = IsoLocationPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$rowL = $rs->getRow();
|
||||
|
||||
//Calendar
|
||||
$calendar = new Calendar();
|
||||
$calendarInfo = $calendar->getCalendarFor($userUid, $userUid, $userUid);
|
||||
$aFields["USR_CALENDAR"] = ($calendarInfo["CALENDAR_APPLIED"] != "DEFAULT")? $calendarInfo["CALENDAR_UID"] : "";
|
||||
$calendarInfo = $calendar->getCalendarFor( $userUid, $userUid, $userUid );
|
||||
$aFields["USR_CALENDAR"] = ($calendarInfo["CALENDAR_APPLIED"] != "DEFAULT") ? $calendarInfo["CALENDAR_UID"] : "";
|
||||
|
||||
//Photo
|
||||
$pathPhoto = PATH_IMAGES_ENVIRONMENT_USERS . $userUid . ".gif";
|
||||
|
||||
if (!file_exists($pathPhoto)) {
|
||||
if (! file_exists( $pathPhoto )) {
|
||||
$pathPhoto = PATH_HOME . "public_html" . PATH_SEP . "images" . PATH_SEP . "user.gif";
|
||||
}
|
||||
|
||||
//Data
|
||||
$arrayData = array();
|
||||
$arrayData = array ();
|
||||
$arrayData["username"] = $aFields["USR_USERNAME"];
|
||||
$arrayData["firstname"] = $aFields["USR_FIRSTNAME"];
|
||||
$arrayData["lastname"] = $aFields["USR_LASTNAME"];
|
||||
@@ -318,80 +296,67 @@ public function userExists($UsrUid)
|
||||
}
|
||||
}
|
||||
|
||||
function getAvailableUsersCriteria($sGroupUID = '')
|
||||
function getAvailableUsersCriteria ($sGroupUID = '')
|
||||
{
|
||||
try {
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, 'ACTIVE');
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||
$oCriteria->add( UsersPeer::USR_STATUS, 'ACTIVE' );
|
||||
|
||||
return $oCriteria;
|
||||
}
|
||||
catch (exception $oError) {
|
||||
} catch (exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all Active users
|
||||
*
|
||||
* @return array of all active users
|
||||
*/
|
||||
function getAll($start=null, $limit=null, $search=null)
|
||||
function getAll ($start = null, $limit = null, $search = null)
|
||||
{
|
||||
$totalCount = 0;
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$criteria->add(UsersPeer::USR_STATUS, 'ACTIVE');
|
||||
$criteria->addAscendingOrderByColumn ( UsersPeer::USR_LASTNAME );
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->addSelectColumn( UsersPeer::USR_UID );
|
||||
$criteria->addSelectColumn( UsersPeer::USR_USERNAME );
|
||||
$criteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
$criteria->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||
$criteria->add( UsersPeer::USR_STATUS, 'ACTIVE' );
|
||||
$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
|
||||
)
|
||||
)
|
||||
);
|
||||
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 ) ) );
|
||||
}
|
||||
|
||||
$c = clone $criteria;
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn('COUNT(*)');
|
||||
$dataset = UsersPeer::doSelectRS($c);
|
||||
$c->addSelectColumn( 'COUNT(*)' );
|
||||
$dataset = UsersPeer::doSelectRS( $c );
|
||||
$dataset->next();
|
||||
$rowCount = $dataset->getRow();
|
||||
|
||||
if( is_array($rowCount) )
|
||||
if (is_array( $rowCount )) {
|
||||
$totalCount = $rowCount[0];
|
||||
}
|
||||
|
||||
if( $start )
|
||||
$criteria->setOffset($start);
|
||||
if( $limit )
|
||||
$criteria->setLimit($limit);
|
||||
if ($start) {
|
||||
$criteria->setOffset( $start );
|
||||
}
|
||||
if ($limit) {
|
||||
$criteria->setLimit( $limit );
|
||||
}
|
||||
|
||||
$rs = UsersPeer::doSelectRS($criteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs = UsersPeer::doSelectRS( $criteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$rows = Array();
|
||||
while( $rs->next() )
|
||||
$rows = Array ();
|
||||
while ($rs->next()) {
|
||||
$rows[] = $rs->getRow();
|
||||
}
|
||||
|
||||
$result->data = $rows;
|
||||
$result->totalCount = $totalCount;
|
||||
@@ -399,21 +364,21 @@ public function userExists($UsrUid)
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function userVacation($UsrUid = "")
|
||||
public function userVacation ($UsrUid = "")
|
||||
{
|
||||
$aFields = array();
|
||||
$aFields = array ();
|
||||
$cnt = 0;
|
||||
do {
|
||||
if ($UsrUid != "" && $cnt < 100) {
|
||||
$aFields = $this->load($UsrUid);
|
||||
$aFields = $this->load( $UsrUid );
|
||||
$UsrUid = $aFields['USR_REPLACED_BY'];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
$cnt++;
|
||||
$cnt ++;
|
||||
} 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
|
||||
);
|
||||
@@ -231,7 +237,7 @@ try {
|
||||
$c->setDBArrayTable( 'process' );
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrProcessList', $c );
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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
|
||||
);
|
||||
@@ -290,7 +302,7 @@ try {
|
||||
$c->setDBArrayTable( 'role' );
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrRoleList', $c );
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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
|
||||
);
|
||||
@@ -347,7 +365,7 @@ try {
|
||||
$c->setDBArrayTable( 'group' );
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrGroupList', $c );
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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
|
||||
);
|
||||
@@ -421,7 +450,7 @@ try {
|
||||
//$c->addAscendingOrderByColumn ( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrCaseList', $c );
|
||||
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
@@ -486,7 +524,7 @@ try {
|
||||
$c->setDBArrayTable( 'case' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrUnassignedCaseList', $c );
|
||||
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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
|
||||
);
|
||||
@@ -546,7 +590,7 @@ try {
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrUserList', $c );
|
||||
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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
|
||||
);
|
||||
@@ -822,7 +872,7 @@ try {
|
||||
$c->setDBArrayTable( 'task' );
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrTaskList', $c );
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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;
|
||||
@@ -898,7 +958,7 @@ try {
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrTriggerList', $c );
|
||||
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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;
|
||||
@@ -1012,7 +1102,7 @@ try {
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrInputDocumentList', $c );
|
||||
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
@@ -1075,7 +1174,7 @@ try {
|
||||
$c->setDBArrayTable( 'inputDocuments' );
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrInputDocumentProcessList', $c );
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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;
|
||||
|
||||
@@ -1184,7 +1313,7 @@ try {
|
||||
$c->setDBArrayTable( 'outputDocument' );
|
||||
$c->addAscendingOrderByColumn( 'name' );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrOutputDocumentList', $c );
|
||||
} else if (is_object( $result )) {
|
||||
} elseif (is_object( $result )) {
|
||||
$_SESSION['WS_SESSION_ID'] = '';
|
||||
$fields['status_code'] = $result->status_code;
|
||||
$fields['message'] = $result->message;
|
||||
@@ -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