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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,77 +1,76 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'classes/model/Application.php';
|
require_once 'classes/model/Application.php';
|
||||||
G::LoadClass( 'case' );
|
G::LoadClass( 'case' );
|
||||||
|
|
||||||
class adhocUserProxy extends HttpProxyController
|
class adhocUserProxy extends HttpProxyController
|
||||||
{
|
{
|
||||||
//list of users into adhoc option
|
//list of users into adhoc option
|
||||||
function adhocAssignUsersk ($params)
|
function adhocAssignUsersk ($params)
|
||||||
{
|
{
|
||||||
|
|
||||||
G::LoadClass( 'groups' );
|
G::LoadClass( 'groups' );
|
||||||
G::LoadClass( 'tasks' );
|
G::LoadClass( 'tasks' );
|
||||||
$oTasks = new Tasks();
|
$oTasks = new Tasks();
|
||||||
$aAux = $oTasks->getGroupsOfTask( $_SESSION['TASK'], 2 );
|
$aAux = $oTasks->getGroupsOfTask( $_SESSION['TASK'], 2 );
|
||||||
$aAdhocUsers = array ();
|
$aAdhocUsers = array ();
|
||||||
$oGroups = new Groups();
|
$oGroups = new Groups();
|
||||||
foreach ($aAux as $aGroup) {
|
foreach ($aAux as $aGroup) {
|
||||||
$aUsers = $oGroups->getUsersOfGroup( $aGroup['GRP_UID'] );
|
$aUsers = $oGroups->getUsersOfGroup( $aGroup['GRP_UID'] );
|
||||||
foreach ($aUsers as $aUser) {
|
foreach ($aUsers as $aUser) {
|
||||||
if ($aUser['USR_UID'] != $_SESSION['USER_LOGGED']) {
|
if ($aUser['USR_UID'] != $_SESSION['USER_LOGGED']) {
|
||||||
$aAdhocUsers[] = $aUser['USR_UID'];
|
$aAdhocUsers[] = $aUser['USR_UID'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$aAux = $oTasks->getUsersOfTask( $_SESSION['TASK'], 2 );
|
$aAux = $oTasks->getUsersOfTask( $_SESSION['TASK'], 2 );
|
||||||
foreach ($aAux as $aUser) {
|
foreach ($aAux as $aUser) {
|
||||||
if ($aUser['USR_UID'] != $_SESSION['USER_LOGGED']) {
|
if ($aUser['USR_UID'] != $_SESSION['USER_LOGGED']) {
|
||||||
$aAdhocUsers[] = $aUser['USR_UID'];
|
$aAdhocUsers[] = $aUser['USR_UID'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
require_once 'classes/model/Users.php';
|
require_once 'classes/model/Users.php';
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
|
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
|
||||||
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||||
$oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
|
$oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||||
$oCriteria->add( UsersPeer::USR_UID, $aAdhocUsers, Criteria::IN );
|
$oCriteria->add( UsersPeer::USR_UID, $aAdhocUsers, Criteria::IN );
|
||||||
$oDataset = UsersPeer::doSelectRS( $oCriteria );
|
$oDataset = UsersPeer::doSelectRS( $oCriteria );
|
||||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$aData = array ();
|
$aData = array ();
|
||||||
while ($oDataset->next()) {
|
while ($oDataset->next()) {
|
||||||
$aData[] = $oDataset->getRow();
|
$aData[] = $oDataset->getRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data = $aData;
|
$this->data = $aData;
|
||||||
|
|
||||||
}
|
}
|
||||||
//assign user adhoc
|
//assign user adhoc
|
||||||
function reassignCase ($params)
|
function reassignCase ($params)
|
||||||
{
|
{
|
||||||
$cases = new Cases();
|
$cases = new Cases();
|
||||||
$cases->reassignCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $_POST['USR_UID'], $_POST['THETYPE'] );
|
$cases->reassignCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $_POST['USR_UID'], $_POST['THETYPE'] );
|
||||||
$this->success = true;
|
$this->success = true;
|
||||||
}
|
}
|
||||||
//delete case adhoc
|
//delete case adhoc
|
||||||
function deleteCase ($params)
|
function deleteCase ($params)
|
||||||
{
|
{
|
||||||
$ainfoCase = array ();
|
$ainfoCase = array ();
|
||||||
try {
|
try {
|
||||||
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||||
$app = new Application();
|
$app = new Application();
|
||||||
$caseData = $app->load( $applicationUID );
|
$caseData = $app->load( $applicationUID );
|
||||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||||
|
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
$oCase->removeCase( $applicationUID );
|
$oCase->removeCase( $applicationUID );
|
||||||
|
|
||||||
$this->success = true;
|
$this->success = true;
|
||||||
$this->msg = G::LoadTranslation( 'ID_CASE_DELETED_SUCCESSFULLY', SYS_LANG, $data );
|
$this->msg = G::LoadTranslation( 'ID_CASE_DELETED_SUCCESSFULLY', SYS_LANG, $data );
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->success = false;
|
$this->success = false;
|
||||||
$this->msg = $e->getMessage();
|
$this->msg = $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//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