Merged in jennydmz/processmaker/BY-166 (pull request #3929)
Deleting Sub Process send email functionality in PMGmail
This commit is contained in:
@@ -37,52 +37,6 @@ class SubApplication extends BaseSubApplication
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadSubProUidByParent($appUidParent, $delThreadParent, $delIndexParent )
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$criteria = new Criteria("workflow");
|
|
||||||
$criteria->addSelectColumn(SubApplicationPeer::APP_UID);
|
|
||||||
$criteria->add(SubApplicationPeer::APP_PARENT, $appUidParent);
|
|
||||||
$criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $delIndexParent);
|
|
||||||
$criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $delThreadParent);
|
|
||||||
|
|
||||||
$rsCriteria = SubApplicationPeer::doSelectRs($criteria);
|
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
while ($rsCriteria->next()) {
|
|
||||||
$row = $rsCriteria->getRow();
|
|
||||||
}
|
|
||||||
if(is_array( $row )){
|
|
||||||
return($row['APP_UID']);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
} catch (Exception $oError) {
|
|
||||||
throw($oError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function loadSubProUidBySon($appUidSon, $delThreadParent, $delIndexParent )
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$criteria = new Criteria("workflow");
|
|
||||||
$criteria->addSelectColumn(SubApplicationPeer::APP_PARENT);
|
|
||||||
$criteria->add(SubApplicationPeer::APP_UID, $appUidSon);
|
|
||||||
$criteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $delIndexParent);
|
|
||||||
$criteria->add(SubApplicationPeer::DEL_THREAD_PARENT, $delThreadParent);
|
|
||||||
|
|
||||||
$rsCriteria = SubApplicationPeer::doSelectRs($criteria);
|
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
while ($rsCriteria->next()) {
|
|
||||||
$row = $rsCriteria->getRow();
|
|
||||||
}
|
|
||||||
if(is_array( $row )){
|
|
||||||
return($row['APP_PARENT']);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
} catch (Exception $oError) {
|
|
||||||
throw($oError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create($aData)
|
public function create($aData)
|
||||||
{
|
{
|
||||||
$oConnection = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
|
$oConnection = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
|
||||||
|
|||||||
@@ -115,10 +115,6 @@ class Pmgmail {
|
|||||||
}
|
}
|
||||||
$appData = $this->getDraftApp($app_uid, $index);
|
$appData = $this->getDraftApp($app_uid, $index);
|
||||||
|
|
||||||
if (!$appData){
|
|
||||||
$appData = $this->getDraftApp($app_uid, $index-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($appData as $application) {
|
foreach ($appData as $application) {
|
||||||
$appNumber = $application['APP_NUMBER'];
|
$appNumber = $application['APP_NUMBER'];
|
||||||
$appStatus = $application['APP_STATUS'];
|
$appStatus = $application['APP_STATUS'];
|
||||||
@@ -165,65 +161,18 @@ class Pmgmail {
|
|||||||
$row = $rsCriteria->getRow ();
|
$row = $rsCriteria->getRow ();
|
||||||
}
|
}
|
||||||
$taskUsers = unserialize ( $row ['GRP_UID'] );
|
$taskUsers = unserialize ( $row ['GRP_UID'] );
|
||||||
|
|
||||||
foreach ($taskUsers as $user) {
|
|
||||||
$oUsers = new \Users ();
|
$oUsers = new \Users ();
|
||||||
|
if ($taskUsers !== false){
|
||||||
|
foreach ( $taskUsers as $user ) {
|
||||||
$usrData = $oUsers->loadDetails ( $user );
|
$usrData = $oUsers->loadDetails ( $user );
|
||||||
$nextMail = $usrData ['USR_EMAIL'];
|
$nextMail = $usrData ['USR_EMAIL'];
|
||||||
$mailToAddresses .= ($mailToAddresses == '') ? $nextMail : ',' . $nextMail;
|
$mailToAddresses .= ($mailToAddresses == '') ? $nextMail : ',' . $nextMail;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (!$aTask["TAS_PARENT"]){
|
$usrData = $oUsers->loadDetails ( $user );
|
||||||
$aTask["TAS_PARENT"] = $tasUid;
|
$mailToAddresses = $usrData ['USR_EMAIL'];
|
||||||
}
|
|
||||||
$oTask = new \Task();
|
|
||||||
$aTaskInfo = $oTask->load($aTask["TAS_PARENT"]);
|
|
||||||
|
|
||||||
$oSubPro = new \SubApplication();
|
|
||||||
$subProAppUid = "";
|
|
||||||
if( ($aTaskInfo["TAS_TYPE"] === "SUBPROCESS") ){
|
|
||||||
$subProAppUid = $oSubPro->loadSubProUidByParent($app_uid, $index, $index+1);
|
|
||||||
} else if($aTask['TAS_UID'] == -1 && $aTask['TAS_ASSIGN_TYPE'] == "nobody"){
|
|
||||||
$subProAppUid = $oSubPro->loadSubProUidBySon($app_uid, $index, $index+1);
|
|
||||||
|
|
||||||
$appDel = new \AppDelegation();
|
|
||||||
$actualThread = $appDel->Load($subProAppUid, $index+1);
|
|
||||||
$index = $actualThread['DEL_INDEX']+1;
|
|
||||||
|
|
||||||
$aCriteria = new \Criteria("workflow");
|
|
||||||
$aCriteria->addSelectColumn(\RoutePeer::ROU_NEXT_TASK);
|
|
||||||
$aCriteria->add(\RoutePeer::TAS_UID, $actualThread['TAS_UID']);
|
|
||||||
|
|
||||||
$roCriteria = \RoutePeer::doSelectRs($aCriteria);
|
|
||||||
$roCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
while ($roCriteria->next()) {
|
|
||||||
$rowTas = $roCriteria->getRow();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$aTaskInfo = $oTask->load($rowTas['ROU_NEXT_TASK']);
|
|
||||||
$newTask = new \Tasks();
|
|
||||||
$aTaskUsers = $newTask->getUsersOfTask($rowTas['ROU_NEXT_TASK'],1);
|
|
||||||
|
|
||||||
foreach ($aTaskUsers as $user) {
|
|
||||||
$nextMail = $user['USR_EMAIL'];
|
|
||||||
$mailToAddresses .= ($mailToAddresses == '') ? $nextMail : ',' . $nextMail;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($subProAppUid !== ""){
|
|
||||||
$subProData = $oApplication->Load($subProAppUid);
|
|
||||||
$oProcess = new \Processes();
|
|
||||||
$proInfo = $oProcess->getProcessRow($subProData['PRO_UID']);
|
|
||||||
|
|
||||||
$appNumber = $subProData['APP_NUMBER'];
|
|
||||||
$app_uid = $subProAppUid;
|
|
||||||
$tasName = $aTaskInfo["TAS_TITLE"];
|
|
||||||
$appStatus = $subProData['APP_STATUS'];
|
|
||||||
$prvUsr = $nextUsr;
|
|
||||||
$delegateDate = $subProData['APP_CREATE_DATE'];
|
|
||||||
$proName = $proInfo['PRO_TITLE'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if(curl_exec($gCurl) === false){
|
|||||||
$gResp = G::json_decode ( $gCurl_response );
|
$gResp = G::json_decode ( $gCurl_response );
|
||||||
if ($gResp === false) {
|
if ($gResp === false) {
|
||||||
echo Bootstrap::LoadTranslation ( 'ID_NO_LICENSE_FEATURE_ENABLED' );
|
echo Bootstrap::LoadTranslation ( 'ID_NO_LICENSE_FEATURE_ENABLED' );
|
||||||
die;
|
die ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_time_limit(60);
|
set_time_limit(60);
|
||||||
@@ -125,7 +125,9 @@ if( !isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] != $decodedResp
|
|||||||
if ($action == "draft"){
|
if ($action == "draft"){
|
||||||
//sending the email
|
//sending the email
|
||||||
$curlApp = curl_init( 'https://' . $server . '/api/1.0/' . $pmws . '/gmailIntegration/sendEmail/' . $appUid . '/to/' . $gmail . '/index/' . $delIndex );
|
$curlApp = curl_init( 'https://' . $server . '/api/1.0/' . $pmws . '/gmailIntegration/sendEmail/' . $appUid . '/to/' . $gmail . '/index/' . $delIndex );
|
||||||
curl_setopt( $curlApp, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $pmtoken ) );
|
curl_setopt ( $curlApp, CURLOPT_HTTPHEADER, array (
|
||||||
|
'Authorization: Bearer ' . $pmtoken
|
||||||
|
) );
|
||||||
curl_setopt ( $curlApp, CURLOPT_CUSTOMREQUEST, "POST" );
|
curl_setopt ( $curlApp, CURLOPT_CUSTOMREQUEST, "POST" );
|
||||||
curl_setopt ( $curlApp, CURLOPT_RETURNTRANSFER, true );
|
curl_setopt ( $curlApp, CURLOPT_RETURNTRANSFER, true );
|
||||||
curl_setopt ( $curlApp, CURLOPT_SSL_VERIFYPEER, false );
|
curl_setopt ( $curlApp, CURLOPT_SSL_VERIFYPEER, false );
|
||||||
|
|||||||
Reference in New Issue
Block a user