BUG 10852 Control de los reenvíos de la notificaciones a través del historial de mensajes 'Messages History' SOLVED
- Revised target/origin task and PMFSendMessage function for object permissions.
This commit is contained in:
@@ -5090,7 +5090,7 @@ class Cases
|
||||
"INPUT" => Array(),
|
||||
"OUTPUT" => Array(),
|
||||
"CASES_NOTES" => 0,
|
||||
"MSGS_HISTORY" => ""
|
||||
"MSGS_HISTORY" => Array()
|
||||
);
|
||||
|
||||
//permissions per user
|
||||
@@ -5349,7 +5349,34 @@ class Cases
|
||||
$RESULT['CASES_NOTES'] = 1;
|
||||
break;
|
||||
case 'MSGS_HISTORY':
|
||||
$RESULT['MSGS_HISTORY'] = $ACTION;
|
||||
// Permission
|
||||
$RESULT['MSGS_HISTORY'] = array('PERMISSION' => $ACTION);
|
||||
$delIndex = array();
|
||||
if ($TASK_SOURCE != "" && (int)$TASK_SOURCE != 0) {
|
||||
$oCriteria = new Criteria('workflow');
|
||||
|
||||
$oCriteria->add(AppDelegationPeer::APP_UID, $APP_UID);
|
||||
$oCriteria->add(AppDelegationPeer::PRO_UID, $PRO_UID);
|
||||
if ($aCase['APP_STATUS'] != 'COMPLETED') {
|
||||
if ($TASK_SOURCE != '' && $TASK_SOURCE != "0" && $TASK_SOURCE != 0) {
|
||||
$oCriteria->add(AppDelegationPeer::TAS_UID, $TASK_SOURCE);
|
||||
}
|
||||
}
|
||||
$oCriteria->add(AppDelegationPeer::USR_UID, $USER);
|
||||
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if ($TASK_SOURCE == $aRow['TAS_UID']) {
|
||||
$delIndex[] = $aRow['DEL_INDEX'];
|
||||
}
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
$RESULT['MSGS_HISTORY'] = array_merge(array('DEL_INDEX' => $delIndex), $RESULT['MSGS_HISTORY']);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -56,23 +56,30 @@ if ($actionAjax == 'messageHistoryGridList_JXP') {
|
||||
$respBlock = $oCase->getAllObjectsFrom( $proUid, $appUid, $tasUid, $usrUid, 'BLOCK' );
|
||||
$respResend = $oCase->getAllObjectsFrom( $proUid, $appUid, $tasUid, $usrUid, 'RESEND' );
|
||||
|
||||
if ($respView['MSGS_HISTORY'] != "" ) {
|
||||
$respMess = $respView['MSGS_HISTORY'];
|
||||
$delIndex = array();
|
||||
$respMess = "";
|
||||
if (count($respView['MSGS_HISTORY'])>0) {
|
||||
$respMess = $respView['MSGS_HISTORY']['PERMISSION'];
|
||||
$delIndex = $respView['MSGS_HISTORY']['DEL_INDEX'];
|
||||
} else {
|
||||
if ( $respBlock['MSGS_HISTORY'] != "" ) {
|
||||
$respMess = $respBlock['MSGS_HISTORY'];
|
||||
if (count($respBlock['MSGS_HISTORY'])>0) {
|
||||
$respMess = $respBlock['MSGS_HISTORY']['PERMISSION'];
|
||||
$delIndex = $respView['MSGS_HISTORY']['DEL_INDEX'];
|
||||
} else {
|
||||
if ($respResend['MSGS_HISTORY'] != "") {
|
||||
$respMess = $respResend['MSGS_HISTORY'];
|
||||
} else {
|
||||
$respMess = "";
|
||||
if (count($respResend['MSGS_HISTORY'])>0) {
|
||||
$respMess = $respResend['MSGS_HISTORY']['PERMISSION'];
|
||||
$delIndex = $respView['MSGS_HISTORY']['DEL_INDEX'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($appMessageArray as $index => $value) {
|
||||
if ($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1 && $respMess != 'BLOCK' ) {
|
||||
if (($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1 && $respMess != 'BLOCK' ) &&
|
||||
($appMessageArray[$index]['DEL_INDEX'] == 0 || in_array($appMessageArray[$index]['DEL_INDEX'], $delIndex ))) {
|
||||
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
|
||||
if ($respMess == 'BLOCK' || $respMess == '') {
|
||||
$appMessageArray[$index]['APP_MSG_BODY'] = "";
|
||||
}
|
||||
$aProcesses[] = array_merge($appMessageArray[$index], array('MSGS_HISTORY' => $respMess));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user