Fix critical bugs breaking ticket page and settings modal
- Fix fatal PHP error in UserModel::getAllGroups() - typo 'setCache' should be 'setCached', was causing ticket page to fail to render - Fix settings.js null reference errors when timezone element missing on ticket page (only exists on dashboard) - Fix ESC key detection for settings modal (checked 'block' but modal uses 'flex' display) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,15 +73,22 @@ function applyPreferences() {
|
|||||||
|
|
||||||
// Save preferences
|
// Save preferences
|
||||||
async function saveSettings() {
|
async function saveSettings() {
|
||||||
|
const rowsPerPage = document.getElementById('rowsPerPage');
|
||||||
|
const tableDensity = document.getElementById('tableDensity');
|
||||||
|
const userTimezone = document.getElementById('userTimezone');
|
||||||
|
const notificationsEnabled = document.getElementById('notificationsEnabled');
|
||||||
|
const soundEffects = document.getElementById('soundEffects');
|
||||||
|
const toastDuration = document.getElementById('toastDuration');
|
||||||
|
|
||||||
const prefs = {
|
const prefs = {
|
||||||
rows_per_page: document.getElementById('rowsPerPage').value,
|
rows_per_page: rowsPerPage ? rowsPerPage.value : '15',
|
||||||
default_status_filters: Array.from(document.querySelectorAll('[name="defaultFilters"]:checked'))
|
default_status_filters: Array.from(document.querySelectorAll('[name="defaultFilters"]:checked'))
|
||||||
.map(cb => cb.value).join(','),
|
.map(cb => cb.value).join(',') || 'Open,Pending,In Progress',
|
||||||
table_density: document.getElementById('tableDensity').value,
|
table_density: tableDensity ? tableDensity.value : 'normal',
|
||||||
timezone: document.getElementById('userTimezone').value,
|
timezone: userTimezone ? userTimezone.value : (window.APP_TIMEZONE || 'America/New_York'),
|
||||||
notifications_enabled: document.getElementById('notificationsEnabled').checked ? '1' : '0',
|
notifications_enabled: notificationsEnabled ? (notificationsEnabled.checked ? '1' : '0') : '1',
|
||||||
sound_effects: document.getElementById('soundEffects').checked ? '1' : '0',
|
sound_effects: soundEffects ? (soundEffects.checked ? '1' : '0') : '1',
|
||||||
toast_duration: document.getElementById('toastDuration').value
|
toast_duration: toastDuration ? toastDuration.value : '3000'
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -154,7 +161,7 @@ document.addEventListener('keydown', (e) => {
|
|||||||
// ESC to close modal
|
// ESC to close modal
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
const modal = document.getElementById('settingsModal');
|
const modal = document.getElementById('settingsModal');
|
||||||
if (modal && modal.style.display === 'block') {
|
if (modal && modal.style.display !== 'none' && modal.style.display !== '') {
|
||||||
closeSettingsModal();
|
closeSettingsModal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ class UserModel {
|
|||||||
sort($uniqueGroups);
|
sort($uniqueGroups);
|
||||||
|
|
||||||
// Cache the result
|
// Cache the result
|
||||||
self::setCache($cacheKey, $uniqueGroups);
|
self::setCached($cacheKey, $uniqueGroups);
|
||||||
|
|
||||||
return $uniqueGroups;
|
return $uniqueGroups;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user