Add php files
This commit is contained in:
29
modules/Schedulers/EcmNotificationAjax.php
Executable file
29
modules/Schedulers/EcmNotificationAjax.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
require 'include/ECM/EcmNotifications/EcmNotification.php';
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('-1');
|
||||
if (!$_POST['job'] || $_POST['job']=='') die ('-1');
|
||||
switch ($_POST['job']) {
|
||||
case 'updateNotificationStatus': updateNotificationStatus($_POST['id'],$_POST['flag']); break;
|
||||
case 'changeNotificationDate': changeNotificationDate($_POST['id'],$_POST['flag']); break;
|
||||
case 'getLeaveadNotifications': getLeaveadNotifications($_POST['user_id']); break;
|
||||
}
|
||||
|
||||
function updateNotificationStatus($id,$flag){
|
||||
$EcmNotification = new EcmNotification();
|
||||
echo $EcmNotification->setNotificationFlag($id,$flag);
|
||||
unset($EcmNotification);
|
||||
}
|
||||
|
||||
function changeNotificationDate($id,$flag){
|
||||
$EcmNotification = new EcmNotification();
|
||||
echo $EcmNotification->setNotificationDate($id,$flag);
|
||||
unset($EcmNotification);
|
||||
}
|
||||
|
||||
function getLeaveadNotifications($user_id){
|
||||
|
||||
$EcmNotification = new EcmNotification($user_id);
|
||||
echo json_encode($EcmNotification->searchLeavedNotifications(), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE);
|
||||
unset($EcmNotification);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user