BY-237, BY-232, BY-169, BY-170

This commit is contained in:
Dante
2016-03-28 11:53:07 -04:00
parent a6f09aa0d7
commit 037749b03a
8 changed files with 396 additions and 249 deletions

View File

@@ -261,21 +261,6 @@ function startCase ()
$_SESSION['CASES_REFRESH'] = true;
/*----------------------------------********---------------------------------*/
//sending the email for gmail integration if the option is available
$licensedFeatures = &PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
G::LoadClass( "pmGoogleApi" );
$pmGoogle = new PMGoogleApi();
if($pmGoogle->getServiceGmailStatus()){
require_once 'src/ProcessMaker/BusinessModel/Pmgmail.php';
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail();
$response = $Pmgmail->sendEmail($aData['APPLICATION'], "", $aData['INDEX'], null, null);
}
}
/*----------------------------------********---------------------------------*/
$oCase = new Cases();
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );

View File

@@ -77,6 +77,17 @@ if ($aDelegation['USR_UID'] == "") {
$labGmail->addRelabelingToQueue($sAppUid, $iDelIndex, -1, true);
}
}
if ($licensedFeatures->verifyfeature('AhKNjBEVXZlWUFpWE8wVTREQ0FObmo0aTdhVzhvalFic1M=')) {
G::LoadClass("AppDocumentDrive");
$drive = new AppDocumentDrive();
if ($drive->getStatusDrive()) {
//add users email next task
$user = new Users();
$userInfo = $user->load($_SESSION['USER_LOGGED']);
$drive->addUsersDocumentDrive($sAppUid, array($userInfo['USR_EMAIL']));
}
}
/*----------------------------------********---------------------------------*/
//changing email labels if the claim comes from gmail
if(array_key_exists('gmail',$_SESSION) && $_SESSION['gmail'] == 1){

View File

@@ -163,32 +163,28 @@ try {
// Send notifications - Start
$oUser = new Users();
$aUser = $oUser->load( $_SESSION['USER_LOGGED'] );
$sFromName = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ($aUser['USR_EMAIL'] != '' ? ' <' . $aUser['USR_EMAIL'] . '>' : '');
$flagGmail = false;
/*----------------------------------********---------------------------------*/
$licensedFeatures = &PMLicensedFeatures::getSingleton ();
if ($licensedFeatures->verifyfeature ( '7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09' )) {
G::LoadClass ( "pmGoogleApi" );
$pmGoogle = new PMGoogleApi ();
if ($pmGoogle->getServiceGmailStatus ()) {
$flagGmail = true;
$appDel = new AppDelegation ();
$actualThread = $appDel->Load ( $_SESSION ['APPLICATION'], $_SESSION ['INDEX'] );
$appDelPrev = $appDel->LoadParallel ( $_SESSION ['APPLICATION'] );
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail ();
if (! $appDelPrev) {
$Pmgmail->sendEmail ( $_SESSION ['APPLICATION'], "", $_SESSION ['INDEX'], $_POST ['form'] ['TASKS'], $appFields ['APP_DATA'] );
} else {
foreach ( $appDelPrev as $app ) {
if (($app ['DEL_INDEX'] != $_SESSION ['INDEX']) && ($app ['DEL_PREVIOUS'] != $actualThread ['DEL_PREVIOUS'])) {
$Pmgmail->sendEmail ( $_SESSION ['APPLICATION'], "", $app ['DEL_INDEX'], $_POST ['form'] ['TASKS'], $appFields ['APP_DATA'] );
}
}
}
}
$sFromName = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ($aUser['USR_EMAIL'] != '' ? ' <' . $aUser['USR_EMAIL'] . '>' : '');
$flagGmail = false;
/*----------------------------------********---------------------------------*/
$licensedFeatures = &PMLicensedFeatures::getSingleton ();
if ($licensedFeatures->verifyfeature ( '7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09' )) {
G::LoadClass ( "pmGoogleApi" );
$pmGoogle = new PMGoogleApi ();
if ($pmGoogle->getServiceGmailStatus ()) {
$flagGmail = true;
$appDel = new AppDelegation ();
$actualThread = $appDel->Load ( $_SESSION ['APPLICATION'], $_SESSION ['INDEX'] );
$appDelPrev = $appDel->LoadParallel ( $_SESSION ['APPLICATION'] );
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail ();
foreach ( $appDelPrev as $app ) {
if (($app ['DEL_INDEX'] != $_SESSION ['INDEX']) && ($app ['DEL_PREVIOUS'] != $actualThread ['DEL_PREVIOUS'])) {
$Pmgmail->gmailsIfSelfServiceValueBased ( $_SESSION ['APPLICATION'], $app ['DEL_INDEX'], $_POST ['form'] ['TASKS'], $appFields ['APP_DATA'] );
}
}
}
}
/*----------------------------------********---------------------------------*/
@@ -251,16 +247,16 @@ try {
// Set users drive - End
/*----------------------------------********---------------------------------*/
$debuggerAvailable = true;
$casesRedirector = 'casesListExtJsRedirector';
if (isset ( $_SESSION ['user_experience'] ) && $flagGmail === false) {
$aNextStep ['PAGE'] = $casesRedirector . '?ux=' . $_SESSION ['user_experience'];
$debuggerAvailable = false;
} else if ($flagGmail === true) {
$aNextStep ['PAGE'] = $casesRedirector . '?gmail=1';
} else {
$aNextStep ['PAGE'] = $casesRedirector;
$debuggerAvailable = true;
$casesRedirector = 'casesListExtJsRedirector';
if (isset ( $_SESSION ['user_experience'] ) && $flagGmail === false) {
$aNextStep ['PAGE'] = $casesRedirector . '?ux=' . $_SESSION ['user_experience'];
$debuggerAvailable = false;
} else if ($flagGmail === true) {
$aNextStep ['PAGE'] = $casesRedirector . '?gmail=1';
} else {
$aNextStep ['PAGE'] = $casesRedirector;
}
if (isset( $_SESSION['PMDEBUGGER'] ) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {