Skip to content

feat: add Actions tab on AccidentInvestigation (curative/corrective subtasks)#4757

Open
elisa34 wants to merge 1 commit into
Evarisk:developfrom
elisa34:feat/accident-investigation-actions-tab
Open

feat: add Actions tab on AccidentInvestigation (curative/corrective subtasks)#4757
elisa34 wants to merge 1 commit into
Evarisk:developfrom
elisa34:feat/accident-investigation-actions-tab

Conversation

@elisa34
Copy link
Copy Markdown

@elisa34 elisa34 commented May 20, 2026

Summary

  • Add digirisk_action_type select extrafield on projet_task to distinguish curative (1) vs corrective (2) actions
  • Set the extrafield on T1/T2 task creation in accidentinvestigation_card.php
  • SQL migration to backfill existing T1/T2 tasks from their label prefix
  • New Actions tab on the AccidentInvestigation fiche (between Participants and Notes):
    • Two sections (curative / corrective) each with a row count badge
    • Inline add-form using native Dolibarr selectDate() and select_dolusers()
    • Checkbox to mark an action as done (progress = 100)
    • Inline progress input (0-100 %) with submit button
    • Status rendered via Task::LibStatut(4) (native Dolibarr badge)
    • Progress bar via native Dolibarr CSS classes (progress sm / progress-bar-info/success)
    • Helper getAccidentInvestigationActionsByType() with correlated subquery for TASKEXECUTIVE assignee
  • Add langs/en_US/digiriskdolibarr.lang; extend fr_FR with all action-tab keys

Test plan

  • Validate an AccidentInvestigation ? confirm T1 and T2 subtasks are created with digirisk_action_type 1 and 2
  • Open the Actions tab ? two sections visible, "no actions" message if empty
  • Add a curative action with label, deadline, assignee ? row appears in table
  • Check progress bar and status badge use native Dolibarr rendering
  • Check the inline progress input saves correctly
  • Check the checkbox marks action as done (progress = 100, bar turns green)
  • Run SQL migration on existing data ? T1/T2 tasks correctly typed

?? Generated with Claude Code

…ve subtasks

- Add digirisk_action_type select extrafield on projet_task (position 60)
  to distinguish curative (1) vs corrective (2) actions
- Set extrafield on T1/T2 task creation in accidentinvestigation_card.php
- SQL migration: backfill digirisk_action_type from existing T1/T2 task labels
- New accidentinvestigation_actions.php tab (key 15, between attendants and note):
  - Two sections (curative / corrective) with inline add-form (label, deadline,
    assignee via native Dolibarr selectors, progress input)
  - Checkbox to close action (progress=100), inline progress update
  - Status rendered via Task::LibStatut(4), progress bar via native CSS classes
  - Helper getAccidentInvestigationActionsByType() in lib with correlated subquery
    for TASKEXECUTIVE assignee (avoids N+1)
- Add en_US lang file; extend fr_FR with action-tab translation keys

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants