Merged in qronald/processmaker/HOR-684 (pull request #4051)

HOR-684
This commit is contained in:
Julio Cesar Laura Avendaño
2016-04-05 15:56:06 -04:00
3 changed files with 60 additions and 44 deletions

View File

@@ -2519,11 +2519,13 @@ class wsBase
// Send notifications Mobile - Start
try {
$notificationMobile = new \ProcessMaker\BusinessModel\Light\NotificationDevice();
if ($notificationMobile->checkMobileNotifications()) {
$oLight = new \ProcessMaker\BusinessModel\Light();
$nextIndex = $oLight->getInformationDerivatedCase($appFields['APP_UID'], $delIndex);
$notificationMobile = new \ProcessMaker\BusinessModel\Light\NotificationDevice();
$notificationMobile->routeCaseNotification($userId, $_SESSION["PROCESS"], $appdel['TAS_UID'],
$appFields, $nextDelegations, $nextIndex, $delIndex);
}
} catch (Exception $e) {
\G::log(G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . '|' . $e->getMessage() , PATH_DATA, "mobile.log");
}

View File

@@ -201,11 +201,13 @@ try {
// Send notifications Mobile - Start
try {
$notificationMobile = new \ProcessMaker\BusinessModel\Light\NotificationDevice();
if ($notificationMobile->checkMobileNotifications()) {
$oLight = new \ProcessMaker\BusinessModel\Light();
$nextIndex = $oLight->getInformationDerivatedCase($appFields['APP_UID'], $appFields['DEL_INDEX']);
$notificationMobile = new \ProcessMaker\BusinessModel\Light\NotificationDevice();
$notificationMobile->routeCaseNotification($_SESSION['USER_LOGGED'], $_SESSION['PROCESS'], $_SESSION['TASK'],
$appFields, $_POST['form']['TASKS'], $nextIndex, $appFields['DEL_INDEX']);
}
} catch (Exception $e) {
\G::log(G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . '|' . $e->getMessage() , PATH_DATA, "mobile.log");
}

View File

@@ -7,6 +7,18 @@ use G;
class NotificationDevice
{
public function checkMobileNotifications()
{
$conf = \System::getSystemConfiguration('', '', SYS_SYS);
$activeNotifications = true;
if (isset($conf['mobileNotifications'])) {
$activeNotifications = $conf['mobileNotifications'] == 1 ? true : false;
}
return $activeNotifications;
}
/**
* Post Create register device with userUid
*