Skip to content

Commit

Permalink
[Accident] fix: change on accident for use new sql table
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Nov 30, 2021
1 parent 7f7def8 commit 16edefe
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 312 deletions.
11 changes: 5 additions & 6 deletions accident_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
require_once __DIR__ . '/lib/digiriskdolibarr_function.lib.php';
require_once __DIR__ . '/lib/digiriskdolibarr_accident.lib.php';
require_once __DIR__ . '/core/modules/digiriskdolibarr/digiriskelement/accident/mod_accident_standard.php';
require_once __DIR__ . '/core/modules/digiriskdolibarr/digiriskelement/accidentdet/mod_accidentdet_standard.php';
require_once __DIR__ . '/core/modules/digiriskdolibarr/digiriskelement/accident_workstop/mod_accident_workstop_standard.php';
//require_once __DIR__ . '/core/modules/digiriskdolibarr/digiriskdocuments/accidentdocument/mod_accidentdocument_standard.php';
//require_once __DIR__ . '/core/modules/digiriskdolibarr/digiriskdocuments/accidentdocument/modules_accidentdocument.php';

Expand All @@ -73,8 +73,7 @@
$object = new Accident($db);
$preventionplan = new PreventionPlan($db);
$preventionplanline = new PreventionPlanLine($db);
$signatory = new AccidentSignature($db);
$objectline = new AccidentLine($db);
$objectline = new AccidentWorkStop($db);
//$accidentdocument = new AccidentDocument($db);
$risk = new Risk($db);
$contact = new Contact($db);
Expand All @@ -85,7 +84,7 @@
$digiriskresources = new DigiriskResources($db);
$project = new Project($db);
$refAccidentMod = new $conf->global->DIGIRISKDOLIBARR_ACCIDENT_ADDON($db);
$refAccidentDetMod = new $conf->global->DIGIRISKDOLIBARR_ACCIDENTDET_ADDON($db);
$refAccidentWorkStopMod = new $conf->global->DIGIRISKDOLIBARR_ACCIDENT_WORKSTOP_ADDON($db);

// Load object
$object->fetch($id);
Expand Down Expand Up @@ -309,7 +308,7 @@

// Initialize object accident line
$objectline->date_creation = $object->db->idate($now);
$objectline->ref = $refAccidentDetMod->getNextValue($objectline);
$objectline->ref = $refAccidentWorkStopMod->getNextValue($objectline);
$objectline->entity = $conf->entity;
$objectline->workstop_days = $workstop_days;
$objectline->fk_accident = $parent_id;
Expand Down Expand Up @@ -982,7 +981,7 @@

print '<tr>';
print '<td>';
print $refAccidentDetMod->getNextValue($objectline);
print $refAccidentWorkStopMod->getNextValue($objectline);
print '</td>';

$coldisplay++;
Expand Down
1 change: 0 additions & 1 deletion accident_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@

// Initialize technical objects
$accident = new Accident($db);
$signatory = new AccidentSignature($db);
$preventionplan = new PreventionPlan($db);
$societe = new Societe($db);
$contact = new Contact($db);
Expand Down
Loading

0 comments on commit 16edefe

Please sign in to comment.