DirectAccessReportGenerator now, when CaseFilesCore is installed (soft-detected,
no hard dependency), sets the generated Document's folderId to the case
"מסמכים" folder via CaseFolderService so it shows in the CaseDocs panel. The
existing Case link + best-effort NetworkStorage upload are unchanged.
Verified on dev (P7_OK): php -l clean; Case.documents relate is visible via
Document.cases (shared junction); folder placement works.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The direct-access report now follows rule N1 canonical naming:
- The document name uses a tight ASCII hyphen ("דוח גישה ישירה-{contact}") instead of
an em-dash, and is sanitized via NetworkStorageIntegration's shared sanitizer.
- The report is now uploaded explicitly to the case folder after the Case link is set
(the AfterSave hook fired before the link existed, so reports previously landed in the
generic fallback folder). The Document and Attachment names are realigned to the
canonical stored name.
Adds build.sh (was missing) so the package can be built locally if needed.
Refs Task Master #1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Legal tools (generate_initial_report) are now built into shira-hermes
(mcp_server/tools/legal_tools.py). The AfterInstall no longer needs to
deploy tools.json and prompts.json to ai-gateway's plugins/ directory.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous regex /<w:t(?!...)/ matched any tag starting with <w:t
including <w:tbl>, <w:tc>, <w:tr>. Added lookahead (?=[ >/]) to only
match <w:t> elements (followed by space, > or /).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PHPWord's TemplateProcessor strips whitespace from <w:t> elements that
lack xml:space="preserve". Post-process the output DOCX to add this
attribute, preventing words from sticking together (e.g. בהולמועדים,
לקוחנחוץ).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PHPWord's TemplateProcessor loses regular spaces between placeholder
replacement values and adjacent text in RTL documents. Using NBSP
(\u00A0) after ☑/☐ ensures Word preserves the spacing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When legalAnalysis arrives as a stdClass (from JSON decode), cast it to
array before using array access. Prevents fatal error in PHP 8.x.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Prompt: CRITICAL instruction — must complete all 7 steps before generating report
- Step 5 (legal analysis) is mandatory, cannot be skipped even if user asks
- Step 6: explicit instruction to use "המשך ייצוג" when user is filing/continuing
- Prevent AI from choosing "עדיין לא ניתן להחליט" when user has already decided
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix cLegalAidNumber placeholder key mismatch (template expects cLegalAidNumber, code sent legalAidNumber)
- Add fallback for flat legalAnalysis fields (AI may send them outside the nested object)
- Improve assignedUserName resolution: prefer case assignee, filter out system/API user names
- Add "המשך ייצוג" positive recommendation option to enum, checkboxes, prompt, and DOCX template
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DirectAccessReportGenerator now downloads the template from NetworkStorage
(WebDAV) if it's not found in data/document-templates/. This means template
updates via WebDAV are picked up automatically without manual file copy.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The AI prompt referenced the old tool name (generate_initial_report) but the
metadata and handler were registered as generate_direct_access_report, causing
404 errors when Shira tried to generate direct access reports.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Breaking change: LegalAid entity removed entirely. Reports are now
generated directly from JSON params to DOCX without any intermediate
entity or database table.
New:
- DirectAccessReportGenerator: takes JSON from Shira, generates DOCX
via PHPWord, attaches as Document to Case (single PHP file)
- AfterUninstall: full cleanup script (drops tables, columns, templates)
- docs/examples/entity-reference-legalaid.md: full reference for future
entity creation
Removed:
- LegalAid entity (entityDefs, scopes, clientDefs, layouts, i18n, controller)
- GenerateInitialReport tool (replaced by DirectAccessReportGenerator)
- Custom JS field view for cLegalAidNumber
- update_legal_aid and get_legal_aid tools
- Case link to legalAids
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Complete removal of the old DirectAccessReport entity and all related
files. LegalAid is now the sole entity for legal aid data management.
- Remove DirectAccessReport: controller, service, hooks, entity defs,
scopes, clientDefs, layouts, i18n (all 3 locales)
- Remove directAccessReports link from Case
- Rewrite GenerateInitialReport tool to work directly with LegalAid
- Clean up Case i18n (remove old field translations)
- Bump version to 1.5.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace scattered Case fields with a dedicated LegalAid entity that
holds all legal aid data (aid type, urgency, client contact, proceeding
details, legal analysis, recommendation, etc.). DirectAccessReport now
pulls from LegalAid for DOCX generation with automatic checkbox mapping.
- Add LegalAid entity with controller, layouts, i18n (he/en/fa)
- Remove cAidType, cUrgencyLevel, cAppointmentDate, cFilingDeadline,
cLegalAidType from Case (migrated to LegalAid)
- Add legalAidType field to LegalAid (DirectAccess/Regular/Duty)
- Update DirectAccessReportService to use LegalAid entity
- Add update_legal_aid and get_legal_aid SmartAssistant tools
- Fix AfterInstall template entityType to LegalAid
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
EspoCRM requires an explicit controller class for every entity — without
it the API returns 404. Added a simple Record controller for DirectAccessReport.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
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>
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>
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>
The HebrewLanguage extension uses fa_IR as the locale code (RTL wrapper),
not he_IL. Without fa_IR translations, all labels show in English.
Copied he_IL → fa_IR. Bump to v1.2.0.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- prompts.json: rewrite in Hebrew with general awareness of "גישה ישירה"
concept, trigger keywords, and structured 8-step conversation flow
- tools.json: add courtName enum with 6 valid court names (was free string)
These changes match what was deployed to ai-gateway plugins/legal-assistance/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add Global.json (he_IL + en_US) for scope names in navigation/menus
- Add en_US/Case.json for English field/option translations
- Add all enum option translations to DirectAccessReport (both languages)
- Bump version to 1.1.0
- Include updated extension ZIP package
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- DirectAccessReport entity (48 fields, status lifecycle, Case relationship)
- Case fields: cLegalAidType, cAppointmentDate, cAidType, cUrgencyLevel, cFilingDeadline
- Auto-tasks hook: creates 3 tasks when case set to Direct Access
- DOCX template with 72 placeholders (converted from original form)
- Shira plugin: generate_initial_report tool with structured conversation flow
- AfterInstall/AfterUninstall scripts for plugin deployment
- Hebrew + English translations
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>