diff --git a/debug.log b/debug.log index 9b24c40..f0c1e6a 100644 --- a/debug.log +++ b/debug.log @@ -134,3 +134,4 @@ 2026-05-02 17:32:10 - Requesting AI. UUID: [e1f9b5b3-fcef-4c8d-87d2-8630b1f72491] CFG: {"base_url":"https:\/\/flatlogic.com","responses_path":"\/projects\/38471\/ai-request","project_id":"38471","project_uuid":"e1f9b5b3-fcef-4c8d-87d2-8630b1f72491","project_header":"Project-UUID","default_model":"gpt-4o-mini","timeout":30,"verify_tls":true} 2026-05-02 17:32:11 - Requesting AI. UUID: [e1f9b5b3-fcef-4c8d-87d2-8630b1f72491] CFG: {"base_url":"https:\/\/flatlogic.com","responses_path":"\/projects\/38471\/ai-request","project_id":"38471","project_uuid":"e1f9b5b3-fcef-4c8d-87d2-8630b1f72491","project_header":"Project-UUID","default_model":"gpt-4o-mini","timeout":30,"verify_tls":true} 2026-05-02 17:32:54 - Requesting AI. UUID: [e1f9b5b3-fcef-4c8d-87d2-8630b1f72491] CFG: {"base_url":"https:\/\/flatlogic.com","responses_path":"\/projects\/38471\/ai-request","project_id":"38471","project_uuid":"e1f9b5b3-fcef-4c8d-87d2-8630b1f72491","project_header":"Project-UUID","default_model":"gpt-4o-mini","timeout":30,"verify_tls":true} +2026-05-02 18:41:44 - Items case hit diff --git a/index.php b/index.php index 655c2a2..b3d6f44 100644 --- a/index.php +++ b/index.php @@ -426,6 +426,26 @@ if (!isset($_SESSION['lang'])) { $lang = $_SESSION['lang']; $dir = ($lang === 'ar') ? 'rtl' : 'ltr'; +if (!function_exists('localized_option_label')) { + function localized_option_label(array $row, ?string $forceLang = null, string $fallback = '---'): string + { + global $lang; + $targetLang = $forceLang ?? $lang; + $keys = $targetLang === 'ar' + ? ['name_ar', 'short_name_ar', 'name_en', 'short_name_en'] + : ['name_en', 'short_name_en', 'name_ar', 'short_name_ar']; + + foreach ($keys as $key) { + $value = trim((string)($row[$key] ?? '')); + if ($value !== '') { + return $value; + } + } + + return $fallback; + } +} + // Licensing Middleware try { $is_activated = LicenseService::isActivated(); @@ -6244,24 +6264,24 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';