Skip to content

Commit

Permalink
Evarisk#3693 [AuditReportDocument] fix: repair data form riskassessme…
Browse files Browse the repository at this point in the history
…ntdocument
  • Loading branch information
nicolas-eoxia committed Apr 5, 2024
1 parent 2c9e95e commit 8cc6d18
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 3 additions & 0 deletions class/digiriskdocuments.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public function DigiriskFillJSON() {
$this->json = $this->InformationsSharingFillJSON();
break;
case "auditreportdocument":
$riskAssessmentDocument = new RiskAssessmentDocument($this->db);
$this->json = $riskAssessmentDocument->RiskAssessmentDocumentFillJSON();
break;
case "riskassessmentdocument":
$this->json = $this->RiskAssessmentDocumentFillJSON();
break;
Expand Down
6 changes: 0 additions & 6 deletions class/digiriskdolibarrdocuments/auditreportdocument.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

// Load DigiriskDolibarr librairies
require_once __DIR__ . '/../digiriskdocuments.class.php';
require_once __DIR__ . './riskassessmentdocument.class.php';

/**
* Class for AuditReportDocument
Expand All @@ -51,9 +50,4 @@ public function __construct(DoliDB $db)
{
parent::__construct($db, $this->module, $this->element);
}

public function RiskAssessmentDocumentFillJSON() {
$riskassessmentDocument = new RiskAssessmentDocument($this->db);
return $riskassessmentDocument->RiskAssessmentDocumentFillJSON();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function write_file(SaturneDocuments $objectDocument, Translate $outputLa
$objectDocument->DigiriskFillJSON();

$previousObjectDocumentElement = $objectDocument->element;
$objectDocument->element = 'riskassessmentdocument@digiriskdolibarr';
$objectDocument->element = $objectDocument->element . '@digiriskdolibarr';
complete_substitutions_array($tmpArray, $outputLangs, $objectDocument);
$objectDocument->element = $previousObjectDocumentElement;

Expand Down
1 change: 1 addition & 0 deletions core/substitutions/functions_digiriskdolibarr.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ function digiriskdolibarr_completesubstitutionarray(&$substitutionarray, $langs,

break;

case 'auditreportdocument@digiriskdolibarr':
case 'riskassessmentdocument@digiriskdolibarr':

$riskassessmentdocument = json_decode($object->json, false, 512, JSON_UNESCAPED_UNICODE)->RiskAssessmentDocument;
Expand Down

0 comments on commit 8cc6d18

Please sign in to comment.