- Switch gateway from PBI_LV_Tickets to PBI_FP_Tickets to get Description and Company_Contact_Name fields - Ticket number links to ticket detail page - Customer column shows Company_Contact_Name with link to debitor detail - Description column with text-overflow ellipsis - Last activity column shows formatted date (was: age in hours) - Backend provides last_activity ISO string and customer_name per ticket - Table headers use i18n labels via data attributes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
94 lines
3.6 KiB
PHTML
94 lines
3.6 KiB
PHTML
<?php
|
|
|
|
/**
|
|
* Team workload dashboard — visual workload map for support team leads.
|
|
* Tab "Current": agent cards with open tickets, queue at top.
|
|
* Tab "Performance": resolved per agent in a selectable period.
|
|
*/
|
|
|
|
$periods = [30, 90, 180, 365];
|
|
$periodLabels = [
|
|
30 => t('30 days'),
|
|
90 => t('90 days'),
|
|
180 => t('6 months'),
|
|
365 => t('1 year'),
|
|
];
|
|
?>
|
|
<div class="app-details-container"
|
|
data-team-workload-url="<?php e(lurl('helpdesk/team-workload-data')); ?>"
|
|
data-label-not-assigned="<?php e(t('Not assigned')); ?>"
|
|
data-label-queue="<?php e(t('Queue')); ?>"
|
|
data-label-tickets="<?php e(t('Tickets')); ?>"
|
|
data-label-error="<?php e(t('Could not load team dashboard.')); ?>"
|
|
data-label-empty="<?php e(t('No team data available.')); ?>"
|
|
data-label-critical="<?php e(t('Critical (>48h open)')); ?>"
|
|
data-ticket-base-url="<?php e(lurl('helpdesk/ticket/')); ?>"
|
|
data-debitor-base-url="<?php e(lurl('helpdesk/debitor/')); ?>"
|
|
data-label-ticket="<?php e(t('Ticket')); ?>"
|
|
data-label-customer="<?php e(t('Debtor')); ?>"
|
|
data-label-description="<?php e(t('Description')); ?>"
|
|
data-label-last-activity="<?php e(t('Last activity')); ?>"
|
|
>
|
|
<section>
|
|
<?php
|
|
$titlebar = [
|
|
'title' => t('Team workload'),
|
|
'backHref' => lurl('helpdesk'),
|
|
'backTitle' => t('Back'),
|
|
'actions' => [
|
|
[
|
|
'label' => t('Refresh data'),
|
|
'type' => 'button',
|
|
'name' => 'team-refresh',
|
|
'class' => 'secondary outline',
|
|
],
|
|
],
|
|
];
|
|
require templatePath('partials/app-details-titlebar.phtml');
|
|
require templatePath('partials/app-flash.phtml');
|
|
?>
|
|
|
|
<div class="helpdesk-team-dashboard">
|
|
<div id="team-loading" aria-busy="true">
|
|
<?php for ($i = 0; $i < 3; $i++): ?>
|
|
<div class="helpdesk-skeleton" style="height: 5rem; margin-bottom: 0.75rem; border-radius: var(--app-radius, 0.375rem);"></div>
|
|
<?php endfor; ?>
|
|
</div>
|
|
|
|
<div id="team-error" class="notice" data-variant="error" role="alert" hidden>
|
|
<p><?php e(t('Could not load team dashboard.')); ?></p>
|
|
</div>
|
|
|
|
<div id="team-empty" class="notice" data-variant="info" role="status" hidden>
|
|
<p><?php e(t('No team data available.')); ?></p>
|
|
</div>
|
|
|
|
<div id="team-content" hidden>
|
|
<div class="app-tabs" data-tabs data-app-component="tabs" data-tabs-param="tab" data-tabs-storage-key="helpdesk-team-tabs-v1">
|
|
<div class="app-tabs-nav">
|
|
<button type="button" data-tab="current" data-tab-default><?php e(t('Current')); ?></button>
|
|
<button type="button" data-tab="performance"><?php e(t('Performance')); ?></button>
|
|
</div>
|
|
|
|
<div data-tab-panel="current">
|
|
<div id="team-current-cards"></div>
|
|
</div>
|
|
|
|
<div data-tab-panel="performance" class="helpdesk-team-performance-panel">
|
|
<div class="helpdesk-segment-control" id="team-period-selector">
|
|
<?php foreach ($periods as $p): ?>
|
|
<input type="radio" name="team-period" id="team-period-<?php e($p); ?>" value="<?php e($p); ?>"<?php if ($p === 90): ?> checked<?php endif; ?>>
|
|
<label for="team-period-<?php e($p); ?>"><?php e($periodLabels[$p]); ?></label>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
<div id="team-performance-cards"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<script type="module" src="<?php e(assetVersion('modules/helpdesk/js/helpdesk-team.js')); ?>"></script>
|