No changes
This commit is contained in:
parent
8680a02b13
commit
b6b398f5bf
17374 changed files with 2475441 additions and 0 deletions
24
ControlPanel/modules/tickets/notificationCount.php
Normal file
24
ControlPanel/modules/tickets/notificationCount.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
require 'include/ticket.php';
|
||||
require 'include/TicketSettings.php';
|
||||
|
||||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
|
||||
$ticket = new Ticket($db);
|
||||
$TicketSettings = new TicketSettings($db);
|
||||
$notificationsEnabled = $TicketSettings->get('notifications_enabled');
|
||||
|
||||
if ($notificationsEnabled['notifications_enabled']) {
|
||||
$isAdmin = $db->isAdmin($_SESSION['user_id']);
|
||||
$status = $isAdmin ? 3 : 2;
|
||||
$ticketOwner = (!$isAdmin ? $_SESSION['user_id'] : null);
|
||||
|
||||
echo json_encode(
|
||||
array('notificationCount' => $ticket->notificationCount($ticketOwner, $status)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue