Merged colosa/processmaker into master
This commit is contained in:
@@ -142,6 +142,7 @@ class Derivation
|
||||
|
||||
$arrayNextTask = array();
|
||||
$arrayNextTaskDefault = array();
|
||||
$i = 0;
|
||||
|
||||
//SELECT *
|
||||
//FROM APP_DELEGATION AS A
|
||||
@@ -210,17 +211,18 @@ class Derivation
|
||||
}
|
||||
|
||||
if ($flagContinue) {
|
||||
$arrayNextTask[] = $this->prepareInformationTask($arrayRouteData);
|
||||
$arrayNextTask[++$i] = $this->prepareInformationTask($arrayRouteData);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($arrayNextTask) == 0 && count($arrayNextTaskDefault) > 0) {
|
||||
$arrayNextTask[] = $this->prepareInformationTask($arrayNextTaskDefault);
|
||||
$arrayNextTask[++$i] = $this->prepareInformationTask($arrayNextTaskDefault);
|
||||
}
|
||||
|
||||
//Check Task GATEWAYTOGATEWAY
|
||||
$arrayNextTaskBk = $arrayNextTask;
|
||||
$arrayNextTask = array();
|
||||
$i = 0;
|
||||
|
||||
foreach ($arrayNextTaskBk as $value) {
|
||||
$arrayNextTaskData = $value;
|
||||
@@ -229,10 +231,10 @@ class Derivation
|
||||
$arrayAux = $this->prepareInformation($arrayData, $arrayNextTaskData["NEXT_TASK"]["TAS_UID"]);
|
||||
|
||||
foreach ($arrayAux as $value2) {
|
||||
$arrayNextTask[] = $value2;
|
||||
$arrayNextTask[++$i] = $value2;
|
||||
}
|
||||
} else {
|
||||
$arrayNextTask[] = $arrayNextTaskData;
|
||||
$arrayNextTask[++$i] = $arrayNextTaskData;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,28 @@ class CaseScheduler extends BaseCaseScheduler
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
|
||||
//Add Audit Log
|
||||
switch ($aData['SCH_OPTION']) {
|
||||
case '1':
|
||||
$perform = 'Daily';
|
||||
break;
|
||||
case '2':
|
||||
$perform = 'Weekly';
|
||||
break;
|
||||
case '3':
|
||||
$perform = 'Monthly';
|
||||
break;
|
||||
case '4':
|
||||
$perform = 'One time only';
|
||||
break;
|
||||
case '5':
|
||||
$perform = 'Every';
|
||||
break;
|
||||
|
||||
}
|
||||
G::auditLog("CreateCaseScheduler", "Scheduler Name: ".$aData['SCH_NAME'].", Task: ".$aData['TAS_UID'].", Perform this task: ".$perform.", Start Date: ".$aData['SCH_START_DATE'].", End Date: ".$aData['SCH_END_DATE'].", Execution time : ".$aData['SCH_START_TIME']);
|
||||
|
||||
return $result;
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
@@ -70,6 +92,27 @@ class CaseScheduler extends BaseCaseScheduler
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
|
||||
//Add Audit Log
|
||||
switch ($fields['SCH_OPTION']){
|
||||
case '1':
|
||||
$perform = 'Daily';
|
||||
break;
|
||||
case '2':
|
||||
$perform = 'Weekly';
|
||||
break;
|
||||
case '3':
|
||||
$perform = 'Monthly';
|
||||
break;
|
||||
case '4':
|
||||
$perform = 'One time only';
|
||||
break;
|
||||
case '5':
|
||||
$perform = 'Every';
|
||||
break;
|
||||
}
|
||||
G::auditLog("UpdateCaseScheduler", "Scheduler Name: ".$fields['SCH_NAME'].", Task: ".$fields['TAS_UID'].", Perform this task: ".$perform.", Start Date: ".$fields['SCH_START_DATE'].", End Date: ".$fields['SCH_END_DATE'].", Execution time : ".$fields['SCH_START_TIME']);
|
||||
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
@@ -87,8 +130,12 @@ class CaseScheduler extends BaseCaseScheduler
|
||||
try {
|
||||
$oCaseScheduler = CaseSchedulerPeer::retrieveByPK( $SchUid );
|
||||
if (! is_null( $oCaseScheduler )) {
|
||||
$fields = $this->Load( $SchUid );
|
||||
$iResult = $oCaseScheduler->delete();
|
||||
$con->commit();
|
||||
//Add Audit Log
|
||||
G::auditLog("DeleteCaseScheduler", "Scheduler Name: ".$fields['SCH_NAME'].", Task: ".$fields['TAS_UID']);
|
||||
|
||||
return $iResult;
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
|
||||
@@ -141,6 +141,9 @@ class DbSource extends BaseDbSource
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
//Add Audit Log
|
||||
G::auditLog("UpdateDatabaseConnection", "Connection Uid: ".$fields['DBS_UID'].", Connection Engine: ".$fields['DBS_TYPE'].", Connection Encode: ".$fields['DBS_ENCODE'].", Connection Server: ".$fields['DBS_SERVER'].", Connection Database: ".$fields['DBS_DATABASE_NAME'].", Connection Port: ".$fields['DBS_PORT']);
|
||||
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
@@ -156,6 +159,7 @@ class DbSource extends BaseDbSource
|
||||
{
|
||||
$con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
|
||||
try {
|
||||
$fields = $this->load($DbsUid, $ProUID);
|
||||
$con->begin();
|
||||
$this->setDbsUid($DbsUid);
|
||||
$this->setProUid($ProUID);
|
||||
@@ -167,6 +171,9 @@ class DbSource extends BaseDbSource
|
||||
}
|
||||
$result = $this->delete();
|
||||
$con->commit();
|
||||
//Add Audit Log
|
||||
G::auditLog("DeleteDatabaseConnection", "Connection Uid: ".$DbsUid.", Connection Engine: ".$fields['DBS_TYPE'].", Connection Database: ".$fields['DBS_DATABASE_NAME']);
|
||||
|
||||
return $result;
|
||||
} catch (exception $e) {
|
||||
$con->rollback();
|
||||
@@ -196,6 +203,9 @@ class DbSource extends BaseDbSource
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
//Add Audit Log
|
||||
G::auditLog("CreateDatabaseConnection", "Connection Uid: ".$aData['DBS_UID'].", Connection Engine: ".$aData['DBS_TYPE'].", Connection Encode: ".$aData['DBS_ENCODE'].", Connection Server: ".$aData['DBS_SERVER'].", Connection Database: ".$aData['DBS_DATABASE_NAME'].", Connection Port: ".$aData['DBS_PORT']);
|
||||
|
||||
return $this->getDbsUid();
|
||||
} catch (exception $e) {
|
||||
$con->rollback();
|
||||
|
||||
@@ -126,6 +126,34 @@ class InputDocument extends BaseInputDocument
|
||||
}
|
||||
$iResult = $oInputDocument->save();
|
||||
$oConnection->commit();
|
||||
//Add Audit Log
|
||||
switch ($aData['INP_DOC_FORM_NEEDED']){
|
||||
case 'VIRTUAL':
|
||||
$docType = 'Digital';
|
||||
break;
|
||||
case 'REAL':
|
||||
$docType = 'Printed';
|
||||
break;
|
||||
case 'VREAL':
|
||||
$docType = 'Digital/Printed';
|
||||
break;
|
||||
}
|
||||
if(isset($aData['INP_DOC_VERSIONING']) && $aData['INP_DOC_VERSIONING'] == 1){
|
||||
$enableVersion = 'Yes';
|
||||
}else{
|
||||
$enableVersion = 'No';
|
||||
}
|
||||
$description = "Input Document Title: ".$aData['INP_DOC_TITLE'].", Input Document Uid: ".$aData['INP_DOC_UID'].", Document Type: ".$docType;
|
||||
if(!empty($aData['INP_DOC_DESCRIPTION'])){
|
||||
$description .= ", Description: ".$aData['INP_DOC_DESCRIPTION'];
|
||||
}
|
||||
if(!empty($aData['INP_DOC_DESTINATION_PATH'])){
|
||||
$description .= ", Destination Path: ".$aData['INP_DOC_DESTINATION_PATH'];
|
||||
}
|
||||
$inputDocMaxFileSize = $aData['INP_DOC_MAX_FILESIZE']? $aData['INP_DOC_MAX_FILESIZE'].' '.$aData['INP_DOC_MAX_FILESIZE_UNIT'] : "256 MB";
|
||||
$description .= ", Extensions: ".$aData['INP_DOC_TYPE_FILE'].", Maximum Input Document file size: ".$inputDocMaxFileSize;
|
||||
G::auditLog("CreateInputDocument", $description);
|
||||
|
||||
return $aData['INP_DOC_UID'];
|
||||
} else {
|
||||
$sMessage = '';
|
||||
@@ -165,6 +193,34 @@ class InputDocument extends BaseInputDocument
|
||||
}
|
||||
$iResult = $oInputDocument->save();
|
||||
$oConnection->commit();
|
||||
//Add Audit Log
|
||||
switch ($aData['INP_DOC_FORM_NEEDED']){
|
||||
case 'VIRTUAL':
|
||||
$docType = 'Digital';
|
||||
break;
|
||||
case 'REAL':
|
||||
$docType = 'Printed';
|
||||
break;
|
||||
case 'VREAL':
|
||||
$docType = 'Digital/Printed';
|
||||
break;
|
||||
}
|
||||
if(isset($aData['INP_DOC_VERSIONING']) && $aData['INP_DOC_VERSIONING'] == 1){
|
||||
$enableVersion = 'Yes';
|
||||
}else{
|
||||
$enableVersion = 'No';
|
||||
}
|
||||
$description = "Input Document Title: ".$aData['INP_DOC_TITLE'].", Input Document Uid: ".$aData['INP_DOC_UID'].", Document Type: ".$docType;
|
||||
if(!empty($aData['INP_DOC_DESCRIPTION'])){
|
||||
$description .= ", Description: ".$aData['INP_DOC_DESCRIPTION'];
|
||||
}
|
||||
if(!empty($aData['INP_DOC_DESTINATION_PATH'])){
|
||||
$description .= ", Destination Path: ".$aData['INP_DOC_DESTINATION_PATH'];
|
||||
}
|
||||
$inputDocMaxFileSize = $aData['INP_DOC_MAX_FILESIZE']? $aData['INP_DOC_MAX_FILESIZE'].' '.$aData['INP_DOC_MAX_FILESIZE_UNIT'] : "256 MB";
|
||||
$description .= ", Extensions: ".$aData['INP_DOC_TYPE_FILE'].", Maximum Input Document file size: ".$inputDocMaxFileSize;
|
||||
G::auditLog("UpdateInputDocument", $description);
|
||||
|
||||
return $iResult;
|
||||
} else {
|
||||
$sMessage = '';
|
||||
@@ -196,11 +252,18 @@ class InputDocument extends BaseInputDocument
|
||||
try {
|
||||
$oInputDocument = InputDocumentPeer::retrieveByPK( $sInpDocUid );
|
||||
if (! is_null( $oInputDocument )) {
|
||||
$nameInput = $this->getInpDocTitle();
|
||||
$descInput = $this->getInpDocDescription();
|
||||
$oConnection->begin();
|
||||
Content::removeContent( 'INP_DOC_TITLE', '', $oInputDocument->getInpDocUid() );
|
||||
Content::removeContent( 'INP_DOC_DESCRIPTION', '', $oInputDocument->getInpDocUid() );
|
||||
$iResult = $oInputDocument->delete();
|
||||
$oConnection->commit();
|
||||
//Add Audit Log
|
||||
$nameInput = $this->getInpDocTitle();
|
||||
$descInput = $this->getInpDocDescription();
|
||||
G::auditLog("DeleteInputDocument", "Input Document Name: ".$nameInput.", Input Document Uid: ".$sInpDocUid.", Description: ".$descInput);
|
||||
|
||||
return $iResult;
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -155,7 +155,7 @@ class Triggers extends BaseTriggers
|
||||
} else {
|
||||
$this->setTriUid($aData['TRI_UID'] );
|
||||
}
|
||||
|
||||
$triggerUid = $this->getTriUid();
|
||||
$this->setProUid($aData['PRO_UID']);
|
||||
$this->setTriType("SCRIPT");
|
||||
|
||||
@@ -183,6 +183,13 @@ class Triggers extends BaseTriggers
|
||||
}
|
||||
$result=$this->save();
|
||||
$con->commit();
|
||||
//Add Audit Log
|
||||
$description = "Trigger Name: ".$aData['TRI_TITLE'].", Trigger Uid: ".$triggerUid;
|
||||
if (isset ( $aData['TRI_DESCRIPTION'] )) {
|
||||
$description .= ", Description: ".$aData['TRI_DESCRIPTION'];
|
||||
}
|
||||
G::auditLog("CreateTrigger", $description);
|
||||
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
@@ -233,10 +240,18 @@ class Triggers extends BaseTriggers
|
||||
$con->begin();
|
||||
$oTri = TriggersPeer::retrieveByPK( $TriUid );
|
||||
if (!is_null($oTri)) {
|
||||
$triggerName = $this->getTriTitle();
|
||||
$triggerDesc = $this->getTriDescription();
|
||||
Content::removeContent( 'TRI_TITLE', '', $this->getTriUid());
|
||||
Content::removeContent( 'TRI_DESCRIPTION', '', $this->getTriUid());
|
||||
$result = $oTri->delete();
|
||||
$con->commit();
|
||||
//Add Audit Log
|
||||
$description = "Trigger Name: ".$triggerName.", Trigger Uid: ".$TriUid;
|
||||
if (isset ( $triggerDesc )) {
|
||||
$description .= ", Description: ".$triggerDesc;
|
||||
}
|
||||
G::auditLog("DeleteTrigger", $description);
|
||||
}
|
||||
return $result;
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -28,8 +28,15 @@ if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1) {
|
||||
die();
|
||||
}
|
||||
|
||||
$eventInstance = new Event();
|
||||
$eventFields = $eventInstance->load($_POST['EVN_UID']);
|
||||
$proUid = $eventFields['PRO_UID'];
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($proUid);
|
||||
G::auditLog('Events','Delete event ('.$_POST['EVN_UID'].') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
$evnUid = $_POST['EVN_UID'];
|
||||
require_once 'classes/model/Event.php';
|
||||
$oEvent = new Event();
|
||||
$oEvent->remove( $evnUid );
|
||||
|
||||
$oEvent->remove( $evnUid );
|
||||
@@ -60,6 +60,10 @@ if ($_POST['form']['EVN_UID'] == '') {
|
||||
$oEvent->update( $_POST['form'] );
|
||||
}
|
||||
|
||||
$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)
|
||||
{
|
||||
for ($i = 0; $i < sizeof( $aData ); $i ++) {
|
||||
|
||||
@@ -36,3 +36,11 @@ if ($_POST['form']['TRI_UID'] != '') {
|
||||
|
||||
$oTrigger->update( $_POST['form'] );
|
||||
|
||||
$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'].'"');
|
||||
|
||||
|
||||
@@ -42,17 +42,93 @@ try {
|
||||
if (isset($_REQUEST['data'])) {
|
||||
if($_REQUEST['action']=="addText"||$_REQUEST['action']=="updateText") {
|
||||
$oData = Bootstrap::json_decode($_REQUEST['data']);
|
||||
$oDataAux = G::json_decode($_REQUEST['data']);
|
||||
$oDataAux = (array)$oDataAux;
|
||||
} else {
|
||||
$oData = Bootstrap::json_decode(stripslashes($_REQUEST['data']));
|
||||
$oDataAux = G::json_decode(stripslashes($_REQUEST['data']));
|
||||
$oDataAux = (array)$oDataAux;
|
||||
}
|
||||
//$oData = $oJSON->decode( stripslashes( $_REQUEST['data'] ) );
|
||||
$sOutput = '';
|
||||
$sTask = '';
|
||||
|
||||
if(array_key_exists('pro_uid', $oDataAux) || array_key_exists('uid', $oDataAux) || array_key_exists('PRO_UID', $oDataAux) || array_key_exists('UID', $oDataAux)) {
|
||||
if(array_key_exists('pro_uid', $oDataAux) || array_key_exists('PRO_UID', $oDataAux)) {
|
||||
if(array_key_exists('pro_uid', $oDataAux)) {
|
||||
$proUid = $oDataAux['pro_uid'];
|
||||
} else {
|
||||
$proUid = $oDataAux['PRO_UID'];
|
||||
}
|
||||
} else {
|
||||
$proUid = $oDataAux['uid'];
|
||||
$uidAux = $proUid;
|
||||
}
|
||||
|
||||
G::LoadClass('processes');
|
||||
$infoProcess = new Processes();
|
||||
|
||||
if(!$infoProcess->processExists($proUid)) {
|
||||
$oSL = new SwimlanesElements();
|
||||
if($oSL->swimlanesElementsExists($proUid)) {
|
||||
$aFields = $oSL->load($proUid);
|
||||
$proUid = $aFields['PRO_UID'];
|
||||
} else {
|
||||
$k = new Criteria('workflow');
|
||||
$k->clearSelectColumns();
|
||||
$k->addSelectColumn(TaskPeer::PRO_UID);
|
||||
$k->add(TaskPeer::TAS_UID, $uidAux );
|
||||
$rs = TaskPeer::doSelectRS($k);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$proUid = $row['PRO_UID'];
|
||||
}
|
||||
}
|
||||
$resultProcess = $infoProcess->getProcessRow($proUid);
|
||||
} else {
|
||||
if(array_key_exists('PU_UID', $oDataAux)) {
|
||||
$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();
|
||||
$resultProcess = $infoProcess->getProcessRow($row['PRO_UID']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(isset($_REQUEST['pro_uid']) && !empty($_REQUEST['pro_uid']) || isset($_REQUEST['PRO_UID']) && !empty($_REQUEST['PRO_UID'])) {
|
||||
if(isset($_REQUEST['pro_uid']) && !empty($_REQUEST['pro_uid'])) {
|
||||
$proUid = $_REQUEST['pro_uid'];
|
||||
} else {
|
||||
$proUid = $_REQUEST['PRO_UID'];
|
||||
}
|
||||
G::LoadClass('processes');
|
||||
$infoProcess = new Processes();
|
||||
$resultProcess = $infoProcess->getProcessRow($proUid);
|
||||
}
|
||||
|
||||
if($proUid != "") {
|
||||
$valuesProcess['PRO_UID'] = $proUid;
|
||||
$valuesProcess['PRO_UPDATE_DATE'] = date("Y-m-d H:m:i");
|
||||
G::LoadClass('processes');
|
||||
$infoProcess = new Processes();
|
||||
$resultProcess = $infoProcess->updateProcessRow($valuesProcess);
|
||||
$resultProcess = $infoProcess->getProcessRow($proUid);
|
||||
}
|
||||
|
||||
//G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new processMap(new DBConnection());
|
||||
|
||||
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'load':
|
||||
$_SESSION['PROCESS'] = $oData->uid;
|
||||
@@ -85,6 +161,7 @@ try {
|
||||
break;
|
||||
case 'process_Export':
|
||||
include (PATH_METHODS . 'processes/processes_Export.php');
|
||||
G::auditLog('ExportProcess','Export Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'process_User':
|
||||
include (PATH_METHODS . 'processes/processes_User.php');
|
||||
@@ -101,9 +178,14 @@ try {
|
||||
break;
|
||||
case 'webEntry_delete':
|
||||
$form = $_REQUEST;
|
||||
unlink(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME']);
|
||||
unlink(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php");
|
||||
if(file_exists(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME'])) {
|
||||
unlink(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME']);
|
||||
}
|
||||
if(file_exists(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php")) {
|
||||
unlink(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php");
|
||||
}
|
||||
$oProcessMap->webEntry($_REQUEST['PRO_UID']);
|
||||
G::auditLog('WebEntry','Delete web entry ('.$form['FILENAME'].') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'webEntry_new':
|
||||
$oProcessMap->webEntry_new($oData->PRO_UID);
|
||||
@@ -113,6 +195,7 @@ try {
|
||||
G::LoadClass('processMap');
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->listProcessesUser($oData->PRO_UID);
|
||||
G::auditLog('AssignRole','Assign new supervisor ('.$oData->USR_UID.') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'removeProcessUser':
|
||||
$oProcessMap->removeProcessUser($oData->PU_UID);
|
||||
@@ -122,6 +205,8 @@ try {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
G::auditLog('RemoveUser','Remove supervisor ('.$userSupervisor.') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'supervisorDynaforms':
|
||||
$oProcessMap->supervisorDynaforms($oData->pro_uid);
|
||||
@@ -159,9 +244,11 @@ try {
|
||||
break;
|
||||
case 'addTask':
|
||||
$sOutput = $oProcessMap->addTask($oData->uid, $oData->position->x, $oData->position->y);
|
||||
G::auditLog('AddTask','Add new task in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'addSubProcess':
|
||||
$sOutput = $oProcessMap->addSubProcess($oData->uid, $oData->position->x, $oData->position->y);
|
||||
G::auditLog('AddSubProcess','Add new sub process in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'taskColor':
|
||||
$oTask->taskColor($oData->pro_uid, $oData->tas_uid);
|
||||
@@ -174,33 +261,48 @@ try {
|
||||
break;
|
||||
case 'saveTaskPosition':
|
||||
$sOutput = $oProcessMap->saveTaskPosition($oData->uid, $oData->position->x, $oData->position->y);
|
||||
$oTask = new Task();
|
||||
$oTask->load($uidAux);
|
||||
G::auditLog('SaveTaskPosition','Change task position ('.$oTask->getTasTitle().') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'deleteTask':
|
||||
$sOutput = $oProcessMap->deleteTask($oData->tas_uid);
|
||||
break;
|
||||
case 'addGuide':
|
||||
$sOutput = $oProcessMap->addGuide($oData->uid, $oData->position, $oData->direction);
|
||||
$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);
|
||||
G::auditLog('SaveGuidePosition','Change '.$oData->direction.' line position in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'deleteGuide':
|
||||
$sOutput = $oProcessMap->deleteGuide($oData->uid);
|
||||
G::auditLog('DeleteLine','Delete line ('.$oData->uid.') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'deleteGuides':
|
||||
$sOutput = $oProcessMap->deleteGuides($oData->pro_uid);
|
||||
G::auditLog('DeleteLines','Delete all lines in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'addText':
|
||||
$sOutput = $oProcessMap->addText($oData->uid, $oData->label, $oData->position->x, $oData->position->y);
|
||||
$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 ('.$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 ('.$oData->uid.' ) in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'deleteText':
|
||||
$sOutput = $oProcessMap->deleteText($oData->uid);
|
||||
G::auditLog('DeleteText','Delete text ('.$oData->uid.' ) in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'dynaforms':
|
||||
$oProcessMap->dynaformsList($oData->pro_uid);
|
||||
@@ -326,9 +428,11 @@ try {
|
||||
case 'exploreDirectory':
|
||||
$_SESSION["PFMDirectory"] = $oData->main_directory;
|
||||
$oProcessMap->exploreDirectory($oData->pro_uid, $oData->main_directory, $oData->directory);
|
||||
G::auditLog('ProcessFileManager','Upload template ('.$oData->main_directory.') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'deleteFile':
|
||||
$oProcessMap->deleteFile($oData->pro_uid, $oData->main_directory, $oData->directory, $oData->file);
|
||||
G::auditLog('ProcessFileManager','Delete template ('.$oData->main_directory.': '.$oData->file.') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'deleteDirectory':
|
||||
$oProcessMap->deleteDirectory($oData->pro_uid, $oData->main_directory, $oData->directory, $oData->dir_to_delete);
|
||||
@@ -440,9 +544,11 @@ try {
|
||||
switch ($sDir) {
|
||||
case 'mailTemplates':
|
||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
|
||||
G::auditLog('ProcessFileManager','Edit template ('.$_REQUEST['filename'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'public':
|
||||
$sDirectory = PATH_DATA_PUBLIC . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
|
||||
G::auditLog('ProcessFileManager','Edit public template ('.$_REQUEST['filename'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
default:
|
||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
|
||||
@@ -530,9 +636,11 @@ try {
|
||||
switch ($sDir) {
|
||||
case 'mailTemplates':
|
||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
|
||||
G::auditLog('ProcessFileManager','Save template ('.$_REQUEST['filename'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'public':
|
||||
$sDirectory = PATH_DATA_PUBLIC . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
|
||||
G::auditLog('ProcessFileManager','Save public template ('.$_REQUEST['filename'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
default:
|
||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $_REQUEST['pro_uid'] . PATH_SEP . $_REQUEST['filename'];
|
||||
|
||||
@@ -58,3 +58,7 @@ try {
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
print G::json_encode( $result );
|
||||
|
||||
$infoProcess = new Processes();
|
||||
$resultProcess = $infoProcess->getProcessRow($sProcessUID);
|
||||
G::auditLog('DeletePermissions','Delete Permissions ('.$_GET['OP_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
@@ -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';
|
||||
@@ -91,4 +92,54 @@ switch ($function) {
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
$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'].'"');
|
||||
@@ -76,3 +76,8 @@ $oOP->save();
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->getObjectsPermissionsCriteria( $sValue['PRO_UID'] );
|
||||
|
||||
$infoProcess = new Processes();
|
||||
$resultProcess = $infoProcess->getProcessRow($sValue['PRO_UID']);
|
||||
$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'].'"');
|
||||
|
||||
@@ -38,6 +38,9 @@ try {
|
||||
$http = 'http://';
|
||||
|
||||
$sContent = '';
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($sPRO_UID);
|
||||
|
||||
if ($withWS) {
|
||||
//creating sys.info;
|
||||
@@ -73,6 +76,8 @@ try {
|
||||
$template->assign( 'wsUser', $sWS_USER );
|
||||
$template->assign( 'wsPass', Bootstrap::hashPassword($sWS_PASS, '', true) );
|
||||
$template->assign( 'wsRoundRobin', $sWS_ROUNDROBIN );
|
||||
|
||||
G::auditLog('WebEntry','Generate web entry with web services ('.$dynTitle.'.php) in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
if ($sWE_USR == "2") {
|
||||
$template->assign( 'USR_VAR', "\$cInfo = ws_getCaseInfo(\$caseId);\n\t \$USR_UID = \$cInfo->currentUsers->userId;" );
|
||||
@@ -118,8 +123,7 @@ try {
|
||||
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
|
||||
print $link;
|
||||
//print "\n<a href='$link' target='_new' > $link </a>";
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
$G_FORM = new Form( $sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false );
|
||||
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
|
||||
@@ -159,6 +163,7 @@ try {
|
||||
}
|
||||
|
||||
print_r( '<textarea cols="70" rows="20">' . htmlentities( str_replace( '</body>', '</form></body>', str_replace( '</form>', '', $template->getOutputContent() ) ) ) . '</textarea>' );
|
||||
G::auditLog('WebEntry','Generate web entry with single HTML (dynaform uid: '.$sDYNAFORM.') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -41,6 +41,9 @@ try {
|
||||
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
|
||||
$infoProcess = new Processes();
|
||||
$resultProcess = $infoProcess->getProcessRow($_POST['PRO_UID']);
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'availableSupervisorDynaforms':
|
||||
@@ -48,18 +51,22 @@ try {
|
||||
break;
|
||||
case 'assignSupervisorDynaform':
|
||||
$oProcessMap->assignSupervisorStep( $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'] );
|
||||
G::auditLog('AssignSupervisorDynaform','Assign Supervisor Dynaform ('.$_POST['DYN_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'removeSupervisorDynaform':
|
||||
$oProcessMap->removeSupervisorStep( $_POST['STEP_UID'], $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'], $_POST['STEP_POSITION'] );
|
||||
G::auditLog('RemoveSupervisorDynaform','Remove Supervisor Dynaform ('.$_POST['DYN_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'availableSupervisorInputs':
|
||||
$oProcessMap->availableSupervisorInputs( $_POST['PRO_UID'] );
|
||||
break;
|
||||
case 'assignSupervisorInput':
|
||||
$oProcessMap->assignSupervisorStep( $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'] );
|
||||
G::auditLog('AssignSupervisorInput','Assign Supervisor Input ('.$_POST['INP_DOC_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'removeSupervisorInput':
|
||||
$oProcessMap->removeSupervisorStep( $_POST['STEP_UID'], $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'], $_POST['STEP_POSITION'] );
|
||||
G::auditLog('RemoveSupervisorInput','Remove Supervisor Input ('.$_POST['INP_DOC_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
}
|
||||
} catch (Exception $oException) {
|
||||
|
||||
@@ -25,6 +25,10 @@ try {
|
||||
if (isset( $_POST['form']['action'] )) {
|
||||
$_POST['action'] = $_POST['form']['action'];
|
||||
}
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($_POST['PRO_UID']);
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'availableCaseTrackerObjects':
|
||||
G::LoadClass( 'processMap' );
|
||||
@@ -37,24 +41,28 @@ try {
|
||||
$cto_UID = $oProcessMap->assignCaseTrackerObject( $_POST['PRO_UID'], $_POST['OBJECT_TYPE'], $_POST['OBJECT_UID'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
echo $cto_UID;
|
||||
G::auditLog('CaseTrackers','Assign Case Tracker Object ('.$cto_UID.' - '.$_POST['OBJECT_TYPE'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'removeCaseTrackerObject':
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->removeCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
G::auditLog('CaseTrackers','Remove Case Tracker Object ('.$_POST['CTO_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'upCaseTrackerObject':
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->upCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
G::auditLog('CaseTrackers','Move Up Case Tracker Object ('.$_POST['CTO_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'downCaseTrackerObject':
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new ProcessMap();
|
||||
$oProcessMap->downCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
|
||||
$oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
|
||||
G::auditLog('CaseTrackers','Move Down Case Tracker Object ('.$_POST['CTO_UID'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'editStagesMap':
|
||||
$oTemplatePower = new TemplatePower( PATH_TPL . 'tracker/stages_Map.html' );
|
||||
|
||||
@@ -48,6 +48,10 @@ try {
|
||||
$aFields = $oCaseTrackerObject->load( $value['CTO_UID'] );
|
||||
$aFields['CTO_CONDITION'] = $value['CTO_CONDITION'];
|
||||
$oCaseTrackerObject->update( $aFields );
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($value['PRO_UID']);
|
||||
G::auditLog('CaseTrackers','Save Condition Case Tracker Object ('.$value['CTO_UID'].', condition: '.$value['CTO_CONDITION'].') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
|
||||
@@ -15,3 +15,14 @@ require_once 'classes/model/CaseTracker.php';
|
||||
$oCaseTracker = new CaseTracker();
|
||||
$oCaseTracker->update( $sValue );
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($sValue['PRO_UID']);
|
||||
|
||||
if($sValue['CT_DERIVATION_HISTORY'] == 1) {
|
||||
$type[] = "Routing History";
|
||||
}
|
||||
if($sValue['CT_MESSAGE_HISTORY'] == 1) {
|
||||
$type[] = "Messages History";
|
||||
}
|
||||
G::auditLog('CaseTrackers','Save Case Tracker Properties ('.$sValue['CT_MAP_TYPE'].' - '.implode(', ',$type).') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
|
||||
@@ -101,15 +101,27 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') {
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
$swCreate = true;
|
||||
if ($value['TRI_UID'] != '') {
|
||||
$oTrigger->load( $value['TRI_UID'] );
|
||||
} else {
|
||||
$oTrigger->create( $value );
|
||||
$value['TRI_UID'] = $oTrigger->getTriUid();
|
||||
}
|
||||
//print_r($_POST['form']);die;
|
||||
$swCreate = false;
|
||||
}
|
||||
$oTrigger->update( $value );
|
||||
if($swCreate){
|
||||
//Add Audit Log
|
||||
$fields = $oTrigger->load( $value['TRI_UID'] );
|
||||
$description = "Trigger Name: ".$fields['TRI_TITLE'].", Trigger Uid: ".$value['TRI_UID'];
|
||||
if (isset ( $fields['TRI_DESCRIPTION'] )) {
|
||||
$description .= ", Description: ".$fields['TRI_DESCRIPTION'];
|
||||
}
|
||||
if (isset($value["TRI_WEBBOT"])) {
|
||||
$description .= ", [EDIT CODE]";
|
||||
}
|
||||
G::auditLog("UpdateTrigger", $description);
|
||||
}
|
||||
|
||||
//if (! isset( $_POST['mode'] )) {
|
||||
// $oProcessMap->triggersList( $value['PRO_UID'] );
|
||||
|
||||
Reference in New Issue
Block a user