From 040df12b5b46515f059525dcbb1d09d806b46e39 Mon Sep 17 00:00:00 2001 From: "Marco A. Nina Mena" Date: Tue, 29 Mar 2016 10:30:39 -0400 Subject: [PATCH] BY-234 No se comparten archivos cuando el flujo es self service - Se adiciona al usuario cuando reclama el caso de esa forma el documento drive ya tiene su email. --- .../engine/classes/class.AppDocumentDrive.php | 18 ++++++++++++++++-- .../methods/cases/cases_CatchExecute.php | 11 +++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.AppDocumentDrive.php b/workflow/engine/classes/class.AppDocumentDrive.php index e9d558a93..4ef3afa0a 100644 --- a/workflow/engine/classes/class.AppDocumentDrive.php +++ b/workflow/engine/classes/class.AppDocumentDrive.php @@ -414,9 +414,23 @@ class AppDocumentDrive } } - public function addUsersDocumentDrive ($appUid) + /** + * Add users to documents drive to give permissions + * + * @param $appUid Id application + * @param $emails array with emails which can be null + * + * @throws \Exception + */ + public function addUsersDocumentDrive ($appUid, $emails=null) { - $this->getEmailUsersTask($appUid); + if (is_array($emails)) { + foreach ($emails as $index => $email) { + $this->addUserEmail($email); + } + } else { + $this->getEmailUsersTask($appUid); + } $criteria = new Criteria( 'workflow' ); $criteria->add( AppDocumentPeer::APP_UID, $appUid ); diff --git a/workflow/engine/methods/cases/cases_CatchExecute.php b/workflow/engine/methods/cases/cases_CatchExecute.php index 1caf658f6..ae866d2b7 100755 --- a/workflow/engine/methods/cases/cases_CatchExecute.php +++ b/workflow/engine/methods/cases/cases_CatchExecute.php @@ -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){