Merge pull request #849 from ferOnti/master

CODE STYLE class/model/ files
This commit is contained in:
ferOnti
2012-10-22 03:01:25 -07:00
45 changed files with 3066 additions and 3250 deletions

View File

@@ -20,7 +20,6 @@ require_once 'classes/model/om/BaseAdditionalTables.php';
*/
class AdditionalTables extends BaseAdditionalTables
{
public $fields = array();
public $primaryKeys = array();
@@ -28,7 +27,7 @@ class AdditionalTables extends BaseAdditionalTables
* Function load
* access public
*/
public function load($sUID, $bFields=false)
public function load($sUID, $bFields = false)
{
$oAdditionalTables = AdditionalTablesPeer::retrieveByPK($sUID);
@@ -82,7 +81,7 @@ class AdditionalTables extends BaseAdditionalTables
return $this->fields;
}
public function getPrimaryKeys($type='complete')
public function getPrimaryKeys($type = 'complete')
{
$this->primaryKeys = array();
foreach ($this->fields as $field) {
@@ -136,7 +135,7 @@ class AdditionalTables extends BaseAdditionalTables
/**
* Create & Update function
*/
public function create($aData, $aFields=array())
public function create($aData, $aFields = array())
{
if (!isset($aData['ADD_TAB_UID']) || (isset($aData['ADD_TAB_UID']) && $aData['ADD_TAB_UID'] == '')) {
$aData['ADD_TAB_UID'] = G::generateUniqueID();
@@ -177,7 +176,7 @@ class AdditionalTables extends BaseAdditionalTables
}
}
public function update($aData, $aFields=array())
public function update($aData, $aFields = array())
{
$oConnection = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
try {
@@ -188,16 +187,6 @@ class AdditionalTables extends BaseAdditionalTables
$oConnection->begin();
$iResult = $oAdditionalTables->save();
$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 {
$sMessage = '';
$aValidationFailures = $oAdditionalTables->getValidationFailures();
@@ -320,7 +309,7 @@ class AdditionalTables extends BaseAdditionalTables
}
}
public function getAllData($sUID, $start=null, $limit=null, $keyOrderUppercase=true)
public function getAllData($sUID, $start = null, $limit = null, $keyOrderUppercase = true)
{
$addTab = new AdditionalTables();
$aData = $addTab->load($sUID, true);
@@ -429,7 +418,7 @@ class AdditionalTables extends BaseAdditionalTables
}
}
if ($oClass->validate()) {
$iResult = $oClass->save();
$iResult = $oClass->save();
if ($keysAutoIncrement == 1 && $aFields[$keyUIDAutoIncrement] == '' && isset($_SESSION['APPLICATION']) && $_SESSION['APPLICATION'] != '') {
G::LoadClass('case');
$oCaseKeyAuto = new Cases();
@@ -437,7 +426,7 @@ class AdditionalTables extends BaseAdditionalTables
$aFields = $oCaseKeyAuto->loadCase($_SESSION['APPLICATION']);
$aFields['APP_DATA'][$keyUIDAutoIncrement] = $newId;
if (isset($_POST['form'])) {
$_POST['form'][$keyUIDAutoIncrement] = $newId;
$_POST['form'][$keyUIDAutoIncrement] = $newId;
}
$oCaseKeyAuto->updateCase($_SESSION['APPLICATION'], $aFields);
}
@@ -568,7 +557,7 @@ class AdditionalTables extends BaseAdditionalTables
* @param string $sGrid
* @return number
*/
public function populateReportTable($tableName, $sConnection='rp', $type='NORMAL', $processUid='', $gridKey='')
public function populateReportTable($tableName, $sConnection = 'rp', $type = 'NORMAL', $processUid = '', $gridKey = '')
{
require_once "classes/model/Application.php";
@@ -727,7 +716,7 @@ class AdditionalTables extends BaseAdditionalTables
}
}
public function getTableVars($uid, $bWhitType=false)
public function getTableVars($uid, $bWhitType = false)
{
require_once 'classes/model/Fields.php';
try {
@@ -761,7 +750,7 @@ class AdditionalTables extends BaseAdditionalTables
}
}
public function getAll($start=0, $limit=20, $filter='', $process=null)
public function getAll($start = 0, $limit = 20, $filter = '', $process = null)
{
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_UID);
@@ -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);
}
@@ -856,7 +837,7 @@ class AdditionalTables extends BaseAdditionalTables
* Don't use this method, it was left only for backward compatibility
* for some external plugins that still is using it
*/
public function createPropelClasses($sTableName, $sClassName, $aFields, $sAddTabUid, $connection='workflow')
public function createPropelClasses($sTableName, $sClassName, $aFields, $sAddTabUid, $connection = 'workflow')
{
try {
/* $aUID = array('FLD_NAME' => 'PM_UNIQUE_ID',
@@ -1257,5 +1238,4 @@ class AdditionalTables extends BaseAdditionalTables
}
}
}
// AdditionalTables

View File

@@ -14,14 +14,15 @@
/**
* Skeleton subclass for performing query and update operations on the 'ADDITIONAL_TABLES' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*
* @package workflow.engine.classes.model
*/
class AdditionalTablesPeer extends BaseAdditionalTablesPeer {
class AdditionalTablesPeer extends BaseAdditionalTablesPeer
{
}
} // AdditionalTablesPeer

View File

@@ -34,7 +34,7 @@ class AppCacheView extends BaseAppCacheView
public $confCasesList;
public $pathToAppCacheFiles;
public function getAllCounters($aTypes, $userUid, $processSummary=false)
public function getAllCounters($aTypes, $userUid, $processSummary = false)
{
$aResult = array();
@@ -248,7 +248,7 @@ class AppCacheView extends BaseAppCacheView
* @param string $sUIDUser
* @return $rows
*/
public function getSelfServiceTasks($userUid='')
public function getSelfServiceTasks($userUid = '')
{
$rows[] = array();
$tasks = array();
@@ -304,7 +304,8 @@ class AppCacheView extends BaseAppCacheView
return $tasks;
}
public function getSelfServiceCasesByEvaluate($userUid) {
public function getSelfServiceCasesByEvaluate($userUid)
{
$cases = array();
//check groups assigned to SelfService task
@@ -327,34 +328,34 @@ class AppCacheView extends BaseAppCacheView
$rs->next();
if ($rs->getRecordCount() > 0) {
if (!class_exists('Cases')) {
G::loadClass('case');
}
$caseInstance = new Cases();
while ($row = $rs->getRow()) {
$tasGroupVariable = str_replace(array('@', '#'), '', $row['TAS_GROUP_VARIABLE']);
$c2 = new Criteria();
$c2->clearSelectColumns();
$c2->addSelectColumn(AppDelegationPeer::APP_UID);
$c2->add(AppDelegationPeer::TAS_UID, $row['TAS_UID']);
$c2->add(AppDelegationPeer::USR_UID, '');
$c2->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
$rs2 = AppDelegationPeer::doSelectRS($c2);
$rs2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs2->next();
while ($row2 = $rs2->getRow()) {
$caseData = $caseInstance->LoadCase($row2['APP_UID']);
if (isset($caseData['APP_DATA'][$tasGroupVariable])) {
if (trim($caseData['APP_DATA'][$tasGroupVariable]) != '') {
if (in_array(trim($caseData['APP_DATA'][$tasGroupVariable]), $aGroups)) {
$cases[] = $row2['APP_UID'];
}
if (!class_exists('Cases')) {
G::loadClass('case');
}
$caseInstance = new Cases();
while ($row = $rs->getRow()) {
$tasGroupVariable = str_replace(array('@', '#'), '', $row['TAS_GROUP_VARIABLE']);
$c2 = new Criteria();
$c2->clearSelectColumns();
$c2->addSelectColumn(AppDelegationPeer::APP_UID);
$c2->add(AppDelegationPeer::TAS_UID, $row['TAS_UID']);
$c2->add(AppDelegationPeer::USR_UID, '');
$c2->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
$rs2 = AppDelegationPeer::doSelectRS($c2);
$rs2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs2->next();
while ($row2 = $rs2->getRow()) {
$caseData = $caseInstance->LoadCase($row2['APP_UID']);
if (isset($caseData['APP_DATA'][$tasGroupVariable])) {
if (trim($caseData['APP_DATA'][$tasGroupVariable]) != '') {
if (in_array(trim($caseData['APP_DATA'][$tasGroupVariable]), $aGroups)) {
$cases[] = $row2['APP_UID'];
}
}
}
}
$rs2->next();
}
$rs->next();
}
$rs2->next();
}
$rs->next();
}
}
return $cases;
}
@@ -853,7 +854,7 @@ class AppCacheView extends BaseAppCacheView
* @param Boolean $doCount
* @return Criteria
*/
public function getGeneralCases($doCount='false')
public function getGeneralCases($doCount = 'false')
{
if ($doCount && !isset($this->confCasesList['PMTable']) && !empty($this->confCasesList['PMTable'])) {
$oCriteria = new Criteria('workflow');
@@ -1021,7 +1022,7 @@ class AppCacheView extends BaseAppCacheView
return $row[0];
}
public function checkGrantsForUser($root=false)
public function checkGrantsForUser($root = false)
{
try {
if ($root) {
@@ -1144,7 +1145,7 @@ class AppCacheView extends BaseAppCacheView
* Insert an app delegatiojn trigger
* @return void
*/
public function triggerAppDelegationInsert($lang, $recreate=false)
public function triggerAppDelegationInsert($lang, $recreate = false)
{
$con = Propel::getConnection("workflow");
$stmt = $con->createStatement();
@@ -1191,7 +1192,7 @@ class AppCacheView extends BaseAppCacheView
* update the App Delegation triggers
* @return void
*/
public function triggerAppDelegationUpdate($lang, $recreate=false)
public function triggerAppDelegationUpdate($lang, $recreate = false)
{
$con = Propel::getConnection("workflow");
$stmt = $con->createStatement();
@@ -1238,7 +1239,7 @@ class AppCacheView extends BaseAppCacheView
* update the Application triggers
* @return void
*/
public function triggerApplicationUpdate($lang, $recreate=false)
public function triggerApplicationUpdate($lang, $recreate = false)
{
$con = Propel::getConnection("workflow");
$stmt = $con->createStatement();
@@ -1283,7 +1284,7 @@ class AppCacheView extends BaseAppCacheView
* update the Application triggers
* @return void
*/
public function triggerApplicationDelete($lang, $recreate=false)
public function triggerApplicationDelete($lang, $recreate = false)
{
$con = Propel::getConnection("workflow");
$stmt = $con->createStatement();
@@ -1324,7 +1325,7 @@ class AppCacheView extends BaseAppCacheView
return 'exists';
}
public function triggerContentUpdate($lang, $recreate=false)
public function triggerContentUpdate($lang, $recreate = false)
{
$cnn = Propel::getConnection("workflow");
$stmt = $cnn->createStatement();
@@ -1456,7 +1457,7 @@ class AppCacheView extends BaseAppCacheView
return $aRows;
}
public function appTitleByTaskCaseLabelUpdate($taskUid, $lang, $cron=0)
public function appTitleByTaskCaseLabelUpdate($taskUid, $lang, $cron = 0)
{
$taskDefTitle = null;
@@ -1537,5 +1538,4 @@ class AppCacheView extends BaseAppCacheView
}
}
}
//AppCacheView

View File

@@ -14,14 +14,15 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_CACHE_VIEW' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*
* @package workflow.engine.classes.model
*/
class AppCacheViewPeer extends BaseAppCacheViewPeer {
class AppCacheViewPeer extends BaseAppCacheViewPeer
{
}
} // AppCacheViewPeer

View File

@@ -18,105 +18,105 @@ require_once 'classes/model/om/BaseAppDelay.php';
* /**
* @package workflow.engine.classes.model
*/
class AppDelay extends BaseAppDelay {
/**
* Create the application delay registry
* @param array $aData
* @return string
**/
public function create($aData)
{
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
try {
if ( isset ( $aData['APP_DELAY_UID'] ) && $aData['APP_DELAY_UID']== '' )
unset ( $aData['APP_DELAY_UID'] );
if ( !isset ( $aData['APP_DELAY_UID'] ) )
$aData['APP_DELAY_UID'] = G::generateUniqueID();
$oAppDelay = new AppDelay();
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oAppDelay->validate()) {
$oConnection->begin();
$iResult = $oAppDelay->save();
$oConnection->commit();
return $aData['APP_DELAY_UID'];
}
else {
$sMessage = '';
$aValidationFailures = $oAppDelay->getValidationFailures();
foreach($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
class AppDelay extends BaseAppDelay
{
/**
* Create the application delay registry
* @param array $aData
* @return string
**/
public function create($aData)
{
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
try {
if ( isset ( $aData['APP_DELAY_UID'] ) && $aData['APP_DELAY_UID']== '' ) {
unset ( $aData['APP_DELAY_UID'] );
}
if ( !isset ( $aData['APP_DELAY_UID'] ) ) {
$aData['APP_DELAY_UID'] = G::generateUniqueID();
}
$oAppDelay = new AppDelay();
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oAppDelay->validate()) {
$oConnection->begin();
$iResult = $oAppDelay->save();
$oConnection->commit();
return $aData['APP_DELAY_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oAppDelay->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw(new Exception('The registry cannot be created!<br />'.$sMessage));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
throw(new Exception('The registry cannot be created!<br />'.$sMessage));
}
}
catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
}
/**
* Update the application delay registry
* @param array $aData
* @return string
**/
public function update($aData)
{
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
try {
$oAppDelay = AppDelayPeer::retrieveByPK($aData['APP_DELAY_UID']);
if (!is_null($oAppDelay))
{
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oAppDelay->validate()) {
$oConnection->begin();
$iResult = $oAppDelay->save();
$oConnection->commit();
return $iResult;
/**
* Update the application delay registry
* @param array $aData
* @return string
**/
public function update($aData)
{
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
try {
$oAppDelay = AppDelayPeer::retrieveByPK($aData['APP_DELAY_UID']);
if (!is_null($oAppDelay)) {
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oAppDelay->validate()) {
$oConnection->begin();
$iResult = $oAppDelay->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oAppDelay->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
}
} else {
throw(new Exception('This row doesn\'t exist!'));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
else {
$sMessage = '';
$aValidationFailures = $oAppDelay->getValidationFailures();
foreach($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
}
public function isPaused($appUid, $delIndex)
{
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelayPeer::APP_UID, $appUid);
$oCriteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex);
$oCriteria->add(AppDelayPeer::APP_TYPE, 'PAUSE');
$oCriteria->add(AppDelayPeer::APP_DISABLE_ACTION_USER, null);
$oCriteria->add(
$oCriteria->getNewCriterion(
AppDelayPeer::APP_DISABLE_ACTION_USER,
null,
Criteria::ISNULL
)->addOr(
$oCriteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0)
)
);
$oDataset = AppDelayPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
if ( $aRow ) {
return true;
} else {
return false;
}
}
else {
throw(new Exception('This row doesn\'t exist!'));
}
}
catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
}
function isPaused($appUid, $delIndex){
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelayPeer::APP_UID, $appUid);
$oCriteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex);
$oCriteria->add(AppDelayPeer::APP_TYPE, 'PAUSE');
$oCriteria->add(AppDelayPeer::APP_DISABLE_ACTION_USER, null);
$oCriteria->add(
$oCriteria->getNewCriterion(
AppDelayPeer::APP_DISABLE_ACTION_USER,
null,
Criteria::ISNULL
)->addOr(
$oCriteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0)
)
);
$oDataset = AppDelayPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
}
}
if( $aRow )
return true;
else
return false;
}
} // AppDelay

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_DELAY' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class AppDelayPeer extends BaseAppDelayPeer {
class AppDelayPeer extends BaseAppDelayPeer
{
}
} // AppDelayPeer

View File

@@ -56,9 +56,8 @@ class AppDelegation extends BaseAppDelegation
* @param $isSubprocess is a subprocess inside a process?
* @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) {
throw (new Exception( 'Column "PRO_UID" cannot be null.' ));
}
@@ -159,7 +158,7 @@ class AppDelegation extends BaseAppDelegation
* @return array $Fields the fields
*/
function Load ($AppUid, $sDelIndex)
public function Load ($AppUid, $sDelIndex)
{
$con = Propel::getConnection( AppDelegationPeer::DATABASE_NAME );
try {
@@ -213,7 +212,7 @@ class AppDelegation extends BaseAppDelegation
}
}
function remove ($sApplicationUID, $iDelegationIndex)
public function remove ($sApplicationUID, $iDelegationIndex)
{
$oConnection = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
try {
@@ -232,7 +231,7 @@ class AppDelegation extends BaseAppDelegation
// TasTypeDay = 1 => working days
// TasTypeDay = 2 => calendar days
function calculateDueDate ($sNextTasParam)
public function calculateDueDate ($sNextTasParam)
{
//Get Task properties
$task = TaskPeer::retrieveByPK( $this->getTasUid() );
@@ -272,7 +271,7 @@ class AppDelegation extends BaseAppDelegation
return $iDueDate;
}
function getDiffDate ($date1, $date2)
public function getDiffDate ($date1, $date2)
{
return ($date1 - $date2) / (24 * 60 * 60); //days
return ($date1 - $date2) / 3600;
@@ -445,23 +444,15 @@ class AppDelegation extends BaseAppDelegation
//and finally save the record
$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();
$row = $rs->getRow();
}
} catch (Exception $oError) {
error_log( $oError->getMessage() );
}
}
function getLastDeleration ($APP_UID)
public function getLastDeleration ($APP_UID)
{
$c = new Criteria( 'workflow' );
$c->addSelectColumn( AppDelegationPeer::APP_UID );
@@ -486,5 +477,4 @@ class AppDelegation extends BaseAppDelegation
return $rs->getRow();
}
}
// AppDelegation

View File

@@ -2,10 +2,10 @@
/**
* AppDelegationPeer.php
* @package workflow.engine.classes.model
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_DELEGATION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
* /**
* @package workflow.engine.classes.model
*/
class AppDelegationPeer extends BaseAppDelegationPeer {
class AppDelegationPeer extends BaseAppDelegationPeer
{
}
} // AppDelegationPeer

View File

@@ -578,7 +578,7 @@ class AppDocument extends BaseAppDocument
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->add( AppDocumentPeer::APP_UID, $APP_UID );
@@ -617,5 +617,4 @@ class AppDocument extends BaseAppDocument
return $documents;
}
}
// AppDocument

View File

@@ -2,10 +2,10 @@
/**
* AppDocumentPeer.php
* @package workflow.engine.classes.model
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_DOCUMENT' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class AppDocumentPeer extends BaseAppDocumentPeer {
class AppDocumentPeer extends BaseAppDocumentPeer
{
}
} // AppDocumentPeer

View File

@@ -37,7 +37,7 @@ class AppEvent extends BaseAppEvent
}
}
function create ($aData)
public function create ($aData)
{
$oConnection = Propel::getConnection( AppEventPeer::DATABASE_NAME );
try {
@@ -62,7 +62,7 @@ class AppEvent extends BaseAppEvent
}
}
function update ($aData)
public function update ($aData)
{
$oConnection = Propel::getConnection( AppEventPeer::DATABASE_NAME );
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 );
try {
@@ -110,7 +110,7 @@ class AppEvent extends BaseAppEvent
}
}
function getAppEventsCriteria ($sProcessUid = '', $sStatus = '', $EVN_ACTION = '')
public function getAppEventsCriteria ($sProcessUid = '', $sStatus = '', $EVN_ACTION = '')
{
try {
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['APP_EVN_STATUS'] = 'CLOSE';
$this->update( $aRow );
}
}
// AppEvent

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_EVENT' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class AppEventPeer extends BaseAppEventPeer {
class AppEventPeer extends BaseAppEventPeer
{
}
} // AppEventPeer

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_FOLDER' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class AppFolderPeer extends BaseAppFolderPeer {
class AppFolderPeer extends BaseAppFolderPeer
{
}
} // AppFolderPeer

View File

@@ -18,10 +18,10 @@ require_once 'classes/model/om/BaseAppHistory.php';
*
* @package workflow.engine.classes.model
*/
class AppHistory extends BaseAppHistory {
function insertHistory($aData){
class AppHistory extends BaseAppHistory
{
public function insertHistory($aData)
{
$this->setAppUid($aData['APP_UID']);
$this->setDelIndex($aData['DEL_INDEX']);
$this->setProUid($aData['PRO_UID']);
@@ -32,28 +32,20 @@ class AppHistory extends BaseAppHistory {
$this->setHistoryDate($aData['APP_UPDATE_DATE']);
$this->setHistoryData($aData['APP_DATA']);
if ($this->validate() ) {
$res = $this->save();
}
else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = '';
$validationFailuresArray = $this->getValidationFailures();
foreach($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
krumo($msg);
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
}
$res = $this->save();
} else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = '';
$validationFailuresArray = $this->getValidationFailures();
foreach ($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
}
}
function getDynaformHistory($PRO_UID,$TAS_UID,$APP_UID,$DYN_UID=""){
public function getDynaformHistory($PRO_UID, $TAS_UID, $APP_UID, $DYN_UID = "")
{
G::LoadClass('case');
$oCase = new Cases();
@@ -62,37 +54,30 @@ class AppHistory extends BaseAppHistory {
$aObjectPermissions = $oCase->getAllObjects($PRO_UID, $APP_UID, $TAS_UID, $_SESSION['USER_LOGGED']);
if (!is_array($aObjectPermissions)) {
$aObjectPermissions = array('DYNAFORMS' => array(-1), 'INPUT_DOCUMENTS' => array(-1), 'OUTPUT_DOCUMENTS' => array(-1));
$aObjectPermissions = array('DYNAFORMS' => array(-1), 'INPUT_DOCUMENTS' => array(-1), 'OUTPUT_DOCUMENTS' => array(-1));
}
if (!isset($aObjectPermissions['DYNAFORMS'])) {
$aObjectPermissions['DYNAFORMS'] = array(-1);
}
else {
if (!is_array($aObjectPermissions['DYNAFORMS'])) {
$aObjectPermissions['DYNAFORMS'] = array(-1);
}
} else {
if (!is_array($aObjectPermissions['DYNAFORMS'])) {
$aObjectPermissions['DYNAFORMS'] = array(-1);
}
}
if (!isset($aObjectPermissions['INPUT_DOCUMENTS'])) {
$aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
}
else {
if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) {
$aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
}
} else {
if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) {
$aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
}
}
if (!isset($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
}
else {
if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
}
} else {
if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
$aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
}
}
$c = new Criteria('workflow');
$c->addSelectColumn(AppHistoryPeer::APP_UID);
$c->addSelectColumn(AppHistoryPeer::DEL_INDEX);
@@ -108,12 +93,11 @@ class AppHistory extends BaseAppHistory {
$c->addAsColumn('USR_NAME', "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME)");
$c->addJoin(AppHistoryPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
//WHERE
$c->add(AppHistoryPeer::DYN_UID, $aObjectPermissions['DYNAFORMS'], Criteria::IN);
$c->add(AppHistoryPeer::PRO_UID, $PRO_UID);
$c->add(AppHistoryPeer::APP_UID, $APP_UID);
if((isset($DYN_UID))&&($DYN_UID!="")){
if ((isset($DYN_UID))&&($DYN_UID!="")) {
$c->add(AppHistoryPeer::DYN_UID, $DYN_UID);
}
@@ -121,7 +105,6 @@ class AppHistory extends BaseAppHistory {
$c->clearOrderByColumns();
$c->addDescendingOrderByColumn(AppHistoryPeer::HISTORY_DATE);
//Execute
$oDataset = AppHistoryPeer::doSelectRS($c);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
@@ -129,38 +112,37 @@ class AppHistory extends BaseAppHistory {
$aDynHistory = array();
$aDynHistory[] = array(
'DYN_TITLE' => 'char'
'DYN_TITLE' => 'char'
);
while ($aRow = $oDataset->getRow()) {
$o = new Dynaform();
$o->setDynUid($aRow['DYN_UID']);
$aRow['DYN_TITLE'] = $o->getDynTitle();
$changedValues=unserialize($aRow['HISTORY_DATA']);
$html="<table border='0' cellpadding='0' cellspacing='0'>";
$sw_add=false;
foreach($changedValues as $key =>$value){
if(($value!=NULL)&&(!is_array($value))){
foreach ($changedValues as $key => $value) {
if (($value!=null) && (!is_array($value))) {
$sw_add=true;
$html.="<tr>";
$html.="<td><b>$key:</b> </td>";
$html.="<td>$value</td>";
$html.="</tr>";
}
if(is_array($value)){
if (is_array($value)) {
$html.="<tr>";
$html.="<td><b>$key (grid):</b> </td>";
$html.="<td>";
$html.="<table>";
foreach($value as $key1 =>$value1){
foreach ($value as $key1 => $value1) {
$html.="<tr>";
$html.="<td><b>$key1</b></td>";
$html.="<td>";
if(is_array($value1)){
if (is_array($value1)) {
$sw_add=true;
$html.="<table>";
foreach($value1 as $key2 =>$value2){
foreach ($value1 as $key2 => $value2) {
$html.="<tr>";
$html.="<td><b>$key2</b></td>";
$html.="<td>$value2</td>";
@@ -170,7 +152,6 @@ class AppHistory extends BaseAppHistory {
}
$html.="</td>";
$html.="</tr>";
}
$html.="</table>";
$html.="</td>";
@@ -182,7 +163,7 @@ class AppHistory extends BaseAppHistory {
$aRow['FIELDS'] = $html;
if($sw_add){
if ($sw_add) {
$aDynHistory[] = $aRow;
}
$oDataset->next();
@@ -196,7 +177,6 @@ class AppHistory extends BaseAppHistory {
$oCriteria->setDBArrayTable('DynaformsHistory');
$oCriteria->addDescendingOrderByColumn(AppHistoryPeer::HISTORY_DATE);
return $oCriteria;
}
}
} // AppHistory

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_HISTORY' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class AppHistoryPeer extends BaseAppHistoryPeer {
class AppHistoryPeer extends BaseAppHistoryPeer
{
}
} // AppHistoryPeer

View File

@@ -121,5 +121,4 @@ class AppMessage extends BaseAppMessage
}
}
}
// AppMessage

View File

@@ -2,10 +2,10 @@
/**
* AppMessagePeer.php
* @package workflow.engine.classes.model
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_MESSAGE' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class AppMessagePeer extends BaseAppMessagePeer {
class AppMessagePeer extends BaseAppMessagePeer
{
}
} // AppMessagePeer

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_NOTES' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -18,6 +18,7 @@
*
* @package classes.model
*/
class AppNotesPeer extends BaseAppNotesPeer {
class AppNotesPeer extends BaseAppNotesPeer
{
}
} // AppNotesPeer

View File

@@ -2,10 +2,10 @@
/**
* AppOwner.php
* @package workflow.engine.classes.model
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
require_once 'classes/model/om/BaseAppOwner.php';
@@ -30,7 +30,7 @@ require_once 'classes/model/om/BaseAppOwner.php';
/**
* Skeleton subclass for representing a row from the 'APP_OWNER' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -38,6 +38,7 @@ require_once 'classes/model/om/BaseAppOwner.php';
*
* @package workflow.engine.classes.model
*/
class AppOwner extends BaseAppOwner {
class AppOwner extends BaseAppOwner
{
}
} // AppOwner

View File

@@ -2,10 +2,10 @@
/**
* AppOwnerPeer.php
* @package workflow.engine.classes.model
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_OWNER' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class AppOwnerPeer extends BaseAppOwnerPeer {
class AppOwnerPeer extends BaseAppOwnerPeer
{
}
} // AppOwnerPeer

View File

@@ -7,7 +7,7 @@ require_once 'classes/entities/AppSolrQueue.php';
/**
* Skeleton subclass for representing a row from the 'APP_SOLR_QUEUE' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -15,112 +15,100 @@ require_once 'classes/entities/AppSolrQueue.php';
*
* @package classes.model
*/
class AppSolrQueue extends BaseAppSolrQueue {
public function exists($sAppUid)
{
try {
$oRow = AppSolrQueuePeer::retrieveByPK( $sAppUid );
if (!is_null($oRow))
{
return true;
}
else {
return false;
}
}
catch (Exception $oError) {
return false;
}
class AppSolrQueue extends BaseAppSolrQueue
{
public function exists($sAppUid)
{
try {
$oRow = AppSolrQueuePeer::retrieveByPK( $sAppUid );
if (!is_null($oRow)) {
return true;
} else {
return false;
}
} catch (Exception $oError) {
return false;
}
}
public function createUpdate($sAppUid, $iUpdated)
{
$con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
try
{
if($this->exists($sAppUid)){
public function createUpdate($sAppUid, $iUpdated)
{
$con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
try {
if ($this->exists($sAppUid)) {
$con->begin();
//update record
//$oRow = AppSolrQueuePeer::retrieveByPK( $sAppUid );
//$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
//$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
//$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
//$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
$this->setNew(false);
//set field
$this->setAppUid($sAppUid);
$this->setAppUpdated($iUpdated);
if($this->validate())
{
$result=$this->save();
}
else
{
$con->rollback();
throw(new Exception("Failed Validation in class ".get_class($this)."."));
if ($this->validate()) {
$result=$this->save();
} else {
$con->rollback();
throw(new Exception("Failed Validation in class ".get_class($this)."."));
}
$con->commit();
return $result;
}else{
$con->commit();
return $result;
} else {
//create record
//set values
$this->setAppUid($sAppUid);
$this->setAppUpdated($iUpdated);
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)
{
$con->rollback();
throw($e);
}
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) {
$con->rollback();
throw($e);
}
}
/**
* Returns the list of updated applications
* array of Entity_AppSolrQueue
*/
public function getListUpdatedApplications(){
$updatedApplications = array();
try
{
$c = new Criteria();
$c->addSelectColumn(AppSolrQueuePeer::APP_UID);
$c->addSelectColumn(AppSolrQueuePeer::APP_UPDATED);
//"WHERE
public function getListUpdatedApplications()
{
$updatedApplications = array();
try {
$c = new Criteria();
$c->addSelectColumn(AppSolrQueuePeer::APP_UID);
$c->addSelectColumn(AppSolrQueuePeer::APP_UPDATED);
//"WHERE
$c->add(AppSolrQueuePeer::APP_UPDATED, 0, Criteria::NOT_EQUAL);
$rs = AppSolrQueuePeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
//echo $c->toString();
$rs->next();
$row = $rs->getRow();
$rs = AppSolrQueuePeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
//echo $c->toString();
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
$appSolrQueue = Entity_AppSolrQueue::createEmpty();
$appSolrQueue->appUid = $row['APP_UID'];
$appSolrQueue->appUpdated = $row['APP_UPDATED'];
$updatedApplications[] = $appSolrQueue;
$rs->next();
$row = $rs->getRow();
$updatedApplications[] = $appSolrQueue;
$rs->next();
$row = $rs->getRow();
}
return $updatedApplications;
}catch(Exception $e){
$con->rollback();
} catch (Exception $e) {
$con->rollback();
throw($e);
}
}
} // AppSolrQueue
}

View File

@@ -10,7 +10,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_SOLR_QUEUE' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -18,6 +18,7 @@
*
* @package classes.model
*/
class AppSolrQueuePeer extends BaseAppSolrQueuePeer {
class AppSolrQueuePeer extends BaseAppSolrQueuePeer
{
}
} // AppSolrQueuePeer

View File

@@ -2,10 +2,10 @@
/**
* AppThread.php
* @package workflow.engine.classes.model
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
require_once 'classes/model/om/BaseAppThread.php';
@@ -30,7 +30,7 @@ require_once 'classes/model/om/BaseAppThread.php';
/**
* Skeleton subclass for representing a row from the 'APP_THREAD' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -38,85 +38,81 @@ require_once 'classes/model/om/BaseAppThread.php';
*
* @package workflow.engine.classes.model
*/
class AppThread extends BaseAppThread {
function createAppThread ( $sAppUid, $iDelIndex, $iParent ) {
if (!isset($sAppUid) || strlen($sAppUid ) == 0 ) {
throw ( new Exception ( 'Column "APP_UID" cannot be null.' ) );
}
if (!isset($iDelIndex) || strlen($iDelIndex ) == 0 ) {
throw ( new Exception ( 'Column "DEL_INDEX" cannot be null.' ) );
}
if (!isset($iParent) || strlen($iDelIndex ) == 0 ) {
throw ( new Exception ( 'Column "APP_THREAD_INDEX" cannot be null.' ) );
}
$c = new Criteria ();
$c->clearSelectColumns();
$c->addSelectColumn ( 'MAX(' . AppThreadPeer::APP_THREAD_INDEX . ') ' );
$c->add ( AppThreadPeer::APP_UID, $sAppUid );
$rs = AppThreadPeer::doSelectRS ( $c );
$rs->next();
$row = $rs->getRow();
$iAppThreadIndex = $row[0] + 1;
$this->setAppUid ( $sAppUid );
$this->setAppThreadIndex ( $iAppThreadIndex );
$this->setAppThreadParent ( $iParent );
$this->setAppThreadStatus ( 'OPEN' );
$this->setDelIndex ( $iDelIndex );
if ($this->validate() ) {
try {
$res = $this->save();
}
catch ( PropelException $e ) {
throw ( $e );
}
}
else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = '';
$validationFailuresArray = $this->getValidationFailures();
foreach($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage();
}
throw ( new Exception ( 'Failed Data validation. ' . $msg ) );
}
return $iAppThreadIndex;
}
public function update($aData)
{
$con = Propel::getConnection( AppThreadPeer::DATABASE_NAME );
try {
$con->begin();
$oApp = AppThreadPeer::retrieveByPK( $aData['APP_UID'], $aData['APP_THREAD_INDEX'] );
if (is_object($oApp) && get_class ($oApp) == 'AppThread' ) {
$oApp->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oApp->validate()) {
$res = $oApp->save();
$con->commit();
return $res;
class AppThread extends BaseAppThread
{
public function createAppThread ($sAppUid, $iDelIndex, $iParent)
{
if (!isset($sAppUid) || strlen($sAppUid ) == 0 ) {
throw ( new Exception ( 'Column "APP_UID" cannot be null.' ) );
}
else {
$msg = '';
foreach($this->getValidationFailures() as $objValidationFailure)
$msg .= $objValidationFailure->getMessage() . "<br/>";
throw ( new PropelException ( 'The AppThread row cannot be created!', new PropelException ( $msg ) ) );
}
}
else {
$con->rollback();
throw(new Exception( "This AppThread row doesn't exist!" ));
}
}
catch (Exception $oError) {
throw($oError);
}
}
} // AppThread
if (!isset($iDelIndex) || strlen($iDelIndex ) == 0 ) {
throw ( new Exception ( 'Column "DEL_INDEX" cannot be null.' ) );
}
if (!isset($iParent) || strlen($iDelIndex ) == 0 ) {
throw ( new Exception ( 'Column "APP_THREAD_INDEX" cannot be null.' ) );
}
$c = new Criteria ();
$c->clearSelectColumns();
$c->addSelectColumn ( 'MAX(' . AppThreadPeer::APP_THREAD_INDEX . ') ' );
$c->add ( AppThreadPeer::APP_UID, $sAppUid );
$rs = AppThreadPeer::doSelectRS ( $c );
$rs->next();
$row = $rs->getRow();
$iAppThreadIndex = $row[0] + 1;
$this->setAppUid ( $sAppUid );
$this->setAppThreadIndex ( $iAppThreadIndex );
$this->setAppThreadParent ( $iParent );
$this->setAppThreadStatus ( 'OPEN' );
$this->setDelIndex ( $iDelIndex );
if ($this->validate() ) {
try {
$res = $this->save();
} catch ( PropelException $e ) {
throw ( $e );
}
} else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = '';
$validationFailuresArray = $this->getValidationFailures();
foreach ($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage();
}
throw ( new Exception ( 'Failed Data validation. ' . $msg ) );
}
return $iAppThreadIndex;
}
public function update($aData)
{
$con = Propel::getConnection( AppThreadPeer::DATABASE_NAME );
try {
$con->begin();
$oApp = AppThreadPeer::retrieveByPK( $aData['APP_UID'], $aData['APP_THREAD_INDEX'] );
if (is_object($oApp) && get_class ($oApp) == 'AppThread' ) {
$oApp->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oApp->validate()) {
$res = $oApp->save();
$con->commit();
return $res;
} else {
$msg = '';
foreach ($this->getValidationFailures() as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
throw ( new PropelException ( 'The AppThread row cannot be created!', new PropelException ( $msg ) ) );
}
} else {
$con->rollback();
throw(new Exception( "This AppThread row doesn't exist!" ));
}
} catch (Exception $oError) {
throw($oError);
}
}
}

View File

@@ -2,10 +2,10 @@
/**
* AppThreadPeer.php
* @package workflow.engine.classes.model
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APP_THREAD' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class AppThreadPeer extends BaseAppThreadPeer {
class AppThreadPeer extends BaseAppThreadPeer
{
}
} // AppThreadPeer

View File

@@ -2,10 +2,10 @@
/**
* ApplicationPeer.php
* @package workflow.engine.classes.model
*
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'APPLICATION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class ApplicationPeer extends BaseApplicationPeer {
class ApplicationPeer extends BaseApplicationPeer
{
}
} // ApplicationPeer

View File

@@ -10,7 +10,7 @@ require_once 'classes/model/om/BaseCalendarAssignments.php';
/**
* Skeleton subclass for representing a row from the 'CALENDAR_ASSIGNMENTS' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -18,6 +18,7 @@ require_once 'classes/model/om/BaseCalendarAssignments.php';
*
* @package workflow.engine.classes.model
*/
class CalendarAssignments extends BaseCalendarAssignments {
class CalendarAssignments extends BaseCalendarAssignments
{
}
} // CalendarAssignments

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'CALENDAR_ASSIGNMENTS' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class CalendarAssignmentsPeer extends BaseCalendarAssignmentsPeer {
class CalendarAssignmentsPeer extends BaseCalendarAssignmentsPeer
{
}
} // CalendarAssignmentsPeer

View File

@@ -10,7 +10,7 @@ require_once 'classes/model/om/BaseCalendarBusinessHours.php';
/**
* Skeleton subclass for representing a row from the 'CALENDAR_BUSINESS_HOURS' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -18,94 +18,84 @@ require_once 'classes/model/om/BaseCalendarBusinessHours.php';
*
* @package workflow.engine.classes.model
*/
class CalendarBusinessHours extends BaseCalendarBusinessHours {
function getCalendarBusinessHours($CalendarUid){
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns ( );
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_UID );
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY );
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END );
$Criteria->add ( CalendarBusinessHoursPeer::CALENDAR_UID, $CalendarUid , CRITERIA::EQUAL );
$Criteria->addDescendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY );
$Criteria->addAscendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
//$Criteria->addDescendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
$rs = CalendarBusinessHoursPeer::doSelectRS($Criteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
$fields=array();
$count=0;
class CalendarBusinessHours extends BaseCalendarBusinessHours
{
public function getCalendarBusinessHours($CalendarUid)
{
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns ( );
while (is_array($row)) {
$count++;
$fields[$count] = $row;
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_UID );
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY );
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
$Criteria->addSelectColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END );
$Criteria->add ( CalendarBusinessHoursPeer::CALENDAR_UID, $CalendarUid , CRITERIA::EQUAL );
$Criteria->addDescendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY );
$Criteria->addAscendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
$rs = CalendarBusinessHoursPeer::doSelectRS($Criteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
}
return $fields;
}
function deleteAllCalendarBusinessHours($CalendarUid){
$toDelete=$this->getCalendarBusinessHours($CalendarUid);
foreach($toDelete as $key => $businessHoursInfo){
$CalendarUid = $businessHoursInfo['CALENDAR_UID'];
$CalendarBusinessDay = $businessHoursInfo['CALENDAR_BUSINESS_DAY'];
$CalendarBusinessStart = $businessHoursInfo['CALENDAR_BUSINESS_START'];
$CalendarBusinessEnd = $businessHoursInfo['CALENDAR_BUSINESS_END'];
//if exists the row in the database propel will update it, otherwise will insert.
$tr = CalendarBusinessHoursPeer::retrieveByPK ( $CalendarUid,$CalendarBusinessDay, $CalendarBusinessStart,$CalendarBusinessEnd );
if ( ( is_object ( $tr ) && get_class ($tr) == 'CalendarBusinessHours' ) ) {
$tr->delete();
}
$fields=array();
$count=0;
while (is_array($row)) {
$count++;
$fields[$count] = $row;
$rs->next();
$row = $rs->getRow();
}
return $fields;
}
}
function saveCalendarBusinessHours($aData){
$CalendarUid = $aData['CALENDAR_UID'];
$CalendarBusinessDay = $aData['CALENDAR_BUSINESS_DAY'];
$CalendarBusinessStart = $aData['CALENDAR_BUSINESS_START'];
$CalendarBusinessEnd = $aData['CALENDAR_BUSINESS_END'];
//if exists the row in the database propel will update it, otherwise will insert.
$tr = CalendarBusinessHoursPeer::retrieveByPK ( $CalendarUid,$CalendarBusinessDay, $CalendarBusinessStart,$CalendarBusinessEnd );
if ( ! ( is_object ( $tr ) && get_class ($tr) == 'CalendarBusinessHours' ) ) {
$tr = new CalendarBusinessHours();
}
$tr->setCalendarUid( $CalendarUid );
$tr->setCalendarBusinessDay( $CalendarBusinessDay );
$tr->setCalendarBusinessStart( $CalendarBusinessStart );
$tr->setCalendarBusinessEnd( $CalendarBusinessEnd );
if ($tr->validate() ) {
// we save it, since we get no validation errors, or do whatever else you like.
$res = $tr->save();
}
else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = $CalendarBusinessDay.'<hr/>';
$validationFailuresArray = $tr->getValidationFailures();
foreach($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $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' );
//}
}
public function deleteAllCalendarBusinessHours($CalendarUid)
{
$toDelete = $this->getCalendarBusinessHours($CalendarUid);
foreach ($toDelete as $key => $businessHoursInfo) {
$CalendarUid = $businessHoursInfo['CALENDAR_UID'];
$CalendarBusinessDay = $businessHoursInfo['CALENDAR_BUSINESS_DAY'];
$CalendarBusinessStart = $businessHoursInfo['CALENDAR_BUSINESS_START'];
$CalendarBusinessEnd = $businessHoursInfo['CALENDAR_BUSINESS_END'];
//if exists the row in the database propel will update it, otherwise will insert.
$tr = CalendarBusinessHoursPeer::retrieveByPK ( $CalendarUid,$CalendarBusinessDay, $CalendarBusinessStart,$CalendarBusinessEnd );
if (( is_object ( $tr ) && get_class ($tr) == 'CalendarBusinessHours' ) ) {
$tr->delete();
}
}
}
public function saveCalendarBusinessHours($aData)
{
$CalendarUid = $aData['CALENDAR_UID'];
$CalendarBusinessDay = $aData['CALENDAR_BUSINESS_DAY'];
$CalendarBusinessStart = $aData['CALENDAR_BUSINESS_START'];
$CalendarBusinessEnd = $aData['CALENDAR_BUSINESS_END'];
//if exists the row in the database propel will update it, otherwise will insert.
$tr = CalendarBusinessHoursPeer::retrieveByPK ( $CalendarUid,$CalendarBusinessDay, $CalendarBusinessStart,$CalendarBusinessEnd );
if ( ! ( is_object ( $tr ) && get_class ($tr) == 'CalendarBusinessHours' ) ) {
$tr = new CalendarBusinessHours();
}
$tr->setCalendarUid( $CalendarUid );
$tr->setCalendarBusinessDay( $CalendarBusinessDay );
$tr->setCalendarBusinessStart( $CalendarBusinessStart );
$tr->setCalendarBusinessEnd( $CalendarBusinessEnd );
if ($tr->validate() ) {
// we save it, since we get no validation errors, or do whatever else you like.
$res = $tr->save();
} else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = $CalendarBusinessDay.'<hr/>';
$validationFailuresArray = $tr->getValidationFailures();
foreach ($validationFailuresArray as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
G::SendTemporalMessage($msg);
}
}
}
} // CalendarBusinessHours

Some files were not shown because too many files have changed in this diff Show More