Skip to content

Commit

Permalink
[ODT] fix: generate document dont work correctly because missing argu…
Browse files Browse the repository at this point in the history
…ment in function write file
  • Loading branch information
nicolas-eoxia committed Feb 1, 2022
1 parent a8e8913 commit 16f3f6b
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 81 deletions.
54 changes: 30 additions & 24 deletions class/digiriskelement.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,30 +367,36 @@ public function info($id)
}
}

// public function getRiskAssessmentCategoriesNumber()
// {
// $risk = new Risk($this->db);
// $risks = $risk->fetchFromParent($this->id);
// $scale_counter = array(
// 1 => 0,
// 2 => 0,
// 3 => 0,
// 4 => 0
// );
// if ( ! empty($risks) && $risks > 0) {
// foreach ($risks as $risk) {
// $riskassessment = new RiskAssessment($this->db);
// $riskassessment = $riskassessment->fetchFromParent($risk->id, 1);
// if ( ! empty($riskassessment) && $riskassessment > 0) {
// $riskassessment = array_shift($riskassessment);
// $scale = $riskassessment->get_evaluation_scale();
// $scale_counter[$scale] += 1;
// }
// }
// }
//
// return $scale_counter;
// }
/**
* Get riskassessment categorires number
*
* @return array
* @throws Exception
*/
public function getRiskAssessmentCategoriesNumber()
{
$risk = new Risk($this->db);
$risks = $risk->fetchFromParent($this->id);
$scale_counter = array(
1 => 0,
2 => 0,
3 => 0,
4 => 0
);
if ( ! empty($risks) && $risks > 0) {
foreach ($risks as $risk) {
$riskassessment = new RiskAssessment($this->db);
$riskassessment = $riskassessment->fetchFromParent($risk->id, 1);
if ( ! empty($riskassessment) && $riskassessment > 0) {
$riskassessment = array_shift($riskassessment);
$scale = $riskassessment->get_evaluation_scale();
$scale_counter[$scale] += 1;
}
}
}

return $scale_counter;
}

/**
* Output html form to select a third party.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,17 @@ public function info($langs)
/**
* Function to build a document on disk using the generic odt module.
*
* @param FirePermitDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param $firepermit
* @return int 1 if OK, <=0 if KO
* @throws Exception
* @param FirePermitDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param FirePermit $firepermit FirePermit object
* @return int 1 if OK, <=0 if KO
* @throws Exception
*/
public function write_file($object, $outputlangs, $srctemplatepath, $firepermit)
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $firepermit)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $action, $mysoc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,17 @@ public function info($langs)
/**
* Function to build a document on disk using the generic odt module.
*
* @param GroupmentDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param $digiriskelement
* @return int 1 if OK, <=0 if KO
* @throws Exception
* @param GroupmentDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param DigiriskElement $digiriskelement Object for get DigiriskElement info
* @return int 1 if OK, <=0 if KO
* @throws Exception
*/
public function write_file($object, $outputlangs, $srctemplatepath, $digiriskelement)
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $digiriskelement)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $action, $mysoc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,17 @@ public function info($langs)
/**
* Function to build a document on disk using the generic odt module.
*
* @param ListingRisksAction $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param $digiriskelement
* @return int 1 if OK, <=0 if KO
* @throws Exception
* @param ListingRisksAction $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param DigiriskElement $digiriskelement Object for get DigiriskElement info
* @return int 1 if OK, <=0 if KO
* @throws Exception
*/
public function write_file($object, $outputlangs, $srctemplatepath, $digiriskelement)
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $digiriskelement)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $action, $mysoc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,17 @@ public function info($langs)
/**
* Function to build a document on disk using the generic odt module.
*
* @param ListingRisksPhoto $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param $digiriskelement
* @return int 1 if OK, <=0 if KO
* @throws Exception
* @param ListingRisksPhoto $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param DigiriskElement $digiriskelement Object for get DigiriskElement info
* @return int 1 if OK, <=0 if KO
* @throws Exception
*/
public function write_file($object, $outputlangs, $srctemplatepath, $digiriskelement)
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $digiriskelement)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $action, $mysoc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,17 @@ public function info($langs)
/**
* Function to build a document on disk using the generic odt module.
*
* @param PreventionPlanDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param $preventionplan
* @return int 1 if OK, <=0 if KO
* @throws Exception
* @param PreventionPlanDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param PreventionPlan $preventionplan PreventionPlan Object
* @return int 1 if OK, <=0 if KO
* @throws Exception
*/
public function write_file($object, $outputlangs, $srctemplatepath, $preventionplan)
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $preventionplan)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $action, $mysoc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,17 @@ public function info($langs)
/**
* Function to build a document on disk using the generic odt module.
*
* @param PreventionPlanDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param $preventionplan
* @return int 1 if OK, <=0 if KO
* @throws Exception
* @param PreventionPlanDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param PreventionPlan $preventionplan PreventionPlan Object
* @return int 1 if OK, <=0 if KO
* @throws Exception
*/
public function write_file($object, $outputlangs, $srctemplatepath, $preventionplan)
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $preventionplan)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $action, $mysoc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,17 @@ public function info($langs)
/**
* Function to build a document on disk using the generic odt module.
*
* @param RiskAssessmentDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param $digiriskelement
* @return int 1 if OK, <=0 if KO
* @throws Exception
* @param RiskAssessmentDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param DigiriskElement $digiriskelement Object for get DigiriskElement info
* @return int 1 if OK, <=0 if KO
* @throws Exception
*/
public function write_file($object, $outputlangs, $srctemplatepath, $digiriskelement)
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $digiriskelement)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $action, $mysoc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,17 @@ public function info($langs)
/**
* Function to build a document on disk using the generic odt module.
*
* @param WorkUnitDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param $digiriskelement
* @return int 1 if OK, <=0 if KO
* @throws Exception
* @param WorkUnitDocument $object Object source to build document
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param DigiriskElement $digiriskelement Object for get DigiriskElement info
* @return int 1 if OK, <=0 if KO
* @throws Exception
*/
public function write_file($object, $outputlangs, $srctemplatepath, $digiriskelement)
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $digiriskelement)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $action, $mysoc;
Expand Down
1 change: 0 additions & 1 deletion workflow/phpDocumentor
Submodule phpDocumentor deleted from 2f288a

0 comments on commit 16f3f6b

Please sign in to comment.