[FEAT] A4 Fase 4.1 — Organigramma (org_roles): ruoli/gerarchia + nodo governance Art.23

Primo modulo del modello relazionale A4 (docs/DESIGN_A4_RELATIONAL.md).

Backend:
- Migration 041 (docs/sql/041_org_roles.sql) + runner scripts/migrate-a4.php.
  Tabella org_roles additiva/idempotente: gerarchia self-FK (parent_role_id),
  titolare (holder_user_id), is_governance_body (organi amministrazione/direttivi
  Art.23 D.Lgs.138/2024), description (GV.RR-02). APPLICATA su prod (container
  nis2-db v8.0.45, TLSv1.3, 11 col, 4 FK).
- OrgRoleController: list (flat+tree arricchiti), get, create, update, delete,
  assignableUsers. Multi-tenancy ancorata a getCurrentOrgId(), anti-IDOR
  (id+organization_id), prevenzione cicli nella gerarchia, holder = membro org,
  delete bloccato se ha figli (409). Route registrate in public/index.php.

Frontend:
- public/organigramma.html + js/organigramma.js: vista ad albero (badge governance,
  titolare/vacante), editor crea/modifica/elimina con select padre anti-ciclo,
  "crea struttura di base". Bootstrap Italia V2.
- Voce sidebar "Organigramma" (common.js + common-bi.js) + nav.org_chart i18n IT/EN.
- api.js: metodi orgRole* (wrapper _acn).

Help/KB:
- help.js: guida contestuale 'org' (cosa rappresenta, nodo Art.23, come si usa,
  fonti certe D.Lgs.138/2024 art.23 + GV.RR-02 best practice, disclaimer no-parere-legale).

Cache-buster: bump ?v=20260617 dei 5 JS condivisi su tutte le 32 HTML referenti.
version.json 1.15.2 -> 1.16.0. Smoke E2E su prod (fpm reale): login, CRUD, tree,
anti-ciclo (422), delete-con-figli (409), cleanup tutti verdi.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
DevEnv nis2-agile
2026-06-15 18:05:56 +02:00
co-authored by Claude Opus 4.8
parent dcb9a14f0f
commit 8540b53cb2
44 changed files with 994 additions and 126 deletions
+4
View File
@@ -78,6 +78,10 @@ const I18n = (function () {
'isms.s6.hint': { it: 'Gli audit interni e le non conformità si gestiscono nei moduli esistenti: Audit & Report e NCR/CAPA.', en: 'Internal audits and non-conformities are managed in the existing modules: Audit & Reports and NCR/CAPA.' },
'isms.s6.readiness': { it: 'Completamento del SGSI', en: 'ISMS completion' },
'nav.management': { it: 'Gestione', en: 'Management' },
'nav.org_chart': { it: 'Organigramma', en: 'Org Chart' },
'org.title': { it: 'Organigramma', en: 'Org Chart' },
'org.subtitle': { it: 'Ruoli, responsabilità e organi di governance', en: 'Roles, responsibilities and governance bodies' },
'org.new_role': { it: 'Nuovo ruolo', en: 'New role' },
'nav.risks': { it: 'Rischi', en: 'Risks' },
'nav.incidents': { it: 'Incidenti', en: 'Incidents' },
'nav.policies': { it: 'Policy', en: 'Policies' },