This commit is contained in:
Paula Quispe
2018-04-20 08:57:55 -04:00
parent 8487e072d9
commit f40431e703
14 changed files with 603 additions and 456 deletions

View File

@@ -1856,14 +1856,16 @@ class Cases
* This function updates a row in APP_DELEGATION * This function updates a row in APP_DELEGATION
* *
* @name closeAllDelegations * @name closeAllDelegations
* @param string $sAppUid * @param string $appUid
*
* @return void * @return void
* @throws Exception
*/ */
public function closeAllThreads($sAppUid) public function closeAllThreads($appUid)
{ {
try { try {
$c = new Criteria(); $c = new Criteria();
$c->add(AppThreadPeer::APP_UID, $sAppUid); $c->add(AppThreadPeer::APP_UID, $appUid);
$c->add(AppThreadPeer::APP_THREAD_STATUS, 'OPEN'); $c->add(AppThreadPeer::APP_THREAD_STATUS, 'OPEN');
$rowObj = AppThreadPeer::doSelect($c); $rowObj = AppThreadPeer::doSelect($c);
foreach ($rowObj as $appThread) { foreach ($rowObj as $appThread) {
@@ -1878,11 +1880,12 @@ class Cases
throw (new PropelException('The row cannot be created!', new PropelException($msg))); throw (new PropelException('The row cannot be created!', new PropelException($msg)));
} }
} }
//update searchindex
/** Update search index */
if ($this->appSolr != null) { if ($this->appSolr != null) {
$this->appSolr->updateApplicationSearchIndex($sAppUid); $this->appSolr->updateApplicationSearchIndex($appUid);
} }
} catch (exception $e) { } catch (Exception $e) {
throw ($e); throw ($e);
} }
} }
@@ -1915,19 +1918,22 @@ class Cases
/** /**
* With this function we can change status to CLOSED in APP_DELEGATION * With this function we can change status to CLOSED in APP_DELEGATION
* *
* @name closeAllDelegations * @param string $appUid
* @param string $sAppUid *
* @return * @return void
* @throws Exception
*/ */
public function closeAllDelegations($sAppUid) public function closeAllDelegations($appUid)
{ {
try { try {
$c = new Criteria(); $criteria = new Criteria();
$c->add(AppDelegationPeer::APP_UID, $sAppUid); $criteria->add(AppDelegationPeer::APP_UID, $appUid);
$c->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN'); $criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
$rowObj = AppDelegationPeer::doSelect($c); $rowObj = AppDelegationPeer::doSelect($criteria);
$data = [];
foreach ($rowObj as $appDel) { foreach ($rowObj as $appDel) {
$appDel->setDelThreadStatus('CLOSED'); $appDel->setDelThreadStatus('CLOSED');
$appDel->setDelFinishDate('now');
if ($appDel->Validate()) { if ($appDel->Validate()) {
$appDel->Save(); $appDel->Save();
} else { } else {
@@ -1937,12 +1943,31 @@ class Cases
} }
throw (new PropelException('The row cannot be created!', new PropelException($msg))); throw (new PropelException('The row cannot be created!', new PropelException($msg)));
} }
/*----------------------------------********---------------------------------*/
$delIndex = $appDel->getDelIndex();
$inbox = new ListInbox();
$inbox->remove($appUid, $delIndex);
$data['DEL_THREAD_STATUS'] = 'CLOSED';
$data['APP_UID'] = $appUid;
$data['DEL_INDEX'] = $delIndex;
$data['USR_UID'] = $appDel->getUsrUid();
$listParticipatedLast = new ListParticipatedLast();
$listParticipatedLast->refresh($data);
/*----------------------------------********---------------------------------*/
/** This case is subProcess? */
if (SubApplication::isCaseSubProcess($appUid)) {
$route = new Derivation();
$route->verifyIsCaseChild($appUid, $delIndex);
} }
//update searchindex }
/** Update search index */
if ($this->appSolr != null) { if ($this->appSolr != null) {
$this->appSolr->updateApplicationSearchIndex($sAppUid); $this->appSolr->updateApplicationSearchIndex($appUid);
} }
} catch (exception $e) { } catch (Exception $e) {
throw ($e); throw ($e);
} }
} }
@@ -1950,18 +1975,19 @@ class Cases
/** /**
* With this we can change the status to CLOSED in APP_DELEGATION * With this we can change the status to CLOSED in APP_DELEGATION
* *
* @name CloseCurrentDelegation * @param string $appUid
* @param string $sAppUid * @param string $delIndex
* @param string $iDelIndex *
* @return Fields * @return void
* @throws Exception
*/ */
public function CloseCurrentDelegation($sAppUid, $iDelIndex) public function CloseCurrentDelegation($appUid, $delIndex)
{ {
try { try {
$c = new Criteria(); $criteria = new Criteria();
$c->add(AppDelegationPeer::APP_UID, $sAppUid); $criteria->add(AppDelegationPeer::APP_UID, $appUid);
$c->add(AppDelegationPeer::DEL_INDEX, $iDelIndex); $criteria->add(AppDelegationPeer::DEL_INDEX, $delIndex);
$rowObj = AppDelegationPeer::doSelect($c); $rowObj = AppDelegationPeer::doSelect($criteria);
$user = ''; $user = '';
foreach ($rowObj as $appDel) { foreach ($rowObj as $appDel) {
$appDel->setDelThreadStatus('CLOSED'); $appDel->setDelThreadStatus('CLOSED');
@@ -1977,17 +2003,30 @@ class Cases
throw (new PropelException('The row cannot be created!', new PropelException($msg))); throw (new PropelException('The row cannot be created!', new PropelException($msg)));
} }
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$inbox = new ListInbox(); $inbox = new ListInbox();
$inbox->remove($sAppUid, $iDelIndex); $data = [];
$inbox->remove($appUid, $delIndex);
$data['DEL_THREAD_STATUS'] = 'CLOSED'; $data['DEL_THREAD_STATUS'] = 'CLOSED';
$data['APP_UID'] = $sAppUid; $data['APP_UID'] = $appUid;
$data['DEL_INDEX'] = $iDelIndex; $data['DEL_INDEX'] = $delIndex;
$data['USR_UID'] = $user; $data['USR_UID'] = $user;
$listParticipatedLast = new ListParticipatedLast(); $listParticipatedLast = new ListParticipatedLast();
$listParticipatedLast->refresh($data); $listParticipatedLast->refresh($data);
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
} catch (exception $e) {
/** This case is subProcess? */
if (SubApplication::isCaseSubProcess($appUid)) {
$route = new Derivation();
$route->verifyIsCaseChild($appUid, $delIndex);
}
/** Update searchindex */
if ($this->appSolr != null) {
$this->appSolr->updateApplicationSearchIndex($appUid);
}
} catch (Exception $e) {
throw ($e); throw ($e);
} }
} }
@@ -4125,103 +4164,94 @@ class Cases
} }
/** /**
* cancel a case * Cancel case without matter the threads
* if the force is true, we will cancel it does not matter the threads
* if the force is false, we will to cancel one thread
* *
* @name cancelCase * @param string $appUid
* @param string $sApplicationUID * @param integer $delIndex
* @param string $iIndex * @param string $usrUid
* @param string $user_logged *
* @return void * @return boolean|string
*/ */
public function cancelCase($sApplicationUID, $iIndex, $user_logged) public function cancelCase($appUid, $delIndex = null, $usrUid = null)
{ {
$this->getExecuteTriggerProcess($sApplicationUID, 'CANCELED'); /** Execute a trigger when a case is cancelled */
$this->getExecuteTriggerProcess($appUid, 'CANCELED');
$oApplication = new Application(); $caseFields = $this->loadCase($appUid);
$aFields = $oApplication->load($sApplicationUID); $appStatusCurrent = $caseFields['APP_STATUS'];
$appData = self::unserializeData($aFields['APP_DATA']); /** Update the status CANCELLED in the tables related */
$appData = G::array_merges(G::getSystemConstants(), $appData); $caseFields['APP_STATUS'] = Application::APP_STATUS_CANCELLED;
$this->updateCase($appUid, $caseFields);
$appStatusCurrent = $aFields['APP_STATUS']; /** Close the thread(s) in APP_DELEGATION and APP_THREAD */
$oCriteria = new Criteria('workflow'); $indexesClosed = self::closeCaseThreads($appUid, $delIndex);
$oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID);
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
$resAppDel = AppDelegationPeer::doCount($oCriteria);
$this->CloseCurrentDelegation($sApplicationUID, $iIndex);
if ($resAppDel == 1) {
$aFields['APP_STATUS'] = 'CANCELLED';
$oApplication->update($aFields);
require_once 'classes/model/AdditionalTables.php';
$oReportTables = new ReportTables();
$addtionalTables = new additionalTables();
$oReportTables->updateTables($aFields['PRO_UID'], $aFields['APP_UID'], $aFields['APP_NUMBER'], $appData);
$addtionalTables->updateReportTables($aFields['PRO_UID'], $aFields['APP_UID'], $aFields['APP_NUMBER'], $appData, $aFields['APP_STATUS']);
}
$oAppDel = new AppDelegation();
$oAppDel->Load($sApplicationUID, $iIndex);
$aAppDel = $oAppDel->toArray(BasePeer::TYPE_FIELDNAME);
$this->closeAppThread($sApplicationUID, $aAppDel['DEL_THREAD']);
/** Create a register in APP_DELAY */
$delay = new AppDelay(); $delay = new AppDelay();
$array['PRO_UID'] = $aFields['PRO_UID'];
$array['APP_UID'] = $sApplicationUID;
$c = new Criteria('workflow'); foreach ($indexesClosed as $value){
$c->clearSelectColumns(); $dataList = [];
$c->addSelectColumn(AppThreadPeer::APP_THREAD_INDEX); $rowDelay = AppDelay::buildAppDelayRow(
$c->add(AppThreadPeer::APP_UID, $sApplicationUID); $caseFields['PRO_UID'],
$c->add(AppThreadPeer::DEL_INDEX, $iIndex); $caseFields['PRO_ID'],
$oDataset = AppThreadPeer::doSelectRS($c); $appUid,
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $caseFields['APP_NUMBER'],
$oDataset->next(); $value['DEL_INDEX'],
$aRow = $oDataset->getRow(); $value['DEL_THREAD'],
$array['APP_THREAD_INDEX'] = $aRow['APP_THREAD_INDEX']; AppDelay::APP_TYPE_CANCEL,
$array['APP_DEL_INDEX'] = $iIndex; Application::APP_STATUS_CANCELLED,
$array['APP_TYPE'] = 'CANCEL'; is_null($usrUid) ? '' : $usrUid
$c = new Criteria('workflow');
$c->clearSelectColumns();
$c->addSelectColumn(ApplicationPeer::APP_STATUS);
$c->add(ApplicationPeer::APP_UID, $sApplicationUID);
$oDataset = ApplicationPeer::doSelectRS($c);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow1 = $oDataset->getRow();
$array['APP_STATUS'] = $aRow1['APP_STATUS'];
$array['APP_DELEGATION_USER'] = $user_logged;
$array['APP_ENABLE_ACTION_USER'] = $user_logged;
$array['APP_ENABLE_ACTION_DATE'] = date('Y-m-d H:i:s');
$array['APP_NUMBER'] = $oApplication->getAppNumber();
$delay->create($array);
//Before cancel a case verify if is a child case
$oCriteria2 = new Criteria('workflow');
$oCriteria2->add(SubApplicationPeer::APP_UID, $sApplicationUID);
$oCriteria2->add(SubApplicationPeer::SA_STATUS, 'ACTIVE');
if (SubApplicationPeer::doCount($oCriteria2) > 0) {
$oDerivation = new Derivation();
$oDerivation->verifyIsCaseChild($sApplicationUID, $iIndex);
}
//update searchindex
if ($this->appSolr != null) {
$this->appSolr->updateApplicationSearchIndex($sApplicationUID);
}
/*----------------------------------********---------------------------------*/
$data = array(
'APP_UID' => $sApplicationUID,
'DEL_INDEX' => $iIndex,
'USR_UID' => $user_logged,
'APP_STATUS_CURRENT' => $appStatusCurrent
); );
$data = array_merge($aFields, $data); $delay->create($rowDelay);
$oListCanceled = new ListCanceled();
$oListCanceled->create($data);
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$dataList = [
'APP_UID' => $appUid,
'DEL_INDEX' => $value['DEL_INDEX'],
'USR_UID' => $rowDelay['APP_DELEGATION_USER'],
'APP_STATUS_CURRENT' => $appStatusCurrent
];
$dataList = array_merge($caseFields, $dataList);
$listCanceled = new ListCanceled();
$listCanceled->create($dataList);
/*----------------------------------********---------------------------------*/
}
}
/**
* This function will be close the one or all threads
*
* @param string $appUid
* @param integer $delIndex, if is null we will to close all threads
*
* @return array
*/
private function closeCaseThreads($appUid, $delIndex = null)
{
$delegation = new AppDelegation();
$result = [];
/** Close all the threads in APP_DELEGATION and APP_THREAD */
if (is_null($delIndex)) {
/*----------------------------------********---------------------------------*/
$result = $delegation->LoadParallel($appUid);
$this->closeAllDelegations($appUid);
$this->closeAllThreads($appUid);
/*----------------------------------********---------------------------------*/
} else {
/** Close the specific delIndex in APP_DELEGATION and APP_THREAD */
$this->CloseCurrentDelegation($appUid, $delIndex);
$resultDelegation = $delegation->Load($appUid, $delIndex);
$this->closeAppThread($appUid, $result['DEL_THREAD']);
$result[] = $resultDelegation;
}
return $result;
} }
/** /**

View File

@@ -2939,7 +2939,6 @@ class WsBase
} }
$result = new WsResponse(0, G::loadTranslation('ID_COMMAND_EXECUTED_SUCCESSFULLY')); $result = new WsResponse(0, G::loadTranslation('ID_COMMAND_EXECUTED_SUCCESSFULLY'));
$g->sessionVarRestore(); $g->sessionVarRestore();
return $result; return $result;
@@ -3066,14 +3065,7 @@ class WsBase
$case->removeCase($caseUid); $case->removeCase($caseUid);
//Response //Response
$res = new WsResponse(0, G::LoadTranslation("ID_COMMAND_EXECUTED_SUCCESSFULLY")); $result = self::messageExecuteSuccessfully();
$result = array(
"status_code" => $res->status_code,
"message" => $res->message,
"timestamp" => $res->timestamp
);
$g->sessionVarRestore(); $g->sessionVarRestore();
return $result; return $result;
@@ -3093,7 +3085,7 @@ class WsBase
* @param int delIndex : Delegation index of the case. * @param int delIndex : Delegation index of the case.
* @param string userUid : The unique ID of the user who will cancel the case. * @param string userUid : The unique ID of the user who will cancel the case.
* *
* @return $result will return an object * @return array | object
*/ */
public function cancelCase($caseUid, $delIndex, $userUid) public function cancelCase($caseUid, $delIndex, $userUid)
{ {
@@ -3107,62 +3099,68 @@ class WsBase
$_SESSION["USER_LOGGED"] = $userUid; $_SESSION["USER_LOGGED"] = $userUid;
if (empty($caseUid)) { if (empty($caseUid)) {
$result = new WsResponse(100, G::LoadTranslation("ID_REQUIRED_FIELD") . " caseUid");
$g->sessionVarRestore(); $g->sessionVarRestore();
return $result; return self::messageRequiredField('caseUid');
}
if (empty($delIndex)) {
$result = new WsResponse(100, G::LoadTranslation("ID_REQUIRED_FIELD") . " delIndex");
$g->sessionVarRestore();
return $result;
}
if (empty($userUid)) {
$result = new WsResponse(100, G::LoadTranslation("ID_REQUIRED_FIELD") . " userUid");
$g->sessionVarRestore();
return $result;
}
$oApplication = new Application();
$aFields = $oApplication->load($caseUid);
if ($aFields['APP_STATUS'] == 'DRAFT') {
$result = new WsResponse(100, G::LoadTranslation("ID_CASE_IN_STATUS") . " DRAFT");
$g->sessionVarRestore();
return $result;
}
$oAppThread = new AppThread();
$cant = $oAppThread->countStatus($caseUid, 'OPEN');
if ($cant > 1) {
$result = new WsResponse(100, G::LoadTranslation("ID_CASE_CANCELLED_PARALLEL"));
$g->sessionVarRestore();
return $result;
} }
$case = new Cases(); $case = new Cases();
$case->cancelCase($caseUid, $delIndex, $userUid); $statusCase = $case->loadCase($caseUid)['APP_STATUS'];
if ($statusCase !== 'TO_DO') {
$g->sessionVarRestore();
//Response return self::messageIllegalValues('ID_CASE_IN_STATUS', ' ' . $statusCase);
$res = new WsResponse(0, G::LoadTranslation("ID_COMMAND_EXECUTED_SUCCESSFULLY")); }
$result = array( /** If those parameters are null we will to force the cancelCase */
"status_code" => $res->status_code, if (is_null($delIndex) && is_null($userUid)) {
"message" => $res->message, /*----------------------------------********---------------------------------*/
"timestamp" => $res->timestamp $case->cancelCase($caseUid, null, null);
); $result = self::messageExecuteSuccessfully();
$g->sessionVarRestore();
return $result;
/*----------------------------------********---------------------------------*/
}
/** We will to continue with review the threads */
if (empty($delIndex)) {
$g->sessionVarRestore();
return self::messageRequiredField('delIndex');
}
$delegation = new AppDelegation();
$indexOpen = $delegation->LoadParallel($caseUid, $delIndex);
if (empty($indexOpen)) {
$g->sessionVarRestore();
return self::messageIllegalValues('ID_CASE_DELEGATION_ALREADY_CLOSED');
}
if (empty($userUid)) {
$g->sessionVarRestore();
return self::messageRequiredField('userUid');
}
if (AppThread::countStatus($caseUid, 'OPEN') > 1) {
$g->sessionVarRestore();
return self::messageIllegalValues("ID_CASE_CANCELLED_PARALLEL");
}
/** Cancel case */
$case->cancelCase($caseUid, (int)$delIndex, $userUid);
//Define the result of the cancelCase
$result = self::messageExecuteSuccessfully();
$g->sessionVarRestore(); $g->sessionVarRestore();
return $result; return $result;
} catch (Exception $e) { } catch (Exception $e) {
$result = new WsResponse(100, $e->getMessage()); $result = new WsResponse(100, $e->getMessage());
$g->sessionVarRestore(); $g->sessionVarRestore();
return $result; return $result;
@@ -3228,15 +3226,9 @@ class WsBase
$case->pauseCase($caseUid, $delIndex, $userUid, $unpauseDate); $case->pauseCase($caseUid, $delIndex, $userUid, $unpauseDate);
//Response //Response
$res = new WsResponse(0, G::LoadTranslation("ID_COMMAND_EXECUTED_SUCCESSFULLY")); $result = self::messageExecuteSuccessfully();
$result = array(
"status_code" => $res->status_code,
"message" => $res->message,
"timestamp" => $res->timestamp
);
$g->sessionVarRestore(); $g->sessionVarRestore();
return $result; return $result;
} catch (Exception $e) { } catch (Exception $e) {
$result = new WsResponse(100, $e->getMessage()); $result = new WsResponse(100, $e->getMessage());
@@ -3295,14 +3287,7 @@ class WsBase
$case->unpauseCase($caseUid, $delIndex, $userUid); $case->unpauseCase($caseUid, $delIndex, $userUid);
//Response //Response
$res = new WsResponse(0, G::LoadTranslation("ID_COMMAND_EXECUTED_SUCCESSFULLY")); $result = self::messageExecuteSuccessfully();
$result = array(
"status_code" => $res->status_code,
"message" => $res->message,
"timestamp" => $res->timestamp
);
$g->sessionVarRestore(); $g->sessionVarRestore();
return $result; return $result;
@@ -3409,4 +3394,52 @@ class WsBase
return $result; return $result;
} }
} }
/**
* Define the message for the required fields
*
* @param string $field
* @param integer code
*
* @return object
*/
private function messageRequiredField($field, $code = 100)
{
$result = new WsResponse($code, G::LoadTranslation("ID_REQUIRED_FIELD") . ' ' . $field);
return $result;
}
/**
* Define the message for the required fields
*
* @param string $translationId
* @param string $field
* @param integer code
*
* @return object
*/
private function messageIllegalValues($translationId, $field = '', $code = 100)
{
$result = new WsResponse($code, G::LoadTranslation($translationId) . $field);
return $result;
}
/**
* Define the result when it's execute successfully
*
* @return object
*/
private function messageExecuteSuccessfully()
{
$res = new WsResponse(0, G::LoadTranslation("ID_COMMAND_EXECUTED_SUCCESSFULLY"));
$result = [
"status_code" => $res->status_code,
"message" => $res->message,
"timestamp" => $res->timestamp
];
return $result;
}
} }

View File

@@ -2775,10 +2775,17 @@ function PMFCancelCase ($caseUid, $delIndex, $userUid)
G::header('Location: ../cases/casesListExtJsRedirector'); G::header('Location: ../cases/casesListExtJsRedirector');
die(); die();
} else { } else {
die(G::LoadTranslation('ID_PM_FUNCTION_CHANGE_CASE', SYS_LANG, array('PMFCancelCase', G::LoadTranslation('ID_CANCELLED')))); die(
G::LoadTranslation(
'ID_PM_FUNCTION_CHANGE_CASE',
SYS_LANG,
['PMFCancelCase', G::LoadTranslation('ID_CANCELLED')]
)
);
} }
} }
} }
return 1; return 1;
} else { } else {
return 0; return 0;

View File

@@ -1,12 +1,4 @@
<?php <?php
/**
* AppDelay.php
* @package workflow.engine.classes.model
*/
//require_once 'classes/model/om/BaseAppDelay.php';
/** /**
* Skeleton subclass for representing a row from the 'APP_DELAY' table. * Skeleton subclass for representing a row from the 'APP_DELAY' table.
* *
@@ -20,93 +12,111 @@
*/ */
class AppDelay extends BaseAppDelay class AppDelay extends BaseAppDelay
{ {
const APP_TYPE_CANCEL = 'CANCEL';
const APP_TYPE_PAUSE = 'PAUSE';
/** /**
* Create the application delay registry * Create the application delay registry
* @param array $aData *
* @param array $data
*
* @return string * @return string
* @throws Exception
**/ **/
public function create($aData) public function create($data)
{ {
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME); $connection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
try { try {
if ( isset ( $aData['APP_DELAY_UID'] ) && $aData['APP_DELAY_UID']== '' ) { if (isset ($data['APP_DELAY_UID']) && $data['APP_DELAY_UID'] == '') {
unset ( $aData['APP_DELAY_UID'] ); unset ($data['APP_DELAY_UID']);
} }
if ( !isset ( $aData['APP_DELAY_UID'] ) ) { if (!isset ($data['APP_DELAY_UID'])) {
$aData['APP_DELAY_UID'] = G::generateUniqueID(); $data['APP_DELAY_UID'] = G::generateUniqueID();
} }
$oAppDelay = new AppDelay(); $appDelay = new AppDelay();
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME); $appDelay->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($oAppDelay->validate()) { if ($appDelay->validate()) {
$oConnection->begin(); $connection->begin();
$iResult = $oAppDelay->save(); $result = $appDelay->save();
$oConnection->commit(); $connection->commit();
return $aData['APP_DELAY_UID'];
return $data['APP_DELAY_UID'];
} else { } else {
$sMessage = ''; $message = '';
$aValidationFailures = $oAppDelay->getValidationFailures(); $validationFailures = $appDelay->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) { foreach ($validationFailures as $validationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />'; $message .= $validationFailure->getMessage() . '<br />';
} }
throw(new Exception('The registry cannot be created!<br />'.$sMessage)); throw(new Exception('The registry cannot be created!<br />' . $message));
} }
} catch (Exception $oError) { } catch (Exception $error) {
$oConnection->rollback(); $connection->rollback();
throw($oError); throw($error);
} }
} }
/** /**
* Update the application delay registry * Update the application delay registry
* @param array $aData *
* @param array $data
*
* @return string * @return string
* @throws Exception
**/ **/
public function update($aData) public function update($data)
{ {
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME); $connection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
try { try {
$oAppDelay = AppDelayPeer::retrieveByPK($aData['APP_DELAY_UID']); $appDelay = AppDelayPeer::retrieveByPK($data['APP_DELAY_UID']);
if (!is_null($oAppDelay)) { if (!is_null($appDelay)) {
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME); $appDelay->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($oAppDelay->validate()) { if ($appDelay->validate()) {
$oConnection->begin(); $connection->begin();
$iResult = $oAppDelay->save(); $result = $appDelay->save();
$oConnection->commit(); $connection->commit();
return $iResult; return $result;
} else { } else {
$sMessage = ''; $message = '';
$aValidationFailures = $oAppDelay->getValidationFailures(); $validationFailures = $appDelay->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) { foreach ($validationFailures as $validationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />'; $message .= $validationFailure->getMessage() . '<br />';
} }
throw(new Exception('The registry cannot be updated!<br />'.$sMessage)); throw(new Exception('The registry cannot be updated!<br />'.$message));
} }
} else { } else {
throw(new Exception('This row doesn\'t exist!')); throw(new Exception('This row doesn\'t exist!'));
} }
} catch (Exception $oError) { } catch (Exception $error) {
$oConnection->rollback(); $connection->rollback();
throw($oError); throw($error);
} }
} }
/**
* Review if the application in a specific index is paused
*
* @param string $appUid
* @param integer $delIndex
*
* @return boolean
*/
public function isPaused($appUid, $delIndex) public function isPaused($appUid, $delIndex)
{ {
$oCriteria = new Criteria('workflow'); $criteria = new Criteria('workflow');
$oCriteria->add(AppDelayPeer::APP_UID, $appUid); $criteria->add(AppDelayPeer::APP_UID, $appUid);
$oCriteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex); $criteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex);
$oCriteria->add(AppDelayPeer::APP_TYPE, 'PAUSE'); $criteria->add(AppDelayPeer::APP_TYPE, AppDelay::APP_TYPE_PAUSE);
$oCriteria->add( $criteria->add(
$oCriteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0, Criteria::EQUAL)->addOr( $criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0, Criteria::EQUAL)->addOr(
$oCriteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL)) $criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL))
); );
$oDataset = AppDelayPeer::doSelectRS($oCriteria); $dataset = AppDelayPeer::doSelectRS($criteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next(); $dataset->next();
$aRow = $oDataset->getRow(); $row = $dataset->getRow();
if ($aRow) { if ($row) {
return true; return true;
} else { } else {
return false; return false;
@@ -117,20 +127,74 @@ class AppDelay extends BaseAppDelay
* Verify if the case is Paused or cancelled * Verify if the case is Paused or cancelled
* *
* @param $appUid string * @param $appUid string
* @return $oDataset array *
* @return array|null
*/ */
public function getCasesCancelOrPaused($appUid) public function getCasesCancelOrPaused($appUid)
{ {
$oCriteria = new Criteria( 'workflow' ); $criteria = new Criteria('workflow');
$oCriteria->addSelectColumn( AppDelayPeer::APP_UID ); $criteria->addSelectColumn(AppDelayPeer::APP_UID);
$oCriteria->addSelectColumn( AppDelayPeer::APP_DEL_INDEX ); $criteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
$oCriteria->add( AppDelayPeer::APP_UID, $appUid ); $criteria->add(AppDelayPeer::APP_UID, $appUid);
$oCriteria->add( $oCriteria->getNewCriterion( AppDelayPeer::APP_TYPE, 'PAUSE' )->addOr( $oCriteria->getNewCriterion( AppDelayPeer::APP_TYPE, 'CANCEL' ) ) ); $criteria->add(
$oCriteria->addAscendingOrderByColumn( AppDelayPeer::APP_ENABLE_ACTION_DATE ); $criteria->getNewCriterion(AppDelayPeer::APP_TYPE, AppDelay::APP_TYPE_PAUSE)->addOr(
$oDataset = AppDelayPeer::doSelectRS( $oCriteria ); $criteria->getNewCriterion(AppDelayPeer::APP_TYPE, AppDelay::APP_TYPE_CANCEL)
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); )
$oDataset->next(); );
return $oDataset->getRow(); $criteria->addAscendingOrderByColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
$dataset = AppDelayPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
return $dataset->getRow();
}
/**
* Build the row for the appDelay to be inserted
*
* @param string $proUid
* @param integer $proId
* @param string $appUid
* @param integer $appNumber
* @param integer $appThreadIndex
* @param integer $delIndex
* @param string $appType
* @param string $appStatus
* @param string $usrUid
*
* @return array
*/
public static function buildAppDelayRow(
$proUid = '',
$proId = 0,
$appUid = '',
$appNumber = 0,
$appThreadIndex = 0,
$delIndex = 0,
$appType = 'CANCEL',
$appStatus = 'CANCELLED',
$usrUid = ''
) {
$row = [];
$row['PRO_UID'] = $proUid;
$row['PRO_ID'] = $proId;
$row['APP_UID'] = $appUid;
$row['APP_NUMBER'] = $appNumber;
$row['APP_THREAD_INDEX'] = $appThreadIndex;
$row['APP_DEL_INDEX'] = $delIndex;
$row['APP_TYPE'] = $appType;
$row['APP_STATUS'] = $appStatus;
$row['APP_ENABLE_ACTION_DATE'] = date('Y-m-d H:i:s');
//Define the user that execute the insert
if (empty($usrUid)) {
global $RBAC;
$usrUid = $RBAC->aUserInfo['USER_INFO']['USR_UID'];
}
$row['APP_DELEGATION_USER'] = $usrUid;
$row['APP_ENABLE_ACTION_USER'] = $usrUid;
return $row;
} }
} }

View File

@@ -331,16 +331,17 @@ class AppDelegation extends BaseAppDelegation
} }
} }
/* Load the Application Delegation row specified in [app_id] column value. /**
* Load the Application Delegation row specified in [app_id] column value.
*
* @param string $appUid the uid of the application
* @param integer $index the index of the delegation
* *
* @param string $AppUid the uid of the application
* @param string $index the index of the delegation
* @return array $Fields the fields * @return array $Fields the fields
*/ */
public function LoadParallel($appUid, $index = 0)
public function LoadParallel($AppUid, $index = "")
{ {
$aCases = array(); $cases = [];
$c = new Criteria('workflow'); $c = new Criteria('workflow');
$c->addSelectColumn(AppDelegationPeer::APP_UID); $c->addSelectColumn(AppDelegationPeer::APP_UID);
@@ -348,17 +349,19 @@ class AppDelegation extends BaseAppDelegation
$c->addSelectColumn(AppDelegationPeer::PRO_UID); $c->addSelectColumn(AppDelegationPeer::PRO_UID);
$c->addSelectColumn(AppDelegationPeer::TAS_UID); $c->addSelectColumn(AppDelegationPeer::TAS_UID);
$c->addSelectColumn(AppDelegationPeer::USR_UID); $c->addSelectColumn(AppDelegationPeer::USR_UID);
$c->addSelectColumn(AppDelegationPeer::DEL_THREAD);
$c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE); $c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
$c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE); $c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$c->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE); $c->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE); $c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
$c->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS); $c->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
$c->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN'); $c->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
$c->add(AppDelegationPeer::APP_UID, $AppUid); $c->add(AppDelegationPeer::APP_UID, $appUid);
if (!empty($index)) {
if ($index > 0) {
$c->add(AppDelegationPeer::DEL_INDEX, $index); $c->add(AppDelegationPeer::DEL_INDEX, $index);
} }
$c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX); $c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
$rs = AppDelegationPeer::doSelectRS($c); $rs = AppDelegationPeer::doSelectRS($c);
$row = $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC); $row = $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
@@ -367,22 +370,12 @@ class AppDelegation extends BaseAppDelegation
$row = $rs->getRow(); $row = $rs->getRow();
while (is_array($row)) { while (is_array($row)) {
$case = array(); $cases[] = $row;
$case['TAS_UID'] = $row['TAS_UID'];
$case['USR_UID'] = $row['USR_UID'];
$case['DEL_INDEX'] = $row['DEL_INDEX'];
$case['TAS_UID'] = $row['TAS_UID'];
$case['DEL_DELEGATE_DATE'] = $row['DEL_DELEGATE_DATE'];
$case['DEL_INIT_DATE'] = $row['DEL_INIT_DATE'];
$case['DEL_TASK_DUE_DATE'] = $row['DEL_TASK_DUE_DATE'];
$case['DEL_FINISH_DATE'] = $row['DEL_FINISH_DATE'];
$case['DEL_PREVIOUS'] = $row['DEL_PREVIOUS'];
$aCases[] = $case;
$rs->next(); $rs->next();
$row = $rs->getRow(); $row = $rs->getRow();
} }
return $aCases; return $cases;
} }
/** /**

View File

@@ -115,13 +115,23 @@ class AppThread extends BaseAppThread
} }
} }
public function countStatus($appUid, $status='OPEN'){ /**
* Count the open threads
*
* @param string $appUid
* @param string $status
*
* @return integer
*/
public static function countStatus($appUid, $status = 'OPEN')
{
$c = new Criteria('workflow'); $c = new Criteria('workflow');
$c->clearSelectColumns(); $c->clearSelectColumns();
$c->addSelectColumn(AppThreadPeer::APP_THREAD_PARENT); $c->addSelectColumn(AppThreadPeer::APP_THREAD_PARENT);
$c->add(AppThreadPeer::APP_UID, $appUid); $c->add(AppThreadPeer::APP_UID, $appUid);
$c->add(AppThreadPeer::APP_THREAD_STATUS, $status); $c->add(AppThreadPeer::APP_THREAD_STATUS, $status);
$cant = AppThreadPeer::doCount($c); $cant = AppThreadPeer::doCount($c);
return $cant; return $cant;
} }
} }

View File

@@ -46,9 +46,10 @@ class Application extends BaseApplication
* This value goes in the content table * This value goes in the content table
* @var string * @var string
*/ */
const APP_STATUS_CANCELLED = 'CANCELLED';
public static $app_status_values = ['DRAFT' => 1, 'TO_DO' => 2, 'COMPLETED' => 3, 'CANCELLED' => 4];
protected $app_title_content = ''; protected $app_title_content = '';
protected $app_description_content = ''; protected $app_description_content = '';
public static $app_status_values = ['DRAFT' => 1, 'TO_DO' => 2, 'COMPLETED' => 3, 'CANCELLED' => 4];
/** /**
* Get the [app_title_content] column value. * Get the [app_title_content] column value.

View File

@@ -2,29 +2,17 @@
require_once 'classes/model/om/BaseListCanceled.php'; require_once 'classes/model/om/BaseListCanceled.php';
/**
* Skeleton subclass for representing a row from the 'LIST_CANCELED' 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 classes.model
*/
// @codingStandardsIgnoreStart
class ListCanceled extends BaseListCanceled implements ListInterface class ListCanceled extends BaseListCanceled implements ListInterface
{ {
use ListBaseTrait; use ListBaseTrait;
// @codingStandardsIgnoreEnd
/** /**
* Create List Canceled Table * Create List Canceled Table
* *
* @param type $data * @param array $data
* @return type *
* @return void
* @throws Exception
* *
*/ */
public function create($data) public function create($data)
@@ -182,16 +170,17 @@ class ListCanceled extends BaseListCanceled implements ListInterface
/** /**
* Remove List Canceled * Remove List Canceled
* *
* @param type $seqName * @param string $appUid
* @return type *
* @throws type * @return void
* @throws Exception
* *
*/ */
public function remove($app_uid) public function remove($appUid)
{ {
$con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME); $con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME);
try { try {
$this->setAppUid($app_uid); $this->setAppUid($appUid);
$con->begin(); $con->begin();
$this->delete(); $this->delete();
$con->commit(); $con->commit();
@@ -351,4 +340,5 @@ class ListCanceled extends BaseListCanceled implements ListInterface
return $this->getCountListFromPeer return $this->getCountListFromPeer
(ListCanceledPeer::class, $usrUid, $filters); (ListCanceledPeer::class, $usrUid, $filters);
} }
} // ListCanceled } // ListCanceled

View File

@@ -111,5 +111,22 @@ class SubApplication extends BaseSubApplication
} }
return false; return false;
} }
/**
* Verify if is a case related to the subProcess
*
* @param string $appUid
*
* @return boolean
*/
public static function isCaseSubProcess($appUid)
{
$criteria = new Criteria('workflow');
$criteria->add(SubApplicationPeer::APP_UID, $appUid);
$criteria->add(SubApplicationPeer::SA_STATUS, 'ACTIVE');
$dataset = SubApplicationPeer::doSelectOne($criteria);
return !is_null($dataset);
}
} }

View File

@@ -67,6 +67,8 @@ class ListCanceledMapBuilder
$tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32); $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32); $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32); $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
@@ -83,8 +85,6 @@ class ListCanceledMapBuilder
$tMap->addColumn('APP_CANCELED_DATE', 'AppCanceledDate', 'int', CreoleTypes::TIMESTAMP, false, null); $tMap->addColumn('APP_CANCELED_DATE', 'AppCanceledDate', 'int', CreoleTypes::TIMESTAMP, false, null);
$tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('DEL_PREVIOUS_USR_UID', 'DelPreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32); $tMap->addColumn('DEL_PREVIOUS_USR_UID', 'DelPreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('DEL_CURRENT_USR_USERNAME', 'DelCurrentUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100); $tMap->addColumn('DEL_CURRENT_USR_USERNAME', 'DelCurrentUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100);

View File

@@ -33,6 +33,12 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
*/ */
protected $app_uid = ''; protected $app_uid = '';
/**
* The value for the del_index field.
* @var int
*/
protected $del_index = 0;
/** /**
* The value for the usr_uid field. * The value for the usr_uid field.
* @var string * @var string
@@ -81,12 +87,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
*/ */
protected $app_canceled_date; protected $app_canceled_date;
/**
* The value for the del_index field.
* @var int
*/
protected $del_index = 0;
/** /**
* The value for the del_previous_usr_uid field. * The value for the del_previous_usr_uid field.
* @var string * @var string
@@ -178,6 +178,17 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
return $this->app_uid; return $this->app_uid;
} }
/**
* Get the [del_index] column value.
*
* @return int
*/
public function getDelIndex()
{
return $this->del_index;
}
/** /**
* Get the [usr_uid] column value. * Get the [usr_uid] column value.
* *
@@ -287,17 +298,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
} }
} }
/**
* Get the [del_index] column value.
*
* @return int
*/
public function getDelIndex()
{
return $this->del_index;
}
/** /**
* Get the [del_previous_usr_uid] column value. * Get the [del_previous_usr_uid] column value.
* *
@@ -504,6 +504,28 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
} // setAppUid() } // setAppUid()
/**
* Set the value of [del_index] column.
*
* @param int $v new value
* @return void
*/
public function setDelIndex($v)
{
// Since the native PHP type for this column is integer,
// we will cast the input value to an int (if it is not).
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->del_index !== $v || $v === 0) {
$this->del_index = $v;
$this->modifiedColumns[] = ListCanceledPeer::DEL_INDEX;
}
} // setDelIndex()
/** /**
* Set the value of [usr_uid] column. * Set the value of [usr_uid] column.
* *
@@ -687,28 +709,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
} // setAppCanceledDate() } // setAppCanceledDate()
/**
* Set the value of [del_index] column.
*
* @param int $v new value
* @return void
*/
public function setDelIndex($v)
{
// Since the native PHP type for this column is integer,
// we will cast the input value to an int (if it is not).
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->del_index !== $v || $v === 0) {
$this->del_index = $v;
$this->modifiedColumns[] = ListCanceledPeer::DEL_INDEX;
}
} // setDelIndex()
/** /**
* Set the value of [del_previous_usr_uid] column. * Set the value of [del_previous_usr_uid] column.
* *
@@ -991,23 +991,23 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$this->app_uid = $rs->getString($startcol + 0); $this->app_uid = $rs->getString($startcol + 0);
$this->usr_uid = $rs->getString($startcol + 1); $this->del_index = $rs->getInt($startcol + 1);
$this->tas_uid = $rs->getString($startcol + 2); $this->usr_uid = $rs->getString($startcol + 2);
$this->pro_uid = $rs->getString($startcol + 3); $this->tas_uid = $rs->getString($startcol + 3);
$this->app_number = $rs->getInt($startcol + 4); $this->pro_uid = $rs->getString($startcol + 4);
$this->app_title = $rs->getString($startcol + 5); $this->app_number = $rs->getInt($startcol + 5);
$this->app_pro_title = $rs->getString($startcol + 6); $this->app_title = $rs->getString($startcol + 6);
$this->app_tas_title = $rs->getString($startcol + 7); $this->app_pro_title = $rs->getString($startcol + 7);
$this->app_canceled_date = $rs->getTimestamp($startcol + 8, null); $this->app_tas_title = $rs->getString($startcol + 8);
$this->del_index = $rs->getInt($startcol + 9); $this->app_canceled_date = $rs->getTimestamp($startcol + 9, null);
$this->del_previous_usr_uid = $rs->getString($startcol + 10); $this->del_previous_usr_uid = $rs->getString($startcol + 10);
@@ -1244,31 +1244,31 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
return $this->getAppUid(); return $this->getAppUid();
break; break;
case 1: case 1:
return $this->getUsrUid(); return $this->getDelIndex();
break; break;
case 2: case 2:
return $this->getTasUid(); return $this->getUsrUid();
break; break;
case 3: case 3:
return $this->getProUid(); return $this->getTasUid();
break; break;
case 4: case 4:
return $this->getAppNumber(); return $this->getProUid();
break; break;
case 5: case 5:
return $this->getAppTitle(); return $this->getAppNumber();
break; break;
case 6: case 6:
return $this->getAppProTitle(); return $this->getAppTitle();
break; break;
case 7: case 7:
return $this->getAppTasTitle(); return $this->getAppProTitle();
break; break;
case 8: case 8:
return $this->getAppCanceledDate(); return $this->getAppTasTitle();
break; break;
case 9: case 9:
return $this->getDelIndex(); return $this->getAppCanceledDate();
break; break;
case 10: case 10:
return $this->getDelPreviousUsrUid(); return $this->getDelPreviousUsrUid();
@@ -1324,15 +1324,15 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$keys = ListCanceledPeer::getFieldNames($keyType); $keys = ListCanceledPeer::getFieldNames($keyType);
$result = array( $result = array(
$keys[0] => $this->getAppUid(), $keys[0] => $this->getAppUid(),
$keys[1] => $this->getUsrUid(), $keys[1] => $this->getDelIndex(),
$keys[2] => $this->getTasUid(), $keys[2] => $this->getUsrUid(),
$keys[3] => $this->getProUid(), $keys[3] => $this->getTasUid(),
$keys[4] => $this->getAppNumber(), $keys[4] => $this->getProUid(),
$keys[5] => $this->getAppTitle(), $keys[5] => $this->getAppNumber(),
$keys[6] => $this->getAppProTitle(), $keys[6] => $this->getAppTitle(),
$keys[7] => $this->getAppTasTitle(), $keys[7] => $this->getAppProTitle(),
$keys[8] => $this->getAppCanceledDate(), $keys[8] => $this->getAppTasTitle(),
$keys[9] => $this->getDelIndex(), $keys[9] => $this->getAppCanceledDate(),
$keys[10] => $this->getDelPreviousUsrUid(), $keys[10] => $this->getDelPreviousUsrUid(),
$keys[11] => $this->getDelCurrentUsrUsername(), $keys[11] => $this->getDelCurrentUsrUsername(),
$keys[12] => $this->getDelCurrentUsrFirstname(), $keys[12] => $this->getDelCurrentUsrFirstname(),
@@ -1379,31 +1379,31 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$this->setAppUid($value); $this->setAppUid($value);
break; break;
case 1: case 1:
$this->setUsrUid($value); $this->setDelIndex($value);
break; break;
case 2: case 2:
$this->setTasUid($value); $this->setUsrUid($value);
break; break;
case 3: case 3:
$this->setProUid($value); $this->setTasUid($value);
break; break;
case 4: case 4:
$this->setAppNumber($value); $this->setProUid($value);
break; break;
case 5: case 5:
$this->setAppTitle($value); $this->setAppNumber($value);
break; break;
case 6: case 6:
$this->setAppProTitle($value); $this->setAppTitle($value);
break; break;
case 7: case 7:
$this->setAppTasTitle($value); $this->setAppProTitle($value);
break; break;
case 8: case 8:
$this->setAppCanceledDate($value); $this->setAppTasTitle($value);
break; break;
case 9: case 9:
$this->setDelIndex($value); $this->setAppCanceledDate($value);
break; break;
case 10: case 10:
$this->setDelPreviousUsrUid($value); $this->setDelPreviousUsrUid($value);
@@ -1466,39 +1466,39 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
} }
if (array_key_exists($keys[1], $arr)) { if (array_key_exists($keys[1], $arr)) {
$this->setUsrUid($arr[$keys[1]]); $this->setDelIndex($arr[$keys[1]]);
} }
if (array_key_exists($keys[2], $arr)) { if (array_key_exists($keys[2], $arr)) {
$this->setTasUid($arr[$keys[2]]); $this->setUsrUid($arr[$keys[2]]);
} }
if (array_key_exists($keys[3], $arr)) { if (array_key_exists($keys[3], $arr)) {
$this->setProUid($arr[$keys[3]]); $this->setTasUid($arr[$keys[3]]);
} }
if (array_key_exists($keys[4], $arr)) { if (array_key_exists($keys[4], $arr)) {
$this->setAppNumber($arr[$keys[4]]); $this->setProUid($arr[$keys[4]]);
} }
if (array_key_exists($keys[5], $arr)) { if (array_key_exists($keys[5], $arr)) {
$this->setAppTitle($arr[$keys[5]]); $this->setAppNumber($arr[$keys[5]]);
} }
if (array_key_exists($keys[6], $arr)) { if (array_key_exists($keys[6], $arr)) {
$this->setAppProTitle($arr[$keys[6]]); $this->setAppTitle($arr[$keys[6]]);
} }
if (array_key_exists($keys[7], $arr)) { if (array_key_exists($keys[7], $arr)) {
$this->setAppTasTitle($arr[$keys[7]]); $this->setAppProTitle($arr[$keys[7]]);
} }
if (array_key_exists($keys[8], $arr)) { if (array_key_exists($keys[8], $arr)) {
$this->setAppCanceledDate($arr[$keys[8]]); $this->setAppTasTitle($arr[$keys[8]]);
} }
if (array_key_exists($keys[9], $arr)) { if (array_key_exists($keys[9], $arr)) {
$this->setDelIndex($arr[$keys[9]]); $this->setAppCanceledDate($arr[$keys[9]]);
} }
if (array_key_exists($keys[10], $arr)) { if (array_key_exists($keys[10], $arr)) {
@@ -1560,6 +1560,10 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$criteria->add(ListCanceledPeer::APP_UID, $this->app_uid); $criteria->add(ListCanceledPeer::APP_UID, $this->app_uid);
} }
if ($this->isColumnModified(ListCanceledPeer::DEL_INDEX)) {
$criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index);
}
if ($this->isColumnModified(ListCanceledPeer::USR_UID)) { if ($this->isColumnModified(ListCanceledPeer::USR_UID)) {
$criteria->add(ListCanceledPeer::USR_UID, $this->usr_uid); $criteria->add(ListCanceledPeer::USR_UID, $this->usr_uid);
} }
@@ -1592,10 +1596,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$criteria->add(ListCanceledPeer::APP_CANCELED_DATE, $this->app_canceled_date); $criteria->add(ListCanceledPeer::APP_CANCELED_DATE, $this->app_canceled_date);
} }
if ($this->isColumnModified(ListCanceledPeer::DEL_INDEX)) {
$criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index);
}
if ($this->isColumnModified(ListCanceledPeer::DEL_PREVIOUS_USR_UID)) { if ($this->isColumnModified(ListCanceledPeer::DEL_PREVIOUS_USR_UID)) {
$criteria->add(ListCanceledPeer::DEL_PREVIOUS_USR_UID, $this->del_previous_usr_uid); $criteria->add(ListCanceledPeer::DEL_PREVIOUS_USR_UID, $this->del_previous_usr_uid);
} }
@@ -1657,28 +1657,40 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$criteria = new Criteria(ListCanceledPeer::DATABASE_NAME); $criteria = new Criteria(ListCanceledPeer::DATABASE_NAME);
$criteria->add(ListCanceledPeer::APP_UID, $this->app_uid); $criteria->add(ListCanceledPeer::APP_UID, $this->app_uid);
$criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index);
return $criteria; return $criteria;
} }
/** /**
* Returns the primary key for this object (row). * Returns the composite primary key for this object.
* @return string * The array elements will be in same order as specified in XML.
* @return array
*/ */
public function getPrimaryKey() public function getPrimaryKey()
{ {
return $this->getAppUid(); $pks = array();
$pks[0] = $this->getAppUid();
$pks[1] = $this->getDelIndex();
return $pks;
} }
/** /**
* Generic method to set the primary key (app_uid column). * Set the [composite] primary key.
* *
* @param string $key Primary key. * @param array $keys The elements of the composite key (order must match the order in XML file).
* @return void * @return void
*/ */
public function setPrimaryKey($key) public function setPrimaryKey($keys)
{ {
$this->setAppUid($key);
$this->setAppUid($keys[0]);
$this->setDelIndex($keys[1]);
} }
/** /**
@@ -1710,8 +1722,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$copyObj->setAppCanceledDate($this->app_canceled_date); $copyObj->setAppCanceledDate($this->app_canceled_date);
$copyObj->setDelIndex($this->del_index);
$copyObj->setDelPreviousUsrUid($this->del_previous_usr_uid); $copyObj->setDelPreviousUsrUid($this->del_previous_usr_uid);
$copyObj->setDelCurrentUsrUsername($this->del_current_usr_username); $copyObj->setDelCurrentUsrUsername($this->del_current_usr_username);
@@ -1739,6 +1749,8 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$copyObj->setAppUid(''); // this is a pkey column, so set to default value $copyObj->setAppUid(''); // this is a pkey column, so set to default value
$copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
} }
/** /**

View File

@@ -34,6 +34,9 @@ abstract class BaseListCanceledPeer
/** the column name for the APP_UID field */ /** the column name for the APP_UID field */
const APP_UID = 'LIST_CANCELED.APP_UID'; const APP_UID = 'LIST_CANCELED.APP_UID';
/** the column name for the DEL_INDEX field */
const DEL_INDEX = 'LIST_CANCELED.DEL_INDEX';
/** the column name for the USR_UID field */ /** the column name for the USR_UID field */
const USR_UID = 'LIST_CANCELED.USR_UID'; const USR_UID = 'LIST_CANCELED.USR_UID';
@@ -58,9 +61,6 @@ abstract class BaseListCanceledPeer
/** the column name for the APP_CANCELED_DATE field */ /** the column name for the APP_CANCELED_DATE field */
const APP_CANCELED_DATE = 'LIST_CANCELED.APP_CANCELED_DATE'; const APP_CANCELED_DATE = 'LIST_CANCELED.APP_CANCELED_DATE';
/** the column name for the DEL_INDEX field */
const DEL_INDEX = 'LIST_CANCELED.DEL_INDEX';
/** the column name for the DEL_PREVIOUS_USR_UID field */ /** the column name for the DEL_PREVIOUS_USR_UID field */
const DEL_PREVIOUS_USR_UID = 'LIST_CANCELED.DEL_PREVIOUS_USR_UID'; const DEL_PREVIOUS_USR_UID = 'LIST_CANCELED.DEL_PREVIOUS_USR_UID';
@@ -105,9 +105,9 @@ abstract class BaseListCanceledPeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('AppUid', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCanceledDate', 'DelIndex', 'DelPreviousUsrUid', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', 'ProId', 'UsrId', 'TasId', ), BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCanceledDate', 'DelPreviousUsrUid', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', 'ProId', 'UsrId', 'TasId', ),
BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID, ListCanceledPeer::USR_UID, ListCanceledPeer::TAS_UID, ListCanceledPeer::PRO_UID, ListCanceledPeer::APP_NUMBER, ListCanceledPeer::APP_TITLE, ListCanceledPeer::APP_PRO_TITLE, ListCanceledPeer::APP_TAS_TITLE, ListCanceledPeer::APP_CANCELED_DATE, ListCanceledPeer::DEL_INDEX, ListCanceledPeer::DEL_PREVIOUS_USR_UID, ListCanceledPeer::DEL_CURRENT_USR_USERNAME, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME, ListCanceledPeer::DEL_DELEGATE_DATE, ListCanceledPeer::DEL_INIT_DATE, ListCanceledPeer::DEL_DUE_DATE, ListCanceledPeer::DEL_PRIORITY, ListCanceledPeer::PRO_ID, ListCanceledPeer::USR_ID, ListCanceledPeer::TAS_ID, ), BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID, ListCanceledPeer::DEL_INDEX, ListCanceledPeer::USR_UID, ListCanceledPeer::TAS_UID, ListCanceledPeer::PRO_UID, ListCanceledPeer::APP_NUMBER, ListCanceledPeer::APP_TITLE, ListCanceledPeer::APP_PRO_TITLE, ListCanceledPeer::APP_TAS_TITLE, ListCanceledPeer::APP_CANCELED_DATE, ListCanceledPeer::DEL_PREVIOUS_USR_UID, ListCanceledPeer::DEL_CURRENT_USR_USERNAME, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME, ListCanceledPeer::DEL_DELEGATE_DATE, ListCanceledPeer::DEL_INIT_DATE, ListCanceledPeer::DEL_DUE_DATE, ListCanceledPeer::DEL_PRIORITY, ListCanceledPeer::PRO_ID, ListCanceledPeer::USR_ID, ListCanceledPeer::TAS_ID, ),
BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_CANCELED_DATE', 'DEL_INDEX', 'DEL_PREVIOUS_USR_UID', 'DEL_CURRENT_USR_USERNAME', 'DEL_CURRENT_USR_FIRSTNAME', 'DEL_CURRENT_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', 'PRO_ID', 'USR_ID', 'TAS_ID', ), BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_CANCELED_DATE', 'DEL_PREVIOUS_USR_UID', 'DEL_CURRENT_USR_USERNAME', 'DEL_CURRENT_USR_FIRSTNAME', 'DEL_CURRENT_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', 'PRO_ID', 'USR_ID', 'TAS_ID', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, )
); );
@@ -118,9 +118,9 @@ abstract class BaseListCanceledPeer
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'UsrUid' => 1, 'TasUid' => 2, 'ProUid' => 3, 'AppNumber' => 4, 'AppTitle' => 5, 'AppProTitle' => 6, 'AppTasTitle' => 7, 'AppCanceledDate' => 8, 'DelIndex' => 9, 'DelPreviousUsrUid' => 10, 'DelCurrentUsrUsername' => 11, 'DelCurrentUsrFirstname' => 12, 'DelCurrentUsrLastname' => 13, 'DelDelegateDate' => 14, 'DelInitDate' => 15, 'DelDueDate' => 16, 'DelPriority' => 17, 'ProId' => 18, 'UsrId' => 19, 'TasId' => 20, ), BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'UsrUid' => 2, 'TasUid' => 3, 'ProUid' => 4, 'AppNumber' => 5, 'AppTitle' => 6, 'AppProTitle' => 7, 'AppTasTitle' => 8, 'AppCanceledDate' => 9, 'DelPreviousUsrUid' => 10, 'DelCurrentUsrUsername' => 11, 'DelCurrentUsrFirstname' => 12, 'DelCurrentUsrLastname' => 13, 'DelDelegateDate' => 14, 'DelInitDate' => 15, 'DelDueDate' => 16, 'DelPriority' => 17, 'ProId' => 18, 'UsrId' => 19, 'TasId' => 20, ),
BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID => 0, ListCanceledPeer::USR_UID => 1, ListCanceledPeer::TAS_UID => 2, ListCanceledPeer::PRO_UID => 3, ListCanceledPeer::APP_NUMBER => 4, ListCanceledPeer::APP_TITLE => 5, ListCanceledPeer::APP_PRO_TITLE => 6, ListCanceledPeer::APP_TAS_TITLE => 7, ListCanceledPeer::APP_CANCELED_DATE => 8, ListCanceledPeer::DEL_INDEX => 9, ListCanceledPeer::DEL_PREVIOUS_USR_UID => 10, ListCanceledPeer::DEL_CURRENT_USR_USERNAME => 11, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME => 12, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME => 13, ListCanceledPeer::DEL_DELEGATE_DATE => 14, ListCanceledPeer::DEL_INIT_DATE => 15, ListCanceledPeer::DEL_DUE_DATE => 16, ListCanceledPeer::DEL_PRIORITY => 17, ListCanceledPeer::PRO_ID => 18, ListCanceledPeer::USR_ID => 19, ListCanceledPeer::TAS_ID => 20, ), BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID => 0, ListCanceledPeer::DEL_INDEX => 1, ListCanceledPeer::USR_UID => 2, ListCanceledPeer::TAS_UID => 3, ListCanceledPeer::PRO_UID => 4, ListCanceledPeer::APP_NUMBER => 5, ListCanceledPeer::APP_TITLE => 6, ListCanceledPeer::APP_PRO_TITLE => 7, ListCanceledPeer::APP_TAS_TITLE => 8, ListCanceledPeer::APP_CANCELED_DATE => 9, ListCanceledPeer::DEL_PREVIOUS_USR_UID => 10, ListCanceledPeer::DEL_CURRENT_USR_USERNAME => 11, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME => 12, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME => 13, ListCanceledPeer::DEL_DELEGATE_DATE => 14, ListCanceledPeer::DEL_INIT_DATE => 15, ListCanceledPeer::DEL_DUE_DATE => 16, ListCanceledPeer::DEL_PRIORITY => 17, ListCanceledPeer::PRO_ID => 18, ListCanceledPeer::USR_ID => 19, ListCanceledPeer::TAS_ID => 20, ),
BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'USR_UID' => 1, 'TAS_UID' => 2, 'PRO_UID' => 3, 'APP_NUMBER' => 4, 'APP_TITLE' => 5, 'APP_PRO_TITLE' => 6, 'APP_TAS_TITLE' => 7, 'APP_CANCELED_DATE' => 8, 'DEL_INDEX' => 9, 'DEL_PREVIOUS_USR_UID' => 10, 'DEL_CURRENT_USR_USERNAME' => 11, 'DEL_CURRENT_USR_FIRSTNAME' => 12, 'DEL_CURRENT_USR_LASTNAME' => 13, 'DEL_DELEGATE_DATE' => 14, 'DEL_INIT_DATE' => 15, 'DEL_DUE_DATE' => 16, 'DEL_PRIORITY' => 17, 'PRO_ID' => 18, 'USR_ID' => 19, 'TAS_ID' => 20, ), BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'USR_UID' => 2, 'TAS_UID' => 3, 'PRO_UID' => 4, 'APP_NUMBER' => 5, 'APP_TITLE' => 6, 'APP_PRO_TITLE' => 7, 'APP_TAS_TITLE' => 8, 'APP_CANCELED_DATE' => 9, 'DEL_PREVIOUS_USR_UID' => 10, 'DEL_CURRENT_USR_USERNAME' => 11, 'DEL_CURRENT_USR_FIRSTNAME' => 12, 'DEL_CURRENT_USR_LASTNAME' => 13, 'DEL_DELEGATE_DATE' => 14, 'DEL_INIT_DATE' => 15, 'DEL_DUE_DATE' => 16, 'DEL_PRIORITY' => 17, 'PRO_ID' => 18, 'USR_ID' => 19, 'TAS_ID' => 20, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, )
); );
@@ -224,6 +224,8 @@ abstract class BaseListCanceledPeer
$criteria->addSelectColumn(ListCanceledPeer::APP_UID); $criteria->addSelectColumn(ListCanceledPeer::APP_UID);
$criteria->addSelectColumn(ListCanceledPeer::DEL_INDEX);
$criteria->addSelectColumn(ListCanceledPeer::USR_UID); $criteria->addSelectColumn(ListCanceledPeer::USR_UID);
$criteria->addSelectColumn(ListCanceledPeer::TAS_UID); $criteria->addSelectColumn(ListCanceledPeer::TAS_UID);
@@ -240,8 +242,6 @@ abstract class BaseListCanceledPeer
$criteria->addSelectColumn(ListCanceledPeer::APP_CANCELED_DATE); $criteria->addSelectColumn(ListCanceledPeer::APP_CANCELED_DATE);
$criteria->addSelectColumn(ListCanceledPeer::DEL_INDEX);
$criteria->addSelectColumn(ListCanceledPeer::DEL_PREVIOUS_USR_UID); $criteria->addSelectColumn(ListCanceledPeer::DEL_PREVIOUS_USR_UID);
$criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_USERNAME); $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_USERNAME);
@@ -479,6 +479,9 @@ abstract class BaseListCanceledPeer
$comparison = $criteria->getComparison(ListCanceledPeer::APP_UID); $comparison = $criteria->getComparison(ListCanceledPeer::APP_UID);
$selectCriteria->add(ListCanceledPeer::APP_UID, $criteria->remove(ListCanceledPeer::APP_UID), $comparison); $selectCriteria->add(ListCanceledPeer::APP_UID, $criteria->remove(ListCanceledPeer::APP_UID), $comparison);
$comparison = $criteria->getComparison(ListCanceledPeer::DEL_INDEX);
$selectCriteria->add(ListCanceledPeer::DEL_INDEX, $criteria->remove(ListCanceledPeer::DEL_INDEX), $comparison);
} else { } else {
$criteria = $values->buildCriteria(); // gets full criteria $criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
@@ -540,7 +543,22 @@ abstract class BaseListCanceledPeer
} else { } else {
// it must be the primary key // it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME); $criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(ListCanceledPeer::APP_UID, (array) $values, Criteria::IN); // primary key is composite; we therefore, expect
// the primary key passed to be an array of pkey
// values
if (count($values) == count($values, COUNT_RECURSIVE)) {
// array is not multi-dimensional
$values = array($values);
}
$vals = array();
foreach ($values as $value) {
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(ListCanceledPeer::APP_UID, $vals[0], Criteria::IN);
$criteria->add(ListCanceledPeer::DEL_INDEX, $vals[1], Criteria::IN);
} }
// Set the correct dbName // Set the correct dbName
@@ -600,51 +618,23 @@ abstract class BaseListCanceledPeer
} }
/** /**
* Retrieve a single object by pkey. * Retrieve object using using composite pkey values.
* * @param string $app_uid
* @param mixed $pk the primary key. * @param int $del_index
* @param Connection $con the connection to use * @param Connection $con
* @return ListCanceled * @return ListCanceled
*/ */
public static function retrieveByPK($pk, $con = null) public static function retrieveByPK($app_uid, $del_index, $con = null)
{ {
if ($con === null) { if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME); $con = Propel::getConnection(self::DATABASE_NAME);
} }
$criteria = new Criteria();
$criteria = new Criteria(ListCanceledPeer::DATABASE_NAME); $criteria->add(ListCanceledPeer::APP_UID, $app_uid);
$criteria->add(ListCanceledPeer::DEL_INDEX, $del_index);
$criteria->add(ListCanceledPeer::APP_UID, $pk);
$v = ListCanceledPeer::doSelect($criteria, $con); $v = ListCanceledPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null; return !empty($v) ? $v[0] : null;
}
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(ListCanceledPeer::APP_UID, $pks, Criteria::IN);
$objs = ListCanceledPeer::doSelect($criteria, $con);
}
return $objs;
} }
} }

View File

@@ -4624,6 +4624,7 @@
<parameter name="Comment" value="Canceled list"/> <parameter name="Comment" value="Canceled list"/>
</vendor> </vendor>
<column name="APP_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/> <column name="APP_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
<column name="DEL_INDEX" type="INTEGER" required="true" primaryKey="true" default="0"/>
<column name="USR_UID" type="VARCHAR" size="32" required="true" default=""/> <column name="USR_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="TAS_UID" type="VARCHAR" size="32" required="true" default=""/> <column name="TAS_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="PRO_UID" type="VARCHAR" size="32" required="true" default=""/> <column name="PRO_UID" type="VARCHAR" size="32" required="true" default=""/>
@@ -4632,7 +4633,6 @@
<column name="APP_PRO_TITLE" type="LONGVARCHAR" required="false"/> <column name="APP_PRO_TITLE" type="LONGVARCHAR" required="false"/>
<column name="APP_TAS_TITLE" type="LONGVARCHAR" required="false"/> <column name="APP_TAS_TITLE" type="LONGVARCHAR" required="false"/>
<column name="APP_CANCELED_DATE" type="TIMESTAMP" required="false"/> <column name="APP_CANCELED_DATE" type="TIMESTAMP" required="false"/>
<column name="DEL_INDEX" type="INTEGER" required="true" default="0"/>
<column name="DEL_PREVIOUS_USR_UID" type="VARCHAR" size="32" default=""/> <column name="DEL_PREVIOUS_USR_UID" type="VARCHAR" size="32" default=""/>
<column name="DEL_CURRENT_USR_USERNAME" type="VARCHAR" size="100" default=""/> <column name="DEL_CURRENT_USR_USERNAME" type="VARCHAR" size="100" default=""/>
<column name="DEL_CURRENT_USR_FIRSTNAME" type="VARCHAR" size="50" default=""/> <column name="DEL_CURRENT_USR_FIRSTNAME" type="VARCHAR" size="50" default=""/>

View File

@@ -2569,6 +2569,7 @@ DROP TABLE IF EXISTS `LIST_CANCELED`;
CREATE TABLE `LIST_CANCELED` CREATE TABLE `LIST_CANCELED`
( (
`APP_UID` VARCHAR(32) default '' NOT NULL, `APP_UID` VARCHAR(32) default '' NOT NULL,
`DEL_INDEX` INTEGER default 0 NOT NULL,
`USR_UID` VARCHAR(32) default '' NOT NULL, `USR_UID` VARCHAR(32) default '' NOT NULL,
`TAS_UID` VARCHAR(32) default '' NOT NULL, `TAS_UID` VARCHAR(32) default '' NOT NULL,
`PRO_UID` VARCHAR(32) default '' NOT NULL, `PRO_UID` VARCHAR(32) default '' NOT NULL,
@@ -2577,7 +2578,6 @@ CREATE TABLE `LIST_CANCELED`
`APP_PRO_TITLE` MEDIUMTEXT, `APP_PRO_TITLE` MEDIUMTEXT,
`APP_TAS_TITLE` MEDIUMTEXT, `APP_TAS_TITLE` MEDIUMTEXT,
`APP_CANCELED_DATE` DATETIME, `APP_CANCELED_DATE` DATETIME,
`DEL_INDEX` INTEGER default 0 NOT NULL,
`DEL_PREVIOUS_USR_UID` VARCHAR(32) default '', `DEL_PREVIOUS_USR_UID` VARCHAR(32) default '',
`DEL_CURRENT_USR_USERNAME` VARCHAR(100) default '', `DEL_CURRENT_USR_USERNAME` VARCHAR(100) default '',
`DEL_CURRENT_USR_FIRSTNAME` VARCHAR(50) default '', `DEL_CURRENT_USR_FIRSTNAME` VARCHAR(50) default '',
@@ -2589,7 +2589,7 @@ CREATE TABLE `LIST_CANCELED`
`PRO_ID` INTEGER default 0, `PRO_ID` INTEGER default 0,
`USR_ID` INTEGER default 0, `USR_ID` INTEGER default 0,
`TAS_ID` INTEGER default 0, `TAS_ID` INTEGER default 0,
PRIMARY KEY (`APP_UID`), PRIMARY KEY (`APP_UID`,`DEL_INDEX`),
KEY `INDEX_PRO_ID`(`PRO_ID`), KEY `INDEX_PRO_ID`(`PRO_ID`),
KEY `INDEX_USR_ID`(`USR_ID`), KEY `INDEX_USR_ID`(`USR_ID`),
KEY `INDEX_TAS_ID`(`TAS_ID`), KEY `INDEX_TAS_ID`(`TAS_ID`),