HOR-1568
validation Action button
This commit is contained in:
@@ -2878,10 +2878,6 @@ class wsBase
|
|||||||
*/
|
*/
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$aConditions = array ();
|
$aConditions = array ();
|
||||||
// $aConditions[] = array(AppDelegationPeer::USR_UID, TaskUserPeer::USR_UID);
|
|
||||||
// $aConditions[] = array(AppDelegationPeer::TAS_UID, TaskUserPeer::TAS_UID);
|
|
||||||
// $oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
|
|
||||||
//$oCriteria->addJoin(AppDelegationPeer::USR_UID, TaskUserPeer::USR_UID, Criteria::LEFT_JOIN);
|
|
||||||
$oCriteria->add( AppDelegationPeer::APP_UID, $caseId );
|
$oCriteria->add( AppDelegationPeer::APP_UID, $caseId );
|
||||||
$oCriteria->add( AppDelegationPeer::USR_UID, $userIdSource );
|
$oCriteria->add( AppDelegationPeer::USR_UID, $userIdSource );
|
||||||
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $delIndex );
|
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $delIndex );
|
||||||
|
|||||||
@@ -738,6 +738,20 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
return $data['TAS_UID'];
|
return $data['TAS_UID'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCurrentUsers($appUid, $index)
|
||||||
|
{
|
||||||
|
$oCriteria = new Criteria();
|
||||||
|
$oCriteria->addSelectColumn( AppDelegationPeer::USR_UID );
|
||||||
|
$oCriteria->add( AppDelegationPeer::APP_UID, $appUid );
|
||||||
|
$oCriteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
|
||||||
|
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $index );
|
||||||
|
$oRuleSet = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||||
|
$oRuleSet->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
$oRuleSet->next();
|
||||||
|
$data = $oRuleSet->getRow();
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify if the current case is already routed.
|
* Verify if the current case is already routed.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -194,8 +194,10 @@ class Ajax
|
|||||||
$options[] = Array('text' => G::LoadTranslation('ID_DELETE'), 'fn' => 'deleteCase');
|
$options[] = Array('text' => G::LoadTranslation('ID_DELETE'), 'fn' => 'deleteCase');
|
||||||
|
|
||||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
||||||
|
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
||||||
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
|
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'TO_DO':
|
case 'TO_DO':
|
||||||
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
||||||
@@ -211,8 +213,10 @@ class Ajax
|
|||||||
$options[] = Array('text' => G::LoadTranslation('ID_UNPAUSE'), 'fn' => 'unpauseCase');
|
$options[] = Array('text' => G::LoadTranslation('ID_UNPAUSE'), 'fn' => 'unpauseCase');
|
||||||
}
|
}
|
||||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1 || $RBAC->userCanAccess('PM_SUPERVISOR') == 1) {
|
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1 || $RBAC->userCanAccess('PM_SUPERVISOR') == 1) {
|
||||||
|
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
||||||
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
|
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'CANCELLED':
|
case 'CANCELLED':
|
||||||
$options[] = Array('text' => G::LoadTranslation('ID_REACTIVATE'), 'fn' => 'reactivateCase');
|
$options[] = Array('text' => G::LoadTranslation('ID_REACTIVATE'), 'fn' => 'reactivateCase');
|
||||||
@@ -597,10 +601,31 @@ class Ajax
|
|||||||
$user = new Users();
|
$user = new Users();
|
||||||
$app = new Application();
|
$app = new Application();
|
||||||
$result = new stdclass();
|
$result = new stdclass();
|
||||||
|
$oAppDel = new AppDelegation();
|
||||||
|
|
||||||
$TO_USR_UID = $_POST['USR_UID'];
|
$TO_USR_UID = $_POST['USR_UID'];
|
||||||
try {
|
try {
|
||||||
|
//Current users of OPEN DEL_INDEX thread
|
||||||
|
if(isset($_SESSION['APPLICATION']) && isset($_SESSION['INDEX'])){
|
||||||
|
$aCurUser = $oAppDel->getCurrentUsers($_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
||||||
|
}
|
||||||
|
$flagReassign = true;
|
||||||
|
if(!empty($aCurUser)){
|
||||||
|
foreach ($aCurUser as $key => $value) {
|
||||||
|
if($value === $TO_USR_UID){
|
||||||
|
$flagReassign = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//DEL_INDEX is CLOSED
|
||||||
|
throw new Exception(G::LoadTranslation('ID_REASSIGNMENT_ERROR'));
|
||||||
|
}
|
||||||
|
|
||||||
|
//If the currentUser is diferent to nextUser, create the thread
|
||||||
|
if($flagReassign){
|
||||||
$cases->reassignCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $TO_USR_UID);
|
$cases->reassignCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $TO_USR_UID);
|
||||||
|
}
|
||||||
|
|
||||||
$caseData = $app->load($_SESSION['APPLICATION']);
|
$caseData = $app->load($_SESSION['APPLICATION']);
|
||||||
$userData = $user->load($TO_USR_UID);
|
$userData = $user->load($TO_USR_UID);
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,7 @@ foreach ($items as $item) {
|
|||||||
$dataUids = explode( "|", $item );
|
$dataUids = explode( "|", $item );
|
||||||
$appSelectedUids[] = $dataUids[0];
|
$appSelectedUids[] = $dataUids[0];
|
||||||
}
|
}
|
||||||
// var_dump($aData);
|
|
||||||
//var_dump($appSelectedUids);
|
|
||||||
$casesReassignedCount = 0;
|
$casesReassignedCount = 0;
|
||||||
$serverResponse = array ();
|
$serverResponse = array ();
|
||||||
G::LoadClass( 'case' );
|
G::LoadClass( 'case' );
|
||||||
@@ -37,6 +36,7 @@ $oCases = new Cases();
|
|||||||
require_once ('classes/model/Task.php');
|
require_once ('classes/model/Task.php');
|
||||||
require_once ('classes/model/AppCacheView.php');
|
require_once ('classes/model/AppCacheView.php');
|
||||||
$oAppCacheView = new AppCacheView();
|
$oAppCacheView = new AppCacheView();
|
||||||
|
$oAppDel = new AppDelegation();
|
||||||
$oCasesReassignList = $oAppCacheView->getToReassignListCriteria(null);
|
$oCasesReassignList = $oAppCacheView->getToReassignListCriteria(null);
|
||||||
if (isset( $_POST['selected'] ) && $_POST['selected'] == 'true') {
|
if (isset( $_POST['selected'] ) && $_POST['selected'] == 'true') {
|
||||||
$oCasesReassignList->add( AppCacheViewPeer::APP_UID, $appSelectedUids, Criteria::IN );
|
$oCasesReassignList->add( AppCacheViewPeer::APP_UID, $appSelectedUids, Criteria::IN );
|
||||||
@@ -47,9 +47,7 @@ if (empty( $aData )) {
|
|||||||
echo G::json_encode( $serverResponse );
|
echo G::json_encode( $serverResponse );
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
// $params = array ();
|
|
||||||
// $sql = BasePeer::createSelectSql($oCasesReassignList, $params);
|
|
||||||
// var_dump($sql);
|
|
||||||
if (is_array( $aData )) {
|
if (is_array( $aData )) {
|
||||||
$currentCasesReassigned = 0;
|
$currentCasesReassigned = 0;
|
||||||
require_once ("classes/model/AppNotes.php");
|
require_once ("classes/model/AppNotes.php");
|
||||||
@@ -61,8 +59,26 @@ if (is_array( $aData )) {
|
|||||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$rs->next();
|
$rs->next();
|
||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
//$aCase = $oCases->loadCaseInCurrentDelegation( $data->APP_UID );
|
|
||||||
|
//Current users of OPEN DEL_INDEX thread
|
||||||
|
$aCurUser = $oAppDel->getCurrentUsers($row['APP_UID'], $row['DEL_INDEX']);
|
||||||
|
$flagReassign = true;
|
||||||
|
if(!empty($aCurUser)){
|
||||||
|
foreach ($aCurUser as $key => $value) {
|
||||||
|
if($value === $data->APP_REASSIGN_USER_UID){
|
||||||
|
$flagReassign = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//DEL_INDEX is CLOSED
|
||||||
|
throw new Exception(G::LoadTranslation('ID_REASSIGNMENT_ERROR'));
|
||||||
|
}
|
||||||
|
|
||||||
|
//If the currentUser is diferent to nextUser, create the thread
|
||||||
|
if($flagReassign){
|
||||||
$oCases->reassignCase( $row['APP_UID'], $row['DEL_INDEX'], ($row['USR_UID'] != '' ? $row['USR_UID'] : $_SESSION['USER_LOGGED']), $data->APP_REASSIGN_USER_UID );
|
$oCases->reassignCase( $row['APP_UID'], $row['DEL_INDEX'], ($row['USR_UID'] != '' ? $row['USR_UID'] : $_SESSION['USER_LOGGED']), $data->APP_REASSIGN_USER_UID );
|
||||||
|
}
|
||||||
|
|
||||||
$currentCasesReassigned ++;
|
$currentCasesReassigned ++;
|
||||||
$casesReassignedCount ++;
|
$casesReassignedCount ++;
|
||||||
$serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER,'APP_TITLE' => $data->APP_TITLE,'TAS_TITLE' => $data->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
|
$serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER,'APP_TITLE' => $data->APP_TITLE,'TAS_TITLE' => $data->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
|
||||||
@@ -86,11 +102,28 @@ if (is_array( $aData )) {
|
|||||||
while (is_array( $row )) {
|
while (is_array( $row )) {
|
||||||
$APP_UID = $row['APP_UID'];
|
$APP_UID = $row['APP_UID'];
|
||||||
$aCase = $oCases->loadCaseInCurrentDelegation( $APP_UID );
|
$aCase = $oCases->loadCaseInCurrentDelegation( $APP_UID );
|
||||||
|
|
||||||
|
//Current users of OPEN DEL_INDEX thread
|
||||||
|
$aCurUser = $oAppDel->getCurrentUsers($APP_UID, $aCase['DEL_INDEX']);
|
||||||
|
$flagReassign = true;
|
||||||
|
if(!empty($aCurUser)){
|
||||||
|
foreach ($aCurUser as $key => $value) {
|
||||||
|
if($value === $aData->APP_REASSIGN_USER_UID){
|
||||||
|
$flagReassign = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//DEL_INDEX is CLOSED
|
||||||
|
throw new Exception(G::LoadTranslation('ID_REASSIGNMENT_ERROR'));
|
||||||
|
}
|
||||||
|
|
||||||
|
//If the currentUser is diferent to nextUser, create the thread
|
||||||
|
if($flagReassign){
|
||||||
$oCases->reassignCase( $aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $aData->APP_REASSIGN_USER_UID );
|
$oCases->reassignCase( $aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $aData->APP_REASSIGN_USER_UID );
|
||||||
|
}
|
||||||
|
|
||||||
$currentCasesReassigned ++;
|
$currentCasesReassigned ++;
|
||||||
$casesReassignedCount ++;
|
$casesReassignedCount ++;
|
||||||
// var_dump($aCase);
|
|
||||||
// echo ("<br>");
|
|
||||||
$rs->next();
|
$rs->next();
|
||||||
$row = $rs->getRow();
|
$row = $rs->getRow();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user