Merged in mcuiza/processmaker/PM_1506 (pull request #1421)

PM-1506  (Casos duplicados)
This commit is contained in:
Julio Cesar Laura Avendaño
2015-02-11 09:53:51 -04:00
2 changed files with 32 additions and 0 deletions

View File

@@ -576,5 +576,30 @@ class AppDelegation extends BaseAppDelegation
$data = $oRuleSet->getRow();
return $data['TAS_UID'];
}
/**
* Verify if the current case is already routed.
*
* @param string $AppUid the uid of the application
* @return array $Fields the fields
*/
public function alreadyRouted ($appUid, $sDelIndex)
{
$c = new Criteria("workflow");
$c->clearSelectColumns();
$c->addSelectColumn(AppDelegationPeer::APP_UID);
$c->add(AppDelegationPeer::APP_UID, $appUid);
$c->add(AppDelegationPeer::DEL_INDEX, $sDelIndex);
$c->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNOTNULL);
$result = AppDelegationPeer::doSelectRS($c);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if($result->next()) {
return true;
} else {
return false;
}
}
}

View File

@@ -1,4 +1,11 @@
<?php
require_once 'classes/model/AppDelegation.php';
$delegation = new AppDelegation();
if( $delegation->alreadyRouted($_SESSION['APPLICATION'],$_SESSION['INDEX']) ) {
G::header('location: ../cases/casesListExtJs');
die();
}
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">