feat(helpdesk): add Domains list page with BC OData contract type enrichment
Add a new "Domains" page to the helpdesk module that fetches domain data from the FS_Contract_Domains OData endpoint and enriches each domain with its contract type (PI_Header_Type) by joining with FS_Contract_Lines_Test where Type = 'Domain'. New files: - domains/index().php, index(default).phtml, filter-schema.php — list page - domains-data().php — data endpoint with PHP-side filtering/sorting - helpdesk-domains-index.js — Grid.js via initStandardListPage() Gateway additions: - listDomains() — fetch all contract domains - listDomainContractLines() — fetch domain-type contract lines for type lookup Sidebar restructured into three collapsible groups (Lookup, Monitoring, Administration) with per-group icons and color coding, matching the core admin panel pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,55 +9,85 @@ $canViewRiskRadar = !empty($helpdeskNav['can_view_risk_radar']);
|
||||
$settingsActive = navActive('helpdesk/settings', true);
|
||||
$teamActive = navActive('helpdesk/team', true);
|
||||
$riskRadarActive = navActive('helpdesk/risk-radar', true);
|
||||
$domainsActive = navActive('helpdesk/domains', true);
|
||||
$customersActive = navActive('helpdesk', true);
|
||||
if ($settingsActive['isActive'] || $teamActive['isActive'] || $riskRadarActive['isActive']) {
|
||||
if ($settingsActive['isActive'] || $teamActive['isActive'] || $riskRadarActive['isActive'] || $domainsActive['isActive']) {
|
||||
$customersActive = ['class' => '', 'aria' => '', 'isActive' => false];
|
||||
}
|
||||
|
||||
$helpdeskNavItems = [
|
||||
$helpdeskNavGroups = [
|
||||
[
|
||||
'label' => t('Customers'),
|
||||
'path' => 'helpdesk',
|
||||
'active' => $customersActive,
|
||||
'visible' => true,
|
||||
'key' => 'helpdesk-lookup',
|
||||
'label' => t('Lookup'),
|
||||
'icon' => 'bi-search',
|
||||
'items' => [
|
||||
[
|
||||
'label' => t('Customers'),
|
||||
'path' => 'helpdesk',
|
||||
'active' => $customersActive,
|
||||
'visible' => true,
|
||||
],
|
||||
[
|
||||
'label' => t('Domains'),
|
||||
'path' => 'helpdesk/domains',
|
||||
'active' => $domainsActive,
|
||||
'visible' => true,
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => t('Team workload'),
|
||||
'path' => 'helpdesk/team',
|
||||
'active' => $teamActive,
|
||||
'visible' => $canViewTeam,
|
||||
'key' => 'helpdesk-monitoring',
|
||||
'label' => t('Monitoring'),
|
||||
'icon' => 'bi-bar-chart-line',
|
||||
'items' => [
|
||||
[
|
||||
'label' => t('Team workload'),
|
||||
'path' => 'helpdesk/team',
|
||||
'active' => $teamActive,
|
||||
'visible' => $canViewTeam,
|
||||
],
|
||||
[
|
||||
'label' => t('Risk radar'),
|
||||
'path' => 'helpdesk/risk-radar',
|
||||
'active' => $riskRadarActive,
|
||||
'visible' => $canViewRiskRadar,
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => t('Risk radar'),
|
||||
'path' => 'helpdesk/risk-radar',
|
||||
'active' => $riskRadarActive,
|
||||
'visible' => $canViewRiskRadar,
|
||||
],
|
||||
[
|
||||
'label' => t('Settings'),
|
||||
'path' => 'helpdesk/settings',
|
||||
'active' => $settingsActive,
|
||||
'visible' => $canManageSettings,
|
||||
'key' => 'helpdesk-administration',
|
||||
'label' => t('Administration'),
|
||||
'icon' => 'bi-sliders',
|
||||
'items' => [
|
||||
[
|
||||
'label' => t('Settings'),
|
||||
'path' => 'helpdesk/settings',
|
||||
'active' => $settingsActive,
|
||||
'visible' => $canManageSettings,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$visibleItems = array_values(array_filter($helpdeskNavItems, static fn (array $item): bool => !empty($item['visible'])));
|
||||
$groupIsActive = false;
|
||||
foreach ($visibleItems as $item) {
|
||||
$activeState = $item['active'] ?? [];
|
||||
if (!empty($activeState['isActive'])) {
|
||||
$groupIsActive = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<ul class="app-sidebar-admin-nav" aria-label="<?php e(t('Helpdesk')); ?>">
|
||||
<?php if ($visibleItems): ?>
|
||||
<ul>
|
||||
<?php foreach ($helpdeskNavGroups as $group):
|
||||
$visibleItems = array_values(array_filter($group['items'], static fn (array $item): bool => !empty($item['visible'])));
|
||||
if (!$visibleItems) {
|
||||
continue;
|
||||
}
|
||||
$groupIsActive = false;
|
||||
foreach ($visibleItems as $item) {
|
||||
if (!empty(($item['active'] ?? [])['isActive'])) {
|
||||
$groupIsActive = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<li class="app-sidebar-group app-sidebar-admin-group">
|
||||
<details data-details-key="helpdesk-navigation"<?php if ($groupIsActive): ?> open<?php endif; ?>>
|
||||
<details data-details-key="<?php e($group['key']); ?>"<?php if ($groupIsActive): ?> open<?php endif; ?>>
|
||||
<summary>
|
||||
<i class="bi bi-headset"></i>
|
||||
<span><?php e(t('Helpdesk')); ?></span>
|
||||
<i class="bi <?php e($group['icon']); ?>"></i>
|
||||
<span><?php e($group['label']); ?></span>
|
||||
</summary>
|
||||
<ul>
|
||||
<?php foreach ($visibleItems as $item):
|
||||
@@ -72,5 +102,5 @@ foreach ($visibleItems as $item) {
|
||||
</ul>
|
||||
</details>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user