diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index ef24e13faff..1f83048b7b5 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -47,7 +47,7 @@ return [ // PhanPluginConstantVariableNull : 10+ occurrences // PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences // PhanPluginSuspiciousParamPosition : 10+ occurrences - // PhanRedefineClass : 10+ occurrences + // PhanRedefineClass : 3 occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences // PhanEmptyFQSENInClasslike : 5 occurrences // PhanInvalidFQSENInClasslike : 4 occurrences @@ -704,7 +704,7 @@ return [ 'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/expedition/mod_expedition_ribera.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/expedition/modules_expedition.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/expensereport/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanRedefineClass', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/expensereport/mod_expensereport_sand.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/expensereport/modules_expensereport.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/export/export_csviso.modules.php' => ['PhanPluginUnknownArrayMethodParamType'], @@ -724,7 +724,7 @@ return [ 'htdocs/core/modules/fichinter/modules_fichinter.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/holiday/modules_holiday.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/hrm/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanRedefineClass', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/hrm/modules_evaluation.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], @@ -740,11 +740,11 @@ return [ 'htdocs/core/modules/mailings/xinputfile.modules.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/mailings/xinputuser.modules.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/member/doc/doc_generic_member_odt.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/core/modules/member/doc/pdf_standard.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanRedefineClass'], + 'htdocs/core/modules/member/doc/pdf_standard_member.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/modules/member/modules_member.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/modFacture.class.php' => ['PhanPluginDuplicateExpressionAssignmentOperation'], - 'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineClass', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod'], 'htdocs/core/modules/movement/modules_movement.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], @@ -761,7 +761,7 @@ return [ 'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/printsheet/modules_labels.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineClass', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/core/modules/product/modules_product.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/product_batch/mod_lot_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/product_batch/mod_lot_free.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -788,7 +788,7 @@ return [ 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/modules/societe/modules_societe.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/stock/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineClass', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/core/modules/stock/modules_stock.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod'], @@ -804,7 +804,7 @@ return [ 'htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/supplier_order/modules_commandefournisseur.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanRedefineClass', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredMethod'], 'htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/supplier_payment/modules_supplier_payment.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanPluginConstantVariableBool', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 9023ed207ab..61e3d483237 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,24 +122,24 @@ print ''.$langs-> // Name of Accountant Company print ''; -print ''."\n"; +print ''."\n"; // Address print ''; -print ''."\n"; +print ''."\n"; // ZIP print ''; -print ''."\n"; +print ''."\n"; // Town/City print ''; -print ''."\n"; +print ''."\n"; // Country print ''; print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); -print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id'); +print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -147,40 +148,40 @@ print ''."\n"; // State print ''; print img_picto('', 'state', 'class="pictofixedwidth"'); -print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE') ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); +print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'state_id'); print ''."\n"; // Telephone print ''; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Fax print ''; print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // eMail print ''; print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Web print ''; print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Code print ''; -print ''."\n"; +print ''."\n"; // Note print ''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php index bfd1c0b5bc8..1d2c32ca617 100644 --- a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php +++ b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -166,7 +167,7 @@ class pdf_standard_actions $pdf = pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1, 0); diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index faedd65d993..90d2d60131f 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -220,7 +220,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 50; // Height reserved to output the info and total part and payment part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 7f8ae3c09b5..daacb9aba68 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,7 +155,7 @@ class pdf_ban extends ModeleBankAccountDoc $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index babd72f3d68..684f52faa22 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -165,7 +165,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts // Create PDF instance $pdf = pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 018e97f75ac..ec0fa3a38d1 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -230,7 +230,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 30; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 1c4b158bbd4..5c2321a6c87 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -6,6 +6,7 @@ * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2015 Marcos García * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -197,7 +198,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 30; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 17051e0c90e..b54e13710a9 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -241,7 +241,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 53308cf110f..533847c31e2 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -5,6 +5,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -195,7 +196,7 @@ class pdf_merou extends ModelePdfExpedition $pdf = pdf_getInstance($this->format, 'mm', 'l'); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 0; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 20a809ea36a..c52e34f8590 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -274,7 +274,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php similarity index 99% rename from htdocs/core/modules/expensereport/doc/pdf_standard.modules.php rename to htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php index 16fc1284e34..14383a66e85 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2023 Philippe Grand - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Francis Appels * Copyright (C) 2019 Markus Welters * Copyright (C) 2019 Rafael Ingenleuf @@ -25,7 +25,7 @@ */ /** - * \file htdocs/core/modules/expensereport/doc/pdf_standard.modules.php + * \file htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php * \ingroup expensereport * \brief File of class to generate expense report from standard model */ @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; /** * Class to generate expense report based on standard model */ -class pdf_standard extends ModeleExpenseReport +class pdf_standard_expensereport extends ModeleExpenseReport { /** * @var DoliDB Database handler @@ -236,7 +236,7 @@ class pdf_standard extends ModeleExpenseReport $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 12; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 5fb82673a45..8e721a632c8 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -303,7 +303,7 @@ class pdf_crabe extends ModelePDFFactures if ($heightforinfotot > 220) { $heightforinfotot = 220; } - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0d7c33c3536..0dec7f20b65 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -333,7 +333,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetAutoPageBreak(1, 0); $this->heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part - $this->heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $this->heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) $heightforqrinvoice = $heightforqrinvoice_firstpage = 0; diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index eb08a138e20..5a0c89480ba 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -187,7 +187,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php similarity index 98% rename from htdocs/core/modules/hrm/doc/pdf_standard.modules.php rename to htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php index 0fd40330124..f581c42901a 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2023 Philippe Grand - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Francis Appels * Copyright (C) 2019 Markus Welters * Copyright (C) 2019 Rafael Ingenleuf @@ -25,7 +25,7 @@ */ /** - * \file htdocs/core/modules/hrm/doc/pdf_standard.modules.php + * \file htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php * \ingroup hrm * \brief File of class to generate evaluation report from standard model */ @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; /** * Class to generate Evaluation Pdf based on standard model */ -class pdf_standard extends ModelePDFEvaluation +class pdf_standard_evaluation extends ModelePDFEvaluation { /** * @var DoliDB Database handler @@ -196,7 +196,7 @@ class pdf_standard extends ModelePDFEvaluation $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 0; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 12; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard_member.class.php similarity index 97% rename from htdocs/core/modules/member/doc/pdf_standard.class.php rename to htdocs/core/modules/member/doc/pdf_standard_member.class.php index b8b8acbbec1..7e9f438443f 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard_member.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2015 Francis Appels +/* Copyright (C) 2003 Steve Dillon + * Copyright (C) 2003 Laurent Passebecq + * Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2015 Francis Appels * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/modules/member/doc/pdf_standard.class.php + * \file htdocs/core/modules/member/doc/pdf_standard_member.class.php * \ingroup member * \brief File of class to generate PDF document of labels */ @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonstickergenerator.class.php'; /** * Class to generate stick sheet with format Avery or other personalised */ -class pdf_standard extends CommonStickerGenerator +class pdf_standard_member extends CommonStickerGenerator { /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index c2843fffcb7..9d60b72c6dd 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -1,8 +1,9 @@ - * Copyright (C) 2015 Laurent Destailleur - * Copyright (C) 2023 Alexandre Spangaro +/* Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2015 Laurent Destailleur + * Copyright (C) 2023 Alexandre Spangaro * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -261,8 +262,8 @@ class modExpenseReport extends DolibarrModules $this->remove($options); $sql = array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard' AND type='expensereport' AND entity = ".((int) $conf->entity), - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard','expensereport',".((int) $conf->entity).")" + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_expensereport' AND type='expensereport' AND entity = ".((int) $conf->entity), + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_expensereport','expensereport',".((int) $conf->entity).")" ); return $this->_init($sql, $options); diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index ad391a1ec92..de499e51e5c 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2021 Ferran Marcet * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,14 +83,14 @@ class modStock extends DolibarrModules $r++; $this->const[$r][0] = "STOCK_ADDON_PDF"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "standard"; + $this->const[$r][2] = "standard_stock"; $this->const[$r][3] = 'Name of PDF model of stock'; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "MOUVEMENT_ADDON_PDF"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "stdmovement"; + $this->const[$r][2] = "standard_movement_stock"; $this->const[$r][3] = 'Name of PDF model of stock movement'; $this->const[$r][4] = 0; diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php similarity index 98% rename from htdocs/core/modules/movement/doc/pdf_standard.modules.php rename to htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php index 319f8f39c3d..3324865d54c 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/modules/movement/doc/pdf_standard.modules.php + * \file htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php * \ingroup societe * \brief File of class to build PDF documents for stocks movements */ @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** * Class to build documents using ODF templates generator */ -class pdf_standard extends ModelePDFMovement +class pdf_standard_movementstock extends ModelePDFMovement { /** * @var int Save the name of generated file as the main doc when generating a doc with this template @@ -386,7 +386,7 @@ class pdf_standard extends ModelePDFMovement $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { @@ -904,7 +904,7 @@ class pdf_standard extends ModelePDFMovement * Show top header of page. * * @param TCPDF $pdf Object PDF - * @param Object $object Object to show + * @param MouvementStock|Entrepot $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @param string $titlekey Translation key to show as title of document @@ -919,17 +919,17 @@ class pdf_standard extends ModelePDFMovement $default_font_size = pdf_getPDFFontSize($outputlangs); - if ($object->type == 1) { - $titlekey = 'ServiceSheet'; - } else { - $titlekey = 'StockSheet'; - } + // if ($object->type == 1) { + // $titlekey = 'ServiceSheet'; + // } else { + // $titlekey = 'StockSheet'; + // } pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); // Show Draft Watermark - if ($object->statut == 0 && getDolGlobalString('COMMANDE_DRAFT_WATERMARK')) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('COMMANDE_DRAFT_WATERMARK')); + if ($object->status == 0 && getDolGlobalString('WAREHOUSE_DRAFT_WATERMARK')) { + pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('WAREHOUSE_DRAFT_WATERMARK')); } $pdf->SetTextColor(0, 0, 60); @@ -1127,7 +1127,7 @@ class pdf_standard extends ModelePDFMovement * Show footer of page. Need this->emetteur object * * @param TCPDF $pdf PDF - * @param Object $object Object to show + * @param MouvementStock|Entrepot $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 50bd5549d38..faa364523c0 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -210,7 +210,7 @@ class pdf_vinci extends ModelePDFMo $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 828688b2743..eacccaf96f7 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023 Anthony Berton * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -177,7 +178,7 @@ class pdf_standard extends ModelePDFProduct $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -731,7 +732,7 @@ class pdf_standard extends ModelePDFProduct pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); // Show Draft Watermark - if ($object->statut == 0 && getDolGlobalString('PRODUCT_DRAFT_WATERMARK')) { + if ($object->status == 0 && getDolGlobalString('PRODUCT_DRAFT_WATERMARK')) { pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('COMMANDE_DRAFT_WATERMARK')); } diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 3f26a05791c..797d643523f 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -194,7 +195,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 98b86f94000..e17ac35914f 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2015-2018 Charlene Benke * Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -225,7 +226,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index e806a681de0..9422abeacd5 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -189,7 +190,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 66a4ae61fcb..cf2677a3cd8 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -366,7 +366,7 @@ class pdf_azur extends ModelePDFPropales $heightforinfotot = 40; // Height reserved to output the info and total part $heightforsignature = !getDolGlobalString('PROPAL_DISABLE_SIGNATURE') ? (pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature")) + 10) : 0; - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index c0d886f2aa5..6eae41e821c 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -340,7 +340,7 @@ class pdf_cyan extends ModelePDFPropales $heightforinfotot = 40; // Height reserved to output the info and total part $heightforsignature = !getDolGlobalString('PROPAL_DISABLE_SIGNATURE') ? (pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature")) + 10) : 0; - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index f59c84f19c3..85c043e996b 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -245,7 +245,7 @@ class pdf_squille extends ModelePdfReception $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1, 0); diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php similarity index 99% rename from htdocs/core/modules/stock/doc/pdf_standard.modules.php rename to htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php index 7fac3e5ea6f..e54427d429a 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** * Class to build documents using ODF templates generator */ -class pdf_standard extends ModelePDFStock +class pdf_standard_stock extends ModelePDFStock { public $wref; public $posxdesc; @@ -188,7 +188,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index e06b579cbf3..d9e12ac3085 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -298,7 +298,7 @@ class pdf_eagle extends ModelePDFStockTransfer $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 070bb27d5f4..20c4a8e6cef 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -267,7 +267,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 526490336d9..5fde92b440e 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -238,7 +238,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if ($heightforinfotot > 220) { $heightforinfotot = 220; } - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index d6247a50d43..56e90160a75 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -265,7 +265,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 49c81f064ea..be8be8a2603 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -276,7 +276,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php similarity index 97% rename from htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php rename to htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php index b1b6e28514f..4cfd1a03d79 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php @@ -1,8 +1,9 @@ - * Copyright (C) 2010-2014 Laurent Destailleur - * Copyright (C) 2015 Marcos García - * Copyright (C) 2022 Ferran Marcet +/* Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2014 Laurent Destailleur + * Copyright (C) 2015 Marcos García + * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ */ /** - * \file htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php + * \file htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php * \ingroup fournisseur * \brief Class file to generate the supplier invoice payment file with the standard model */ @@ -37,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php'; /** * Class to generate the supplier invoices payment file with the standard model */ -class pdf_standard extends ModelePDFSuppliersPayments +class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments { /** * @var DoliDB Database handler @@ -232,7 +233,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index ebb32a3949f..3146afe8889 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -267,7 +267,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 13a6948fb1a..c8180c69623 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -264,7 +264,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql index 80425a58b73..07338c65ac9 100644 --- a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql +++ b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql @@ -40,6 +40,19 @@ ALTER TABLE llx_projet_task ADD COLUMN billable smallint DEFAULT 1; ALTER TABLE llx_inventory DROP COLUMN datec; +UPDATE llx_document_model SET nom='standard_expensereport' WHERE nom='standard' AND type='expensereport'; +UPDATE llx_document_model SET nom='standard_stock' WHERE nom='standard' AND type='stock'; +UPDATE llx_document_model SET name='standard_movementstock' WHERE nom='standard' AND type='mouvement'; +UPDATE llx_document_model SET nom='standard_evaluation' WHERE nom='standard' AND type='evaluation'; +UPDATE llx_document_model SET nom='standard_supplierpayment' WHERE nom='standard' AND type='supplier_payment'; +UPDATE llx_document_model SET nom='standard_member' WHERE nom='standard' AND type='member'; +-- if rename failed delete old models +DELETE FROM llx_document_model WHERE nom='standard' AND type='expensereport'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='stock'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='mouvement'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='evaluation'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='supplier_payment'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='member'; ALTER TABLE llx_contrat ADD COLUMN total_tva double(24,8) DEFAULT 0; ALTER TABLE llx_contrat ADD COLUMN localtax1 double(24,8) DEFAULT 0; diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 8ed0e0d4207..54db0612084 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -253,7 +253,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 50; // Height reserved to output the info and total part and payment part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) {