Qual: Updates regarding write_file(s) methods for Phan (#30511)

* Fix phpdoc for phpstan

* Add abstract write_file to ModelePDFContract

And update phpdoc for derived classes

* Fix typing for php_standard_actions writefile

* Improve phpdoc for write_files (& related)

* Add abstract write_file to ModelePDFBom

* Add abstract write_file to ModelePDFDeliveryOrder

* Add abstract write_file to ModeleExpenseReport

* Add abstract write_file to ModelePDFFicheinter

* Add abstract write_file to ModelePDFEvaluation

* Add abstract write_file to ModelePDFFactures

* Add abstract write_file to ModelePDFSuppliersInvoices

* Update ModelePDFProjects and ModelePDFTask related classes

* Qual: Add abstract write_file to ModelePdfExpedition

And update phpdoc for derived classes

* Qual: Correct reference (doc) to ModelePDFEvaluation

* Qual: Add abstract write_file to ModelePDFKnowledgeRecord

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFMo & ModelePDFMouvement

And update phpdoc for derived classes

* Qual: Set typehint to ModelePDFFicheinter

* Qual: Add abstract write_file to ModelePDFCommandes

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFPropales

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePdfReception

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFSuppliersOrders

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFSuppliersOrders

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFSuppliersPayments

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFSupplierProposal

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFWorkstation

And update phpdoc for derived classes

* Set typing for doc generator (commonobject)

* Improve typing for write_file

* Set typing for doc generator

* Qual: Add abstract write_file to ModelePDFMember

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFProduct

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFProductBatch

And update phpdoc for derived classes

* Qual: Add abstract write_file to ModelePDFRecruitmentJobPosition

And update phpdoc for derived classes

* Add abstract write_file to ModelePDFTicket

* Add abstract write_file to ModelePDFUser

* Add abstract write_file to ModelePDFUserGroup

* Add abstract write_file to ModeleThirdPartyDoc

* Add abstract write_file to ModelePDFAsset

* Find all incompatible classes

* Qual: update phan baseline

* Set typing for doc generator (commonobject)

* Qual: update phan baseline

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
MDW 2024-08-14 19:21:10 +02:00 committed by GitHub
parent c993c006af
commit 3d04a7195c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
109 changed files with 1222 additions and 743 deletions

View File

@ -11,23 +11,23 @@ return [
// # Issue statistics:
// PhanPluginUnknownPropertyType : 2060+ occurrences
// PhanPossiblyUndeclaredGlobalVariable : 1350+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 1230+ occurrences
// PhanPluginUnknownObjectMethodCall : 1060+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 1220+ occurrences
// PhanPluginUnknownObjectMethodCall : 1050+ occurrences
// PhanUndeclaredProperty : 920+ occurrences
// PhanPluginUnknownArrayMethodParamType : 750+ occurrences
// PhanUndeclaredGlobalVariable : 730+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 610+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 580+ occurrences
// PhanPossiblyUndeclaredVariable : 410+ occurrences
// PhanTypeMismatchProperty : 290+ occurrences
// PhanPluginUnknownArrayFunctionParamType : 190+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 160+ occurrences
// PhanTypeExpectedObjectPropAccess : 150+ occurrences
// PhanTypeInvalidLeftOperandOfNumericOp : 130+ occurrences
// PhanUndeclaredMethod : 120+ occurrences
// PhanUndeclaredMethod : 100+ occurrences
// PhanPluginEmptyStatementIf : 65+ occurrences
// PhanRedefineFunction : 55+ occurrences
// PhanTypeMismatchDimFetch : 50+ occurrences
// PhanTypeSuspiciousNonTraversableForeach : 35+ occurrences
// PhanTypeSuspiciousNonTraversableForeach : 40+ occurrences
// PhanPossiblyNullTypeMismatchProperty : 25+ occurrences
// PhanEmptyForeach : 20+ occurrences
// PhanRedefinedClassReference : 20+ occurrences
@ -48,10 +48,8 @@ return [
// PhanAccessPropertyStaticAsNonStatic : 1 occurrence
// PhanParamSignatureMismatch : 1 occurrence
// PhanPluginRedundantReturnComment : 1 occurrence
// PhanPluginWhitespaceTrailing : 1 occurrence
// PhanTypeArraySuspiciousNull : 1 occurrence
// PhanTypeMismatchReturn : 1 occurrence
// PhanUndeclaredVariableAssignOp : 1 occurrence
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
'file_suppressions' => [
@ -92,18 +90,18 @@ return [
'htdocs/adherents/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/adherents/type.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/admin/agenda_extsites.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/agenda_other.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/admin/agenda_reminder.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/admin/agenda_other.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'],
'htdocs/admin/agenda_reminder.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/admin/bank.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/bank_extrafields.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/bankline_extrafields.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/barcode.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/admin/bom.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/bom.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/chequereceipts.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/admin/company.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/contract.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/contract.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/delais.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetch'],
'htdocs/admin/delivery.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/delivery.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/dict.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/admin/dolistore/class/dolistore.class.php' => ['PhanPluginUnknownObjectMethodCall'],
@ -111,19 +109,19 @@ return [
'htdocs/admin/emailcollector_card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredMethod'],
'htdocs/admin/emailcollector_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/eventorganization.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/expedition.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredMethod'],
'htdocs/admin/expensereport.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/expedition.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/admin/expensereport.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/expensereport_rules.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/external_rss.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull'],
'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/fichinter.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/fichinter.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/geoipmaxmind.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/admin/holiday.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/hrm.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/admin/holiday.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/hrm.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/ihm.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/invoice.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/admin/invoice.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/invoice_situation.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/admin/knowledgemanagement.php' => ['PhanEmptyForeach', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/admin/knowledgemanagement.php' => ['PhanEmptyForeach', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/ldap_groups.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/ldap_users.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/admin/loan.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
@ -135,25 +133,25 @@ return [
'htdocs/admin/menus/edit.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'],
'htdocs/admin/modulehelp.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchDimFetchNullable', 'PhanUndeclaredGlobalVariable'],
'htdocs/admin/modules.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/mrp.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/mrp.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/mrp_extrafields.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/admin/multicurrency.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/oauthlogintokens.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/admin/order.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredMethod'],
'htdocs/admin/order.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/admin/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/admin/pdf.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/perms.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/admin/propal.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/propal.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/receiptprinter.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable'],
'htdocs/admin/reception_setup.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredMethod'],
'htdocs/admin/reception_setup.php' => ['PhanPluginUnknownObjectMethodCall'],
'htdocs/admin/security.php' => ['PhanUndeclaredProperty'],
'htdocs/admin/security_file.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/spip.php' => ['PhanTypeMismatchDimFetch'],
'htdocs/admin/stock.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/admin/stocktransfer.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredMethod'],
'htdocs/admin/supplier_invoice.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/supplier_order.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/admin/supplier_payment.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/admin/supplier_invoice.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/supplier_order.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/admin/supplier_payment.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/admin/supplier_proposal.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/admin/syslog.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'htdocs/admin/system/constall.php' => ['PhanUndeclaredGlobalVariable'],
@ -585,36 +583,30 @@ return [
'htdocs/core/modules/action/modules_action.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod'],
'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/asset/modules_asset.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/bank/doc/pdf_ban.modules.php' => ['PhanUndeclaredMethod'],
'htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/core/modules/bank/modules_bank.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/core/modules/barcode/doc/phpbarcode.modules.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/barcode/modules_barcode.class.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/bom/modules_bom.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'],
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/commande/mod_commande_saphir.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/commande/modules_commande.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/core/modules/commande/modules_commande.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/contract/modules_contract.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/delivery/modules_delivery.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/dons/html_cerfafr.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation'],
'htdocs/core/modules/dons/modules_don.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/expedition/modules_expedition.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginUnknownPropertyType', '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'],
'htdocs/core/modules/export/export_csvutf8.modules.php' => ['PhanPluginUnknownArrayMethodParamType'],
'htdocs/core/modules/export/export_excel2007.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'],
@ -626,14 +618,11 @@ return [
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/mod_facture_mercure.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/fichinter/modules_fichinter.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'],
'htdocs/core/modules/holiday/modules_holiday.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', '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'],
'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
'htdocs/core/modules/import/modules_import.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchDimFetch'],
@ -648,13 +637,11 @@ return [
'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_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/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/member/modules_member.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod'],
'htdocs/core/modules/movement/modules_movement.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/mrp/modules_mo.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/oauth/generic_oauthcallback.php' => ['PhanUndeclaredMethod'],
'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredMethod'],
'htdocs/core/modules/oauth/google_oauthcallback.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredMethod'],
@ -668,65 +655,52 @@ return [
'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' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', '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'],
'htdocs/core/modules/product_batch/mod_sn_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/product_batch/mod_sn_free.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/product_batch/modules_product_batch.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/project/doc/pdf_baleine.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/project/mod_project_universal.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/project/modules_project.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/modules/project/task/modules_task.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/propale/mod_propale_saphir.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/propale/modules_propale.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/core/modules/propale/modules_propale.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/rapport/pdf_paiement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod'],
'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/reception/modules_reception.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/security/generate/modGeneratePassPerso.class.php' => ['PhanPluginUnknownPropertyType'],
'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_stock.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod'],
'htdocs/core/modules/stock/modules_stock.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/stocktransfer/modules_stocktransfer.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/supplier_order/modules_commandefournisseur.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'],
'htdocs/core/modules/supplier_order/modules_commandefournisseur.php' => ['PhanPluginUnknownPropertyType'],
'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' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/syslog/logHandler.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanPluginConstantVariableNull', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/takepos/mod_takepos_ref_universal.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'],
'htdocs/core/modules/ticket/mod_ticket_universal.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/ticket/modules_ticket.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'],
'htdocs/core/modules/user/modules_user.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/usergroup/modules_usergroup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/workstation/modules_workstation.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'],
'htdocs/core/tpl/advtarget.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanUndeclaredGlobalVariable'],
@ -937,7 +911,6 @@ return [
'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic', 'PhanPluginUnknownObjectMethodCall'],
'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/knowledgemanagement/knowledgerecord_agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'],
@ -1143,7 +1116,6 @@ return [
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/recruitment/index.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/recruitment/recruitmentcandidature_agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/recruitment/recruitmentcandidature_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],

View File

@ -96,7 +96,7 @@ if ($action == 'updateMask') {
require_once $file;
$module = new $classname($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFHoliday $module';
if ($module->write_file($holiday, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf");

View File

@ -148,7 +148,7 @@ if ($action == 'update') {
require_once $file;
$module = new $classname($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFEvaluation $module';
if ($module->write_file($tmpobject, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=hrm&file=evaluation/SPECIMEN.pdf");

View File

@ -114,7 +114,7 @@ if ($action == 'updateMask') {
require_once $file;
$module = new $classname($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFFactures $module';
if ($module->write_file($facture, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf");

View File

@ -123,7 +123,7 @@ if ($action == 'updateMask') {
require_once $file;
$module = new $className($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFKnowledgeRecord $module';
if ($module->write_file($tmpobject, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");

View File

@ -92,7 +92,7 @@ if ($action == 'updateMask') {
require_once $file;
$module = new $classname($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFMo $module';
if ($module->write_file($mo, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=mrp&file=SPECIMEN.pdf");

View File

@ -97,7 +97,7 @@ if ($action == 'updateMask') {
require_once $file;
$module = new $classname($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFPropales $module';
if ($module->write_file($propal, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=propal&file=SPECIMEN.pdf");

View File

@ -120,7 +120,7 @@ if ($action == 'updateMask') {
require_once $file;
$module = new $classname($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePdfReception $module';
if ($module->write_file($exp, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=reception&file=SPECIMEN.pdf");

View File

@ -117,7 +117,7 @@ if ($action == 'specimen') { // For invoices
require_once $file;
$module = new $classname($db, $facture);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFSuppliersInvoices $module';
if ($module->write_file($facture, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");

View File

@ -1,27 +1,27 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/supplier_order.php
@ -107,7 +107,7 @@ if ($action == 'specimen') { // For orders
require_once $file;
$module = new $classname($db, $commande);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFSuppliersOrders $module';
if ($module->write_file($commande, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");

View File

@ -118,7 +118,7 @@ if ($action == 'updateMask') {
require_once $file;
$module = new $classname($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFSuppliersPayments $module';
if ($module->write_file($paiementFourn, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_payment&file=SPECIMEN.pdf");

View File

@ -96,7 +96,7 @@ if ($action == 'specimen') {
require_once $file;
$module = new $classname($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFSupplierProposal $module';
if ($module->write_file($supplier_proposal, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf");

View File

@ -108,7 +108,7 @@ if ($action == 'updateMask') {
require_once $file;
$module = new $classname($db);
'@phan-var-force CommonDocGenerator $module';
'@phan-var-force ModelePDFWorkstation $module';
if ($module->write_file($tmpobject, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");

View File

@ -70,7 +70,7 @@ if ($action == 'builddoc') {
require_once DOL_DOCUMENT_ROOT.'/core/modules/action/doc/pdf_standard_actions.class.php';
$cat = new pdf_standard_actions($db, $month, $year);
$result = $cat->write_file(0, $langs);
$result = $cat->write_file(null, $langs);
if ($result < 0) {
setEventMessages($cat->error, $cat->errors, 'errors');
}

View File

@ -1436,7 +1436,7 @@ class CMailFile
* Read a file on disk and return encoded content for emails (mode = 'mail')
*
* @param string $sourcefile Path to file to encode
* @return int|string Return integer <0 if KO, encoded string if OK
* @return int<-1,-1>|string Return integer <0 if KO, encoded string if OK
*/
private function _encode_file($sourcefile)
{
@ -1800,8 +1800,8 @@ class CMailFile
* @param string[] $filename_list Tableau
* @param string[] $mimetype_list Tableau
* @param string[] $mimefilename_list Tableau
* @param string[] $cidlist Array of CID if file must be completed with CID code
* @return string|int String with files encoded
* @param ?string[] $cidlist Array of CID if file must be completed with CID code
* @return string|int<-1,-1> String with files encoded or -1 when error
*/
private function write_files($filename_list, $mimetype_list, $mimefilename_list, $cidlist)
{

View File

@ -5780,6 +5780,19 @@ abstract class CommonObject
$obj = new $classname($this->db);
// TODO: Check the following classes that seem possible for $obj, but removed for compatibility:
// ModeleBankAccountDoc|ModeleExpenseReport|ModelePDFBom|ModelePDFCommandes|ModelePDFContract|
// ModelePDFDeliveryOrder|ModelePDFEvaluation|ModelePDFFactures|ModelePDFFicheinter|
// ModelePDFMo|ModelePDFMovement|ModelePDFProduct|ModelePDFProjects|ModelePDFPropales|
// ModelePDFRecruitmentJobPosition|ModelePDFSupplierProposal|ModelePDFSuppliersInvoices|
// ModelePDFSuppliersOrders|ModelePDFSuppliersPayments|ModelePdfExpedition|ModelePdfReception|
// ModelePDFStock|ModelePDFStockTransfer|
// ModeleDon|ModelePDFTask|
// ModelePDFAsset|ModelePDFTicket|ModelePDFUserGroup|ModeleThirdPartyDoc|ModelePDFUser
// Has no write_file: ModeleBarCode|ModeleImports|ModeleExports|
'@phan-var-force ModelePDFMember $obj';
// '@phan-var-force ModelePDFMember|ModeleBarCode|ModeleDon|ModeleExports|ModeleImports|ModelePDFAsset|ModelePDFContract|ModelePDFDeliveryOrder|ModelePDFEvaluation|ModelePDFFactures|ModelePDFFicheinter|ModelePDFMo|ModelePDFMovement|ModelePDFProduct|ModelePDFProjects|ModelePDFPropales|ModelePDFRecruitmentJobPosition|ModelePDFStock|ModelePDFStockTransfer|ModelePDFSupplierProposal|ModelePDFSuppliersInvoices|ModelePDFSuppliersOrders|ModelePDFSuppliersPayments|ModelePDFTask|ModelePDFTicket|ModelePDFUser|ModelePDFUserGroup|ModelePdfExpedition|ModelePdfReception|ModeleThirdPartyDoc $obj';
// If generator is ODT, we must have srctemplatepath defined, if not we set it.
if ($obj->type == 'odt' && empty($srctemplatepath)) {
$varfortemplatedir = $obj->scandir;
@ -5834,9 +5847,8 @@ abstract class CommonObject
// update model_pdf in object
$this->model_pdf = $saved_model;
if (in_array(get_class($this), array('Adherent'))) {
'@phan-var-force Adherent $this';
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, 'tmp_cards', $moreparams);
if ($obj instanceof ModelePDFMember) {
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, 'tmp_cards');
} else {
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams);
}

View File

@ -1895,7 +1895,7 @@ function version_webserver()
* @param DoliDB $db Database handler
* @param string $type Type of models (company, invoice, ...)
* @param int $maxfilenamelength Max length of value to show
* @return array|int 0 if no module is activated, or array(key=>label). For modules that need directory scan, key is completed with ":filename".
* @return string[]|int<-1,0> 0 if no module is activated, or array(key=>label). For modules that need directory scan, key is completed with ":filename", -1 if error
*/
function getListOfModels($db, $type, $maxfilenamelength = 0)
{

View File

@ -119,13 +119,13 @@ class pdf_standard_actions
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Write the object to document file to disk
* Write the object to document file to disk
*
* @param int $socid Thirdparty id
* @param Translate $outputlangs Lang object for output language
* @return int 1=OK, 0=KO
* @param ?CommonObject $object Order/...
* @param Translate $outputlangs Lang object for output language
* @return int<0,1> 1=OK, 0=KO
*/
public function write_file($socid, $outputlangs)
public function write_file($object, $outputlangs)
{
// phpcs:enable
global $user, $conf, $langs, $hookmanager;

View File

@ -187,15 +187,15 @@ class doc_generic_asset_odt extends ModelePDFAsset
/**
* Function to build a document on disk using the generic odt module.
*
* @param Asset $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
* @return int 1 if OK, <=0 if KO
* @param Asset $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -316,7 +316,7 @@ class doc_generic_asset_odt extends ModelePDFAsset
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -372,7 +372,7 @@ class doc_generic_asset_odt extends ModelePDFAsset
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -408,7 +408,7 @@ class doc_generic_asset_odt extends ModelePDFAsset
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -440,7 +440,7 @@ class doc_generic_asset_odt extends ModelePDFAsset
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -462,14 +462,14 @@ class doc_generic_asset_odt extends ModelePDFAsset
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -141,13 +141,13 @@ class pdf_standard_asset extends ModelePDFAsset
/**
* Function to build pdf onto disk
*
* @param Asset $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param Asset $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -42,9 +42,9 @@ abstract class ModelePDFAsset extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -57,6 +57,21 @@ abstract class ModelePDFAsset extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
* @param Asset $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}

View File

@ -116,14 +116,14 @@ class pdf_sepamandate extends ModeleBankAccountDoc
/**
* Function to create pdf of company bank account sepa mandate
*
* @param Account $object CompanyBankAccount bank account to generate document for
* @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 (not used for this template)
* @param int $hidedesc Do not show desc (not used for this template)
* @param int $hideref Do not show ref (not used for this template)
* @param null|array $moreparams More parameters
* @return int 1 if OK, <=0 if KO
* @param Account $object CompanyBankAccount bank account to generate document for
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @param ?array<string,string> $moreparams More parameters
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{

View File

@ -36,9 +36,9 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -52,13 +52,14 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Write the document to disk
*
* @param Account $object Object Account to generate
* @param Translate $outputlangs Lang output object
* @return int 1 if OK, <=0 if KO
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs);
// phpcs:enable

View File

@ -193,12 +193,12 @@ class doc_generic_bom_odt extends ModelePDFBom
* @param BOM $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
* @return int 1 if OK, <=0 if KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -317,7 +317,7 @@ class doc_generic_bom_odt extends ModelePDFBom
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -373,7 +373,7 @@ class doc_generic_bom_odt extends ModelePDFBom
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -418,7 +418,7 @@ class doc_generic_bom_odt extends ModelePDFBom
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -450,7 +450,7 @@ class doc_generic_bom_odt extends ModelePDFBom
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -472,14 +472,14 @@ class doc_generic_bom_odt extends ModelePDFBom
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -43,9 +43,9 @@ abstract class ModelePDFBom extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -58,6 +58,21 @@ abstract class ModelePDFBom extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
* @param BOM $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}

View File

@ -195,17 +195,17 @@ class doc_generic_order_odt extends ModelePDFCommandes
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
* Function to build pdf onto disk
*
* @param Commande $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
* @return int 1 if OK, <=0 if KO
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -327,7 +327,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -387,7 +387,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -421,7 +421,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -452,7 +452,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -474,14 +474,14 @@ class doc_generic_order_odt extends ModelePDFCommandes
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -166,13 +166,13 @@ class pdf_einstein extends ModelePDFCommandes
/**
* Function to build pdf onto disk
*
* @param Commande $object Object to generate
* @param Commande $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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -153,10 +153,10 @@ class pdf_eratosthene extends ModelePDFCommandes
* @param Commande $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -62,9 +62,9 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -77,6 +77,22 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Commande $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}

View File

@ -192,17 +192,17 @@ class doc_generic_contract_odt extends ModelePDFContract
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
* Function to build a document on disk using the generic odt module
*
* @param Contrat $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
* @return int 1 if OK, <=0 if KO
* @param Contrat $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -338,7 +338,7 @@ class doc_generic_contract_odt extends ModelePDFContract
$tmparray = $substitutionarray;
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -381,7 +381,7 @@ class doc_generic_contract_odt extends ModelePDFContract
}
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -418,7 +418,7 @@ class doc_generic_contract_odt extends ModelePDFContract
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -449,7 +449,7 @@ class doc_generic_contract_odt extends ModelePDFContract
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -471,14 +471,14 @@ class doc_generic_contract_odt extends ModelePDFContract
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -128,15 +128,15 @@ class pdf_strato extends ModelePDFContract
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
* Function to build pdf on disk
*
* @param Contrat $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param Contrat $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -42,9 +42,9 @@ abstract class ModelePDFContract extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string|int<-1,0> List of templates, 0 if no module, -1 if error
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -57,6 +57,22 @@ abstract class ModelePDFContract extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk
*
* @param Contrat $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
}

View File

@ -119,10 +119,10 @@ class pdf_storm extends ModelePDFDeliveryOrder
* @param Delivery $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -140,10 +140,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
* @param Delivery $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -41,9 +41,9 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -56,6 +56,21 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Delivery $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}

View File

@ -193,17 +193,17 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
* Function to build pdf onto disk
*
* @param Expedition $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
* @return int 1 if OK, <=0 if KO
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -325,7 +325,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -450,7 +450,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -487,7 +487,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -518,7 +518,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -540,14 +540,14 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -113,15 +113,15 @@ class pdf_espadon extends ModelePdfExpedition
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
* Function to build pdf onto disk
*
* @param Expedition $object Object shipping to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -111,17 +111,17 @@ class pdf_merou extends ModelePdfExpedition
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
* Function to build pdf onto disk
*
* @param Expedition $object Object expedition to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file(&$object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $conf, $langs, $mysoc, $hookmanager;

View File

@ -146,15 +146,15 @@ class pdf_rouget extends ModelePdfExpedition
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
* Function to build pdf onto disk
*
* @param Expedition $object Object shipping to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -41,11 +41,11 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
{
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation models
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -58,6 +58,22 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Expedition $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}

View File

@ -180,10 +180,10 @@ class pdf_standard_expensereport extends ModeleExpenseReport
* @param ExpenseReport $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -26,11 +26,11 @@ abstract class ModeleExpenseReport extends CommonDocGenerator
{
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active models generation
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -43,6 +43,21 @@ abstract class ModeleExpenseReport extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param ExpenseReport $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}
/**

View File

@ -194,15 +194,15 @@ class doc_generic_invoice_odt extends ModelePDFFactures
/**
* Function to build a document on disk using the generic odt module.
*
* @param Facture $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
* @return int 1 if OK, <=0 if KO
* @param Facture $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1=OK, <=0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -367,7 +367,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -444,7 +444,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -480,7 +480,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -511,7 +511,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -532,14 +532,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures
return -1;
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -184,13 +184,13 @@ class pdf_crabe extends ModelePDFFactures
/**
* Function to build pdf onto disk
*
* @param Facture $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param Facture $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1=OK, <=0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -257,13 +257,13 @@ class pdf_octopus extends ModelePDFFactures
/**
* Function to build pdf onto disk
*
* @param Facture $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param Facture $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1=OK, <=0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
@ -1924,9 +1924,9 @@ class pdf_octopus extends ModelePDFFactures
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{

View File

@ -186,13 +186,13 @@ class pdf_sponge extends ModelePDFFactures
/**
* Function to build pdf onto disk
*
* @param Facture $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param Facture $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1=OK, <=0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
@ -2013,9 +2013,9 @@ class pdf_sponge extends ModelePDFFactures
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{

View File

@ -63,9 +63,9 @@ abstract class ModelePDFFactures extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -79,6 +79,23 @@ abstract class ModelePDFFactures extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Facture $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1=OK, <=0=KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
/**
* Get the SwissQR object, including validation
*

View File

@ -123,10 +123,10 @@ class pdf_soleil extends ModelePDFFicheinter
* @param Fichinter $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -38,11 +38,11 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
{
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation modules
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -55,6 +55,21 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Fichinter $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}
@ -135,6 +150,8 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0,
$obj = new $classname($db);
'@phan-var-force ModelePDFFicheinter $obj';
// We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8.
$sav_charset_output = $outputlangs->charset_output;

View File

@ -41,11 +41,11 @@ abstract class ModelePDFHoliday extends CommonDocGenerator
{
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation modules
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -58,6 +58,21 @@ abstract class ModelePDFHoliday extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Holiday $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}

View File

@ -133,13 +133,13 @@ class pdf_standard_evaluation extends ModelePDFEvaluation
/**
* Function to build pdf onto disk
*
* @param Evaluation $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param Evaluation $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -42,9 +42,9 @@ abstract class ModelePDFEvaluation extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -57,6 +57,22 @@ abstract class ModelePDFEvaluation extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Evaluation $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<0,1> 1=OK, 0=KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}

View File

@ -190,11 +190,11 @@ class doc_generic_member_odt extends ModelePDFMember
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param string $mode Tell if doc module is called for 'member', ...
* @param int $nooutput 1=Generate only file on disk and do not return it on response
* @param int<0,1> $nooutput 1=Generate only file on disk and do not return it on response
* @param string $filename Name of output file (without extension)
* @return int 1 if OK, <=0 if KO
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'member', $nooutput = 0, $filename = 'tmp_cards')
public function write_file($object, $outputlangs, $srctemplatepath = '', $mode = 'member', $nooutput = 0, $filename = 'tmp_cards')
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -339,10 +339,10 @@ class doc_generic_member_odt extends ModelePDFMember
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs,
'substitutionarray'=>&$tmparray
'file' => $file,
'object' => $object,
'outputlangs' => $outputlangs,
'substitutionarray' => &$tmparray
);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -374,7 +374,7 @@ class doc_generic_member_odt extends ModelePDFMember
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -402,7 +402,7 @@ class doc_generic_member_odt extends ModelePDFMember
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -143,6 +143,8 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o
$obj = new $classname($db);
'@phan-var-force ModelePDFMember $obj';
// We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8.
$sav_charset_output = $outputlangs->charset_output;

View File

@ -39,11 +39,11 @@ abstract class ModelePDFMember extends CommonDocGenerator
{
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation modules
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -55,6 +55,22 @@ abstract class ModelePDFMember extends CommonDocGenerator
$list = getListOfModels($db, $type, $maxfilenamelength);
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document
*
* @param Adherent $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 string $mode Tell if doc module is called for 'member', ...
* @param int<0,1> $nooutput 1=Generate only file on disk and do not return it on response
* @param string $filename Name of output file (without extension)
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $mode = 'member', $nooutput = 0, $filename = 'tmp_cards');
// phpcs:enable
}

View File

@ -125,15 +125,15 @@ class pdf_standard_movementstock extends ModelePDFMovement
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
* Function to build pdf onto disk
*
* @param MouvementStock $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
* @return int 1 if OK, <=0 if KO
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -54,11 +54,11 @@ abstract class ModelePDFMovement extends CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation modules
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -71,4 +71,20 @@ abstract class ModelePDFMovement extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build document
*
* @param MouvementStock $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}

View File

@ -183,17 +183,17 @@ class doc_generic_mo_odt extends ModelePDFMo
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
* Function to build pdf onto disk
*
* @param MO $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
* @return int 1 if OK, <=0 if KO
* @param Mo $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -310,7 +310,7 @@ class doc_generic_mo_odt extends ModelePDFMo
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -369,7 +369,7 @@ class doc_generic_mo_odt extends ModelePDFMo
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -406,7 +406,7 @@ class doc_generic_mo_odt extends ModelePDFMo
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -438,7 +438,7 @@ class doc_generic_mo_odt extends ModelePDFMo
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -460,14 +460,14 @@ class doc_generic_mo_odt extends ModelePDFMo
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -126,15 +126,15 @@ class pdf_vinci extends ModelePDFMo
/**
* Function to build pdf onto disk
*
* @param Mo $object Id of object to generate
* @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
* @return int 1=OK, 0=KO
* @param Mo $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $mysoc;

View File

@ -43,9 +43,9 @@ abstract class ModelePDFMo extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -58,6 +58,20 @@ abstract class ModelePDFMo extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Mo $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}

View File

@ -193,13 +193,13 @@ class doc_generic_product_odt extends ModelePDFProduct
*
* @param Product $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
* @return int 1 if OK, <=0 if KO
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $product, $langs, $conf, $mysoc, $hookmanager, $user;
@ -322,7 +322,7 @@ class doc_generic_product_odt extends ModelePDFProduct
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -381,7 +381,7 @@ class doc_generic_product_odt extends ModelePDFProduct
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -407,7 +407,7 @@ class doc_generic_product_odt extends ModelePDFProduct
$array_lines = $this->get_substitutionarray_each_var_object($supplierprice, $outputlangs);
complete_substitutions_array($array_lines, $outputlangs, $object, $supplierprice, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$array_lines, 'line'=>$supplierprice);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$array_lines, 'line' => $supplierprice);
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($array_lines as $key => $val) {
try {
@ -437,7 +437,7 @@ class doc_generic_product_odt extends ModelePDFProduct
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -459,14 +459,14 @@ class doc_generic_product_odt extends ModelePDFProduct
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -107,17 +107,17 @@ class pdf_standard extends ModelePDFProduct
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
* Function to build pdf onto disk
*
* @param Product $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
* @return int 1 if OK, <=0 if KO
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $db, $hookmanager;

View File

@ -41,20 +41,35 @@ abstract class ModelePDFProduct extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @param DoliDB $dbs Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of templates
* @param DoliDB $db Database handler
* @param int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($dbs, $maxfilenamelength = 0)
public static function liste_modeles($db, $maxfilenamelength = 0)
{
// phpcs:enable
$type = 'product';
$list = array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$list = getListOfModels($dbs, $type, $maxfilenamelength);
$list = getListOfModels($db, $type, $maxfilenamelength);
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build document
*
* @param Product $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}
/**

View File

@ -44,9 +44,9 @@ abstract class ModelePDFProductBatch extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -58,6 +58,21 @@ abstract class ModelePDFProductBatch extends CommonDocGenerator
$list = getListOfModels($db, $type, $maxfilenamelength);
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build document
*
* @param Productlot $object Object source to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}
/**

View File

@ -147,18 +147,18 @@ class doc_generic_project_odt extends ModelePDFProjects
}
$resarray = array(
$array_key.'_id'=>$object->id,
$array_key.'_ref'=>$object->ref,
$array_key.'_title'=>$object->title,
$array_key.'_description'=>$object->description,
$array_key.'_date_creation'=>dol_print_date($object->date_c, 'day'),
$array_key.'_date_modification'=>dol_print_date($object->date_m, 'day'),
$array_key.'_date_start'=>dol_print_date($object->date_start, 'day'),
$array_key.'_date_end'=>dol_print_date($object->date_end, 'day'),
$array_key.'_note_private'=>$object->note_private,
$array_key.'_note_public'=>$object->note_public,
$array_key.'_public'=>$object->public,
$array_key.'_statut'=>$object->getLibStatut()
$array_key.'_id' => $object->id,
$array_key.'_ref' => $object->ref,
$array_key.'_title' => $object->title,
$array_key.'_description' => $object->description,
$array_key.'_date_creation' => dol_print_date($object->date_c, 'day'),
$array_key.'_date_modification' => dol_print_date($object->date_m, 'day'),
$array_key.'_date_start' => dol_print_date($object->date_start, 'day'),
$array_key.'_date_end' => dol_print_date($object->date_end, 'day'),
$array_key.'_note_private' => $object->note_private,
$array_key.'_note_public' => $object->note_public,
$array_key.'_public' => $object->public,
$array_key.'_statut' => $object->getLibStatut()
);
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@ -183,23 +183,23 @@ class doc_generic_project_odt extends ModelePDFProjects
{
// phpcs:enable
$resarray = array(
'task_ref'=>$task->ref,
'task_fk_project'=>$task->fk_project,
'task_projectref'=>$task->projectref,
'task_projectlabel'=>$task->projectlabel,
'task_label'=>$task->label,
'task_description'=>$task->description,
'task_fk_parent'=>$task->fk_task_parent,
'task_duration'=>$task->duration,
'task_duration_hour'=>convertSecondToTime($task->duration, 'all'),
'task_planned_workload'=>$task->planned_workload,
'task_planned_workload_hour'=>convertSecondToTime($task->planned_workload, 'all'),
'task_progress'=>$task->progress,
'task_public'=>$task->public,
'task_date_start'=>dol_print_date($task->date_start, 'day'),
'task_date_end'=>dol_print_date($task->date_end, 'day'),
'task_note_private'=>$task->note_private,
'task_note_public'=>$task->note_public
'task_ref' => $task->ref,
'task_fk_project' => $task->fk_project,
'task_projectref' => $task->projectref,
'task_projectlabel' => $task->projectlabel,
'task_label' => $task->label,
'task_description' => $task->description,
'task_fk_parent' => $task->fk_task_parent,
'task_duration' => $task->duration,
'task_duration_hour' => convertSecondToTime($task->duration, 'all'),
'task_planned_workload' => $task->planned_workload,
'task_planned_workload_hour' => convertSecondToTime($task->planned_workload, 'all'),
'task_progress' => $task->progress,
'task_public' => $task->public,
'task_date_start' => dol_print_date($task->date_start, 'day'),
'task_date_end' => dol_print_date($task->date_end, 'day'),
'task_note_private' => $task->note_private,
'task_note_public' => $task->note_public
);
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@ -226,15 +226,15 @@ class doc_generic_project_odt extends ModelePDFProjects
$pc = 'projcontacts_'; // prefix to avoid typos
$ret = array(
$pc.'id'=>$contact['id'],
$pc.'rowid'=>$contact['rowid'],
$pc.'role'=>$contact['libelle'],
$pc.'lastname'=>$contact['lastname'],
$pc.'firstname'=>$contact['firstname'],
$pc.'civility'=>$contact['civility'],
$pc.'fullcivname'=>$contact['fullname'],
$pc.'socname'=>$contact['socname'],
$pc.'email'=>$contact['email']
$pc.'id' => $contact['id'],
$pc.'rowid' => $contact['rowid'],
$pc.'role' => $contact['libelle'],
$pc.'lastname' => $contact['lastname'],
$pc.'firstname' => $contact['firstname'],
$pc.'civility' => $contact['civility'],
$pc.'fullcivname' => $contact['fullname'],
$pc.'socname' => $contact['socname'],
$pc.'email' => $contact['email']
);
if ($contact['source'] == 'external') {
@ -281,9 +281,9 @@ class doc_generic_project_odt extends ModelePDFProjects
{
// phpcs:enable
return array(
'projfile_name'=>$file['name'],
'projfile_date'=>dol_print_date($file['date'], 'day'),
'projfile_size'=>$file['size']
'projfile_name' => $file['name'],
'projfile_date' => dol_print_date($file['date'], 'day'),
'projfile_size' => $file['size']
);
}
@ -301,13 +301,13 @@ class doc_generic_project_odt extends ModelePDFProjects
global $conf;
return array(
'projref_type'=>$refdetail['type'],
'projref_ref'=>$refdetail['ref'],
'projref_date'=>dol_print_date($refdetail['date'], 'day'),
'projref_socname'=>$refdetail['socname'],
'projref_amountht'=>price($refdetail['amountht'], 0, $outputlangs),
'projref_amountttc'=>price($refdetail['amountttc'], 0, $outputlangs),
'projref_status'=>$refdetail['status']
'projref_type' => $refdetail['type'],
'projref_ref' => $refdetail['ref'],
'projref_date' => dol_print_date($refdetail['date'], 'day'),
'projref_socname' => $refdetail['socname'],
'projref_amountht' => price($refdetail['amountht'], 0, $outputlangs),
'projref_amountttc' => price($refdetail['amountttc'], 0, $outputlangs),
'projref_status' => $refdetail['status']
);
}
@ -347,18 +347,18 @@ class doc_generic_project_odt extends ModelePDFProjects
{
// phpcs:enable
return array(
'tasktime_rowid'=>$tasktime['rowid'],
'tasktime_task_date'=>dol_print_date($tasktime['task_date'], 'day'),
'tasktime_task_duration_sec'=>$tasktime['task_duration'],
'tasktime_task_duration'=>convertSecondToTime($tasktime['task_duration'], 'all'),
'tasktime_note'=>$tasktime['note'],
'tasktime_fk_user'=>$tasktime['fk_user'],
'tasktime_user_name'=>$tasktime['name'],
'tasktime_user_first'=>$tasktime['firstname'],
'tasktime_fullcivname'=>$tasktime['fullcivname'],
'tasktime_amountht'=>$tasktime['amountht'],
'tasktime_amountttc'=>$tasktime['amountttc'],
'tasktime_thm'=>$tasktime['thm'],
'tasktime_rowid' => $tasktime['rowid'],
'tasktime_task_date' => dol_print_date($tasktime['task_date'], 'day'),
'tasktime_task_duration_sec' => $tasktime['task_duration'],
'tasktime_task_duration' => convertSecondToTime($tasktime['task_duration'], 'all'),
'tasktime_note' => $tasktime['note'],
'tasktime_fk_user' => $tasktime['fk_user'],
'tasktime_user_name' => $tasktime['name'],
'tasktime_user_first' => $tasktime['firstname'],
'tasktime_fullcivname' => $tasktime['fullcivname'],
'tasktime_amountht' => $tasktime['amountht'],
'tasktime_amountttc' => $tasktime['amountttc'],
'tasktime_thm' => $tasktime['thm'],
);
}
@ -374,9 +374,9 @@ class doc_generic_project_odt extends ModelePDFProjects
{
// phpcs:enable
return array(
'tasksfile_name'=>$file['name'],
'tasksfile_date'=>dol_print_date($file['date'], 'day'),
'tasksfile_size'=>$file['size']
'tasksfile_name' => $file['name'],
'tasksfile_date' => dol_print_date($file['date'], 'day'),
'tasksfile_size' => $file['size']
);
}
@ -488,9 +488,9 @@ class doc_generic_project_odt extends ModelePDFProjects
* @param Project $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
* @return int 1 if OK, <=0 if KO
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath)
public function write_file($object, $outputlangs, $srctemplatepath = '')
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -601,7 +601,7 @@ class doc_generic_project_odt extends ModelePDFProjects
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Open and load template
@ -643,7 +643,7 @@ class doc_generic_project_odt extends ModelePDFProjects
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -1117,7 +1117,7 @@ class doc_generic_project_odt extends ModelePDFProjects
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
@ -1138,14 +1138,14 @@ class doc_generic_project_odt extends ModelePDFProjects
return -1;
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -141,11 +141,12 @@ class pdf_baleine extends ModelePDFProjects
/**
* Function to build pdf project onto disk
*
* @param Project $object Object project a generer
* @param Translate $outputlangs Lang output object
* @return int 1 if OK, <=0 if KO
* @param Project $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
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs)
public function write_file($object, $outputlangs, $srctemplatepath = '')
{
// phpcs:enable
global $conf, $hookmanager, $langs, $user;

View File

@ -168,13 +168,14 @@ class pdf_beluga extends ModelePDFProjects
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Fonction generant le projet sur le disque
* Function generating the project on disk
*
* @param Project $object Object project a generer
* @param Translate $outputlangs Lang output object
* @return int 1 if OK, <=0 if KO
* @param Project $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
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs)
public function write_file($object, $outputlangs, $srctemplatepath = '')
{
// phpcs:enable
global $conf, $hookmanager, $langs, $user;

View File

@ -136,11 +136,12 @@ class pdf_timespent extends ModelePDFProjects
/**
* Function to build pdf project onto disk
*
* @param Project $object Object project a generer
* @param Translate $outputlangs Lang output object
* @return int 1 if OK, <=0 if KO
* @param Project $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
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs)
public function write_file($object, $outputlangs, $srctemplatepath = '')
{
// phpcs:enable
global $conf, $hookmanager, $langs, $user;

View File

@ -47,9 +47,9 @@ abstract class ModelePDFProjects extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -62,6 +62,18 @@ abstract class ModelePDFProjects extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf project onto disk
*
* @param Project $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
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '');
// phpcs:enable
}

View File

@ -452,12 +452,12 @@ class doc_generic_task_odt extends ModelePDFTask
/**
* Function to build a document on disk using the generic odt module.
*
* @param Commande $object Object source to build document
* @param Project $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
* @return int 1 if OK, <=0 if KO
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath)
public function write_file($object, $outputlangs, $srctemplatepath = '')
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;

View File

@ -38,9 +38,9 @@ abstract class ModelePDFTask extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -53,6 +53,19 @@ abstract class ModelePDFTask extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
* @param Project $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
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '');
// phpcs:enable
}

View File

@ -230,14 +230,14 @@ class doc_generic_proposal_odt extends ModelePDFPropales
* Function to build a document on disk using the generic odt module.
*
* @param Propal $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
* @return int 1 if OK, <=0 if KO
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;

View File

@ -170,10 +170,10 @@ class pdf_azur extends ModelePDFPropales
* @param Propal $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -147,10 +147,10 @@ class pdf_cyan extends ModelePDFPropales
* @param Propal $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -59,9 +59,9 @@ abstract class ModelePDFPropales extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -74,6 +74,21 @@ abstract class ModelePDFPropales extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build document
*
* @param Propal $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}

View File

@ -192,13 +192,13 @@ class doc_generic_reception_odt extends ModelePdfReception
*
* @param Reception $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
* @return int 1 if OK, <=0 if KO
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -320,7 +320,7 @@ class doc_generic_reception_odt extends ModelePdfReception
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -377,7 +377,7 @@ class doc_generic_reception_odt extends ModelePdfReception
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
try {
@ -410,7 +410,7 @@ class doc_generic_reception_odt extends ModelePdfReception
$tmparray = $this->get_substitutionarray_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);
$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 {
@ -441,7 +441,7 @@ class doc_generic_reception_odt extends ModelePdfReception
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -462,14 +462,14 @@ class doc_generic_reception_odt extends ModelePdfReception
return -1;
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -129,13 +129,13 @@ class pdf_squille extends ModelePdfReception
/**
* Function to build pdf onto disk
*
* @param Reception $object Object reception to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @param Reception $object Object reception to generate (or id if old method)
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -35,9 +35,9 @@ abstract class ModelePdfReception extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -50,6 +50,22 @@ abstract class ModelePdfReception extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document
*
* @param Reception $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}

View File

@ -195,17 +195,17 @@ class doc_generic_odt extends ModeleThirdPartyDoc
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
* Function to build a document on disk using the generic odt module.
*
* @param Societe $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
* @return int 1 if OK, <=0 if KO
* @param Societe $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -374,7 +374,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Replace variables into document
@ -406,7 +406,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -436,14 +436,14 @@ class doc_generic_odt extends ModeleThirdPartyDoc
return -1;
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -39,21 +39,37 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @param DoliDB $dbs Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of templates
* @param DoliDB $db Database handler
* @param int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($dbs, $maxfilenamelength = 0)
public static function liste_modeles($db, $maxfilenamelength = 0)
{
// phpcs:enable
$type = 'company';
$list = array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$list = getListOfModels($dbs, $type, $maxfilenamelength);
$list = getListOfModels($db, $type, $maxfilenamelength);
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
* @param Societe $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}
/**
@ -85,11 +101,11 @@ abstract class ModeleThirdPartyCode extends CommonNumRefGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Renvoie la liste des modeles de numérotation
* Return list of active generation modules
*
* @param DoliDB $dbs Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array|int List of numbers
* @param DoliDB $dbs Database handler
* @param int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($dbs, $maxfilenamelength = 0)
{

View File

@ -198,15 +198,15 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
/**
* Function to build a document on disk using the generic odt module.
*
* @param Commande $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
* @return int 1 if OK, <=0 if KO
* @param FactureFournisseur $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1=OK, <=0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -323,7 +323,7 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -379,7 +379,7 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -413,7 +413,7 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -445,7 +445,7 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -467,14 +467,14 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -147,15 +147,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
* Function to build a document on disk using the generic odt module.
*
* @param FactureFournisseur $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1=OK, <=0=KO
*/
public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -37,11 +37,11 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
{
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation models
* Return list of active generation modules
*
* @param DoliDB $db Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of numbers
* @param DoliDB $db Database handler
* @param int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -54,6 +54,22 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
* @param FactureFournisseur $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1=OK, <=0=KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}
/**

View File

@ -195,15 +195,15 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
/**
* Function to build a document on disk using the generic odt module.
*
* @param Commande $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
* @return int 1 if OK, <=0 if KO
* @param CommandeFournisseur $object Object source to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -319,7 +319,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
$newfreetext = '';
@ -374,7 +374,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -408,7 +408,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -440,7 +440,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -462,14 +462,14 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -135,17 +135,17 @@ class pdf_cornas extends ModelePDFSuppliersOrders
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
* Function to build pdf onto disk
*
* @param CommandeFournisseur $object Id of object to generate
* @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
* @return int 1=OK, 0=KO
* @param CommandeFournisseur $object Object source to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $mysoc, $nblines;

View File

@ -160,17 +160,17 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
* Function to build pdf onto disk
*
* @param CommandeFournisseur $object Id of object to generate
* @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
* @return int 1=OK, 0=KO
* @param CommandeFournisseur $object Object source to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $mysoc, $nblines;

View File

@ -57,11 +57,11 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation models
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -74,12 +74,27 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build document
*
* @param CommandeFournisseur $object Object source to generate (or id if old method)
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}
/**
* Parent Class of numbering models of suppliers orders references
* Parent Class of numbering models of supplier order references
*/
abstract class ModeleNumRefSuppliersOrders extends CommonNumRefGenerator
{

View File

@ -146,15 +146,15 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
* Function to build pdf onto disk
*
* @param PaiementFourn $object Id of object to generate
* @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
* @return int 1=OK, 0=KO
* @param PaiementFourn $object Object source to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -27,11 +27,11 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator
{
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation models
* Return list of active generation modules
*
* @param DoliDB $db Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of numbers
* @param DoliDB $db Database handler
* @param int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -44,6 +44,21 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build document
*
* @param PaiementFourn $object Object source to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}
/**

View File

@ -216,15 +216,15 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
/**
* Function to build a document on disk using the generic odt module.
*
* @param Propal $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
* @return int 1 if OK, <=0 if KO
* @param SupplierProposal $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -347,7 +347,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -405,7 +405,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@ -439,7 +439,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
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);
$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 {
@ -470,7 +470,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -491,14 +491,14 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
return -1;
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -156,13 +156,13 @@ class pdf_aurore extends ModelePDFSupplierProposal
/**
* Function to build pdf onto disk
*
* @param SupplierProposal $object Object to generate
* @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
* @return int 1=OK, 0=KO
* @param SupplierProposal $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{

View File

@ -136,15 +136,15 @@ class pdf_zenith extends ModelePDFSupplierProposal
/**
* Function to build pdf onto disk
*
* @param SupplierProposal $object Id of object to generate
* @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
* @return int 1=OK, 0=KO
* @param SupplierProposal $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $hookmanager, $mysoc, $nblines;

View File

@ -41,9 +41,9 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -56,6 +56,22 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
* @param SupplierProposal $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}

View File

@ -184,15 +184,15 @@ class doc_generic_ticket_odt extends ModelePDFTicket
/**
* Function to build a document on disk using the generic odt module.
*
* @param User $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
* @return int 1 if OK, <=0 if KO
* @param User $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -337,7 +337,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket
complete_substitutions_array($tmparray, $outputlangs, $object);
$object->fetch_optionals();
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
try {
@ -366,7 +366,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -394,7 +394,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -38,9 +38,9 @@ abstract class ModelePDFTicket extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -53,6 +53,23 @@ abstract class ModelePDFTicket extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
* @param User $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}

View File

@ -218,15 +218,15 @@ class doc_generic_user_odt extends ModelePDFUser
/**
* Function to build a document on disk using the generic odt module.
*
* @param User $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
* @return int 1 if OK, <=0 if KO
* @param User $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -368,7 +368,7 @@ class doc_generic_user_odt extends ModelePDFUser
complete_substitutions_array($tmparray, $outputlangs, $object);
$object->fetch_optionals();
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
try {
@ -397,7 +397,7 @@ class doc_generic_user_odt extends ModelePDFUser
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -425,7 +425,7 @@ class doc_generic_user_odt extends ModelePDFUser
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -21,17 +21,17 @@
/**
* \class ModeleProductCode
* \class ModelePDFUser
* \brief Parent class for product code generators
*/
/**
* \file htdocs/core/modules/contract/modules_contract.php
* \file htdocs/core/modules/user/modules_user.class.php
* \ingroup contract
* \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
/**
* Parent class to manage intervention document templates
@ -46,11 +46,11 @@ abstract class ModelePDFUser extends CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation modules
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -62,4 +62,21 @@ abstract class ModelePDFUser extends CommonDocGenerator
$list = getListOfModels($db, $type, $maxfilenamelength);
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document
*
* @param User $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}

View File

@ -217,17 +217,17 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
* Function to build a document on disk using the generic odt module.
*
* @param UserGroup $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
* @return int 1 if OK, <=0 if KO
* @param UserGroup $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $hookmanager;
@ -346,7 +346,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Line of free text
@ -404,7 +404,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
complete_substitutions_array($tmparray, $outputlangs, $object);
$object->fetch_optionals();
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
try {
@ -437,7 +437,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
unset($tmparray['object_pass_indatabase']);
complete_substitutions_array($tmparray, $outputlangs, $object, $user, "completesubstitutionarray_users");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$u);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray, 'line' => $u);
$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 {
@ -470,7 +470,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
}
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
@ -498,7 +498,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {

View File

@ -35,11 +35,11 @@ abstract class ModelePDFUserGroup extends CommonDocGenerator
{
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of active generation modules
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -51,4 +51,20 @@ abstract class ModelePDFUserGroup extends CommonDocGenerator
$list = getListOfModels($db, $type, $maxfilenamelength);
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
* @param UserGroup $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<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
// phpcs:enable
}

View File

@ -43,9 +43,9 @@ abstract class ModelePDFWorkstation extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @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 int<0,max> $maxfilenamelength Max length of value to show
* @return string[]|int<-1,0> List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
{
@ -58,6 +58,21 @@ abstract class ModelePDFWorkstation extends CommonDocGenerator
return $list;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build pdf onto disk
*
* @param Workstation $object Object source to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int<0,1> $hidedetails Do not show line details
* @param int<0,1> $hidedesc Do not show desc
* @param int<0,1> $hideref Do not show ref
* @return int<-1,1> 1 if OK, <=0 if KO
*/
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
}

Some files were not shown because too many files have changed in this diff Show More