BY-168 Reusing the SendNotification method to send emails in Gmail Integration

BY-165 Adding validation to Self service value based

BY-165 Code Review FixesX
This commit is contained in:
Development
2016-03-08 10:17:03 -04:00
committed by Jenny Murillo
parent 63660a7a19
commit afdd123614
7 changed files with 230 additions and 175 deletions

View File

@@ -2,6 +2,7 @@
if (typeof window.parent != 'undefined') {
<?php
/*----------------------------------********---------------------------------*/
$pathDerivateGmail = 'derivatedGmail?tasks=';
$statusPMGmail = false;
$licensedFeatures = &PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
@@ -20,8 +21,10 @@ if (isset( $_GET['ux'] )) {
default:
$url = 'casesListExtJs';
}
} else if( key_exists('gmail', $_SESSION) && $_SESSION['gmail'] == 1 && $statusPMGmail ){
$url = 'derivatedGmail';
/*----------------------------------********---------------------------------*/
} else if( $statusPMGmail ){
$url = $pathDerivateGmail . $_GET['tasks'].'&arrayData='.$_GET['arrayData'];
/*----------------------------------********---------------------------------*/
} else {
$url = 'casesListExtJs';
}
@@ -32,7 +35,7 @@ echo " window.parent.location.href = '$url';";
if (isset( $_GET['ux'] )) {
/*----------------------------------********---------------------------------*/
if(PMLicensedFeatures::getSingleton()->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09') && $statusPMGmail){
echo '} else { window.parent.location.href = \'derivatedGmail\'; }';
echo '} else { window.parent.location.href = \''.$pathDerivateGmail.$_GET['tasks'].'&arrayData='.$_GET['arrayData'].'\'; }';
} else {
/*----------------------------------********---------------------------------*/
echo '} else { window.parent.location.href = \'casesListExtJs\'; }';

View File

@@ -271,7 +271,7 @@ function startCase ()
if($pmGoogle->getServiceGmailStatus()){
require_once 'src/ProcessMaker/BusinessModel/Pmgmail.php';
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail();
$response = $Pmgmail->sendEmail($aData['APPLICATION'], "", $aData['INDEX']);
$response = $Pmgmail->sendEmail($aData['APPLICATION'], "", $aData['INDEX'], null, null);
}
}
/*----------------------------------********---------------------------------*/

View File

@@ -224,14 +224,24 @@ try {
/*----------------------------------********---------------------------------*/
$debuggerAvailable = true;
if (isset( $_SESSION['user_experience'] )) {
$aNextStep['PAGE'] = 'casesListExtJsRedirector?ux=' . $_SESSION['user_experience'];
$flagGmail = false;
if($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')){
G::LoadClass( "pmGoogleApi" );
$pmGoogle = new PMGoogleApi();
if($pmGoogle->getServiceGmailStatus()){
$flagGmail = true;
}
}
$casesRedirector = 'casesListExtJsRedirector';
if (isset( $_SESSION['user_experience'] ) && $flagGmail === false ) {
$aNextStep['PAGE'] = $casesRedirector.'?ux=' . $_SESSION['user_experience'];
$debuggerAvailable = false;
} else if( isset( $_SESSION['gmail'] ) ){
$aNextStep['PAGE'] = 'casesListExtJsRedirector?gmail='.$_SESSION['gmail'];
} else if( $flagGmail == true ){
$aNextStep['PAGE'] = $casesRedirector.'?gmail=1&tasks='.serialize($_POST['form']['TASKS']) . '&arrayData='.serialize($appFields['APP_DATA']);
} else {
$aNextStep['PAGE'] = 'casesListExtJsRedirector';
$aNextStep['PAGE'] = $casesRedirector;
}
if (isset( $_SESSION['PMDEBUGGER'] ) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {

View File

@@ -26,7 +26,7 @@ if($appDelPrev == array()){
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail();
foreach ($appDelPrev as $app){
if( ($app['DEL_INDEX'] != $actualIndex) && ($app['DEL_PREVIOUS'] != $actualLastIndex) ){ //Sending the email to all threads of the case except the actual thread
$response = $Pmgmail->sendEmail($caseId, "", $app['DEL_INDEX']);
$response = $Pmgmail->sendEmail($caseId, "", $app['DEL_INDEX'], unserialize($_GET['tasks']), unserialize($_GET['arrayData']));
}
}