feat: Add admin navigation, fix modals, clickable stats, update docs
- Add admin dropdown menu in dashboard header with links to all admin pages - Fix template modal: larger size (800px), responsive grid, type/priority dropdowns - Fix recurring tickets modal: add Type and Assign To fields, larger size - Make dashboard stat cards clickable for quick filtering - Fix user-activity query (remove is_active requirement) - Add table existence check in ticket_dependencies API - Fix table overflow on dashboard - Update Claude.md and README.md with current project status - Remove migrations directory (all migrations completed) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,7 +79,17 @@
|
||||
<?php if (isset($GLOBALS['currentUser'])): ?>
|
||||
<span class="user-name">👤 <?php echo htmlspecialchars($GLOBALS['currentUser']['display_name'] ?? $GLOBALS['currentUser']['username']); ?></span>
|
||||
<?php if ($GLOBALS['currentUser']['is_admin']): ?>
|
||||
<span class="admin-badge">Admin</span>
|
||||
<div class="admin-dropdown">
|
||||
<button class="admin-badge" onclick="toggleAdminMenu(event)">Admin ▼</button>
|
||||
<div class="admin-dropdown-content" id="adminDropdown">
|
||||
<a href="/admin/templates">📋 Templates</a>
|
||||
<a href="/admin/workflow">🔄 Workflow</a>
|
||||
<a href="/admin/recurring-tickets">🔁 Recurring Tickets</a>
|
||||
<a href="/admin/custom-fields">📝 Custom Fields</a>
|
||||
<a href="/admin/user-activity">👥 User Activity</a>
|
||||
<a href="/admin/audit-log">📜 Audit Log</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<button class="settings-icon" title="Settings (Alt+S)" onclick="openSettingsModal()">⚙</button>
|
||||
<?php endif; ?>
|
||||
@@ -667,5 +677,47 @@
|
||||
<script src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/settings.js"></script>
|
||||
<script src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/keyboard-shortcuts.js"></script>
|
||||
<script src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/advanced-search.js"></script>
|
||||
<script>
|
||||
// Admin dropdown toggle
|
||||
function toggleAdminMenu(event) {
|
||||
event.stopPropagation();
|
||||
const dropdown = document.getElementById('adminDropdown');
|
||||
dropdown.classList.toggle('show');
|
||||
}
|
||||
|
||||
// Close admin dropdown when clicking outside
|
||||
document.addEventListener('click', function(event) {
|
||||
const dropdown = document.getElementById('adminDropdown');
|
||||
if (dropdown && !event.target.closest('.admin-dropdown')) {
|
||||
dropdown.classList.remove('show');
|
||||
}
|
||||
});
|
||||
|
||||
// Stat card click handlers for filtering
|
||||
document.querySelectorAll('.stat-card').forEach(card => {
|
||||
card.style.cursor = 'pointer';
|
||||
card.addEventListener('click', function() {
|
||||
const classList = this.classList;
|
||||
let url = '/?';
|
||||
const today = new Date().toISOString().split('T')[0];
|
||||
|
||||
if (classList.contains('stat-open')) {
|
||||
url += 'status=Open';
|
||||
} else if (classList.contains('stat-critical')) {
|
||||
url += 'status=Open,Pending,In+Progress&priority_max=1';
|
||||
} else if (classList.contains('stat-unassigned')) {
|
||||
url += 'status=Open,Pending,In+Progress&assigned_to=unassigned';
|
||||
} else if (classList.contains('stat-today')) {
|
||||
url += 'status=Open,Pending,In+Progress&created_from=' + today + '&created_to=' + today;
|
||||
} else if (classList.contains('stat-resolved')) {
|
||||
url += 'status=Closed&updated_from=' + today + '&updated_to=' + today;
|
||||
}
|
||||
|
||||
if (url !== '/?') {
|
||||
window.location.href = url;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user