Merge branch 'master' of git://github.com/colosa/processmaker into BUG-12112
This commit is contained in:
@@ -1100,7 +1100,6 @@ class Cases
|
|||||||
$criteria = new Criteria("workflow");
|
$criteria = new Criteria("workflow");
|
||||||
$criteria->add(AppSolrQueuePeer::APP_UID, $sAppUid);
|
$criteria->add(AppSolrQueuePeer::APP_UID, $sAppUid);
|
||||||
AppSolrQueuePeer::doDelete($criteria);
|
AppSolrQueuePeer::doDelete($criteria);
|
||||||
|
|
||||||
//Before delete verify if is a child case
|
//Before delete verify if is a child case
|
||||||
$oCriteria2 = new Criteria('workflow');
|
$oCriteria2 = new Criteria('workflow');
|
||||||
$oCriteria2->add(SubApplicationPeer::APP_UID, $sAppUid);
|
$oCriteria2->add(SubApplicationPeer::APP_UID, $sAppUid);
|
||||||
@@ -1118,10 +1117,12 @@ class Cases
|
|||||||
$oCriteria2->add(SubApplicationPeer::APP_PARENT, $sAppUid);
|
$oCriteria2->add(SubApplicationPeer::APP_PARENT, $sAppUid);
|
||||||
SubApplicationPeer::doDelete($oCriteria2);
|
SubApplicationPeer::doDelete($oCriteria2);
|
||||||
|
|
||||||
|
//Delete records of the Report Table
|
||||||
|
$this->reportTableDeleteRecord($sAppUid);
|
||||||
|
|
||||||
//Delete record of the APPLICATION table (trigger: delete records of the APP_CACHE_VIEW table)
|
//Delete record of the APPLICATION table (trigger: delete records of the APP_CACHE_VIEW table)
|
||||||
$application = new Application();
|
$application = new Application();
|
||||||
$result = $application->remove($sAppUid);
|
$result = $application->remove($sAppUid);
|
||||||
|
|
||||||
//delete application from index
|
//delete application from index
|
||||||
if ($this->appSolr != null) {
|
if ($this->appSolr != null) {
|
||||||
$this->appSolr->deleteApplicationSearchIndex($sAppUid);
|
$this->appSolr->deleteApplicationSearchIndex($sAppUid);
|
||||||
@@ -6554,4 +6555,63 @@ class Cases
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function reportTableDeleteRecord($applicationUid)
|
||||||
|
{
|
||||||
|
$criteria1 = new Criteria("workflow");
|
||||||
|
|
||||||
|
//SELECT
|
||||||
|
$criteria1->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||||
|
|
||||||
|
//FROM
|
||||||
|
|
||||||
|
//WHERE
|
||||||
|
$criteria1->add(ApplicationPeer::APP_UID, $applicationUid);
|
||||||
|
|
||||||
|
//QUERY
|
||||||
|
$rsCriteria1 = ApplicationPeer::doSelectRS($criteria1);
|
||||||
|
$rsCriteria1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
$rsCriteria1->next();
|
||||||
|
$row1 = $rsCriteria1->getRow();
|
||||||
|
|
||||||
|
$processUid = $row1["PRO_UID"];
|
||||||
|
|
||||||
|
$criteria2 = new Criteria("workflow");
|
||||||
|
|
||||||
|
//SELECT
|
||||||
|
$criteria2->addSelectColumn(AdditionalTablesPeer::ADD_TAB_NAME);
|
||||||
|
|
||||||
|
//FROM
|
||||||
|
|
||||||
|
//WHERE
|
||||||
|
|
||||||
|
$criteria2->add(AdditionalTablesPeer::PRO_UID, $processUid);
|
||||||
|
|
||||||
|
//QUERY
|
||||||
|
$rsCriteria2 = AdditionalTablesPeer::doSelectRS($criteria2);
|
||||||
|
$rsCriteria2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
G::LoadClass("pmTable");
|
||||||
|
$pmTable = new PmTable();
|
||||||
|
|
||||||
|
while ($rsCriteria2->next()) {
|
||||||
|
try {
|
||||||
|
$row2 = $rsCriteria2->getRow();
|
||||||
|
$tableName = $row2["ADD_TAB_NAME"];
|
||||||
|
$pmTableName = $pmTable->toCamelCase($tableName);
|
||||||
|
|
||||||
|
//DELETE
|
||||||
|
require_once (PATH_WORKSPACE . "classes" . PATH_SEP . "$pmTableName.php");
|
||||||
|
|
||||||
|
$criteria3 = new Criteria("workflow");
|
||||||
|
|
||||||
|
eval("\$criteria3->add(" . $pmTableName . "Peer::APP_UID, \$applicationUid);");
|
||||||
|
eval($pmTableName . "Peer::doDelete(\$criteria3);");
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,4 +74,3 @@ class adhocUserProxy extends HttpProxyController
|
|||||||
|
|
||||||
}
|
}
|
||||||
//End adhocUserProxy
|
//End adhocUserProxy
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ try {
|
|||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
$oCase->removeCase( $id );
|
$oCase->removeCase( $id );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count( $_POST['APP_UIDS'] ) > 1) {
|
if (count( $_POST['APP_UIDS'] ) > 1) {
|
||||||
echo 'The Case was deleted successfully';
|
echo 'The Case was deleted successfully';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user