Compare commits

...

5 Commits

Author SHA1 Message Date
chaim 836594a863 chore: bump version to 1.3.1 for reinstall
Version 1.2.3 was installed on EspoCRM but DirectAccessReport entity
was returning 404. Bumped to 1.3.1 to allow clean upgrade install.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:10:51 +00:00
chaim 19db7c1093 feat: AfterInstall creates custom i18n directories for all locales
Ensures custom/Espo/Custom/Resources/i18n/{locale}/ exists for
en_US, fa_IR, he_IL, and the system language. Without this, Label
Manager fails with 500 on fresh installs using fa_IR (Hebrew RTL
wrapper) because the directory doesn't exist and EspoCRM doesn't
create it automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 14:27:44 +00:00
chaim ee55f1ecef fix: repair broken Unicode characters in entityDefs and PHP service
- Case.json: "תחום א��ר" → "תחום אחר", "��הול" → "בהול"
- DirectAccessReportService.php: "גישה ישיר��" → "גישה ישירה", broken em-dash

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 13:20:29 +00:00
chaim 0cca55da0c fix: translate $LegalAssistance panel tab via "tabs" i18n key
Bottom panel tab labels with $ prefix resolve via translate(key, 'tabs', scope),
not 'labels'. Added "tabs" section to Case.json (fa_IR/he_IL/en_US).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 13:07:51 +00:00
chaim ca3d5e7890 fix: add Hebrew translation for LegalAssistance panel tab label
Translates the bottom panel tab "$LegalAssistance" → "סיוע משפטי"
in Case detail view (fa_IR + he_IL + en_US).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 12:54:14 +00:00
12 changed files with 48 additions and 5 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,10 @@
{ {
"labels": {
"LegalAssistance": "Legal Assistance"
},
"tabs": {
"LegalAssistance": "Legal Assistance"
},
"fields": { "fields": {
"cLegalAidType": "Legal Aid Type", "cLegalAidType": "Legal Aid Type",
"cAppointmentDate": "Appointment Date", "cAppointmentDate": "Appointment Date",
@@ -1,4 +1,10 @@
{ {
"labels": {
"LegalAssistance": "סיוע משפטי"
},
"tabs": {
"LegalAssistance": "סיוע משפטי"
},
"fields": { "fields": {
"cLegalAidType": "סוג מינוי סיוע משפטי", "cLegalAidType": "סוג מינוי סיוע משפטי",
"cAppointmentDate": "מועד קבלת המינוי", "cAppointmentDate": "מועד קבלת המינוי",
@@ -1,4 +1,10 @@
{ {
"labels": {
"LegalAssistance": "סיוע משפטי"
},
"tabs": {
"LegalAssistance": "סיוע משפטי"
},
"fields": { "fields": {
"cLegalAidType": "סוג מינוי סיוע משפטי", "cLegalAidType": "סוג מינוי סיוע משפטי",
"cAppointmentDate": "מועד קבלת המינוי", "cAppointmentDate": "מועד קבלת המינוי",
@@ -16,11 +16,11 @@
}, },
"cAidType": { "cAidType": {
"type": "enum", "type": "enum",
"options": ["", "הגשת ערעור", "יעוץ והדרכה", "סיוע נוסף ביטוח לאומי", "סיוע נוסף תחום אר", "אי מתן סיוע"] "options": ["", "הגשת ערעור", "יעוץ והדרכה", "סיוע נוסף ביטוח לאומי", "סיוע נוסף תחום אחר", "אי מתן סיוע"]
}, },
"cUrgencyLevel": { "cUrgencyLevel": {
"type": "enum", "type": "enum",
"options": ["", "רגיל", "דחוף", "הול"], "options": ["", "רגיל", "דחוף", "בהול"],
"displayAsLabel": true, "displayAsLabel": true,
"style": { "style": {
"רגיל": "default", "רגיל": "default",
@@ -36,7 +36,7 @@ class DirectAccessReportService
$contactName = $contact $contactName = $contact
? ($contact->get('firstName') . ' ' . $contact->get('lastName')) ? ($contact->get('firstName') . ' ' . $contact->get('lastName'))
: 'ללא איש קשר'; : 'ללא איש קשר';
$reportName = "דוח גישה ישיר{$contactName}"; $reportName = "דוח גישה ישירה{$contactName}";
// Extract legal analysis from nested object // Extract legal analysis from nested object
$legalAnalysis = $params['legalAnalysis'] ?? []; $legalAnalysis = $params['legalAnalysis'] ?? [];
@@ -52,7 +52,7 @@ class DirectAccessReportService
'caseId' => $caseId, 'caseId' => $caseId,
'assignedUserId' => $userId, 'assignedUserId' => $userId,
// Section ב' מהות הסיוע // Section ב' מהות הסיוע
'aidType' => $params['aidType'] ?? null, 'aidType' => $params['aidType'] ?? null,
'urgencyLevel' => $params['urgencyLevel'] ?? null, 'urgencyLevel' => $params['urgencyLevel'] ?? null,
'appointmentDate' => $this->normalizeDate($params['appointmentDate'] ?? null), 'appointmentDate' => $this->normalizeDate($params['appointmentDate'] ?? null),
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "LegalAssistance", "name": "LegalAssistance",
"version": "1.2.0", "version": "1.3.1",
"acceptableVersions": [">=8.0.0"], "acceptableVersions": [">=8.0.0"],
"php": [">=8.1"], "php": [">=8.1"],
"releaseDate": "2026-04-06", "releaseDate": "2026-04-06",
+25
View File
@@ -24,6 +24,10 @@ class AfterInstall
$log->info('LegalAssistance: Running AfterInstall...'); $log->info('LegalAssistance: Running AfterInstall...');
// 0. Ensure custom i18n directories exist for all supported locales
$config = $container->getByClass(Config::class);
$this->ensureI18nDirectories($config, $log);
// 1. Deploy ai-gateway plugin files // 1. Deploy ai-gateway plugin files
$this->deployPluginFiles($log); $this->deployPluginFiles($log);
@@ -42,6 +46,27 @@ class AfterInstall
$log->info('LegalAssistance: AfterInstall completed.'); $log->info('LegalAssistance: AfterInstall completed.');
} }
private function ensureI18nDirectories(Config $config, Log $log): void
{
$basePath = 'custom/Espo/Custom/Resources/i18n';
$language = $config->get('language', 'en_US');
$locales = array_unique(['en_US', 'fa_IR', 'he_IL', $language]);
foreach ($locales as $locale) {
$dir = $basePath . '/' . $locale;
if (!is_dir($dir)) {
if (mkdir($dir, 0775, true)) {
$log->info("LegalAssistance: Created i18n directory: {$dir}");
} else {
$log->warning("LegalAssistance: Failed to create i18n directory: {$dir}");
}
}
}
}
private function deployPluginFiles(Log $log): void private function deployPluginFiles(Log $log): void
{ {
// Source: extension's plugins/ directory (relative to EspoCRM root after install) // Source: extension's plugins/ directory (relative to EspoCRM root after install)