61 lines
2.2 KiB
PHP
61 lines
2.2 KiB
PHP
|
|
<?php
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
if (!isset($escalated_count) && !isset($error)) {
|
||
|
|
require_once dirname(dirname(__DIR__)) . '/actions/user/escalation_overlay_widget_action.php';
|
||
|
|
$viewData = task_cert_user_escalation_overlay_widget_action();
|
||
|
|
if (is_array($viewData)) {
|
||
|
|
extract($viewData, EXTR_SKIP);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
$error = $error ?? null;
|
||
|
|
$viewerContactId = (int) ($viewer_contact_id ?? 0);
|
||
|
|
$escalatedCount = (int) ($escalated_count ?? 0);
|
||
|
|
$myTasksUrl = (string) ($my_tasks_url ?? '');
|
||
|
|
if ($myTasksUrl === '') {
|
||
|
|
$myTasksUrl = task_cert_view_url('user.my_tasks');
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($error || $escalatedCount <= 0 || $viewerContactId <= 0) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!function_exists('task_cert_render_styles')) {
|
||
|
|
require_once dirname(dirname(__DIR__)) . '/bootstrap.php';
|
||
|
|
}
|
||
|
|
task_cert_render_styles(['user']);
|
||
|
|
task_cert_render_scripts(['js/task_cert_escalation_overlay_widget.js']);
|
||
|
|
|
||
|
|
$taskLabel = $escalatedCount === 1 ? 'eskalierte Aufgabe' : 'eskalierte Aufgaben';
|
||
|
|
?>
|
||
|
|
<div
|
||
|
|
class="task-cert task-cert-user-escalation-overlay-widget"
|
||
|
|
data-task-cert-escalation-overlay
|
||
|
|
data-viewer-id="<?php echo $viewerContactId; ?>"
|
||
|
|
data-escalated-count="<?php echo $escalatedCount; ?>"
|
||
|
|
data-my-tasks-url="<?php echo TaskCertView::e($myTasksUrl); ?>"
|
||
|
|
>
|
||
|
|
<div
|
||
|
|
class="task-cert-user-escalation-overlay"
|
||
|
|
role="dialog"
|
||
|
|
aria-modal="true"
|
||
|
|
aria-labelledby="task-cert-escalation-overlay-title"
|
||
|
|
hidden
|
||
|
|
>
|
||
|
|
<div class="task-cert-user-escalation-overlay-backdrop" aria-hidden="true"></div>
|
||
|
|
<div class="task-cert-user-escalation-overlay-panel">
|
||
|
|
<h3 id="task-cert-escalation-overlay-title">Wichtiger Hinweis</h3>
|
||
|
|
<p>Sie haben <?php echo $escalatedCount; ?> <?php echo TaskCertView::e($taskLabel); ?>.</p>
|
||
|
|
<div class="task-cert-user-escalation-overlay-actions">
|
||
|
|
<button type="button" class="btn task-cert-btn-success" data-overlay-ack>
|
||
|
|
Ich habe es gelesen und werde die Aufgaben lösen
|
||
|
|
</button>
|
||
|
|
<a href="<?php echo TaskCertView::e($myTasksUrl); ?>" class="btn" data-overlay-my-tasks>
|
||
|
|
Zu meinen Aufgaben
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|