--- /tmp/dsg/dolibarr/htdocs/core/modules/printsheet/github_19.0.3_modules_labels.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/printsheet/client_modules_labels.php @@ -43 +43 @@ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -47,3 +47,3 @@ - * @param DoliDB $db Database handler - * @param integer $maxfilenamelength Max length of value to show - * @return array List of templates + * @param DoliDB $db Database handler + * @param integer $maxfilenamelength Max length of value to show + * @return array List of templates @@ -53 +53,3 @@ - // phpcs:enable + // phpcs:enable + global $conf; + @@ -55 +57 @@ - $list = array(); + $liste = array(); @@ -58 +60 @@ - $list = getListOfModels($db, $type, $maxfilenamelength); + $liste = getListOfModels($db, $type, $maxfilenamelength); @@ -60 +62 @@ - return $list; + return $liste; @@ -76 +78 @@ - * @return int Return integer <0 if KO, >0 if OK + * @return int <0 if KO, >0 if OK @@ -80 +82 @@ - // phpcs:enable + // phpcs:enable @@ -96,2 +98,4 @@ - if (!dol_strlen($modele)) { - if (getDolGlobalString('ADHERENT_ETIQUETTE_TYPE')) { + if (!dol_strlen($modele)) + { + if (!empty($conf->global->ADHERENT_ETIQUETTE_TYPE)) + { @@ -99 +103,3 @@ - } else { + } + else + { @@ -102,2 +107,0 @@ - } else { - $code = $modele; @@ -104,0 +109 @@ + else $code = $modele; @@ -108 +113,2 @@ - if (!empty($tmp[1])) { + if (!empty($tmp[1])) + { @@ -111,2 +116,0 @@ - } else { - $srctemplatepath = $code; @@ -113,0 +118 @@ + else $srctemplatepath = $code; @@ -118,3 +123 @@ - $file = ''; - $classname = ''; - $filefound = 0; + $file = ''; $classname = ''; $filefound = 0; @@ -122,5 +125,5 @@ - if (is_array($conf->modules_parts['models'])) { - $dirmodels = array_merge($dirmodels, $conf->modules_parts['models']); - } - foreach ($dirmodels as $reldir) { - foreach (array('doc', 'pdf') as $prefix) { + if (is_array($conf->modules_parts['models'])) $dirmodels = array_merge($dirmodels, $conf->modules_parts['models']); + foreach ($dirmodels as $reldir) + { + foreach (array('doc', 'pdf') as $prefix) + { @@ -131 +134,2 @@ - if (file_exists($file)) { + if (file_exists($file)) + { @@ -137,3 +141 @@ - if ($filefound) { - break; - } + if ($filefound) break; @@ -143 +145,2 @@ - if ($filefound) { + if ($filefound) + { @@ -151 +154,2 @@ - if ($obj->write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir, $filename) > 0) { + if ($obj->write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir, $filename) > 0) + { @@ -153,28 +156,0 @@ - - $fullpath = $obj->result['fullpath']; - - // Output to http stream - clearstatcache(); - - $attachment = true; - if (getDolGlobalString('MAIN_DISABLE_FORCE_SAVEAS')) { - $attachment = false; - } - $type = dol_mimetype($filename); - - //if ($encoding) header('Content-Encoding: '.$encoding); - if ($type) { - header('Content-Type: '.$type); - } - if ($attachment) { - header('Content-Disposition: attachment; filename="'.$filename.'"'); - } else { - header('Content-Disposition: inline; filename="'.$filename.'"'); - } - - // Ajout directives pour resoudre bug IE - header('Cache-Control: Public, must-revalidate'); - header('Pragma: public'); - - readfile($fullpath); - @@ -182 +158,3 @@ - } else { + } + else + { @@ -187 +165,3 @@ - } else { + } + else + {