PM-1005 "WebEntry-Event (Endpoints)"
- Se han implementado los siguientes Endpoints:
GET /api/1.0/{workspace}/project/{prj_uid}/web-entry-events
GET /api/1.0/{workspace}/project/{prj_uid}/web-entry-event/{wee_uid}
GET /api/1.0/{workspace}/project/{prj_uid}/web-entry-event/event/{evn_uid}
POST /api/1.0/{workspace}/project/{prj_uid}/web-entry-event
PUT /api/1.0/{workspace}/project/{prj_uid}/web-entry-event/{wee_uid}
DELETE /api/1.0/{workspace}/project/{prj_uid}/web-entry-event/{wee_uid}
- Se han implementado los metodos necesarios para el Export, Import y
Delete (delete Process) de este nuevo "Objeto"
- Se ha solucionado bugs al importar un Projecto con "Gateway to Gateway"
This commit is contained in:
@@ -764,10 +764,11 @@ class Workflow extends Handler
|
||||
$oCriteria->add(\CaseTrackerObjectPeer::PRO_UID, $sProcessUID);
|
||||
\ProcessUserPeer::doDelete($oCriteria);
|
||||
|
||||
//Delete Web Entries
|
||||
//Delete WebEntries
|
||||
$webEntry = new \ProcessMaker\BusinessModel\WebEntry();
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\WebEntryPeer::WE_UID);
|
||||
$criteria->add(\WebEntryPeer::PRO_UID, $sProcessUID, \Criteria::EQUAL);
|
||||
|
||||
@@ -780,6 +781,23 @@ class Workflow extends Handler
|
||||
$webEntry->delete($row["WE_UID"]);
|
||||
}
|
||||
|
||||
//Delete WebEntry-Events
|
||||
$webEntryEvent = new \ProcessMaker\BusinessModel\WebEntryEvent();
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\WebEntryEventPeer::WEE_UID);
|
||||
$criteria->add(\WebEntryEventPeer::PRJ_UID, $sProcessUID, \Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = \WebEntryEventPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$webEntryEvent->delete($row["WEE_UID"]);
|
||||
}
|
||||
|
||||
//Delete the process
|
||||
try {
|
||||
$oProcess->remove($sProcessUID);
|
||||
@@ -1055,7 +1073,27 @@ class Workflow extends Handler
|
||||
}
|
||||
}
|
||||
|
||||
//Getting templates files
|
||||
//Get public files to exclude
|
||||
$arrayPublicFileToExclude = array("wsClient.php");
|
||||
|
||||
//WebEntry
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\WebEntryPeer::WE_DATA);
|
||||
$criteria->add(\WebEntryPeer::PRO_UID, $processUid, \Criteria::EQUAL);
|
||||
$criteria->add(\WebEntryPeer::WE_METHOD, "WS", \Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = \WebEntryPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$arrayPublicFileToExclude[] = $row["WE_DATA"];
|
||||
$arrayPublicFileToExclude[] = preg_replace("/^(.+)\.php$/", "$1Post.php", $row["WE_DATA"]);
|
||||
}
|
||||
|
||||
//Get templates and public files
|
||||
$workspaceTargetDirs = array("TEMPLATES" => "mailTemplates", "PUBLIC" => "public");
|
||||
$workspaceDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP;
|
||||
|
||||
@@ -1070,6 +1108,10 @@ class Workflow extends Handler
|
||||
|
||||
$filename = basename($templatesFile);
|
||||
|
||||
if ($target == "PUBLIC" && in_array($filename, $arrayPublicFileToExclude)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$workflowFile[$target][] = array(
|
||||
"filename" => $filename,
|
||||
"filepath" => $processUid . PATH_SEP . $filename,
|
||||
@@ -1095,7 +1137,7 @@ class Workflow extends Handler
|
||||
$processUidOld = $arrayUid[0]["old_uid"];
|
||||
$processUid = $arrayUid[0]["new_uid"];
|
||||
|
||||
//Update TAS_UID
|
||||
//Update TASK.TAS_UID
|
||||
foreach ($arrayWorkflowData["tasks"] as $key => $value) {
|
||||
$taskUid = $arrayWorkflowData["tasks"][$key]["TAS_UID"];
|
||||
|
||||
@@ -1110,6 +1152,20 @@ class Workflow extends Handler
|
||||
}
|
||||
}
|
||||
|
||||
//Update WEB_ENTRY_EVENT.EVN_UID
|
||||
foreach ($arrayWorkflowData["webEntryEvent"] as $key => $value) {
|
||||
$webEntryEventEventUid = $arrayWorkflowData["webEntryEvent"][$key]["EVN_UID"];
|
||||
|
||||
foreach ($arrayUid as $value2) {
|
||||
$arrayItem = $value2;
|
||||
|
||||
if ($arrayItem["old_uid"] == $webEntryEventEventUid) {
|
||||
$arrayWorkflowData["webEntryEvent"][$key]["EVN_UID"] = $arrayItem["new_uid"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Workflow tables
|
||||
$workflowData = (object)($arrayWorkflowData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user