CODE STYLE class/model/ files
This commit is contained in:
@@ -20,7 +20,6 @@ require_once 'classes/model/om/BaseAdditionalTables.php';
|
|||||||
*/
|
*/
|
||||||
class AdditionalTables extends BaseAdditionalTables
|
class AdditionalTables extends BaseAdditionalTables
|
||||||
{
|
{
|
||||||
|
|
||||||
public $fields = array();
|
public $fields = array();
|
||||||
public $primaryKeys = array();
|
public $primaryKeys = array();
|
||||||
|
|
||||||
@@ -188,16 +187,6 @@ class AdditionalTables extends BaseAdditionalTables
|
|||||||
$oConnection->begin();
|
$oConnection->begin();
|
||||||
$iResult = $oAdditionalTables->save();
|
$iResult = $oAdditionalTables->save();
|
||||||
$oConnection->commit();
|
$oConnection->commit();
|
||||||
/* * * DEPRECATED
|
|
||||||
require_once 'classes/model/ShadowTable.php';
|
|
||||||
$oShadowTable = new ShadowTable();
|
|
||||||
$oShadowTable->create(array('ADD_TAB_UID' => $aData['ADD_TAB_UID'],
|
|
||||||
'SHD_ACTION' => 'ALTER',
|
|
||||||
'SHD_DETAILS' => serialize($aFields),
|
|
||||||
'USR_UID' => (isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : ''),
|
|
||||||
'APP_UID' => '',
|
|
||||||
'SHD_DATE' => date('Y-m-d H:i:s')));
|
|
||||||
return $iResult; */
|
|
||||||
} else {
|
} else {
|
||||||
$sMessage = '';
|
$sMessage = '';
|
||||||
$aValidationFailures = $oAdditionalTables->getValidationFailures();
|
$aValidationFailures = $oAdditionalTables->getValidationFailures();
|
||||||
@@ -839,14 +828,6 @@ class AdditionalTables extends BaseAdditionalTables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// // fltering by proces title
|
|
||||||
// if(isset($filter['process'])) {
|
|
||||||
// foreach ($addTables as $i => $addTable) {
|
|
||||||
// if (strpos($addTable['PRO_TITLE'], $filter['process']) === false)
|
|
||||||
// unset($addTables[$i]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return array('rows' => $addTables, 'count' => $count);
|
return array('rows' => $addTables, 'count' => $count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1257,5 +1238,4 @@ class AdditionalTables extends BaseAdditionalTables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// AdditionalTables
|
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AdditionalTablesPeer extends BaseAdditionalTablesPeer {
|
class AdditionalTablesPeer extends BaseAdditionalTablesPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AdditionalTablesPeer
|
|
||||||
|
|||||||
@@ -304,7 +304,8 @@ class AppCacheView extends BaseAppCacheView
|
|||||||
return $tasks;
|
return $tasks;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSelfServiceCasesByEvaluate($userUid) {
|
public function getSelfServiceCasesByEvaluate($userUid)
|
||||||
|
{
|
||||||
$cases = array();
|
$cases = array();
|
||||||
|
|
||||||
//check groups assigned to SelfService task
|
//check groups assigned to SelfService task
|
||||||
@@ -1537,5 +1538,4 @@ class AppCacheView extends BaseAppCacheView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//AppCacheView
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppCacheViewPeer extends BaseAppCacheViewPeer {
|
class AppCacheViewPeer extends BaseAppCacheViewPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppCacheViewPeer
|
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ require_once 'classes/model/om/BaseAppDelay.php';
|
|||||||
* /**
|
* /**
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppDelay extends BaseAppDelay {
|
class AppDelay extends BaseAppDelay
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* Create the application delay registry
|
* Create the application delay registry
|
||||||
* @param array $aData
|
* @param array $aData
|
||||||
@@ -28,10 +29,12 @@ class AppDelay extends BaseAppDelay {
|
|||||||
{
|
{
|
||||||
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
|
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
if ( isset ( $aData['APP_DELAY_UID'] ) && $aData['APP_DELAY_UID']== '' )
|
if ( isset ( $aData['APP_DELAY_UID'] ) && $aData['APP_DELAY_UID']== '' ) {
|
||||||
unset ( $aData['APP_DELAY_UID'] );
|
unset ( $aData['APP_DELAY_UID'] );
|
||||||
if ( !isset ( $aData['APP_DELAY_UID'] ) )
|
}
|
||||||
|
if ( !isset ( $aData['APP_DELAY_UID'] ) ) {
|
||||||
$aData['APP_DELAY_UID'] = G::generateUniqueID();
|
$aData['APP_DELAY_UID'] = G::generateUniqueID();
|
||||||
|
}
|
||||||
$oAppDelay = new AppDelay();
|
$oAppDelay = new AppDelay();
|
||||||
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||||
if ($oAppDelay->validate()) {
|
if ($oAppDelay->validate()) {
|
||||||
@@ -39,8 +42,7 @@ class AppDelay extends BaseAppDelay {
|
|||||||
$iResult = $oAppDelay->save();
|
$iResult = $oAppDelay->save();
|
||||||
$oConnection->commit();
|
$oConnection->commit();
|
||||||
return $aData['APP_DELAY_UID'];
|
return $aData['APP_DELAY_UID'];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$sMessage = '';
|
$sMessage = '';
|
||||||
$aValidationFailures = $oAppDelay->getValidationFailures();
|
$aValidationFailures = $oAppDelay->getValidationFailures();
|
||||||
foreach ($aValidationFailures as $oValidationFailure) {
|
foreach ($aValidationFailures as $oValidationFailure) {
|
||||||
@@ -48,8 +50,7 @@ class AppDelay extends BaseAppDelay {
|
|||||||
}
|
}
|
||||||
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();
|
$oConnection->rollback();
|
||||||
throw($oError);
|
throw($oError);
|
||||||
}
|
}
|
||||||
@@ -65,16 +66,14 @@ class AppDelay extends BaseAppDelay {
|
|||||||
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
|
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
$oAppDelay = AppDelayPeer::retrieveByPK($aData['APP_DELAY_UID']);
|
$oAppDelay = AppDelayPeer::retrieveByPK($aData['APP_DELAY_UID']);
|
||||||
if (!is_null($oAppDelay))
|
if (!is_null($oAppDelay)) {
|
||||||
{
|
|
||||||
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||||
if ($oAppDelay->validate()) {
|
if ($oAppDelay->validate()) {
|
||||||
$oConnection->begin();
|
$oConnection->begin();
|
||||||
$iResult = $oAppDelay->save();
|
$iResult = $oAppDelay->save();
|
||||||
$oConnection->commit();
|
$oConnection->commit();
|
||||||
return $iResult;
|
return $iResult;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$sMessage = '';
|
$sMessage = '';
|
||||||
$aValidationFailures = $oAppDelay->getValidationFailures();
|
$aValidationFailures = $oAppDelay->getValidationFailures();
|
||||||
foreach ($aValidationFailures as $oValidationFailure) {
|
foreach ($aValidationFailures as $oValidationFailure) {
|
||||||
@@ -82,18 +81,17 @@ class AppDelay extends BaseAppDelay {
|
|||||||
}
|
}
|
||||||
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
|
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw(new Exception('This row doesn\'t exist!'));
|
throw(new Exception('This row doesn\'t exist!'));
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $oError) {
|
||||||
catch (Exception $oError) {
|
|
||||||
$oConnection->rollback();
|
$oConnection->rollback();
|
||||||
throw($oError);
|
throw($oError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isPaused($appUid, $delIndex){
|
public function isPaused($appUid, $delIndex)
|
||||||
|
{
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
$oCriteria->add(AppDelayPeer::APP_UID, $appUid);
|
$oCriteria->add(AppDelayPeer::APP_UID, $appUid);
|
||||||
$oCriteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex);
|
$oCriteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex);
|
||||||
@@ -113,10 +111,12 @@ class AppDelay extends BaseAppDelay {
|
|||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
|
|
||||||
if( $aRow )
|
if ( $aRow ) {
|
||||||
return true;
|
return true;
|
||||||
else
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} // AppDelay
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppDelayPeer extends BaseAppDelayPeer {
|
class AppDelayPeer extends BaseAppDelayPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppDelayPeer
|
|
||||||
|
|||||||
@@ -56,9 +56,8 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
* @param $isSubprocess is a subprocess inside a process?
|
* @param $isSubprocess is a subprocess inside a process?
|
||||||
* @return delegation index of the application delegation.
|
* @return delegation index of the application delegation.
|
||||||
*/
|
*/
|
||||||
function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess = false, $sPrevious = -1, $sNextTasParam = null)
|
public function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess = false, $sPrevious = -1, $sNextTasParam = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (! isset( $sProUid ) || strlen( $sProUid ) == 0) {
|
if (! isset( $sProUid ) || strlen( $sProUid ) == 0) {
|
||||||
throw (new Exception( 'Column "PRO_UID" cannot be null.' ));
|
throw (new Exception( 'Column "PRO_UID" cannot be null.' ));
|
||||||
}
|
}
|
||||||
@@ -159,7 +158,7 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
* @return array $Fields the fields
|
* @return array $Fields the fields
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function Load ($AppUid, $sDelIndex)
|
public function Load ($AppUid, $sDelIndex)
|
||||||
{
|
{
|
||||||
$con = Propel::getConnection( AppDelegationPeer::DATABASE_NAME );
|
$con = Propel::getConnection( AppDelegationPeer::DATABASE_NAME );
|
||||||
try {
|
try {
|
||||||
@@ -213,7 +212,7 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove ($sApplicationUID, $iDelegationIndex)
|
public function remove ($sApplicationUID, $iDelegationIndex)
|
||||||
{
|
{
|
||||||
$oConnection = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
$oConnection = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||||
try {
|
try {
|
||||||
@@ -232,7 +231,7 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
|
|
||||||
// TasTypeDay = 1 => working days
|
// TasTypeDay = 1 => working days
|
||||||
// TasTypeDay = 2 => calendar days
|
// TasTypeDay = 2 => calendar days
|
||||||
function calculateDueDate ($sNextTasParam)
|
public function calculateDueDate ($sNextTasParam)
|
||||||
{
|
{
|
||||||
//Get Task properties
|
//Get Task properties
|
||||||
$task = TaskPeer::retrieveByPK( $this->getTasUid() );
|
$task = TaskPeer::retrieveByPK( $this->getTasUid() );
|
||||||
@@ -272,7 +271,7 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
return $iDueDate;
|
return $iDueDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDiffDate ($date1, $date2)
|
public function getDiffDate ($date1, $date2)
|
||||||
{
|
{
|
||||||
return ($date1 - $date2) / (24 * 60 * 60); //days
|
return ($date1 - $date2) / (24 * 60 * 60); //days
|
||||||
return ($date1 - $date2) / 3600;
|
return ($date1 - $date2) / 3600;
|
||||||
@@ -445,23 +444,15 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
|
|
||||||
//and finally save the record
|
//and finally save the record
|
||||||
$RES = $oAppDel->save();
|
$RES = $oAppDel->save();
|
||||||
//print "<tr><td>$iDelegateDate </td><td>$iInitDate </td><td>$iDueDate </td><td>$iFinishDate </td><td>$isStarted </td><td>$isFinished </td><td>$isDelayed</td><td>$queueDuration </td><td>$delDuration </td>" .
|
|
||||||
// "<td>$delayDuration</td><td>$overduePercentage</td><td>" . $row['DEL_INDEX'] . " $RES </td></tr>";
|
|
||||||
|
|
||||||
|
|
||||||
//UPDATE APP_DELEGATION SET DEL_DELAYED = 0
|
|
||||||
//where
|
|
||||||
// APP_OVERDUE_PERCENTAGE < 0
|
|
||||||
$rs->next();
|
$rs->next();
|
||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception $oError) {
|
} catch (Exception $oError) {
|
||||||
error_log( $oError->getMessage() );
|
error_log( $oError->getMessage() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLastDeleration ($APP_UID)
|
public function getLastDeleration ($APP_UID)
|
||||||
{
|
{
|
||||||
$c = new Criteria( 'workflow' );
|
$c = new Criteria( 'workflow' );
|
||||||
$c->addSelectColumn( AppDelegationPeer::APP_UID );
|
$c->addSelectColumn( AppDelegationPeer::APP_UID );
|
||||||
@@ -486,5 +477,4 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
return $rs->getRow();
|
return $rs->getRow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// AppDelegation
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
* /**
|
* /**
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppDelegationPeer extends BaseAppDelegationPeer {
|
class AppDelegationPeer extends BaseAppDelegationPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppDelegationPeer
|
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ class AppDocument extends BaseAppDocument
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getObject ($APP_UID, $DEL_INDEX, $STEP_UID_OBJ, $APP_DOC_TYPE)
|
public function getObject ($APP_UID, $DEL_INDEX, $STEP_UID_OBJ, $APP_DOC_TYPE)
|
||||||
{
|
{
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->add( AppDocumentPeer::APP_UID, $APP_UID );
|
$oCriteria->add( AppDocumentPeer::APP_UID, $APP_UID );
|
||||||
@@ -617,5 +617,4 @@ class AppDocument extends BaseAppDocument
|
|||||||
return $documents;
|
return $documents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// AppDocument
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppDocumentPeer extends BaseAppDocumentPeer {
|
class AppDocumentPeer extends BaseAppDocumentPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppDocumentPeer
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class AppEvent extends BaseAppEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function create ($aData)
|
public function create ($aData)
|
||||||
{
|
{
|
||||||
$oConnection = Propel::getConnection( AppEventPeer::DATABASE_NAME );
|
$oConnection = Propel::getConnection( AppEventPeer::DATABASE_NAME );
|
||||||
try {
|
try {
|
||||||
@@ -62,7 +62,7 @@ class AppEvent extends BaseAppEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function update ($aData)
|
public function update ($aData)
|
||||||
{
|
{
|
||||||
$oConnection = Propel::getConnection( AppEventPeer::DATABASE_NAME );
|
$oConnection = Propel::getConnection( AppEventPeer::DATABASE_NAME );
|
||||||
try {
|
try {
|
||||||
@@ -91,7 +91,7 @@ class AppEvent extends BaseAppEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove ($sApplicationUID, $iDelegation, $sEvnUid)
|
public function remove ($sApplicationUID, $iDelegation, $sEvnUid)
|
||||||
{
|
{
|
||||||
$oConnection = Propel::getConnection( AppEventPeer::DATABASE_NAME );
|
$oConnection = Propel::getConnection( AppEventPeer::DATABASE_NAME );
|
||||||
try {
|
try {
|
||||||
@@ -110,7 +110,7 @@ class AppEvent extends BaseAppEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAppEventsCriteria ($sProcessUid = '', $sStatus = '', $EVN_ACTION = '')
|
public function getAppEventsCriteria ($sProcessUid = '', $sStatus = '', $EVN_ACTION = '')
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
require_once 'classes/model/Event.php';
|
require_once 'classes/model/Event.php';
|
||||||
@@ -347,12 +347,11 @@ class AppEvent extends BaseAppEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function close ($APP_UID, $DEL_INDEX)
|
public function close ($APP_UID, $DEL_INDEX)
|
||||||
{
|
{
|
||||||
$aRow = $this->load( $APP_UID, $DEL_INDEX );
|
$aRow = $this->load( $APP_UID, $DEL_INDEX );
|
||||||
$aRow['APP_EVN_STATUS'] = 'CLOSE';
|
$aRow['APP_EVN_STATUS'] = 'CLOSE';
|
||||||
$this->update( $aRow );
|
$this->update( $aRow );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// AppEvent
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppEventPeer extends BaseAppEventPeer {
|
class AppEventPeer extends BaseAppEventPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppEventPeer
|
|
||||||
|
|||||||
@@ -31,10 +31,9 @@ class AppFolder extends BaseAppFolder
|
|||||||
* @param strin(32) $folderParent
|
* @param strin(32) $folderParent
|
||||||
* @return Ambigous <>|number
|
* @return Ambigous <>|number
|
||||||
*/
|
*/
|
||||||
function createFolder ($folderName, $folderParent = "/", $action = "createifnotexists")
|
public function createFolder ($folderName, $folderParent = "/", $action = "createifnotexists")
|
||||||
{
|
{
|
||||||
$validActions = array ("createifnotexists","create","update"
|
$validActions = array ("createifnotexists","create","update");
|
||||||
);
|
|
||||||
if (! in_array( $action, $validActions )) {
|
if (! in_array( $action, $validActions )) {
|
||||||
$action = "createifnotexists";
|
$action = "createifnotexists";
|
||||||
}
|
}
|
||||||
@@ -93,7 +92,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
* @param strin(32) $sessionID
|
* @param strin(32) $sessionID
|
||||||
* @return string Last Folder ID generated
|
* @return string Last Folder ID generated
|
||||||
*/
|
*/
|
||||||
function createFromPath ($folderPath, $sessionID = "")
|
public function createFromPath ($folderPath, $sessionID = "")
|
||||||
{
|
{
|
||||||
if ($sessionID == "") {
|
if ($sessionID == "") {
|
||||||
$sessionID = $_SESSION['APPLICATION'];
|
$sessionID = $_SESSION['APPLICATION'];
|
||||||
@@ -121,7 +120,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
* @param string(32) $sessionID Application ID
|
* @param string(32) $sessionID Application ID
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function parseTags ($fileTags, $sessionID = "")
|
public function parseTags ($fileTags, $sessionID = "")
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($sessionID == "") {
|
if ($sessionID == "") {
|
||||||
@@ -141,7 +140,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
* @param string(32) $folderID
|
* @param string(32) $folderID
|
||||||
* @return multitype:
|
* @return multitype:
|
||||||
*/
|
*/
|
||||||
function getFolderList ($folderID, $limit = 0, $start = 0)
|
public function getFolderList ($folderID, $limit = 0, $start = 0)
|
||||||
{
|
{
|
||||||
$Criteria = new Criteria( 'workflow' );
|
$Criteria = new Criteria( 'workflow' );
|
||||||
$Criteria->clearSelectColumns()->clearOrderByColumns();
|
$Criteria->clearSelectColumns()->clearOrderByColumns();
|
||||||
@@ -177,7 +176,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
* @param string(32) $folderUid
|
* @param string(32) $folderUid
|
||||||
* @return array <multitype:, mixed>
|
* @return array <multitype:, mixed>
|
||||||
*/
|
*/
|
||||||
function load ($folderUid)
|
public function load ($folderUid)
|
||||||
{
|
{
|
||||||
$tr = AppFolderPeer::retrieveByPK( $folderUid );
|
$tr = AppFolderPeer::retrieveByPK( $folderUid );
|
||||||
if ((is_object( $tr ) && get_class( $tr ) == 'AppFolder')) {
|
if ((is_object( $tr ) && get_class( $tr ) == 'AppFolder')) {
|
||||||
@@ -203,7 +202,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFolderStructure ($folderId)
|
public function getFolderStructure ($folderId)
|
||||||
{
|
{
|
||||||
$folderObj = $this->load( $folderId );
|
$folderObj = $this->load( $folderId );
|
||||||
$folderArray[$folderObj['FOLDER_UID']] = array ("NAME" => $folderObj['FOLDER_NAME'],"PARENT" => $folderObj['FOLDER_PARENT_UID']
|
$folderArray[$folderObj['FOLDER_UID']] = array ("NAME" => $folderObj['FOLDER_NAME'],"PARENT" => $folderObj['FOLDER_PARENT_UID']
|
||||||
@@ -220,7 +219,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
return $folderArray;
|
return $folderArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFolderContent ($folderID, $docIdFilter = array(), $keyword = null, $searchType = null, $limit = 0, $start = 0, $user = '', $onlyActive = false)
|
public function getFolderContent ($folderID, $docIdFilter = array(), $keyword = null, $searchType = null, $limit = 0, $start = 0, $user = '', $onlyActive = false)
|
||||||
{
|
{
|
||||||
require_once ("classes/model/AppDocument.php");
|
require_once ("classes/model/AppDocument.php");
|
||||||
require_once ("classes/model/InputDocument.php");
|
require_once ("classes/model/InputDocument.php");
|
||||||
@@ -308,7 +307,8 @@ class AppFolder extends BaseAppFolder
|
|||||||
}
|
}
|
||||||
} elseif ($lastVersion == $row['DOC_VERSION']) {
|
} elseif ($lastVersion == $row['DOC_VERSION']) {
|
||||||
//Only Last Document version
|
//Only Last Document version
|
||||||
if ($searchType == "ALL") { // If search in name of docs is active then filter
|
if ($searchType == "ALL") {
|
||||||
|
// If search in name of docs is active then filter
|
||||||
if ((stripos( $completeInfo['APP_DOC_FILENAME'], $keyword ) !== false) || (stripos( $completeInfo['APP_DOC_TAGS'], $keyword ) !== false)) {
|
if ((stripos( $completeInfo['APP_DOC_FILENAME'], $keyword ) !== false) || (stripos( $completeInfo['APP_DOC_TAGS'], $keyword ) !== false)) {
|
||||||
$response['documents'][] = $completeInfo;
|
$response['documents'][] = $completeInfo;
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
return ($response);
|
return ($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCompleteDocumentInfo ($appUid, $appDocUid, $docVersion, $docUid, $usrId)
|
public function getCompleteDocumentInfo ($appUid, $appDocUid, $docVersion, $docUid, $usrId)
|
||||||
{
|
{
|
||||||
require_once ("classes/model/AppDocument.php");
|
require_once ("classes/model/AppDocument.php");
|
||||||
require_once ("classes/model/InputDocument.php");
|
require_once ("classes/model/InputDocument.php");
|
||||||
@@ -339,7 +339,8 @@ class AppFolder extends BaseAppFolder
|
|||||||
G::LoadClass( 'process' );
|
G::LoadClass( 'process' );
|
||||||
$oProcess = new Process();
|
$oProcess = new Process();
|
||||||
if (($oApp->exists( $appUid )) || ($appUid == "00000000000000000000000000000000")) {
|
if (($oApp->exists( $appUid )) || ($appUid == "00000000000000000000000000000000")) {
|
||||||
if ($appUid == "00000000000000000000000000000000") { //External Files
|
if ($appUid == "00000000000000000000000000000000") {
|
||||||
|
//External Files
|
||||||
$row1 = $oAppDocument->load( $appDocUid, $docVersion );
|
$row1 = $oAppDocument->load( $appDocUid, $docVersion );
|
||||||
$row2 = array ('PRO_TITLE' => G::LoadTranslation( 'ID_NOT_PROCESS_RELATED' ));
|
$row2 = array ('PRO_TITLE' => G::LoadTranslation( 'ID_NOT_PROCESS_RELATED' ));
|
||||||
$row3 = array ('APP_TITLE' => G::LoadTranslation( 'ID_NOT_PROCESS_RELATED' ));
|
$row3 = array ('APP_TITLE' => G::LoadTranslation( 'ID_NOT_PROCESS_RELATED' ));
|
||||||
@@ -400,7 +401,6 @@ class AppFolder extends BaseAppFolder
|
|||||||
$downloadLabel1 = "";
|
$downloadLabel1 = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
///////
|
|
||||||
if (! empty( $row1["APP_DOC_PLUGIN"] )) {
|
if (! empty( $row1["APP_DOC_PLUGIN"] )) {
|
||||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||||
$pluginName = $row1["APP_DOC_PLUGIN"];
|
$pluginName = $row1["APP_DOC_PLUGIN"];
|
||||||
@@ -434,7 +434,6 @@ class AppFolder extends BaseAppFolder
|
|||||||
$row1["APP_DOC_PLUGIN"] = $fieldValue;
|
$row1["APP_DOC_PLUGIN"] = $fieldValue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$row4 = array ();
|
$row4 = array ();
|
||||||
$versioningEnabled = false;
|
$versioningEnabled = false;
|
||||||
@@ -473,8 +472,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
}
|
}
|
||||||
//**** End get docinfo
|
//**** End get docinfo
|
||||||
$infoMerged = array_merge( $row1, $row2, $row3, $row4, $row5, $row6 );
|
$infoMerged = array_merge( $row1, $row2, $row3, $row4, $row5, $row6 );
|
||||||
//krumo($infoMerged);
|
|
||||||
//****************************************************************************************************
|
|
||||||
$sUserUID = $_SESSION['USER_LOGGED'];
|
$sUserUID = $_SESSION['USER_LOGGED'];
|
||||||
$aObjectPermissions = array ();
|
$aObjectPermissions = array ();
|
||||||
if (isset( $infoMerged['PRO_UID'] )) {
|
if (isset( $infoMerged['PRO_UID'] )) {
|
||||||
@@ -508,12 +506,11 @@ class AppFolder extends BaseAppFolder
|
|||||||
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array (- 1);
|
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array (- 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//****************************************************************************************************
|
|
||||||
return array_merge( $infoMerged, $aObjectPermissions );
|
return array_merge( $infoMerged, $aObjectPermissions );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFolderChilds ($folderID, $folderArray)
|
public function getFolderChilds ($folderID, $folderArray)
|
||||||
{
|
{
|
||||||
$folderList = $this->getFolderList( $folderID );
|
$folderList = $this->getFolderList( $folderID );
|
||||||
$foldersList = array ();
|
$foldersList = array ();
|
||||||
@@ -524,7 +521,7 @@ class AppFolder extends BaseAppFolder
|
|||||||
return (array_merge( $folderArray, $foldersList ));
|
return (array_merge( $folderArray, $foldersList ));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFolderTags ($rootFolder)
|
public function getFolderTags ($rootFolder)
|
||||||
{
|
{
|
||||||
$folderArray[$rootFolder] = $rootFolder;
|
$folderArray[$rootFolder] = $rootFolder;
|
||||||
$foldersToProcess = $this->getFolderChilds( $rootFolder, $folderArray );
|
$foldersToProcess = $this->getFolderChilds( $rootFolder, $folderArray );
|
||||||
@@ -536,22 +533,21 @@ class AppFolder extends BaseAppFolder
|
|||||||
foreach ($filesList as $key => $fileInfo) {
|
foreach ($filesList as $key => $fileInfo) {
|
||||||
$fileTags = explode( ",", $fileInfo['APP_DOC_TAGS'] );
|
$fileTags = explode( ",", $fileInfo['APP_DOC_TAGS'] );
|
||||||
foreach ($fileTags as $key1 => $tag) {
|
foreach ($fileTags as $key1 => $tag) {
|
||||||
if (! (isset( $tagsInfo[$tag] )))
|
if (! (isset( $tagsInfo[$tag] ))) {
|
||||||
$tagsInfo[$tag] = 0;
|
$tagsInfo[$tag] = 0;
|
||||||
|
}
|
||||||
$tagsInfo[$tag] ++;
|
$tagsInfo[$tag] ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $tagsInfo;
|
return $tagsInfo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove ($FolderUid, $rootfolder)
|
public function remove ($FolderUid, $rootfolder)
|
||||||
{
|
{
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->add( AppFolderPeer::FOLDER_UID, $FolderUid );
|
$oCriteria->add( AppFolderPeer::FOLDER_UID, $FolderUid );
|
||||||
AppFolderPeer::doDelete( $oCriteria );
|
AppFolderPeer::doDelete( $oCriteria );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// AppFolder
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppFolderPeer extends BaseAppFolderPeer {
|
class AppFolderPeer extends BaseAppFolderPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppFolderPeer
|
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ require_once 'classes/model/om/BaseAppHistory.php';
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppHistory extends BaseAppHistory {
|
class AppHistory extends BaseAppHistory
|
||||||
|
{
|
||||||
function insertHistory($aData){
|
public function insertHistory($aData)
|
||||||
|
{
|
||||||
$this->setAppUid($aData['APP_UID']);
|
$this->setAppUid($aData['APP_UID']);
|
||||||
$this->setDelIndex($aData['DEL_INDEX']);
|
$this->setDelIndex($aData['DEL_INDEX']);
|
||||||
$this->setProUid($aData['PRO_UID']);
|
$this->setProUid($aData['PRO_UID']);
|
||||||
@@ -32,28 +32,20 @@ class AppHistory extends BaseAppHistory {
|
|||||||
$this->setHistoryDate($aData['APP_UPDATE_DATE']);
|
$this->setHistoryDate($aData['APP_UPDATE_DATE']);
|
||||||
$this->setHistoryData($aData['APP_DATA']);
|
$this->setHistoryData($aData['APP_DATA']);
|
||||||
|
|
||||||
|
|
||||||
if ($this->validate() ) {
|
if ($this->validate() ) {
|
||||||
$res = $this->save();
|
$res = $this->save();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Something went wrong. We can now get the validationFailures and handle them.
|
// Something went wrong. We can now get the validationFailures and handle them.
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$validationFailuresArray = $this->getValidationFailures();
|
$validationFailuresArray = $this->getValidationFailures();
|
||||||
foreach ($validationFailuresArray as $objValidationFailure) {
|
foreach ($validationFailuresArray as $objValidationFailure) {
|
||||||
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
||||||
}
|
}
|
||||||
krumo($msg);
|
}
|
||||||
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDynaformHistory($PRO_UID, $TAS_UID, $APP_UID, $DYN_UID = "")
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function getDynaformHistory($PRO_UID,$TAS_UID,$APP_UID,$DYN_UID=""){
|
|
||||||
G::LoadClass('case');
|
G::LoadClass('case');
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
|
|
||||||
@@ -66,33 +58,26 @@ class AppHistory extends BaseAppHistory {
|
|||||||
}
|
}
|
||||||
if (!isset($aObjectPermissions['DYNAFORMS'])) {
|
if (!isset($aObjectPermissions['DYNAFORMS'])) {
|
||||||
$aObjectPermissions['DYNAFORMS'] = array(-1);
|
$aObjectPermissions['DYNAFORMS'] = array(-1);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (!is_array($aObjectPermissions['DYNAFORMS'])) {
|
if (!is_array($aObjectPermissions['DYNAFORMS'])) {
|
||||||
$aObjectPermissions['DYNAFORMS'] = array(-1);
|
$aObjectPermissions['DYNAFORMS'] = array(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isset($aObjectPermissions['INPUT_DOCUMENTS'])) {
|
if (!isset($aObjectPermissions['INPUT_DOCUMENTS'])) {
|
||||||
$aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
|
$aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) {
|
if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) {
|
||||||
$aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
|
$aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isset($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
|
if (!isset($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
|
||||||
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
|
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
|
if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
|
||||||
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
|
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$c = new Criteria('workflow');
|
$c = new Criteria('workflow');
|
||||||
$c->addSelectColumn(AppHistoryPeer::APP_UID);
|
$c->addSelectColumn(AppHistoryPeer::APP_UID);
|
||||||
$c->addSelectColumn(AppHistoryPeer::DEL_INDEX);
|
$c->addSelectColumn(AppHistoryPeer::DEL_INDEX);
|
||||||
@@ -108,7 +93,6 @@ class AppHistory extends BaseAppHistory {
|
|||||||
$c->addAsColumn('USR_NAME', "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME)");
|
$c->addAsColumn('USR_NAME', "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME)");
|
||||||
$c->addJoin(AppHistoryPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
|
$c->addJoin(AppHistoryPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||||
|
|
||||||
|
|
||||||
//WHERE
|
//WHERE
|
||||||
$c->add(AppHistoryPeer::DYN_UID, $aObjectPermissions['DYNAFORMS'], Criteria::IN);
|
$c->add(AppHistoryPeer::DYN_UID, $aObjectPermissions['DYNAFORMS'], Criteria::IN);
|
||||||
$c->add(AppHistoryPeer::PRO_UID, $PRO_UID);
|
$c->add(AppHistoryPeer::PRO_UID, $PRO_UID);
|
||||||
@@ -121,7 +105,6 @@ class AppHistory extends BaseAppHistory {
|
|||||||
$c->clearOrderByColumns();
|
$c->clearOrderByColumns();
|
||||||
$c->addDescendingOrderByColumn(AppHistoryPeer::HISTORY_DATE);
|
$c->addDescendingOrderByColumn(AppHistoryPeer::HISTORY_DATE);
|
||||||
|
|
||||||
|
|
||||||
//Execute
|
//Execute
|
||||||
$oDataset = AppHistoryPeer::doSelectRS($c);
|
$oDataset = AppHistoryPeer::doSelectRS($c);
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
@@ -133,7 +116,6 @@ class AppHistory extends BaseAppHistory {
|
|||||||
);
|
);
|
||||||
|
|
||||||
while ($aRow = $oDataset->getRow()) {
|
while ($aRow = $oDataset->getRow()) {
|
||||||
|
|
||||||
$o = new Dynaform();
|
$o = new Dynaform();
|
||||||
$o->setDynUid($aRow['DYN_UID']);
|
$o->setDynUid($aRow['DYN_UID']);
|
||||||
$aRow['DYN_TITLE'] = $o->getDynTitle();
|
$aRow['DYN_TITLE'] = $o->getDynTitle();
|
||||||
@@ -141,7 +123,7 @@ class AppHistory extends BaseAppHistory {
|
|||||||
$html="<table border='0' cellpadding='0' cellspacing='0'>";
|
$html="<table border='0' cellpadding='0' cellspacing='0'>";
|
||||||
$sw_add=false;
|
$sw_add=false;
|
||||||
foreach ($changedValues as $key => $value) {
|
foreach ($changedValues as $key => $value) {
|
||||||
if(($value!=NULL)&&(!is_array($value))){
|
if (($value!=null) && (!is_array($value))) {
|
||||||
$sw_add=true;
|
$sw_add=true;
|
||||||
$html.="<tr>";
|
$html.="<tr>";
|
||||||
$html.="<td><b>$key:</b> </td>";
|
$html.="<td><b>$key:</b> </td>";
|
||||||
@@ -170,7 +152,6 @@ class AppHistory extends BaseAppHistory {
|
|||||||
}
|
}
|
||||||
$html.="</td>";
|
$html.="</td>";
|
||||||
$html.="</tr>";
|
$html.="</tr>";
|
||||||
|
|
||||||
}
|
}
|
||||||
$html.="</table>";
|
$html.="</table>";
|
||||||
$html.="</td>";
|
$html.="</td>";
|
||||||
@@ -196,7 +177,6 @@ class AppHistory extends BaseAppHistory {
|
|||||||
$oCriteria->setDBArrayTable('DynaformsHistory');
|
$oCriteria->setDBArrayTable('DynaformsHistory');
|
||||||
$oCriteria->addDescendingOrderByColumn(AppHistoryPeer::HISTORY_DATE);
|
$oCriteria->addDescendingOrderByColumn(AppHistoryPeer::HISTORY_DATE);
|
||||||
return $oCriteria;
|
return $oCriteria;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // AppHistory
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppHistoryPeer extends BaseAppHistoryPeer {
|
class AppHistoryPeer extends BaseAppHistoryPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppHistoryPeer
|
|
||||||
|
|||||||
@@ -121,5 +121,4 @@ class AppMessage extends BaseAppMessage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// AppMessage
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppMessagePeer extends BaseAppMessagePeer {
|
class AppMessagePeer extends BaseAppMessagePeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppMessagePeer
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ require_once 'classes/model/om/BaseAppNotes.php';
|
|||||||
*/
|
*/
|
||||||
class AppNotes extends BaseAppNotes
|
class AppNotes extends BaseAppNotes
|
||||||
{
|
{
|
||||||
|
|
||||||
public function getNotesList ($appUid, $usrUid = '', $start = '', $limit = '')
|
public function getNotesList ($appUid, $usrUid = '', $start = '', $limit = '')
|
||||||
{
|
{
|
||||||
require_once ("classes/model/Users.php");
|
require_once ("classes/model/Users.php");
|
||||||
@@ -206,25 +205,8 @@ class AppNotes extends BaseAppNotes
|
|||||||
|
|
||||||
$sSubject = G::replaceDataField( $configNoteNotification['subject'], $aFields );
|
$sSubject = G::replaceDataField( $configNoteNotification['subject'], $aFields );
|
||||||
|
|
||||||
//erik: new behaviour for messages
|
|
||||||
//G::loadClass('configuration');
|
|
||||||
//$oConf = new Configurations;
|
|
||||||
//$oConf->loadConfig($x, 'TAS_EXTRA_PROPERTIES', $aTaskInfo['TAS_UID'], '', '');
|
|
||||||
//$conf = $oConf->aConfig;
|
|
||||||
/*
|
|
||||||
if( isset($conf['TAS_DEF_MESSAGE_TYPE']) && isset($conf['TAS_DEF_MESSAGE_TEMPLATE'])
|
|
||||||
&& $conf['TAS_DEF_MESSAGE_TYPE'] == 'template' && $conf['TAS_DEF_MESSAGE_TEMPLATE'] != '') {
|
|
||||||
|
|
||||||
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $aTaskInfo['PRO_UID'] . PATH_SEP;
|
|
||||||
$fileTemplate = $pathEmail . $conf['TAS_DEF_MESSAGE_TEMPLATE'];
|
|
||||||
|
|
||||||
if ( ! file_exists ( $fileTemplate ) ) {
|
|
||||||
throw new Exception("Template file '$fileTemplate' does not exist.");
|
|
||||||
}
|
|
||||||
$sBody = G::replaceDataField(file_get_contents($fileTemplate), $aFields);
|
|
||||||
} else {*/
|
|
||||||
$sBody = nl2br( G::replaceDataField( $configNoteNotification['body'], $aFields ) );
|
$sBody = nl2br( G::replaceDataField( $configNoteNotification['body'], $aFields ) );
|
||||||
/*}*/
|
|
||||||
G::LoadClass( 'spool' );
|
G::LoadClass( 'spool' );
|
||||||
$oUser = new Users();
|
$oUser = new Users();
|
||||||
$recipientsArray = explode( ",", $noteRecipients );
|
$recipientsArray = explode( ",", $noteRecipients );
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
*
|
*
|
||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
class AppNotesPeer extends BaseAppNotesPeer {
|
class AppNotesPeer extends BaseAppNotesPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppNotesPeer
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ require_once 'classes/model/om/BaseAppOwner.php';
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppOwner extends BaseAppOwner {
|
class AppOwner extends BaseAppOwner
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppOwner
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppOwnerPeer extends BaseAppOwnerPeer {
|
class AppOwnerPeer extends BaseAppOwnerPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppOwnerPeer
|
|
||||||
|
|||||||
@@ -15,21 +15,18 @@ require_once 'classes/entities/AppSolrQueue.php';
|
|||||||
*
|
*
|
||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
class AppSolrQueue extends BaseAppSolrQueue {
|
class AppSolrQueue extends BaseAppSolrQueue
|
||||||
|
{
|
||||||
public function exists($sAppUid)
|
public function exists($sAppUid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oRow = AppSolrQueuePeer::retrieveByPK( $sAppUid );
|
$oRow = AppSolrQueuePeer::retrieveByPK( $sAppUid );
|
||||||
if (!is_null($oRow))
|
if (!is_null($oRow)) {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $oError) {
|
||||||
catch (Exception $oError) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,8 +34,7 @@ class AppSolrQueue extends BaseAppSolrQueue {
|
|||||||
public function createUpdate($sAppUid, $iUpdated)
|
public function createUpdate($sAppUid, $iUpdated)
|
||||||
{
|
{
|
||||||
$con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
|
$con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
if ($this->exists($sAppUid)) {
|
if ($this->exists($sAppUid)) {
|
||||||
$con->begin();
|
$con->begin();
|
||||||
//update record
|
//update record
|
||||||
@@ -49,12 +45,9 @@ class AppSolrQueue extends BaseAppSolrQueue {
|
|||||||
//set field
|
//set field
|
||||||
$this->setAppUid($sAppUid);
|
$this->setAppUid($sAppUid);
|
||||||
$this->setAppUpdated($iUpdated);
|
$this->setAppUpdated($iUpdated);
|
||||||
if($this->validate())
|
if ($this->validate()) {
|
||||||
{
|
|
||||||
$result=$this->save();
|
$result=$this->save();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw(new Exception("Failed Validation in class ".get_class($this)."."));
|
throw(new Exception("Failed Validation in class ".get_class($this)."."));
|
||||||
}
|
}
|
||||||
@@ -65,12 +58,9 @@ class AppSolrQueue extends BaseAppSolrQueue {
|
|||||||
//set values
|
//set values
|
||||||
$this->setAppUid($sAppUid);
|
$this->setAppUid($sAppUid);
|
||||||
$this->setAppUpdated($iUpdated);
|
$this->setAppUpdated($iUpdated);
|
||||||
if($this->validate())
|
if ($this->validate()) {
|
||||||
{
|
|
||||||
$result=$this->save();
|
$result=$this->save();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$e=new Exception("Failed Validation in class ".get_class($this).".");
|
$e=new Exception("Failed Validation in class ".get_class($this).".");
|
||||||
//$e->aValidationFailures=$this->getValidationFailures();
|
//$e->aValidationFailures=$this->getValidationFailures();
|
||||||
throw($e);
|
throw($e);
|
||||||
@@ -78,9 +68,7 @@ class AppSolrQueue extends BaseAppSolrQueue {
|
|||||||
$con->commit();
|
$con->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch(Exception $e)
|
|
||||||
{
|
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw($e);
|
throw($e);
|
||||||
}
|
}
|
||||||
@@ -90,10 +78,10 @@ class AppSolrQueue extends BaseAppSolrQueue {
|
|||||||
* Returns the list of updated applications
|
* Returns the list of updated applications
|
||||||
* array of Entity_AppSolrQueue
|
* array of Entity_AppSolrQueue
|
||||||
*/
|
*/
|
||||||
public function getListUpdatedApplications(){
|
public function getListUpdatedApplications()
|
||||||
$updatedApplications = array();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
|
$updatedApplications = array();
|
||||||
|
try {
|
||||||
$c = new Criteria();
|
$c = new Criteria();
|
||||||
|
|
||||||
$c->addSelectColumn(AppSolrQueuePeer::APP_UID);
|
$c->addSelectColumn(AppSolrQueuePeer::APP_UID);
|
||||||
@@ -116,11 +104,11 @@ class AppSolrQueue extends BaseAppSolrQueue {
|
|||||||
$rs->next();
|
$rs->next();
|
||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $updatedApplications;
|
return $updatedApplications;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw($e);
|
throw($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // AppSolrQueue
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
*
|
*
|
||||||
* @package classes.model
|
* @package classes.model
|
||||||
*/
|
*/
|
||||||
class AppSolrQueuePeer extends BaseAppSolrQueuePeer {
|
class AppSolrQueuePeer extends BaseAppSolrQueuePeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppSolrQueuePeer
|
|
||||||
|
|||||||
@@ -38,9 +38,10 @@ require_once 'classes/model/om/BaseAppThread.php';
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppThread extends BaseAppThread {
|
class AppThread extends BaseAppThread
|
||||||
|
{
|
||||||
function createAppThread ( $sAppUid, $iDelIndex, $iParent ) {
|
public function createAppThread ($sAppUid, $iDelIndex, $iParent)
|
||||||
|
{
|
||||||
if (!isset($sAppUid) || strlen($sAppUid ) == 0 ) {
|
if (!isset($sAppUid) || strlen($sAppUid ) == 0 ) {
|
||||||
throw ( new Exception ( 'Column "APP_UID" cannot be null.' ) );
|
throw ( new Exception ( 'Column "APP_UID" cannot be null.' ) );
|
||||||
}
|
}
|
||||||
@@ -71,12 +72,10 @@ class AppThread extends BaseAppThread {
|
|||||||
if ($this->validate() ) {
|
if ($this->validate() ) {
|
||||||
try {
|
try {
|
||||||
$res = $this->save();
|
$res = $this->save();
|
||||||
}
|
} catch ( PropelException $e ) {
|
||||||
catch ( PropelException $e ) {
|
|
||||||
throw ( $e );
|
throw ( $e );
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Something went wrong. We can now get the validationFailures and handle them.
|
// Something went wrong. We can now get the validationFailures and handle them.
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$validationFailuresArray = $this->getValidationFailures();
|
$validationFailuresArray = $this->getValidationFailures();
|
||||||
@@ -100,23 +99,20 @@ class AppThread extends BaseAppThread {
|
|||||||
$res = $oApp->save();
|
$res = $oApp->save();
|
||||||
$con->commit();
|
$con->commit();
|
||||||
return $res;
|
return $res;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
foreach($this->getValidationFailures() as $objValidationFailure)
|
foreach ($this->getValidationFailures() as $objValidationFailure) {
|
||||||
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
||||||
|
}
|
||||||
throw ( new PropelException ( 'The AppThread row cannot be created!', new PropelException ( $msg ) ) );
|
throw ( new PropelException ( 'The AppThread row cannot be created!', new PropelException ( $msg ) ) );
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw(new Exception( "This AppThread row doesn't exist!" ));
|
throw(new Exception( "This AppThread row doesn't exist!" ));
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $oError) {
|
||||||
catch (Exception $oError) {
|
|
||||||
throw($oError);
|
throw($oError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // AppThread
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class AppThreadPeer extends BaseAppThreadPeer {
|
class AppThreadPeer extends BaseAppThreadPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // AppThreadPeer
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class ApplicationPeer extends BaseApplicationPeer {
|
class ApplicationPeer extends BaseApplicationPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // ApplicationPeer
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ require_once 'classes/model/om/BaseCalendarAssignments.php';
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CalendarAssignments extends BaseCalendarAssignments {
|
class CalendarAssignments extends BaseCalendarAssignments
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // CalendarAssignments
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CalendarAssignmentsPeer extends BaseCalendarAssignmentsPeer {
|
class CalendarAssignmentsPeer extends BaseCalendarAssignmentsPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // CalendarAssignmentsPeer
|
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ require_once 'classes/model/om/BaseCalendarBusinessHours.php';
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CalendarBusinessHours extends BaseCalendarBusinessHours {
|
class CalendarBusinessHours extends BaseCalendarBusinessHours
|
||||||
function getCalendarBusinessHours($CalendarUid){
|
{
|
||||||
|
public function getCalendarBusinessHours($CalendarUid)
|
||||||
|
{
|
||||||
$Criteria = new Criteria('workflow');
|
$Criteria = new Criteria('workflow');
|
||||||
$Criteria->clearSelectColumns ( );
|
$Criteria->clearSelectColumns ( );
|
||||||
|
|
||||||
@@ -28,21 +30,16 @@ class CalendarBusinessHours extends BaseCalendarBusinessHours {
|
|||||||
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
|
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
|
||||||
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END );
|
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$Criteria->add ( CalendarBusinessHoursPeer::CALENDAR_UID, $CalendarUid , CRITERIA::EQUAL );
|
$Criteria->add ( CalendarBusinessHoursPeer::CALENDAR_UID, $CalendarUid , CRITERIA::EQUAL );
|
||||||
$Criteria->addDescendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY );
|
$Criteria->addDescendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY );
|
||||||
$Criteria->addAscendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
|
$Criteria->addAscendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
|
||||||
//$Criteria->addDescendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
|
|
||||||
|
|
||||||
$rs = CalendarBusinessHoursPeer::doSelectRS($Criteria);
|
$rs = CalendarBusinessHoursPeer::doSelectRS($Criteria);
|
||||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$rs->next();
|
$rs->next();
|
||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
|
|
||||||
$fields=array();
|
$fields=array();
|
||||||
$count=0;
|
$count=0;
|
||||||
|
|
||||||
while (is_array($row)) {
|
while (is_array($row)) {
|
||||||
$count++;
|
$count++;
|
||||||
$fields[$count] = $row;
|
$fields[$count] = $row;
|
||||||
@@ -51,7 +48,9 @@ class CalendarBusinessHours extends BaseCalendarBusinessHours {
|
|||||||
}
|
}
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
function deleteAllCalendarBusinessHours($CalendarUid){
|
|
||||||
|
public function deleteAllCalendarBusinessHours($CalendarUid)
|
||||||
|
{
|
||||||
$toDelete = $this->getCalendarBusinessHours($CalendarUid);
|
$toDelete = $this->getCalendarBusinessHours($CalendarUid);
|
||||||
foreach ($toDelete as $key => $businessHoursInfo) {
|
foreach ($toDelete as $key => $businessHoursInfo) {
|
||||||
$CalendarUid = $businessHoursInfo['CALENDAR_UID'];
|
$CalendarUid = $businessHoursInfo['CALENDAR_UID'];
|
||||||
@@ -64,9 +63,10 @@ class CalendarBusinessHours extends BaseCalendarBusinessHours {
|
|||||||
$tr->delete();
|
$tr->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function saveCalendarBusinessHours($aData){
|
|
||||||
|
public function saveCalendarBusinessHours($aData)
|
||||||
|
{
|
||||||
$CalendarUid = $aData['CALENDAR_UID'];
|
$CalendarUid = $aData['CALENDAR_UID'];
|
||||||
$CalendarBusinessDay = $aData['CALENDAR_BUSINESS_DAY'];
|
$CalendarBusinessDay = $aData['CALENDAR_BUSINESS_DAY'];
|
||||||
$CalendarBusinessStart = $aData['CALENDAR_BUSINESS_START'];
|
$CalendarBusinessStart = $aData['CALENDAR_BUSINESS_START'];
|
||||||
@@ -83,12 +83,10 @@ class CalendarBusinessHours extends BaseCalendarBusinessHours {
|
|||||||
$tr->setCalendarBusinessStart( $CalendarBusinessStart );
|
$tr->setCalendarBusinessStart( $CalendarBusinessStart );
|
||||||
$tr->setCalendarBusinessEnd( $CalendarBusinessEnd );
|
$tr->setCalendarBusinessEnd( $CalendarBusinessEnd );
|
||||||
|
|
||||||
|
|
||||||
if ($tr->validate() ) {
|
if ($tr->validate() ) {
|
||||||
// we save it, since we get no validation errors, or do whatever else you like.
|
// we save it, since we get no validation errors, or do whatever else you like.
|
||||||
$res = $tr->save();
|
$res = $tr->save();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Something went wrong. We can now get the validationFailures and handle them.
|
// Something went wrong. We can now get the validationFailures and handle them.
|
||||||
$msg = $CalendarBusinessDay.'<hr/>';
|
$msg = $CalendarBusinessDay.'<hr/>';
|
||||||
$validationFailuresArray = $tr->getValidationFailures();
|
$validationFailuresArray = $tr->getValidationFailures();
|
||||||
@@ -98,14 +96,6 @@ class CalendarBusinessHours extends BaseCalendarBusinessHours {
|
|||||||
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
||||||
G::SendTemporalMessage($msg);
|
G::SendTemporalMessage($msg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
|
|
||||||
|
|
||||||
//to do: uniform coderror structures for all classes
|
|
||||||
|
|
||||||
//if ( $res['codError'] < 0 ) {
|
|
||||||
// G::SendMessageText ( $res['message'] , 'error' );
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // CalendarBusinessHours
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CalendarBusinessHoursPeer extends BaseCalendarBusinessHoursPeer {
|
class CalendarBusinessHoursPeer extends BaseCalendarBusinessHoursPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // CalendarBusinessHoursPeer
|
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class CalendarDefinition extends BaseCalendarDefinition
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Added by qennix
|
//Added by qennix
|
||||||
//Gets criteria for listing
|
//Gets criteria for listing
|
||||||
public function getCalendarCriterias ($filter, $start, $limit)
|
public function getCalendarCriterias ($filter, $start, $limit)
|
||||||
@@ -143,6 +144,7 @@ class CalendarDefinition extends BaseCalendarDefinition
|
|||||||
//********************
|
//********************
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
//for edit
|
//for edit
|
||||||
public function getCalendarInfoE ($CalendarUid)
|
public function getCalendarInfoE ($CalendarUid)
|
||||||
{
|
{
|
||||||
@@ -291,11 +293,6 @@ class CalendarDefinition extends BaseCalendarDefinition
|
|||||||
}
|
}
|
||||||
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
||||||
}
|
}
|
||||||
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
|
|
||||||
//to do: uniform coderror structures for all classes
|
|
||||||
//if ( $res['codError'] < 0 ) {
|
|
||||||
// G::SendMessageText ( $res['message'] , 'error' );
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteCalendar ($CalendarUid)
|
public function deleteCalendar ($CalendarUid)
|
||||||
@@ -328,11 +325,6 @@ class CalendarDefinition extends BaseCalendarDefinition
|
|||||||
G::SendMessage( "ERROR", $msg );
|
G::SendMessage( "ERROR", $msg );
|
||||||
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
||||||
}
|
}
|
||||||
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
|
|
||||||
//to do: uniform coderror structures for all classes
|
|
||||||
//if ( $res['codError'] < 0 ) {
|
|
||||||
// G::SendMessageText ( $res['message'] , 'error' );
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCalendarFor ($userUid, $proUid, $tasUid, $sw_validate = true)
|
public function getCalendarFor ($userUid, $proUid, $tasUid, $sw_validate = true)
|
||||||
@@ -416,6 +408,7 @@ class CalendarDefinition extends BaseCalendarDefinition
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Added by Qennix
|
//Added by Qennix
|
||||||
//Counts all users,task,process by calendar
|
//Counts all users,task,process by calendar
|
||||||
public function getAllCounterByCalendar ($type)
|
public function getAllCounterByCalendar ($type)
|
||||||
@@ -451,5 +444,4 @@ class CalendarDefinition extends BaseCalendarDefinition
|
|||||||
return $oDataset->getRow();
|
return $oDataset->getRow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CalendarDefinition
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CalendarDefinitionPeer extends BaseCalendarDefinitionPeer {
|
class CalendarDefinitionPeer extends BaseCalendarDefinitionPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // CalendarDefinitionPeer
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
require_once 'classes/model/om/BaseCalendarHolidays.php';
|
require_once 'classes/model/om/BaseCalendarHolidays.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Skeleton subclass for representing a row from the 'CALENDAR_HOLIDAYS' table.
|
* Skeleton subclass for representing a row from the 'CALENDAR_HOLIDAYS' table.
|
||||||
*
|
*
|
||||||
@@ -18,8 +17,10 @@ require_once 'classes/model/om/BaseCalendarHolidays.php';
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CalendarHolidays extends BaseCalendarHolidays {
|
class CalendarHolidays extends BaseCalendarHolidays
|
||||||
function getCalendarHolidays($CalendarUid){
|
{
|
||||||
|
public function getCalendarHolidays ($CalendarUid)
|
||||||
|
{
|
||||||
$Criteria = new Criteria('workflow');
|
$Criteria = new Criteria('workflow');
|
||||||
$Criteria->clearSelectColumns ( );
|
$Criteria->clearSelectColumns ( );
|
||||||
|
|
||||||
@@ -28,8 +29,6 @@ class CalendarHolidays extends BaseCalendarHolidays {
|
|||||||
$Criteria->addSelectColumn ( CalendarHolidaysPeer::CALENDAR_HOLIDAY_START );
|
$Criteria->addSelectColumn ( CalendarHolidaysPeer::CALENDAR_HOLIDAY_START );
|
||||||
$Criteria->addSelectColumn ( CalendarHolidaysPeer::CALENDAR_HOLIDAY_END );
|
$Criteria->addSelectColumn ( CalendarHolidaysPeer::CALENDAR_HOLIDAY_END );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$Criteria->add ( CalendarHolidaysPeer::CALENDAR_UID, $CalendarUid , CRITERIA::EQUAL );
|
$Criteria->add ( CalendarHolidaysPeer::CALENDAR_UID, $CalendarUid , CRITERIA::EQUAL );
|
||||||
|
|
||||||
$rs = CalendarHolidaysPeer::doSelectRS($Criteria);
|
$rs = CalendarHolidaysPeer::doSelectRS($Criteria);
|
||||||
@@ -37,9 +36,7 @@ class CalendarHolidays extends BaseCalendarHolidays {
|
|||||||
$rs->next();
|
$rs->next();
|
||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
$fields=array();
|
$fields=array();
|
||||||
|
|
||||||
$count=0;
|
$count=0;
|
||||||
|
|
||||||
while (is_array($row)) {
|
while (is_array($row)) {
|
||||||
$count++;
|
$count++;
|
||||||
$a=explode(" ",$row['CALENDAR_HOLIDAY_START']);
|
$a=explode(" ",$row['CALENDAR_HOLIDAY_START']);
|
||||||
@@ -52,7 +49,9 @@ class CalendarHolidays extends BaseCalendarHolidays {
|
|||||||
}
|
}
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
function deleteAllCalendarHolidays($CalendarUid){
|
|
||||||
|
public function deleteAllCalendarHolidays($CalendarUid)
|
||||||
|
{
|
||||||
$toDelete=$this->getCalendarHolidays($CalendarUid);
|
$toDelete=$this->getCalendarHolidays($CalendarUid);
|
||||||
foreach ($toDelete as $key => $holidayInfo) {
|
foreach ($toDelete as $key => $holidayInfo) {
|
||||||
$CalendarUid = $holidayInfo['CALENDAR_UID'];
|
$CalendarUid = $holidayInfo['CALENDAR_UID'];
|
||||||
@@ -66,10 +65,10 @@ function deleteAllCalendarHolidays($CalendarUid){
|
|||||||
$tr->delete();
|
$tr->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function saveCalendarHolidays($aData){
|
|
||||||
|
|
||||||
|
public function saveCalendarHolidays($aData)
|
||||||
|
{
|
||||||
$CalendarUid = $aData['CALENDAR_UID'];
|
$CalendarUid = $aData['CALENDAR_UID'];
|
||||||
$CalendarHolidayName = $aData['CALENDAR_HOLIDAY_NAME'];
|
$CalendarHolidayName = $aData['CALENDAR_HOLIDAY_NAME'];
|
||||||
$CalendarHolidayStart = $aData['CALENDAR_HOLIDAY_START'];
|
$CalendarHolidayStart = $aData['CALENDAR_HOLIDAY_START'];
|
||||||
@@ -86,12 +85,9 @@ function deleteAllCalendarHolidays($CalendarUid){
|
|||||||
$tr->setCalendarHolidayStart( $CalendarHolidayStart );
|
$tr->setCalendarHolidayStart( $CalendarHolidayStart );
|
||||||
$tr->setCalendarHolidayEnd( $CalendarHolidayEnd );
|
$tr->setCalendarHolidayEnd( $CalendarHolidayEnd );
|
||||||
|
|
||||||
|
|
||||||
if ($tr->validate() ) {
|
if ($tr->validate() ) {
|
||||||
// we save it, since we get no validation errors, or do whatever else you like.
|
|
||||||
$res = $tr->save();
|
$res = $tr->save();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Something went wrong. We can now get the validationFailures and handle them.
|
// Something went wrong. We can now get the validationFailures and handle them.
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$validationFailuresArray = $tr->getValidationFailures();
|
$validationFailuresArray = $tr->getValidationFailures();
|
||||||
@@ -101,14 +97,7 @@ function deleteAllCalendarHolidays($CalendarUid){
|
|||||||
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
|
|
||||||
|
|
||||||
//to do: uniform coderror structures for all classes
|
//to do: uniform coderror structures for all classes
|
||||||
|
}
|
||||||
//if ( $res['codError'] < 0 ) {
|
|
||||||
// G::SendMessageText ( $res['message'] , 'error' );
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // CalendarHolidays
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CalendarHolidaysPeer extends BaseCalendarHolidaysPeer {
|
class CalendarHolidaysPeer extends BaseCalendarHolidaysPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // CalendarHolidaysPeer
|
|
||||||
|
|||||||
@@ -23,28 +23,6 @@ require_once 'classes/model/Task.php';
|
|||||||
*/
|
*/
|
||||||
class CaseScheduler extends BaseCaseScheduler
|
class CaseScheduler extends BaseCaseScheduler
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
private $SchTimeNextRun = null;
|
|
||||||
private $SchLastRunTime = null;
|
|
||||||
|
|
||||||
public function getSchTimeNextRun() {
|
|
||||||
if($this->SchTimeNextRun === null)
|
|
||||||
$this->SchTimeNextRun = time();
|
|
||||||
return $this->SchTimeNextRun;
|
|
||||||
}
|
|
||||||
public function setSchTimeNextRun($value) {
|
|
||||||
$this->SchTimeNextRun = $value;
|
|
||||||
}
|
|
||||||
public function getSchLastRunTime(){
|
|
||||||
if($this->SchTimeNextRun === null)
|
|
||||||
$this->SchTimeNextRun = time();
|
|
||||||
return $this->SchLastRunTime;
|
|
||||||
}
|
|
||||||
public function setSchLastRunTime($value){
|
|
||||||
$this->SchLastRunTime = $value;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
public function load ($SchUid)
|
public function load ($SchUid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@@ -115,13 +93,6 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
} else {
|
} else {
|
||||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
$con->begin();
|
|
||||||
$this->setSchUid ( $SchUid );
|
|
||||||
$result = $this->delete();
|
|
||||||
$con->commit();
|
|
||||||
return $result;
|
|
||||||
*/
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw ($e);
|
throw ($e);
|
||||||
@@ -145,14 +116,6 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
$this->Update( $Fields );
|
$this->Update( $Fields );
|
||||||
}
|
}
|
||||||
|
|
||||||
// SELECT A.SCH_UID, A.SCH_NAME, A.PRO_UID, B.CON_VALUE AS PROCESS,
|
|
||||||
// A.TAS_UID, B.CON_VALUE AS TASK, A.SCH_TIME_NEXT_RUN, A.SCH_LAST_RUN_TIME, A.SCH_STATE, A.SCH_LAST_STATE,
|
|
||||||
// A.USR_UID, A.SCH_OPTION
|
|
||||||
// SCH_START_TIME, SCH_START_DATE, SCH_DAYS_PERFORM_TASK, SCH_EVERY_DAYS, SCH_WEEK_DAYS
|
|
||||||
// SCH_START_DAY, SCH_MONTHS, SCH_END_DATE, SCH_REPEAT_EVERY, SCH_REPEAT_UNTIL, SCH_REPEAT_STOP_IF_RUNNING
|
|
||||||
// FROM CASE_SCHEDULER A LEFT JOIN CONTENT B ON A.PRO_UID= B.CON_ID AND B.CON_CATEGORY='PRO_TITLE' AND B.CON_LANG='en'
|
|
||||||
// LEFT JOIN CONTENT C ON A.TAS_UID= C.CON_ID AND C.CON_CATEGORY='TAS_TITLE' AND C.CON_LANG='en'
|
|
||||||
//
|
|
||||||
public function getAllCriteria ()
|
public function getAllCriteria ()
|
||||||
{
|
{
|
||||||
$c = new Criteria( 'workflow' );
|
$c = new Criteria( 'workflow' );
|
||||||
@@ -184,7 +147,6 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
$c->addSelectColumn( CaseSchedulerPeer::CASE_SH_PLUGIN_UID );
|
$c->addSelectColumn( CaseSchedulerPeer::CASE_SH_PLUGIN_UID );
|
||||||
|
|
||||||
return $c;
|
return $c;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAll ()
|
public function getAll ()
|
||||||
@@ -293,12 +255,7 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
), array ('PRO_UID' => $aTaskRow['PRO_UID']
|
), array ('PRO_UID' => $aTaskRow['PRO_UID']
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// g::pr($aRows); die;
|
|
||||||
|
|
||||||
|
|
||||||
return $aRows;
|
return $aRows;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function caseSchedulerCron ($date, &$log = array(), $cron = 0)
|
public function caseSchedulerCron ($date, &$log = array(), $cron = 0)
|
||||||
@@ -358,7 +315,6 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
break;
|
break;
|
||||||
case '5':
|
case '5':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sActualTime = $aRow['SCH_TIME_NEXT_RUN'];
|
$sActualTime = $aRow['SCH_TIME_NEXT_RUN'];
|
||||||
@@ -368,6 +324,7 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
$dActualSysMinutes = date( 'i', $nTime );
|
$dActualSysMinutes = date( 'i', $nTime );
|
||||||
$sActualDataTime = strtotime( $aRow['SCH_TIME_NEXT_RUN'] );
|
$sActualDataTime = strtotime( $aRow['SCH_TIME_NEXT_RUN'] );
|
||||||
$sActualSysTime = strtotime( $nTime );
|
$sActualSysTime = strtotime( $nTime );
|
||||||
|
|
||||||
// note added consider the posibility to encapsulate some in functionality in a class method or some funtions
|
// note added consider the posibility to encapsulate some in functionality in a class method or some funtions
|
||||||
if ($sActualDataHour < $dActualSysHour) {
|
if ($sActualDataHour < $dActualSysHour) {
|
||||||
$_PORT = (SERVER_PORT != '80') ? ':' . SERVER_PORT : '';
|
$_PORT = (SERVER_PORT != '80') ? ':' . SERVER_PORT : '';
|
||||||
@@ -419,12 +376,10 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//If there is a trigger that is registered to do this then transfer control
|
//If there is a trigger that is registered to do this then transfer control
|
||||||
|
|
||||||
|
|
||||||
if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
|
if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
|
||||||
eprintln( " - Transfering control to a Plugin: " . $caseSchedulerSelected->sNamespace . "/" . $caseSchedulerSelected->sActionId, 'green' );
|
eprintln( " - Transfering control to a Plugin: " . $caseSchedulerSelected->sNamespace . "/" . $caseSchedulerSelected->sActionId, 'green' );
|
||||||
|
|
||||||
$oData['OBJ_SOAP'] = $client;
|
$oData['OBJ_SOAP'] = $client;
|
||||||
$oData['SCH_UID'] = $aRow['SCH_UID'];
|
$oData['SCH_UID'] = $aRow['SCH_UID'];
|
||||||
$oData['params'] = $params;
|
$oData['params'] = $params;
|
||||||
@@ -563,7 +518,6 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
$paramsLog['WS_CREATE_CASE_STATUS'] = strip_tags( $result->message );
|
$paramsLog['WS_CREATE_CASE_STATUS'] = strip_tags( $result->message );
|
||||||
eprintln( "FAILED->{$paramsLog ['WS_CREATE_CASE_STATUS']}", 'red' );
|
eprintln( "FAILED->{$paramsLog ['WS_CREATE_CASE_STATUS']}", 'red' );
|
||||||
$paramsLogResult = 'FAILED';
|
$paramsLogResult = 'FAILED';
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// invalid user or bad password
|
// invalid user or bad password
|
||||||
@@ -611,10 +565,8 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
$this->updateDate( $sSchedulerUid, $nSchTimeNextRun, $nSchLastRunTime );
|
$this->updateDate( $sSchedulerUid, $nSchTimeNextRun, $nSchLastRunTime );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateDate ($sSchedulerUid = '', $sSchTimeNextRun = '', $sSchLastRunTime = '')
|
public function updateDate ($sSchedulerUid = '', $sSchTimeNextRun = '', $sSchLastRunTime = '')
|
||||||
@@ -628,8 +580,6 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
public function updateNextRun ($sOption, $sValue = '', $sActualTime = '', $sDaysPerformTask = '', $sWeeks = '', $sStartDay = '', $sMonths = '', $currentDate = '')
|
public function updateNextRun ($sOption, $sValue = '', $sActualTime = '', $sDaysPerformTask = '', $sWeeks = '', $sStartDay = '', $sMonths = '', $currentDate = '')
|
||||||
{
|
{
|
||||||
$nActualDate = $currentDate . " " . $sActualTime;
|
$nActualDate = $currentDate . " " . $sActualTime;
|
||||||
// date("Y-m-d H:i:s", $sActualTime);
|
|
||||||
// date("Y-m-d H:i:s", $sActualTime);
|
|
||||||
$dEstimatedDate = '';
|
$dEstimatedDate = '';
|
||||||
switch ($sOption) {
|
switch ($sOption) {
|
||||||
case '1':
|
case '1':
|
||||||
@@ -652,7 +602,6 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '2':
|
case '2':
|
||||||
if (strlen( $sWeeks ) > 0) {
|
if (strlen( $sWeeks ) > 0) {
|
||||||
//die($sActualTime);
|
//die($sActualTime);
|
||||||
@@ -675,12 +624,8 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//die;
|
|
||||||
if ($nSW == 1) {
|
if ($nSW == 1) {
|
||||||
$dEstimatedDate = date( 'Y-m-d', strtotime( "$nActualDate next " . $aDaysWeek[$nNextDay] ) ) . ' ' . date( 'H:i:s', strtotime( $sActualTime ) );
|
$dEstimatedDate = date( 'Y-m-d', strtotime( "$nActualDate next " . $aDaysWeek[$nNextDay] ) ) . ' ' . date( 'H:i:s', strtotime( $sActualTime ) );
|
||||||
//print_r($dEstimatedDate);
|
|
||||||
// die("03");
|
|
||||||
} else {
|
} else {
|
||||||
$nEveryDays = $sDaysPerformTask;
|
$nEveryDays = $sDaysPerformTask;
|
||||||
// $nEveryDays = '1';
|
// $nEveryDays = '1';
|
||||||
@@ -699,31 +644,14 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
$nEveryDays = 1;
|
$nEveryDays = 1;
|
||||||
//$nActualDate = date('Y-m-d').' '.$sActualTime;
|
//$nActualDate = date('Y-m-d').' '.$sActualTime;
|
||||||
$nDataTmp = date( 'Y-m-d', strtotime( "$nActualDate + " . $nEveryDays . " Week" ) );
|
$nDataTmp = date( 'Y-m-d', strtotime( "$nActualDate + " . $nEveryDays . " Week" ) );
|
||||||
//echo "$nActualDate + " . $nEveryDays . " Week ";
|
|
||||||
//echo "++";
|
|
||||||
//echo strtotime( "+".$nEveryDays . " week"), "\n";
|
|
||||||
//echo strtotime("$nActualDate +" . $nEveryDays . " Week ");
|
|
||||||
//echo "++";
|
|
||||||
//echo $nDataTmp;
|
|
||||||
//echo "--";
|
|
||||||
//echo $sTypeOperation;
|
|
||||||
//echo $nFirstDay;
|
|
||||||
//print_r ($aDaysWeek);
|
|
||||||
//$sTypeOperation = "next";
|
|
||||||
$dEstimatedDate = date( 'Y-m-d', strtotime( "$nDataTmp " . $sTypeOperation . " " . $aDaysWeek[$nFirstDay] ) ) . ' ' . date( 'H:i:s', strtotime( $sActualTime ) );
|
$dEstimatedDate = date( 'Y-m-d', strtotime( "$nDataTmp " . $sTypeOperation . " " . $aDaysWeek[$nFirstDay] ) ) . ' ' . date( 'H:i:s', strtotime( $sActualTime ) );
|
||||||
//echo (strtotime ("$nDataTmp " . $sTypeOperation . " " . $aDaysWeek[$nFirstDay]));
|
|
||||||
//echo "$nDataTmp " . $sTypeOperation . " " . $aDaysWeek[$nFirstDay];
|
|
||||||
//echo $dEstimatedDate;
|
|
||||||
//echo "--";
|
|
||||||
//echo date('Y-m-d', strtotime ("$nDataTmp " . $sTypeOperation . " " . $aDaysWeek[$nFirstDay])) . ' ' . date('H:i:s', strtotime($sActualTime));
|
|
||||||
//die("02");
|
|
||||||
}
|
}
|
||||||
//die("03");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '3':
|
case '3':
|
||||||
if (strlen( $sMonths ) > 0) { // Must have at least one selected month
|
if (strlen( $sMonths ) > 0) {
|
||||||
|
// Must have at least one selected month
|
||||||
// Calculamos para la siguiente ejecucion, acorde a lo seleccionado
|
// Calculamos para la siguiente ejecucion, acorde a lo seleccionado
|
||||||
$aStartDay = explode( '|', $sStartDay );
|
$aStartDay = explode( '|', $sStartDay );
|
||||||
$nYear = date( "Y", strtotime( $sActualTime ) );
|
$nYear = date( "Y", strtotime( $sActualTime ) );
|
||||||
@@ -741,7 +669,7 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($nSW == 1) { // Mes encontrado
|
if ($nSW == 1) {
|
||||||
$nExecNextMonth = $nNextMonth;
|
$nExecNextMonth = $nNextMonth;
|
||||||
} else {
|
} else {
|
||||||
$nExecNextMonth = $aMonths[0] - 1;
|
$nExecNextMonth = $aMonths[0] - 1;
|
||||||
@@ -782,11 +710,8 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$dEstimatedDate = date( 'Y-m-d', strtotime( $sDaysWeekOpt . ' week ' . $aWeeksShort[$sDayWeek - 1] . ' ' . $aMontsShort[$nExecNextMonth] . ' ' . $nYear ) ) . ' ' . date( 'H:i:s', strtotime( $sActualTime ) );
|
$dEstimatedDate = date( 'Y-m-d', strtotime( $sDaysWeekOpt . ' week ' . $aWeeksShort[$sDayWeek - 1] . ' ' . $aMontsShort[$nExecNextMonth] . ' ' . $nYear ) ) . ' ' . date( 'H:i:s', strtotime( $sActualTime ) );
|
||||||
// krumo($nExecNextMonth, $sDayWeek);
|
|
||||||
// krumo($sDaysWeekOpt . ' week ' . $aWeeksShort[$sDayWeek-1] . ' ' . $aMontsShort[$nExecNextMonth] . ' ' . $nYear);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -803,5 +728,4 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CaseScheduler
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CaseSchedulerPeer extends BaseCaseSchedulerPeer {
|
class CaseSchedulerPeer extends BaseCaseSchedulerPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // CaseSchedulerPeer
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ require_once 'classes/model/om/BaseCaseTracker.php';
|
|||||||
*/
|
*/
|
||||||
class CaseTracker extends BaseCaseTracker
|
class CaseTracker extends BaseCaseTracker
|
||||||
{
|
{
|
||||||
|
|
||||||
public function load ($sProcessUID)
|
public function load ($sProcessUID)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@@ -110,7 +109,7 @@ class CaseTracker extends BaseCaseTracker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function caseTrackerExists ($sUid)
|
public function caseTrackerExists ($sUid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oObj = CaseTrackerPeer::retrieveByPk( $sUid );
|
$oObj = CaseTrackerPeer::retrieveByPk( $sUid );
|
||||||
@@ -120,5 +119,4 @@ class CaseTracker extends BaseCaseTracker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CaseTracker
|
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class CaseTrackerObject extends BaseCaseTrackerObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reorderPositions ($sProcessUID, $iPosition)
|
public function reorderPositions ($sProcessUID, $iPosition)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
@@ -135,7 +135,7 @@ class CaseTrackerObject extends BaseCaseTrackerObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function caseTrackerObjectExists ($Uid)
|
public function caseTrackerObjectExists ($Uid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oObj = CaseTrackerObjectPeer::retrieveByPk( $Uid );
|
$oObj = CaseTrackerObjectPeer::retrieveByPk( $Uid );
|
||||||
@@ -149,7 +149,7 @@ class CaseTrackerObject extends BaseCaseTrackerObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeByObject ($sType, $sObjUid)
|
public function removeByObject ($sType, $sObjUid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
@@ -161,5 +161,4 @@ class CaseTrackerObject extends BaseCaseTrackerObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CaseTrackerObject
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CaseTrackerObjectPeer extends BaseCaseTrackerObjectPeer {
|
class CaseTrackerObjectPeer extends BaseCaseTrackerObjectPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // CaseTrackerObjectPeer
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class CaseTrackerPeer extends BaseCaseTrackerPeer {
|
class CaseTrackerPeer extends BaseCaseTrackerPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // CaseTrackerPeer
|
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ require_once 'classes/model/Content.php';
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class Configuration extends BaseConfiguration {
|
class Configuration extends BaseConfiguration
|
||||||
|
{
|
||||||
public function create($aData)
|
public function create($aData)
|
||||||
{
|
{
|
||||||
$con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
|
$con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
$con->begin();
|
$con->begin();
|
||||||
$this->setCfgUid($aData['CFG_UID']);
|
$this->setCfgUid($aData['CFG_UID']);
|
||||||
$this->setObjUid($aData['OBJ_UID']);
|
$this->setObjUid($aData['OBJ_UID']);
|
||||||
@@ -52,76 +52,64 @@ class Configuration extends BaseConfiguration {
|
|||||||
$this->setProUid($aData['PRO_UID']);
|
$this->setProUid($aData['PRO_UID']);
|
||||||
$this->setUsrUid($aData['USR_UID']);
|
$this->setUsrUid($aData['USR_UID']);
|
||||||
$this->setAppUid($aData['APP_UID']);
|
$this->setAppUid($aData['APP_UID']);
|
||||||
if($this->validate())
|
if ($this->validate()) {
|
||||||
{
|
|
||||||
$result=$this->save();
|
$result=$this->save();
|
||||||
$con->commit();
|
$con->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$con->rollback();
|
$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();
|
$con->rollback();
|
||||||
throw($e);
|
throw($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function load($CfgUid, $ObjUid = '', $ProUid = '', $UsrUid = '', $AppUid = '')
|
public function load($CfgUid, $ObjUid = '', $ProUid = '', $UsrUid = '', $AppUid = '')
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oRow = ConfigurationPeer::retrieveByPK( $CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid );
|
$oRow = ConfigurationPeer::retrieveByPK( $CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid );
|
||||||
if (!is_null($oRow))
|
if (!is_null($oRow)) {
|
||||||
{
|
|
||||||
$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
|
$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
|
$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
return $aFields;
|
return $aFields;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw(new Exception( "The row '$CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid' in table Configuration doesn't exist!" ));
|
throw(new Exception( "The row '$CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid' in table Configuration doesn't exist!" ));
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $oError) {
|
||||||
catch (Exception $oError) {
|
|
||||||
throw($oError);
|
throw($oError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update($fields)
|
public function update($fields)
|
||||||
{
|
{
|
||||||
$con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
|
$con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
$con->begin();
|
$con->begin();
|
||||||
$this->load($fields['CFG_UID'], $fields['OBJ_UID'], $fields['PRO_UID'], $fields['USR_UID'], $fields['APP_UID']);
|
$this->load($fields['CFG_UID'], $fields['OBJ_UID'], $fields['PRO_UID'], $fields['USR_UID'], $fields['APP_UID']);
|
||||||
$this->fromArray($fields,BasePeer::TYPE_FIELDNAME);
|
$this->fromArray($fields,BasePeer::TYPE_FIELDNAME);
|
||||||
if($this->validate())
|
if ($this->validate()) {
|
||||||
{
|
|
||||||
$contentResult=0;
|
$contentResult=0;
|
||||||
$result=$this->save();
|
$result=$this->save();
|
||||||
$result=($result==0)?($contentResult>0?1:0):$result;
|
$result=($result==0)?($contentResult>0?1:0):$result;
|
||||||
$con->commit();
|
$con->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$con->rollback();
|
$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();
|
$con->rollback();
|
||||||
throw($e);
|
throw($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function remove($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid)
|
public function remove($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid)
|
||||||
{
|
{
|
||||||
$con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
|
$con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
$con->begin();
|
$con->begin();
|
||||||
$this->setCfgUid($CfgUid);
|
$this->setCfgUid($CfgUid);
|
||||||
$this->setObjUid($ObjUid);
|
$this->setObjUid($ObjUid);
|
||||||
@@ -131,16 +119,16 @@ class Configuration extends BaseConfiguration {
|
|||||||
$result=$this->delete();
|
$result=$this->delete();
|
||||||
$con->commit();
|
$con->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch(Exception $e)
|
|
||||||
{
|
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw($e);
|
throw($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exists($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid)
|
public function exists($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid)
|
||||||
{
|
{
|
||||||
$oRow = ConfigurationPeer::retrieveByPK( $CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid );
|
$oRow = ConfigurationPeer::retrieveByPK( $CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid );
|
||||||
return (( get_class ($oRow) == 'Configuration' )&&(!is_null($oRow)));
|
return (( get_class ($oRow) == 'Configuration' )&&(!is_null($oRow)));
|
||||||
}
|
}
|
||||||
} // Configuration
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class ConfigurationPeer extends BaseConfigurationPeer {
|
class ConfigurationPeer extends BaseConfigurationPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // ConfigurationPeer
|
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class Content extends BaseContent
|
|||||||
}
|
}
|
||||||
return $ConValue;
|
return $ConValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find a valid Lang for current Content. The most recent
|
* Find a valid Lang for current Content. The most recent
|
||||||
* @param string $ConCategory
|
* @param string $ConCategory
|
||||||
@@ -102,6 +103,7 @@ class Content extends BaseContent
|
|||||||
}
|
}
|
||||||
return ($defaultLang);
|
return ($defaultLang);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load the content row and the Save automatically the row for the destination language
|
* Load the content row and the Save automatically the row for the destination language
|
||||||
* @param string $ConCategory
|
* @param string $ConCategory
|
||||||
@@ -457,6 +459,7 @@ class Content extends BaseContent
|
|||||||
throw ($e);
|
throw ($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Added by Enrique at Feb 9th,2011
|
//Added by Enrique at Feb 9th,2011
|
||||||
//Gets all Role Names by Role
|
//Gets all Role Names by Role
|
||||||
public function getAllContentsByRole ($sys_lang = SYS_LANG)
|
public function getAllContentsByRole ($sys_lang = SYS_LANG)
|
||||||
@@ -481,5 +484,4 @@ class Content extends BaseContent
|
|||||||
return $aRoles;
|
return $aRoles;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Content
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
*
|
*
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
*/
|
*/
|
||||||
class ContentPeer extends BaseContentPeer {
|
class ContentPeer extends BaseContentPeer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // ContentPeer
|
|
||||||
|
|||||||
Reference in New Issue
Block a user