From 144de734ceb8c91bd0b71264299aa2a9f36f0889 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 18:39:16 +0200 Subject: [PATCH 1/2] Fix phpcs --- htdocs/mrp/lib/mrp_mo.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index fd268c8f6f8..08bc07f298a 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -103,7 +103,7 @@ function moPrepareHead($object) // 'entity:-tabname:Title:@mrp:/mrp/mypage.php?id=__ID__' //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp'); - + complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp', 'remove'); return $head; From 88a482c615a35f04c1c2ba89a5adad0ef00b4835 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 18:40:32 +0200 Subject: [PATCH 2/2] Fix phpcs --- .../doc/doc_generic_reception_odt.modules.php | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 5b69a6d7839..383ab491346 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -63,7 +63,7 @@ class doc_generic_reception_odt extends ModelePdfReception global $conf, $langs, $mysoc; $langs->loadLangs(array("main", "companies")); - + $this->db = $db; $this->name = "ODT templates"; $this->description = $langs->trans("DocumentModelOdt"); @@ -177,7 +177,7 @@ class doc_generic_reception_odt extends ModelePdfReception $texte .= ''; $texte .= ''; $texte .= ''; - + $texte .= ''; $texte .= ''; @@ -228,7 +228,7 @@ class doc_generic_reception_odt extends ModelePdfReception $outputlangs->charset_output = 'UTF-8'; $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); - + if ($conf->reception->dir_output."/reception") { // If $object is id instead of object if (!is_object($object)) { @@ -413,26 +413,26 @@ class doc_generic_reception_odt extends ModelePdfReception dol_syslog($e->getMessage(), LOG_INFO); } if ($foundtagforlines) { - $linenumber = 0; - foreach ($object->lines as $line) { - $linenumber++; - $tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs); - complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); - // Call the ODTSubstitutionLine hook - $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line); - $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - foreach ($tmparray as $key => $val) { - try { - $listlines->setVars($key, $val, true, 'UTF-8'); - } catch (OdfException $e) { - dol_syslog($e->getMessage(), LOG_INFO); - } catch (SegmentException $e) { - dol_syslog($e->getMessage(), LOG_INFO); + $linenumber = 0; + foreach ($object->lines as $line) { + $linenumber++; + $tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs); + complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); + // Call the ODTSubstitutionLine hook + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line); + $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + foreach ($tmparray as $key => $val) { + try { + $listlines->setVars($key, $val, true, 'UTF-8'); + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } catch (SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } } + $listlines->merge(); } - $listlines->merge(); - } - $odfHandler->mergeSegment($listlines); + $odfHandler->mergeSegment($listlines); } } catch (OdfException $e) { $this->error = $e->getMessage(); @@ -482,7 +482,7 @@ class doc_generic_reception_odt extends ModelePdfReception $odfHandler = null; // Destroy object $this->result = array('fullpath'=>$file); - + return 1; // Success } else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);