PM-1585
Audit Log para todas las opciones del menu contextual del PROCESO
This commit is contained in:
@@ -28,15 +28,9 @@ if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
|
||||
die();
|
||||
}
|
||||
|
||||
$k = new Criteria('workflow');
|
||||
$k->clearSelectColumns();
|
||||
$k->addSelectColumn(EventPeer::PRO_UID);
|
||||
$k->add(EventPeer::EVN_UID, $_POST['EVN_UID'] );
|
||||
$rs = EventPeer::doSelectRS($k);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$proUid = $row['PRO_UID'];
|
||||
$eventInstance = new Event();
|
||||
$eventFields = $eventInstance->load($_POST['EVN_UID']);
|
||||
$proUid = $eventFields['PRO_UID'];
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($proUid);
|
||||
|
||||
@@ -59,9 +59,9 @@ if ($_POST['form']['EVN_UID'] == '') {
|
||||
*/
|
||||
$oEvent->update( $_POST['form'] );
|
||||
}
|
||||
$infoProcess = new Processes();
|
||||
$proFields = $infoProcess->serializeProcess($_POST['form']['PRO_UID']);
|
||||
$resultProcess = $infoProcess->saveSerializedProcess($proFields);
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['form']['PRO_UID']);
|
||||
G::auditLog('Events','Save intermediate message ('.$_POST['form']['EVN_UID'].') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
function replaceQuotes ($aData)
|
||||
|
||||
@@ -36,17 +36,11 @@ if ($_POST['form']['TRI_UID'] != '') {
|
||||
|
||||
$oTrigger->update( $_POST['form'] );
|
||||
|
||||
$k = new Criteria('workflow');
|
||||
$k->clearSelectColumns();
|
||||
$k->addSelectColumn(TriggersPeer::PRO_UID);
|
||||
$k->add(TriggersPeer::TRI_UID, $_POST['form']['TRI_UID'] );
|
||||
$rs = TriggersPeer::doSelectRS($k);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$proUid = $row['PRO_UID'];
|
||||
$triggerFields = $oTrigger->load($_POST['form']['TRI_UID']);
|
||||
$proUid = $triggerFields['PRO_UID'];
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($proUid);
|
||||
|
||||
G::auditLog('Events','Save event ('.$_POST['form']['TRI_UID'].') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
|
||||
@@ -91,11 +91,13 @@ try {
|
||||
$c = new Criteria('workflow');
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn(ProcessUserPeer::PRO_UID);
|
||||
$c->addSelectColumn(ProcessUserPeer::USR_UID);
|
||||
$c->add(ProcessUserPeer::PU_UID, $oData->PU_UID);
|
||||
$oDataset = AppDelegationPeer::doSelectRS($c);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$row = $oDataset->getRow();
|
||||
$userSupervisor = $row['USR_UID'];
|
||||
|
||||
G::LoadClass('processes');
|
||||
$infoProcess = new Processes();
|
||||
@@ -123,6 +125,7 @@ try {
|
||||
$resultProcess = $infoProcess->updateProcessRow($valuesProcess);
|
||||
$resultProcess = $infoProcess->getProcessRow($proUid);
|
||||
}
|
||||
|
||||
//G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new processMap(new DBConnection());
|
||||
|
||||
@@ -192,7 +195,7 @@ try {
|
||||
G::LoadClass('processMap');
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->listProcessesUser($oData->PRO_UID);
|
||||
G::auditLog('AssignRole','Assign new supervisor in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
G::auditLog('AssignRole','Assign new supervisor ('.$oData->USR_UID.') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'removeProcessUser':
|
||||
$oProcessMap->removeProcessUser($oData->PU_UID);
|
||||
@@ -203,7 +206,7 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
G::auditLog('RemoveUser','Remove supervisor in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
G::auditLog('RemoveUser','Remove supervisor ('.$userSupervisor.') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'supervisorDynaforms':
|
||||
$oProcessMap->supervisorDynaforms($oData->pro_uid);
|
||||
@@ -267,7 +270,9 @@ try {
|
||||
break;
|
||||
case 'addGuide':
|
||||
$sOutput = $oProcessMap->addGuide($oData->uid, $oData->position, $oData->direction);
|
||||
G::auditLog('Add'.ucwords($oDataAux['direction']).'Line','Add '.$oDataAux['direction'].' line in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
$sOutputAux = G::json_decode($sOutput);
|
||||
$sOutputAux = (array)$sOutputAux;
|
||||
G::auditLog('Add'.ucwords($oDataAux['direction']).'Line','Add '.$oDataAux['direction'].' line ('.$sOutputAux['uid'].') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'saveGuidePosition':
|
||||
$sOutput = $oProcessMap->saveGuidePosition($oData->uid, $oData->position, $oData->direction);
|
||||
@@ -275,7 +280,7 @@ try {
|
||||
break;
|
||||
case 'deleteGuide':
|
||||
$sOutput = $oProcessMap->deleteGuide($oData->uid);
|
||||
G::auditLog('DeleteLine','Delete line in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
G::auditLog('DeleteLine','Delete line ('.$oData->uid.') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'deleteGuides':
|
||||
$sOutput = $oProcessMap->deleteGuides($oData->pro_uid);
|
||||
@@ -283,19 +288,21 @@ try {
|
||||
break;
|
||||
case 'addText':
|
||||
$sOutput = $oProcessMap->addText($oData->uid, $oData->label, $oData->position->x, $oData->position->y);
|
||||
G::auditLog('AddText','Add new text ('.$oDataAux['label'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
$sOutputAux = G::json_decode($sOutput);
|
||||
$sOutputAux = (array)$sOutputAux;
|
||||
G::auditLog('AddText','Add new text ('.$sOutputAux['uid'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'updateText':
|
||||
$sOutput = $oProcessMap->updateText($oData->uid, $oData->label);
|
||||
G::auditLog('UpdateText','Edit text ('.$oDataAux['label'].' ) in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
G::auditLog('UpdateText','Edit text ('.$oData->uid.' ) in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'saveTextPosition':
|
||||
$sOutput = $oProcessMap->saveTextPosition($oData->uid, $oData->position->x, $oData->position->y);
|
||||
G::auditLog('SaveTextPosition','Change text position in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
G::auditLog('SaveTextPosition','Change text position ('.$oData->uid.' ) in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'deleteText':
|
||||
$sOutput = $oProcessMap->deleteText($oData->uid);
|
||||
G::auditLog('DeleteText','Delete text in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
G::auditLog('DeleteText','Delete text ('.$oData->uid.' ) in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'dynaforms':
|
||||
$oProcessMap->dynaformsList($oData->pro_uid);
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
//G::LoadThirdParty( 'pear/json', 'class.json' );
|
||||
|
||||
$function = isset( $_POST['function'] ) ? $_POST['function'] : '';
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcessOld = $infoProcess->load($_POST['form']['PRO_UID']);
|
||||
switch ($function) {
|
||||
case 'lookForNameProcess':
|
||||
require_once 'classes/model/Content.php';
|
||||
@@ -92,4 +93,53 @@ switch ($function) {
|
||||
break;
|
||||
|
||||
}
|
||||
G::auditLog('EditProcess','Edit Process "'.$_POST['form']['PRO_TITLE'].'"');
|
||||
$resultProcessNew = $infoProcess->load($_POST['form']['PRO_UID']);
|
||||
$oldFields = array_diff_assoc($resultProcessOld,$resultProcessNew);
|
||||
$newFields = array_diff_assoc($resultProcessNew,$resultProcessOld);
|
||||
|
||||
if(array_key_exists('PRO_TITLE', $newFields)) {
|
||||
$fields[] = G::LoadTranslation('ID_TITLE');
|
||||
}
|
||||
if(array_key_exists('PRO_DESCRIPTION', $newFields)) {
|
||||
$fields[] = G::LoadTranslation('ID_DESCRIPTION');
|
||||
}
|
||||
if(array_key_exists('PRO_CALENDAR', $newFields)) {
|
||||
$fields[] = G::LoadTranslation('ID_CALENDAR');
|
||||
}
|
||||
if(array_key_exists('PRO_CATEGORY', $newFields)) {
|
||||
$fields[] = "Process Category";
|
||||
}
|
||||
if(array_key_exists('PRO_SUMMARY_DYNAFORM', $newFields)) {
|
||||
$fields[] = "Dynaform to show a case summary";
|
||||
}
|
||||
if(array_key_exists('PRO_DERIVATION_SCREEN_TPL', $newFields)) {
|
||||
$fields[] = "Routing Screen Template";
|
||||
}
|
||||
if(array_key_exists('PRO_DEBUG', $newFields)) {
|
||||
$fields[] = G::LoadTranslation('ID_PRO_DEBUG');
|
||||
}
|
||||
if(array_key_exists('PRO_SHOW_MESSAGE', $newFields)) {
|
||||
$fields[] = "Hide the case number and the case title in the steps";
|
||||
}
|
||||
if(array_key_exists('PRO_SUBPROCESS', $newFields)) {
|
||||
$fields[] = "This a sub process";
|
||||
}
|
||||
if(array_key_exists('PRO_TRI_DELETED', $newFields)) {
|
||||
$fields[] = "Execute a trigger when a case is deleted";
|
||||
}
|
||||
if(array_key_exists('PRO_TRI_CANCELED', $newFields)) {
|
||||
$fields[] = "Execute a trigger when a case is canceled";
|
||||
}
|
||||
if(array_key_exists('PRO_TRI_PAUSED', $newFields)) {
|
||||
$fields[] = "Execute a trigger when a case is paused";
|
||||
}
|
||||
if(array_key_exists('PRO_TRI_REASSIGNED', $newFields)) {
|
||||
$fields[] = "Execute a trigger when a case is reassigned"; G
|
||||
}
|
||||
if(array_key_exists('PRO_TRI_UNPAUSED', $newFields)) {
|
||||
$fields[] = "Execute a trigger when a case is unpaused";
|
||||
}
|
||||
if(array_key_exists('PRO_TYPE_PROCESS', $newFields)) {
|
||||
$fields[] = "Type of process (only owners can edit private processes)";
|
||||
}
|
||||
G::auditLog('EditProcess','Edit fields ('.implode(', ',$fields).') in process "'.$_POST['form']['PRO_TITLE'].'"');
|
||||
@@ -79,4 +79,5 @@ $oProcessMap->getObjectsPermissionsCriteria( $sValue['PRO_UID'] );
|
||||
|
||||
$infoProcess = new Processes();
|
||||
$resultProcess = $infoProcess->getProcessRow($sValue['PRO_UID']);
|
||||
G::auditLog('ProcessPermissions','Add Permission "'.$sValue['OP_OBJ_TYPE'].'" in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
$participation = $sValue['OP_PARTICIPATE'] == 1 ? "YES" : "NO";
|
||||
G::auditLog('ProcessPermissions','Add Permission (group or user: '.end(explode( '|', $sValue['GROUP_USER'] )).', permission: '.$sValue['OP_ACTION'].', status case: '.$sValue['OP_CASE_STATUS'].', type: '.$sValue['OP_OBJ_TYPE'].', participation required: '.$participation.') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
Reference in New Issue
Block a user