top.window.location = '../../index.php'";
exit;
}
require_once __DIR__ . "/" . "../../includes/include_geral_new.inc.php";
require_once __DIR__ . "/" . "../../includes/classes/ConnectPDO.php";
require_once __DIR__ . "/" . "../../includes/components/html2text-master/vendor/autoload.php";
use includes\classes\ConnectPDO;
$conn = ConnectPDO::getInstance();
$auth = new AuthNew($_SESSION['s_logado'], $_SESSION['s_nivel'], 3);
$dateToday = date('Y-m-d');
$exceptions = "";
$user = $_SESSION['s_uid'];
$loadedNotificationsCount = 0;
$sent = false;
$notice_id = [];
?>
= TRANS('MY_NOTICES'); ?>
'.TRANS("SEEN").'';
$hasToSignTerm = hasToSignTerm($conn, $user);
$userHasTicketWaitingToBeRated = userHasTicketWaitingToBeRated($conn, $user);
if ($hasToSignTerm || $userHasTicketWaitingToBeRated) {
?>
= TRANS('NOTICES_NEED_MY_ACTION'); ?>
';
echo message('danger', '', TRANS('MSG_NEED_TO_SIGN_TERM') . $spanProfileUrl, '', '', true);
}
/* Se existirem chamados para serem avaliados pelo usuário */
if ($userHasTicketWaitingToBeRated) {
$loadedNotificationsCount++;
echo message('danger', '', TRANS('NOTIFICATION_YOUR_PENDING_RATING'), '', '', true, 'fas fa-star-half-alt');
}
}
/* Notificações pontuais - não relacionadas aos chamados */
$ticketNumberSeparator = "%tkt%";
$UserOtherNotifications = getUnreadUserNotifications($conn, $user);
$UserSeenOtherNotifications = getSeenUserNotifications($conn, $user);
$cols = [TRANS('AUTHOR'), TRANS('DATE')];
$values = [];
if (count($UserOtherNotifications)) {
$loadedNotificationsCount += count($UserOtherNotifications);
?>
= TRANS('MISC_NOTIFICATIONS'); ?>
1) {
$spanTicketText = '
' . $textParts[1] . '';
$text = "
" .(new \Html2Text\Html2Text($textParts[0]))->getText() . $spanTicketText;
} else {
$text = "
" .(new \Html2Text\Html2Text($notification['text']))->getText();
}
echo alertNotice('secondary', '', $cols, $values, $text, $notification['id'] . '_' . 'users_notifications', 'users_notifications');
}
/* Notificações sobre chamados relacionados ao usuário - Não lidas */
$ticketsNotifications = getUserTicketsNotices($conn, $user);
/* Notificações sobre chamados relacionados ao usuário - lidas */
$tickets_notifications_seen = getUserTicketsNotices($conn, $user, false, true);
if (count($ticketsNotifications) == 0) {
echo message('success', '', TRANS('MSG_NO_NOTICES_ABOUT_YOUR_TICKETS'), '', '', true);
} else {
$loadedNotificationsCount += count($ticketsNotifications);
?>
= TRANS('TICKETS_NOTIFICATIONS'); ?>
' . $notice['ocorrencia'] . '';
$values = [$spanToTicket, getEntryType($notice['type']), $notice['author'], dateScreen($notice['created_at'])];
$text = "
" .(new \Html2Text\Html2Text($notice['assentamento']))->getText(); // . "
";
echo alertNotice('info', TRANS($notice['type_name']), $cols, $values, $text, $notice['notice_id'] . '_' . 'assentamentos', 'assentamentos');
}
}
/**
* Notificações sobre chamados relacionados ao usuário - lidas
*/
if (count($UserSeenOtherNotifications)) {
?>
= TRANS('OTHER_SEEN_NOTIFICATIONS'); ?>
1) {
$spanTicketText = ' ' . $textParts[1] . '';
$text = " " . (new \Html2Text\Html2Text($textParts[0]))->getText() . $spanTicketText;
} else {
$text = " " . (new \Html2Text\Html2Text($notice['text']))->getText();
}
?>
|
= $notice['author']; ?> |
= dateScreen($notice['created_at']); ?> |
= $text; ?> |
= TRANS('TICKETS_SEEN_NOTIFICATIONS'); ?>
getText();
?>
| = TRANS($notice['type_name']); ?> |
= $notice['ocorrencia']; ?> |
= getEntryType($notice['type']); ?> |
= $notice['author']; ?> |
= dateScreen($notice['created_at']); ?> |
= $text; ?> |