Fix phpcs
This commit is contained in:
parent
144de734ce
commit
88a482c615
@ -63,7 +63,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
global $conf, $langs, $mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
|
|
||||||
$langs->loadLangs(array("main", "companies"));
|
$langs->loadLangs(array("main", "companies"));
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->name = "ODT templates";
|
$this->name = "ODT templates";
|
||||||
$this->description = $langs->trans("DocumentModelOdt");
|
$this->description = $langs->trans("DocumentModelOdt");
|
||||||
@ -177,7 +177,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
$texte .= '<input type="hidden" value="RECEPTION_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
|
$texte .= '<input type="hidden" value="RECEPTION_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
|
||||||
$texte .= '<input type="submit" class="button small" value="'.dol_escape_htmltag($langs->trans("Upload")).'" name="upload">';
|
$texte .= '<input type="submit" class="button small" value="'.dol_escape_htmltag($langs->trans("Upload")).'" name="upload">';
|
||||||
$texte .= '</div>';
|
$texte .= '</div>';
|
||||||
|
|
||||||
$texte .= '</td>';
|
$texte .= '</td>';
|
||||||
|
|
||||||
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
|
$texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
|
||||||
@ -228,7 +228,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
$outputlangs->charset_output = 'UTF-8';
|
$outputlangs->charset_output = 'UTF-8';
|
||||||
|
|
||||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
|
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
|
||||||
|
|
||||||
if ($conf->reception->dir_output."/reception") {
|
if ($conf->reception->dir_output."/reception") {
|
||||||
// If $object is id instead of object
|
// If $object is id instead of object
|
||||||
if (!is_object($object)) {
|
if (!is_object($object)) {
|
||||||
@ -413,26 +413,26 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
dol_syslog($e->getMessage(), LOG_INFO);
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
}
|
}
|
||||||
if ($foundtagforlines) {
|
if ($foundtagforlines) {
|
||||||
$linenumber = 0;
|
$linenumber = 0;
|
||||||
foreach ($object->lines as $line) {
|
foreach ($object->lines as $line) {
|
||||||
$linenumber++;
|
$linenumber++;
|
||||||
$tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs);
|
$tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs);
|
||||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||||
// Call the ODTSubstitutionLine hook
|
// Call the ODTSubstitutionLine hook
|
||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
$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
|
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
foreach ($tmparray as $key => $val) {
|
foreach ($tmparray as $key => $val) {
|
||||||
try {
|
try {
|
||||||
$listlines->setVars($key, $val, true, 'UTF-8');
|
$listlines->setVars($key, $val, true, 'UTF-8');
|
||||||
} catch (OdfException $e) {
|
} catch (OdfException $e) {
|
||||||
dol_syslog($e->getMessage(), LOG_INFO);
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
} catch (SegmentException $e) {
|
} catch (SegmentException $e) {
|
||||||
dol_syslog($e->getMessage(), LOG_INFO);
|
dol_syslog($e->getMessage(), LOG_INFO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$listlines->merge();
|
||||||
}
|
}
|
||||||
$listlines->merge();
|
$odfHandler->mergeSegment($listlines);
|
||||||
}
|
|
||||||
$odfHandler->mergeSegment($listlines);
|
|
||||||
}
|
}
|
||||||
} catch (OdfException $e) {
|
} catch (OdfException $e) {
|
||||||
$this->error = $e->getMessage();
|
$this->error = $e->getMessage();
|
||||||
@ -482,7 +482,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
$odfHandler = null; // Destroy object
|
$odfHandler = null; // Destroy object
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
return 1; // Success
|
return 1; // Success
|
||||||
} else {
|
} else {
|
||||||
$this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
|
$this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user