Move breadcrumb rendering from individual page templates into the core topbar. Each page now sets $breadcrumbs in its action .php file; the topbar renders it automatically via the shared partial. - Remove global back/forward buttons and app-nav-history.js component - Remove Alt+Arrow keyboard shortcuts for history navigation - Render breadcrumb in topbar-left section (replaces button area) - Clean up breadcrumb CSS: context-neutral base (flex, no margin) - Recalculate sticky titlebar offset in details container - Migrate all 41 pages (core + helpdesk, audit, addressbook, api-docs) - Add missing breadcrumbs to addressbook detail view - Update architecture contract tests (nav-history references removed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
178 lines
6.5 KiB
PHTML
178 lines
6.5 KiB
PHTML
<?php
|
|
use MintyPHP\Router;
|
|
use MintyPHP\Session;
|
|
use MintyPHP\Http\Request;
|
|
|
|
$toolbarFilterSchema = is_array($toolbarFilterSchema ?? null) ? $toolbarFilterSchema : [];
|
|
$searchToolbarFilterSchema = is_array($searchToolbarFilterSchema ?? null) ? $searchToolbarFilterSchema : [];
|
|
$drawerToolbarFilterSchema = is_array($drawerToolbarFilterSchema ?? null) ? $drawerToolbarFilterSchema : [];
|
|
$toolbarFilterState = is_array($toolbarFilterState ?? null) ? $toolbarFilterState : [];
|
|
$toolbarOptionSets = is_array($toolbarOptionSets ?? null) ? $toolbarOptionSets : [];
|
|
$clientFilterSchema = is_array($clientFilterSchema ?? null) ? $clientFilterSchema : [];
|
|
$filterChipMeta = is_array($filterChipMeta ?? null) ? $filterChipMeta : [];
|
|
$searchConfig = is_array($searchConfig ?? null) ? $searchConfig : null;
|
|
$activeTenant = (string) ($toolbarFilterState['tenant'] ?? '');
|
|
$pageAuth = is_array($viewAuth['page'] ?? null) ? $viewAuth['page'] : [];
|
|
$canDeleteUsers = (bool) ($pageAuth['can_delete_users'] ?? false);
|
|
$canUpdateUsers = (bool) ($pageAuth['can_update_users'] ?? false);
|
|
$canAccessPdf = (bool) ($pageAuth['can_access_pdf'] ?? false);
|
|
$canUpdateSelf = (bool) ($pageAuth['can_update_self'] ?? false);
|
|
$canCreateUser = (bool) ($pageAuth['can_create_user'] ?? false);
|
|
$currentUserUuid = (string) ($_SESSION['user']['uuid'] ?? '');
|
|
$showTenantTabs = isset($tenants) && is_array($tenants) && count($tenants) > 1;
|
|
?>
|
|
<?php
|
|
$listTitle = t('Users');
|
|
ob_start();
|
|
?>
|
|
<button type="button" class="secondary outline" data-users-bulk="activate" hidden>
|
|
<i class="bi bi-check-circle"></i> <?php e(t('Activate')); ?>
|
|
</button>
|
|
<button type="button" class="secondary outline" data-users-bulk="deactivate" hidden>
|
|
<i class="bi bi-ban"></i> <?php e(t('Deactivate')); ?>
|
|
</button>
|
|
<?php if ($canUpdateUsers): ?>
|
|
<button type="button" class="secondary outline" data-users-bulk="send-access" hidden>
|
|
<i class="bi bi-envelope"></i> <?php e(t('Send access')); ?>
|
|
</button>
|
|
<?php endif; ?>
|
|
<?php if ($canAccessPdf): ?>
|
|
<button type="button" class="secondary outline" data-users-bulk="access-pdf" hidden>
|
|
<i class="bi bi-file-earmark-pdf"></i> <?php e(t('Download access PDFs')); ?>
|
|
</button>
|
|
<?php endif; ?>
|
|
<?php if ($canDeleteUsers): ?>
|
|
<button type="button" class="danger outline" data-users-bulk="delete" hidden>
|
|
<i class="bi bi-trash3-fill"></i> <?php e(t('Delete')); ?>
|
|
</button>
|
|
<?php endif; ?>
|
|
<details class="dropdown" data-tooltip="<?php e(t("Actions")); ?>" data-tooltip-pos="top">
|
|
<summary role="button" class="outline secondary"><i class="bi bi-three-dots"></i></summary>
|
|
<ul dir="rtl">
|
|
<li dir="ltr">
|
|
<button class="transparent" type="button" data-users-export>
|
|
<?php e(t('Export CSV')); ?>
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
</details>
|
|
|
|
<?php if ($canCreateUser): ?>
|
|
<a role="button" class="app-action-success" href="<?php e(requestPathWithReturnTarget('admin/users/create', Request::pathWithQuery())); ?>">
|
|
<i class="bi bi-plus"></i> <?php e(t('Create user')); ?>
|
|
</a>
|
|
<?php endif; ?>
|
|
<?php
|
|
$listTitleActionsHtml = ob_get_clean();
|
|
require templatePath('partials/app-list-titlebar.phtml');
|
|
?>
|
|
<?php if ($showTenantTabs): ?>
|
|
<?php
|
|
$listTabsId = 'users-tabs';
|
|
$listTabsItems = [
|
|
[
|
|
'href' => 'admin/users',
|
|
'label' => t('All'),
|
|
'active' => $activeTenant === '',
|
|
],
|
|
];
|
|
foreach ($tenants ?? [] as $tenant) {
|
|
$tenantUuid = (string) ($tenant['uuid'] ?? '');
|
|
if ($tenantUuid === '') {
|
|
continue;
|
|
}
|
|
|
|
$listTabsItems[] = [
|
|
'href' => 'admin/users?tenant=' . rawurlencode($tenantUuid),
|
|
'label' => (string) ($tenant['description'] ?? ''),
|
|
'active' => $activeTenant === $tenantUuid,
|
|
];
|
|
}
|
|
require templatePath('partials/app-list-tabs.phtml');
|
|
?>
|
|
<?php endif; ?>
|
|
<?php
|
|
$filterUiNamespace = 'users';
|
|
require templatePath('partials/app-list-filters.phtml');
|
|
?>
|
|
<div class="app-list-table">
|
|
<div id="users-grid"></div>
|
|
</div>
|
|
<?php if ($canAccessPdf): ?>
|
|
<form id="users-access-pdf-bulk-form" method="post" action="admin/users/access-pdf-bulk" hidden>
|
|
<?php Session::getCsrfInput(); ?>
|
|
<input type="hidden" name="uuids" value="">
|
|
</form>
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php
|
|
$gridLang = json_decode(appBufferValue('grid_lang'), true);
|
|
if (!is_array($gridLang)) {
|
|
$gridLang = [];
|
|
}
|
|
$gridCsrf = json_decode(appBufferValue('grid_csrf'), true);
|
|
if (!is_array($gridCsrf)) {
|
|
$gridCsrf = [];
|
|
}
|
|
$pageConfig = [
|
|
'gridSearch' => $searchConfig,
|
|
'filterSchema' => $clientFilterSchema,
|
|
'filterChipMeta' => $filterChipMeta,
|
|
'currentUserUuid' => (string) $currentUserUuid,
|
|
'canUpdateUsers' => (bool) $canUpdateUsers,
|
|
'canUpdateSelf' => (bool) $canUpdateSelf,
|
|
'csrf' => $gridCsrf,
|
|
'gridLang' => $gridLang,
|
|
'labels' => [
|
|
'avatar' => t('Avatar'),
|
|
'firstName' => t('First name'),
|
|
'lastName' => t('Last name'),
|
|
'email' => t('Email'),
|
|
'state' => t('State'),
|
|
'tenants' => t('Tenants'),
|
|
'departments' => t('Departments'),
|
|
'roles' => t('Roles'),
|
|
'phone' => t('Phone'),
|
|
'mobile' => t('Mobile'),
|
|
'shortDial' => t('Short dial'),
|
|
'created' => t('Created'),
|
|
'modified' => t('Modified'),
|
|
'lastLogin' => t('Last login'),
|
|
'selectAll' => t('Select all'),
|
|
'active' => t('Active'),
|
|
'inactive' => t('Inactive'),
|
|
'never' => t('Never'),
|
|
'bulkActivateConfirm' => t('Activate users?'),
|
|
'bulkDeactivateConfirm' => t('Deactivate users?'),
|
|
'bulkDeleteConfirm' => t('Delete users?'),
|
|
'bulkSendAccessConfirm' => t('Send access emails to selected users?'),
|
|
'bulkAccessPdfConfirm' => t('Generate access PDFs for selected users?'),
|
|
'primaryTenant' => t('Primary tenant'),
|
|
'bulkMessages' => [
|
|
'activate' => [
|
|
'success' => t('%d users activated'),
|
|
'error' => t('Failed to activate users'),
|
|
],
|
|
'deactivate' => [
|
|
'success' => t('%d users deactivated'),
|
|
'error' => t('Failed to deactivate users'),
|
|
],
|
|
'delete' => [
|
|
'success' => t('%d users deleted'),
|
|
'error' => t('Failed to delete users'),
|
|
],
|
|
'send-access' => [
|
|
'success' => t('Access emails sent to %d users'),
|
|
'partial' => t('Access emails sent to %d users, %f failed'),
|
|
'error' => t('Failed to send access emails'),
|
|
],
|
|
],
|
|
],
|
|
];
|
|
?>
|
|
<script src="<?php e(assetVersion('vendor/gridjs/gridjs.umd.js')); ?>"></script>
|
|
<script src="<?php e(assetVersion('vendor/gridjs/plugins/selection/selection.umd.js')); ?>"></script>
|
|
<script type="application/json" id="page-config-admin-users-index"><?php gridJsonForJs($pageConfig); ?></script>
|
|
<script type="module" src="<?php e(assetVersion('js/pages/admin-users-index.js')); ?>"></script>
|