diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b221f3115fe..ef974d9e763 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,13 +1,13 @@ How to contribute to Dolibarr ============================= -Bug reports and feature requests --------------------------------- +Send a Bug reports or a Feature request +--------------------------------------- -*Note*: **GitHub Issues is not a support forum.** If you have questions about Dolibarr / need help using the software, please use [the forums](https://www.dolibarr.org/forum.php). Forums exist in different languages. +*Note*: **GitHub Issues is not a support forum.** If you have questions about Dolibarr / need help on using the software, please use [the forums](https://www.dolibarr.org/forum.php). Forums exist in different languages. -Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues). -Default **language here is English**. So please prepare your contributions in English. +Issues to inform about a bug or a development trouble, like requests for a new feature, are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues). +Default **language here is English**. So please prepare your contributions in English (we recommand using an online translation service if you don't know English). 1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem. 2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request. @@ -18,11 +18,23 @@ Default **language here is English**. So please prepare your contributions in En -Submit code + + +Submit code --------------------- +This process describes how a Developer can submit code to the project so it can be analysezd and validated by the Merger (we call this a Pull Request). + +Definition: +- The Developer: is the human knowing the development language of the application that want to change some part of the code by making changement on the sources of the project. +- The Merger: is the human knowing the development and check that the code submitted for approbation is correct to validate it, in other word, the Merger is the approbator of commits. +- The Releaser: is the human that validates that there a freeze/beta version is ok to be released officialy as a stable version. + + ### Basic workflow +As the Developer: + 1. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr). 2. Clone your fork. 3. Choose a branch(See the [Branches](#branches) section below). @@ -30,8 +42,19 @@ Default **language here is English**. So please prepare your contributions in En 5. Commit and push your changes. 6. [Make a pull request](https://help.github.com/articles/creating-a-pull-request). +As the Merger: + +7. The Merger will check and say if he approves or not the commits. During this step, the Merger can modify your own code to make it valid for appobation or ask you to make the change yourself. For this the Merger may add commits himself. Depending on the tools used (can be done from github directly orfrom an IDE), such commits may be done directly after having validating your PR (for example to complete it). + +Note: Of course, the Merger, does not need to ask to himself if he is ok to validate a commit he did himself. This is a reason why the Merger can validate commits he did directly without passing by the approbation process described for the Developer. + +As the Releaser: + +8. A tag will be added to take a photo of the code will all the changes approved by the Merger, when he decide to do a release. + + ### Branches Unless you're fixing a bug, all pull requests should be made against the *develop* branch. @@ -39,18 +62,24 @@ Unless you're fixing a bug, all pull requests should be made against the *develo If you're fixing a bug, it is preferred that you cook your fix and pull request it against an oldest version affected. We recommend to push it into N - 2 for N the latest version available, if not possible into version N - 1, and finally into develop. -This is just a recommendation, currently, if you push a bug fix on a very old version, it is still merged and propagated into -higher versions. +This is just a recommendation, currently, if you push a bug fix on a very old version, it is still merged and propagated into higher versions. -The rule N - 2 is just a tip if you don't know which version to choose to get the best the best compromise between ease of correction -and number of potential beneficiaries of the correction. +The rule N - 2 is just a tip if you don't know which version to choose to get the best compromise between ease of correction and number of potential beneficiaries of the correction. ### General rules -Please don't edit the ChangeLog file. This file is generated from all commit messages during release process by the project manager. + +- As the Developer, please don't edit the ChangeLog file. This file is generated from all commit messages during the release process by the Project releaser. + +- As the Developer: Do not submit changes into files xx_XX/afile.lang. They are language files and are updated automatically by sync from Transifex. If you need to add a new language file, just add it for the en_US language. + +- As the Releaser: The releaser will decide to make a new release as soon as the planning of the release is reached and the code in the branch to release reach the status "No more known serious bug known". -### Commits + + +### Commits + Use clear commit messages with the following structure: ```plaintext diff --git a/ChangeLog b/ChangeLog index 2777680bc0f..a56a9462451 100644 --- a/ChangeLog +++ b/ChangeLog @@ -276,7 +276,6 @@ QUAL: professional identifiers - remove TODO by adding profid.lib.php QUAL: Properties ->date_update and ->date_modification were merged QUAL: removed duplicate language file QUAL: Remove the external js library jstimezonedetect -QUAL: Remove use of customurl filter. Must use the USF syntax. QUAL: Rename all input fields "tel" into "phone" QUAL: Rename column fk_origin_line on shipment lines into fk_elementdet to match a generic use. (#28989) QUAL: replace $conf->global with getDolGlobalString() @@ -301,6 +300,7 @@ The following changes may create regressions for some external modules, but were * All CLI tools (into /scripts) return a positive value to the shell if error (0 remains success) for a better cross platform compatibility. On linux the exit(-1) was caught as 255, it may be now exit(1) so will be caught as 1. * The parameter $filter of method fetchAll does not accept array of SQL but must be a string of an Universal Search Filter syntax. +* Remove use of customurl into $filter. Must use the USF syntax. * Use of dol_eval with parameter $returnvalue=0 is deprecated. * The signature for all ->delete() method has been modified to match the modulebuilder template (so first param is now always $user), except the delete for thirdparty (still accept the id of thirdparty to delete as first parameter). Will probably be modified into another version. @@ -316,7 +316,6 @@ The following changes may create regressions for some external modules, but were * The signature of method fetch() of class CompanyBankAccount has been modified to match the signature of method Account->fetch() - ***** ChangeLog for 19.0.2 compared to 19.0.1 ***** FIX: $object->oldcopy may be a stdClass and not original object FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index d86b652ccb6..e08db3c0ccb 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -33,7 +33,7 @@ $path = dirname(__FILE__).'/'; // Test if batch mode if (substr($sapi_type, 0, 3) == 'cgi') { echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; - exit; + exit(1); } require_once $path."../htdocs/master.inc.php"; @@ -51,7 +51,7 @@ $buildzip = 0; if (empty($argv[1])) { print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; - exit -1; + exit(1); } @@ -87,7 +87,7 @@ while ($i < $argc) { if (empty($release)) { print "Error: Missing release parameter\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(2); } $savrelease = $release; @@ -107,21 +107,21 @@ if (empty($includecustom)) { if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') { print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(3); } } else { $tmpverter = explode('-', DOL_VERSION, 2); if ($tmpverter[0] != $tmpverbis[0]) { print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(4); } } } else { if (!preg_match('/'.preg_quote(DOL_VERSION, '/').'-/', $release)) { print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(5); } } @@ -147,7 +147,7 @@ $outputfile = $outputdir.'/filelist-'.$release.'.xml'; $fp = fopen($outputfile, 'w'); if (empty($fp)) { print 'Failed to open file '.$outputfile."\n"; - exit(-1); + exit(6); } fputs($fp, ''."\n"); diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index 9029f7b0162..c04c6d0446d 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -58,7 +58,7 @@ $this->datee = $this->db->jdate($obj->datee); $this->periode = $this->db->jdate($obj->period); $tmp = array('id_users' => $obj->id_users, 'nom' => $obj->name, 'reponses' => $obj->reponses); - $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment + $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, 1); // Disable hook for the moment //si les reponses ne concerne pas la colonne effacée, on concatenate GETPOST("mouvement", 'alpha'), GETPOSTINT("mouvement"), diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index ef24e13faff..1f83048b7b5 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -47,7 +47,7 @@ return [ // PhanPluginConstantVariableNull : 10+ occurrences // PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences // PhanPluginSuspiciousParamPosition : 10+ occurrences - // PhanRedefineClass : 10+ occurrences + // PhanRedefineClass : 3 occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences // PhanEmptyFQSENInClasslike : 5 occurrences // PhanInvalidFQSENInClasslike : 4 occurrences @@ -704,7 +704,7 @@ return [ 'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/expedition/mod_expedition_ribera.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/expedition/modules_expedition.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/expensereport/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanRedefineClass', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/expensereport/mod_expensereport_sand.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/expensereport/modules_expensereport.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/export/export_csviso.modules.php' => ['PhanPluginUnknownArrayMethodParamType'], @@ -724,7 +724,7 @@ return [ 'htdocs/core/modules/fichinter/modules_fichinter.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/holiday/modules_holiday.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/hrm/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanRedefineClass', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/hrm/modules_evaluation.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], @@ -740,11 +740,11 @@ return [ 'htdocs/core/modules/mailings/xinputfile.modules.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/mailings/xinputuser.modules.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/member/doc/doc_generic_member_odt.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/core/modules/member/doc/pdf_standard.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanRedefineClass'], + 'htdocs/core/modules/member/doc/pdf_standard_member.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/modules/member/modules_member.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/modFacture.class.php' => ['PhanPluginDuplicateExpressionAssignmentOperation'], - 'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineClass', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod'], 'htdocs/core/modules/movement/modules_movement.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], @@ -761,7 +761,7 @@ return [ 'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/printsheet/modules_labels.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineClass', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/core/modules/product/modules_product.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/product_batch/mod_lot_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/product_batch/mod_lot_free.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -788,7 +788,7 @@ return [ 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/modules/societe/modules_societe.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/stock/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineClass', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/core/modules/stock/modules_stock.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod'], @@ -804,7 +804,7 @@ return [ 'htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/supplier_order/modules_commandefournisseur.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanRedefineClass', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredMethod'], 'htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/supplier_payment/modules_supplier_payment.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanPluginConstantVariableBool', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 0f5b8213ab9..1d15ae5d3a3 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -492,7 +492,7 @@ if ($resql) { // There is several pages if ($num > $listlimit) { print ''; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), ''); print ''; } diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 3e3a85c672e..4442b88a668 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -617,7 +617,7 @@ if ($resql) { // There is several pages if ($num > $listlimit) { print ''; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), ''); print ''; } diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 6b201fe8e13..ed021d04917 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -494,7 +495,7 @@ if ($id) { // There is several pages if ($num > $listlimit) { print ''; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), ''); print ''; } diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 40315b46433..a3318346695 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2013-2017 Olivier Geffroy * Copyright (C) 2017 Elarifr. Ari Elbaz - * Copyright (C) 2017-2019 Frédéric France + * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2017 André Schild * Copyright (C) 2020 Guillaume Alexandre * Copyright (C) 2022 Joachim Kueter @@ -1025,7 +1025,7 @@ class AccountancyExport $arrayofinclusion = array(); // If it is a supplier invoice, we want to use last uploaded file $arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$'; - $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, true); + $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1); if (!empty($fileFoundList)) { $attachmentFileNameTrunc = str_pad(self::trunc($line->piece_num, 8), 8, '0', STR_PAD_LEFT); foreach ($fileFoundList as $fileFound) { @@ -1491,7 +1491,7 @@ class AccountancyExport $arrayofinclusion = array(); // If it is a supplier invoice, we want to use last uploaded file $arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$'; - $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, true); + $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1); if (!empty($fileFoundList)) { $attachmentFileNameTrunc = $line->doc_ref; foreach ($fileFoundList as $fileFound) { @@ -1703,7 +1703,7 @@ class AccountancyExport $arrayofinclusion = array(); // If it is a supplier invoice, we want to use last uploaded file $arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$'; - $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, true); + $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1); if (!empty($fileFoundList)) { $attachmentFileNameTrunc = $line->doc_ref; foreach ($fileFoundList as $fileFound) { diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index a4b757ef958..4c4be8bb0b0 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -1,11 +1,11 @@ - * Copyright (C) 2013-2024 Alexandre Spangaro - * Copyright (C) 2014-2015 Ari Elbaz (elarifr) - * Copyright (C) 2013-2021 Florian Henry - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2016 Laurent Destailleur - * Copyright (C) 2021 Gauthier VERDOL +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2014-2015 Ari Elbaz (elarifr) + * Copyright (C) 2013-2021 Florian Henry + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -232,7 +232,7 @@ $formother = new FormOther($db); $help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; -llxHeader('', $langs->trans("CustomersVentilation"), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-customer page-list'); +llxHeader('', $langs->trans("CustomersVentilation"), $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-accountancy accountancy-customer page-list'); if (empty($chartaccountcode)) { print $langs->trans("ErrorChartOfAccountSystemNotSelected"); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 667a20347df..c729802eaf2 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -1,11 +1,11 @@ - * Copyright (C) 2013-2024 Alexandre Spangaro - * Copyright (C) 2014-2015 Ari Elbaz (elarifr) - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2016 Laurent Destailleur - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2014-2015 Ari Elbaz (elarifr) + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -225,7 +225,7 @@ $formother = new FormOther($db); $help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; -llxHeader('', $langs->trans("ExpenseReportsVentilation"), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-expensereport page-list'); +llxHeader('', $langs->trans("ExpenseReportsVentilation"), $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-accountancy accountancy-expensereport page-list'); if (empty($chartaccountcode)) { print $langs->trans("ErrorChartOfAccountSystemNotSelected"); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index a20724fbd84..3de0a96fa7c 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -242,6 +242,7 @@ if ($result) { // one line tabpay = line into bank // one line for bank record = tabbq // one line for thirdparty record = tabtp + // Note: tabcompany is used to store the subledger account $i = 0; while ($i < $num) { $obj = $db->fetch_object($result); @@ -289,7 +290,8 @@ if ($result) { ); // Set accountancy code for user - // $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists) + // $obj->accountancy_code is the accountancy_code of table u=user (but it is defined only if + // a link with type 'user' exists and user as a subledger account) $compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : ''); $tabuser[$obj->rowid] = array( @@ -408,13 +410,26 @@ if ($result) { $userstatic->lastname = $tabuser[$obj->rowid]['lastname']; $userstatic->status = $tabuser[$obj->rowid]['status']; $userstatic->accountancy_code = $tabuser[$obj->rowid]['accountancy_code']; + + // For a payment of social contribution, we have a link sc + user. + // but we already fill the $tabpay[$obj->rowid]["soclib"] in the line 'sc'. + // If we fill it here to, we must concat. if ($userstatic->id > 0) { - $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); + if ($is_sc) { + $tabpay[$obj->rowid]["soclib"] .= ' '.$userstatic->getNomUrl(1, 'accountancy', 0); + } else { + $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); + } } else { $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment. } + if ($compta_user) { - $tabtp[$obj->rowid][$compta_user] += $amounttouse; + if ($is_sc) { + //$tabcompany[$obj->rowid][$compta_user] += $amounttouse; + } else { + $tabtp[$obj->rowid][$compta_user] += $amounttouse; + } } } elseif ($links[$key]['type'] == 'sc') { $chargestatic->id = $links[$key]['url_id']; @@ -431,6 +446,8 @@ if ($result) { $chargestatic->label = $links[$key]['label']; } $chargestatic->ref = $chargestatic->label; + //$chargestatic->fetch($chargestatic->id); + $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); $tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index b2262067683..66f87389533 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -1,11 +1,11 @@ - * Copyright (C) 2013-2024 Alexandre Spangaro - * Copyright (C) 2014-2015 Ari Elbaz (elarifr) - * Copyright (C) 2013-2021 Florian Henry - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2014 Juanjo Menent s - * Copyright (C) 2016 Laurent Destailleur +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2014-2015 Ari Elbaz (elarifr) + * Copyright (C) 2013-2021 Florian Henry + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2014 Juanjo Menent s + * Copyright (C) 2016 Laurent Destailleur * * 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 @@ -234,7 +234,7 @@ $formother = new FormOther($db); $help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; -llxHeader('', $langs->trans("SuppliersVentilation"), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-supplier page-list'); +llxHeader('', $langs->trans("SuppliersVentilation"), $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-accountancy accountancy-supplier page-list'); if (empty($chartaccountcode)) { print $langs->trans("ErrorChartOfAccountSystemNotSelected"); diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 617e8037983..0f5af1d4817 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -1,16 +1,17 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2020-2021 Frédéric France - * Copyright (C) 2023 Waël Almoman +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020-2021 Frédéric France + * Copyright (C) 2023 Waël Almoman * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -219,9 +220,10 @@ if ($action == 'unset') { $form = new Form($db); +$title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersSetup"), $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/admin/member_emails.php b/htdocs/adherents/admin/member_emails.php index 88d5e0e108a..ee99f4cdef4 100644 --- a/htdocs/adherents/admin/member_emails.php +++ b/htdocs/adherents/admin/member_emails.php @@ -1,13 +1,14 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -135,9 +136,10 @@ if ($action == 'update' || $action == 'add') { $form = new Form($db); +$title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersSetup"), $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_emails'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/admin/member_extrafields.php b/htdocs/adherents/admin/member_extrafields.php index b89a3a4cd05..e1ffbf5fceb 100644 --- a/htdocs/adherents/admin/member_extrafields.php +++ b/htdocs/adherents/admin/member_extrafields.php @@ -1,8 +1,9 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -61,8 +62,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject = $langs->transnoentitiesnoconv("Members"); +$title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersSetup"), $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_extrafields'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/admin/member_type_extrafields.php b/htdocs/adherents/admin/member_type_extrafields.php index d8e935c592a..9ce9780f1d9 100644 --- a/htdocs/adherents/admin/member_type_extrafields.php +++ b/htdocs/adherents/admin/member_type_extrafields.php @@ -1,10 +1,11 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -64,8 +65,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject = $langs->transnoentitiesnoconv("MembersTypes"); +$title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersSetup"), $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_type_extrafields'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index df69c5274d5..d15f0d19605 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -1,8 +1,9 @@ - * Copyright (C) 2006-2015 Laurent Destailleur - * Copyright (C) 2006-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2006-2012 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -104,7 +105,8 @@ $form = new Form($db); $title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_website'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 286a66ea493..bd40ed7166e 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -1,10 +1,12 @@ - * Copyright (C) 2005 Brice Davoleau - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2006-2011 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010 Juanjo Menent +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2024 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -135,7 +137,7 @@ if ($object->id > 0) { $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; - llxHeader("", $title, $help_url); + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_agenda'); if (isModEnabled('notification')) { $langs->load("mails"); @@ -190,7 +192,7 @@ if ($object->id > 0) { $param .= '&limit='.$limit; } - print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', '', $newcardbutton, '', 0, 1, 0); + print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $newcardbutton, '', 0, 1, 0); // List of all actions $filters = array(); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 99eb76ee0bf..334ec4827f6 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1,14 +1,14 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2018 Regis Houssin - * Copyright (C) 2012 Marcos García - * Copyright (C) 2012-2020 Philippe Grand - * Copyright (C) 2015-2024 Alexandre Spangaro - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2021 Waël Almoman - * Copyright (C) 2024 MDW +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2018 Regis Houssin + * Copyright (C) 2012 Marcos García + * Copyright (C) 2012-2020 Philippe Grand + * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2024 MDW * * 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 @@ -891,7 +891,8 @@ $formcompany = new FormCompany($db); $title = $langs->trans("Member")." - ".$langs->trans("Card"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 1b4eb4979e1..fe33407cf21 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -1,7 +1,8 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -264,7 +265,10 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) { $form = new Form($db); -llxHeader('', $langs->trans("MembersCards")); +$title = $langs->trans('MembersCards'); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-cards'); print load_fiche_titre($langs->trans("LinkToGeneratedPages"), '', $adherentstatic->picto); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3aeb87792f0..7eb943244d4 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1,20 +1,20 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2009-2017 Regis Houssin - * Copyright (C) 2014-2018 Alexandre Spangaro - * Copyright (C) 2015 Marcos García - * Copyright (C) 2015-2024 Frédéric France - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2021 Waël Almoman - * Copyright (C) 2021 Philippe Grand +/* Copyright (C) 2002-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2009-2017 Regis Houssin + * Copyright (C) 2014-2018 Alexandre Spangaro + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015-2024 Frédéric France + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2018-2019 Thibault FOUCART + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Philippe Grand * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index e92e1da0d41..8afcd57d5c8 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2013 Cédric Salvador +/* Copyright (C) 2002-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -114,10 +115,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $title = $langs->trans("Member")." - ".$langs->trans("Documents"); - $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; -llxHeader("", $title, $help_url); +llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_documents'); if ($id > 0) { $result = $membert->fetch($object->typeid); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index bd08c394026..1f48941688a 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -1,12 +1,13 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2020 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2021-2023 Frédéric France - * Copyright (C) 2021-2023 Waël Almoman +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2021-2023 Waël Almoman * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -77,7 +78,10 @@ $form = new Form($db); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) $resultboxes = FormOther::getBoxesArea($user, "2"); -llxHeader('', $langs->trans("Members"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'); +$title = $langs->trans("Members"); +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-index'); $staticmember = new Adherent($db); $statictype = new AdherentType($db); diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index f94cc476321..e39152c788e 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -1,6 +1,7 @@ - * Copyright (C) 2006-2021 Regis Houssin +/* Copyright (C) 2006 Laurent Destailleur + * Copyright (C) 2006-2021 Regis Houssin + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -17,9 +18,9 @@ */ /** - * \file htdocs/adherents/ldap.php - * \ingroup ldap member - * \brief Page fiche LDAP adherent + * \file htdocs/adherents/ldap.php + * \ingroup ldap member + * \brief Page fiche LDAP adherent */ // Load Dolibarr environment @@ -104,7 +105,10 @@ if ($action == 'dolibarr2ldap') { $form = new Form($db); -llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'); +$title = $langs->trans("Member"); +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_ldap'); $head = member_prepare_head($object); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 0f969a97bbc..586b34b05b6 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -1,13 +1,14 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2022 Laurent Destailleur - * Copyright (C) 2013-2015 Raphaël Doursenaud - * Copyright (C) 2014-2016 Juanjo Menent - * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Benjamin Falière +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2022 Laurent Destailleur + * Copyright (C) 2013-2015 Raphaël Doursenaud + * Copyright (C) 2014-2016 Juanjo Menent + * Copyright (C) 2018-2024 Alexandre Spangaro + * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Benjamin Falière + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -202,7 +203,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -629,7 +630,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-member page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/adherents/messaging.php b/htdocs/adherents/messaging.php index 545b3f9b57c..63dfaaa564e 100644 --- a/htdocs/adherents/messaging.php +++ b/htdocs/adherents/messaging.php @@ -1,12 +1,13 @@ - * Copyright (C) 2005 Brice Davoleau - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006-2019 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2015 Marcos García +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2019 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -122,8 +123,9 @@ $form = new Form($db); $person_name = !empty($object->firstname) ? $object->lastname.", ".$object->firstname : $object->lastname; $title = $person_name." - ".$langs->trans('Info'); -$help_url = ''; -llxHeader('', $title, $help_url); +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_messaging'); $head = member_prepare_head($object); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index b76a08e6d82..3a176747716 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2015 Frederic France +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2015 Frederic France + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -100,10 +101,9 @@ if (empty($reshook)) { */ $title = $langs->trans("Member")." - ".$langs->trans("Note"); - $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; -llxHeader("", $title, $help_url); +llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_note'); $form = new Form($db); diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index d72825a11a6..c83f721d5fc 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 NextGestion +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 NextGestion + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -143,7 +144,9 @@ $form = new Form($db); $formfile = new FormFile($db); $title = $langs->trans("Partnership"); -llxHeader('', $title); +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_partnership'); $form = new Form($db); diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index f7d530f0f62..8b927da7f4b 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -1,6 +1,7 @@ +/* Copyright (c) 2012 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -55,9 +56,10 @@ $langs->loadLangs(array("companies", "members")); $memberstatic = new Adherent($db); -llxHeader('', $langs->trans("MembersStatisticsByProperties"), '', '', 0, 0, array('https://www.google.com/jsapi')); - $title = $langs->trans("MembersStatisticsByProperties"); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, array('https://www.google.com/jsapi'), '', '', 'mod-member page-stats_byproperties'); print load_fiche_titre($title, '', $memberstatic->picto); diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index b9d09f6f683..afb6f6ab4e2 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -1,6 +1,7 @@ - * Copyright (C) 2024 MDW +/* Copyright (c) 2004-2011 Laurent Destailleur + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -76,7 +77,9 @@ if ($mode == 'memberbyregion') { $title = $langs->trans("MembersStatisticsByRegion"); } -llxHeader('', $title, '', '', 0, 0, $arrayjs); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, $arrayjs, '', '', 'mod-member page-stats_geo'); print load_fiche_titre($title, '', $memberstatic->picto); diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 17488f72508..51bac0047f9 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -69,7 +69,9 @@ $memberstatic = new Adherent($db); $form = new Form($db); $title = $langs->trans("SubscriptionsStatistics"); -llxHeader('', $title); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-stats'); print load_fiche_titre($title, '', $memberstatic->picto); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 68db734ff14..8a4313e04b1 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -1,12 +1,12 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2018 Laurent Destailleur - * Copyright (C) 2012-2017 Regis Houssin - * Copyright (C) 2015-2016 Alexandre Spangaro - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2019 Thibault FOUCART - * Copyright (C) 2023 Waël Almoman +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2018 Laurent Destailleur + * Copyright (C) 2012-2017 Regis Houssin + * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2019 Thibault FOUCART + * Copyright (C) 2023 Waël Almoman * * 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 @@ -441,10 +441,9 @@ $form = new Form($db); $now = dol_now(); $title = $langs->trans("Member")." - ".$langs->trans("Subscriptions"); - $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; -llxHeader("", $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_subscription'); $param = ''; diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index fff38874217..e01630fefd3 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -1,6 +1,7 @@ - * Copyright (C) 2018-2020 Frédéric France +/* Copyright (C) 2007-2019 Laurent Destailleur + * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -164,8 +165,10 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('adheren $form = new Form($db); +$title = $langs->trans("SubscriptionCard"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("SubscriptionCard"), $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-subscription-card'); dol_htmloutput_errors($errmsg); diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 6bdf0fd6f5d..3f4cf87b990 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -1,6 +1,7 @@ - * Copyright (C) 2005-2006 Regis Houssin +/* Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2006 Regis Houssin + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -46,7 +47,10 @@ $rowid = GETPOSTINT("rowid"); $form = new Form($db); -llxHeader(); +$title = $langs->trans('Subscription')." - ".$langs->trans('Info'); +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-subscription-card_info'); $object = new Subscription($db); $result = $object->fetch($rowid); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 3d6488787d4..52bf9210940 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -1,7 +1,8 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2023 Laurent Destailleur +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2023 Laurent Destailleur + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -292,7 +293,7 @@ if (!empty($date_select)) { } $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-subscription-list bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 1e750b71289..711b660a6d5 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -1,13 +1,13 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2019-2022 Thibault Foucart - * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2021 Waël Almoman +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2019-2022 Thibault Foucart + * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2021 Waël Almoman * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * @@ -249,9 +249,10 @@ if ($action == 'confirm_delete' && $user->hasRight('adherent', 'configurer')) { $form = new Form($db); $formproduct = new FormProduct($db); +$title = $langs->trans("MembersTypeSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersTypeSetup"), $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-type'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index 78af4a6c483..e85d39c1d36 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -83,7 +83,10 @@ if (empty($reshook)) { * View */ -llxHeader(); +$title = $langs->trans("MembersTypeSetup"); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-type_ldap'); $form = new Form($db); diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index b219d0ae92f..e8b20ff6afe 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -1,8 +1,9 @@ - * Copyright (C) 2007 Rodolphe Quiedeville - * Copyright (C) 2010-2012 Destailleur Laurent - * Copyright (C) 2014 Henry Florian +/* Copyright (C) 2005-2018 Regis Houssin + * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2010-2012 Destailleur Laurent + * Copyright (C) 2014 Henry Florian + * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,10 +155,9 @@ $help_url = ''; $shortlabel = dol_trunc($object->label, 16); $title = $langs->trans('MemberType')." ".$shortlabel." - ".$langs->trans('Translation'); - $help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-type_translation'); $form = new Form($db); $formadmin = new FormAdmin($db); diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php index 56f82a7665d..52a112f5d91 100644 --- a/htdocs/adherents/vcard.php +++ b/htdocs/adherents/vcard.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2020-2021 Frédéric France +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2020-2021 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -44,7 +44,7 @@ if ($id > 0 || !empty($ref)) { // Define variables to know what current user can do on users $canadduser = ($user->admin || $user->hasRight('user', 'user', 'creer')); - // Define variables to know what current user can do on properties of user linked to edited member + // Define variables to know what the current user can do on properties of user linked to edited member if ($object->user_id) { // $User is the user who edits, $object->user_id is the id of the related user in the edited member $caneditfielduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'creer')) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 9023ed207ab..61e3d483237 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,24 +122,24 @@ print ''.$langs-> // Name of Accountant Company print ''; -print ''."\n"; +print ''."\n"; // Address print ''; -print ''."\n"; +print ''."\n"; // ZIP print ''; -print ''."\n"; +print ''."\n"; // Town/City print ''; -print ''."\n"; +print ''."\n"; // Country print ''; print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); -print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id'); +print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -147,40 +148,40 @@ print ''."\n"; // State print ''; print img_picto('', 'state', 'class="pictofixedwidth"'); -print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE') ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); +print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'state_id'); print ''."\n"; // Telephone print ''; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Fax print ''; print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // eMail print ''; print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Web print ''; print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Code print ''; -print ''."\n"; +print ''."\n"; // Note print ''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index baf017ecfe6..bca5eaf1536 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -119,11 +120,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -309,7 +310,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-user page-emailcollector_list'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-user page-emailcollector_list'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 9c17713bbf5..8f9228b97c8 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -8,6 +8,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -320,7 +321,7 @@ if ($resql) { } // Active - $active = _isInBoxList($idrss, $boxlist) ? 'yes' : 'no'; + $active = _isInBoxList((int) $idrss, $boxlist) ? 'yes' : 'no'; print ''; print ''.$langs->trans('WidgetAvailable').''; print ''.yn($active); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index c1d953db125..d74df8ceac9 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -684,9 +684,9 @@ if ($action == 'edit') { } print $text; - if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && !getDolGlobalString('MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP')) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && getDolGlobalString('MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP')) { $textwarning = $langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"); - print $form->textwithpicto('', ''.$textwarning.'', 1, 'warning', 'nomargintop'); + print $form->textwithpicto('', ''.$textwarning.'', 1, 'help', 'nomargintop'); } print ''; @@ -831,7 +831,7 @@ if ($action == 'edit') { $messagetoshow = str_replace('{s1}', $linktosetvar1, $messagetoshow); $messagetoshow = str_replace('{s2}', $linktosetvar2, $messagetoshow); //print $messagetoshow; - print info_admin($messagetoshow, 0, 0, 'warning nomargintop'); + print info_admin($messagetoshow, 0, 0, 'warning', 'nomargintop', '', 'warning'); } print '
'; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 2976bf969ff..31dcb7533a1 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -110,7 +110,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index cb695dfbe74..747f1c1654f 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -11,7 +11,7 @@ * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015-2024 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -921,7 +921,7 @@ if (GETPOST('from', 'alpha')) { // There is several pages if ($num > $listlimit) { print ''; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), ''); print ''; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 3d560a7a724..765a72d38a7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -8,7 +8,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -374,7 +374,7 @@ if (!dol_is_dir($dirins)) { $dirins_ok = (dol_is_dir($dirins)); $help_url = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('', $langs->trans("Setup"), $help_url, '', '', '', $morejs, $morecss, 0, 'mod-admin page-modules'); +llxHeader('', $langs->trans("Setup"), $help_url, '', 0, 0, $morejs, $morecss, 0, 'mod-admin page-modules'); // Search modules dirs diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 2524fe7b4a8..ed5e508cbd1 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -494,7 +494,7 @@ if ($virtualdiffersfromphysical) { print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; - print "\n"; + print "\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index a897467f72f..28bd0c2b8f3 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -1,7 +1,8 @@ - * Copyright (C) 2022 Alice Adminson - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2022 Alice Adminson + * Copyright (C) 2024 Frédéric France + * Coryright (C) 2024 Alexandre Spangaro * * 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 @@ -179,7 +180,7 @@ $form = new Form($db); $help_url = ''; $title = "AiSetup"; -llxHeader('', $langs->trans($title), $help_url); +llxHeader('', $langs->trans($title), $help_url, '', 0, 0, '', '', '', 'mod-ai page-admin_custom_prompt'); // Subheader $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/ai/admin/setup.php b/htdocs/ai/admin/setup.php index a37a2efa723..796e65b9ad6 100644 --- a/htdocs/ai/admin/setup.php +++ b/htdocs/ai/admin/setup.php @@ -1,8 +1,9 @@ - * Copyright (C) 2022 Alice Adminson +/* Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2022 Alice Adminson * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Coryright (C) 2024 Alexandre Spangaro * * 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 @@ -111,7 +112,7 @@ $form = new Form($db); $help_url = ''; $title = "AiSetup"; -llxHeader('', $langs->trans($title), $help_url); +llxHeader('', $langs->trans($title), $help_url, '', 0, 0, '', '', '', 'mod-ai page-admin'); // Subheader $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index e06bc80ff60..8c2a8b8b800 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -1,7 +1,7 @@ - * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2018 Ferran Marcet +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2018-2024 Alexandre Spangaro + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -109,7 +109,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -354,7 +354,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-asset page-list'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-asset page-list'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 42ebf0f158c..4f0c9355907 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2018-2024 Alexandre Spangaro * * 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 @@ -109,7 +109,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -357,7 +357,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-asset page-model-list'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-asset page-model-list'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 6d79f15aa6c..6d18833819d 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,10 +50,24 @@ if (!defined('NOREQUIREAJAX')) { /** * Empty header * - * @ignore + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { print ''."\n"; print ''."\n"; @@ -63,10 +78,12 @@ function llxHeader() /** * Empty footer * - * @ignore + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { print "\n".''."\n"; } diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 30c979dd830..86af171516d 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -1,8 +1,9 @@ - * Copyright (C) 2017-2018 Laurent Destailleur - * Copyright (C) 2018 Frédéric France +/* Copyright (C) 2017 ATM Consulting + * Copyright (C) 2017-2018 Laurent Destailleur + * Copyright (C) 2018 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -306,7 +307,7 @@ if (GETPOST('withtab', 'alpha')) { } $help_url = "EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable"; -llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-blockedlog page-admin_blockedlog_list'); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-blockedlog page-admin_blockedlog_list'); $MAXLINES = 10000; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index e0bc390b5c6..0d46d2ffa19 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -112,7 +112,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index e3565ce9da3..d9d4bedf525 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -132,7 +132,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index 6d70a8cf159..7fb13145b0b 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index ac4b4fc3d8c..8d9896433df 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2005-2022 Laurent Destailleur + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -213,7 +214,7 @@ $num = $db->num_rows($resql); // Output page // -------------------------------------------------------------------- -llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-bookmarks page-list'); +llxHeader('', $title, '', '', 0, 0, '', '', '', 'bodyforlist mod-bookmarks page-list'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 74a1f0c4cfe..545bd9b3306 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -1,12 +1,14 @@ - * Copyright (C) 2006-2020 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2020 Josep Lluís Amador +/* Copyright (C) 2005 Matthieu Valleton + * Copyright (C) 2006-2020 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -539,7 +541,7 @@ if ($type == Categorie::TYPE_PRODUCT) { $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = ''; - $newcardbutton = dolGetButtonTitle($langs->trans("AddProduct"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&categories[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); + $newcardbutton = dolGetButtonTitle($langs->trans("AddProduct"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&categories[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->hasRight('societe', 'creer')); // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("ProductsAndServices"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit); @@ -580,7 +582,7 @@ if ($type == Categorie::TYPE_PRODUCT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("ProductsAndServices"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'products'); + print_barre_liste($langs->trans("ProductsAndServices"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'products'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -628,7 +630,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; - $newcardbutton = dolGetButtonTitle($langs->trans("AddThirdParty"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&client=3&custcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); + $newcardbutton = dolGetButtonTitle($langs->trans("AddThirdParty"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&client=3&custcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->hasRight('societe', 'creer')); // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit); @@ -667,7 +669,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Customers"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'companies'); + print_barre_liste($langs->trans("Customers"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'companies'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -716,7 +718,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; - $newcardbutton = dolGetButtonTitle($langs->trans("AddSupplier"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&fournisseur=1&suppcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); + $newcardbutton = dolGetButtonTitle($langs->trans("AddSupplier"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&fournisseur=1&suppcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->hasRight('societe', 'creer')); // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Suppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit); @@ -756,7 +758,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Suppliers"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'companies'); + print_barre_liste($langs->trans("Suppliers"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'companies'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -847,7 +849,7 @@ if ($type == Categorie::TYPE_MEMBER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Member"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'members'); + print_barre_liste($langs->trans("Member"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'members'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -894,7 +896,7 @@ if ($type == Categorie::TYPE_CONTACT) { $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($contacts); $nbtotalofrecords = ''; - $newcardbutton = dolGetButtonTitle($langs->trans("AddContact"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create&contcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); + $newcardbutton = dolGetButtonTitle($langs->trans("AddContact"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create&contcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->hasRight('societe', 'creer')); // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contact', 0, $newcardbutton, '', $limit); @@ -940,7 +942,7 @@ if ($type == Categorie::TYPE_CONTACT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Contact"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'contact'); + print_barre_liste($langs->trans("Contact"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'contact'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1030,7 +1032,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Banque"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'bank'); + print_barre_liste($langs->trans("Banque"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'bank'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1120,7 +1122,7 @@ if ($type == Categorie::TYPE_PROJECT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Project"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'project'); + print_barre_liste($langs->trans("Project"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'project'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1204,7 +1206,7 @@ if ($type == Categorie::TYPE_USER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Users"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'user'); + print_barre_liste($langs->trans("Users"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'user'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1275,7 +1277,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Warehouse"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'stock'); + print_barre_liste($langs->trans("Warehouse"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'stock'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1283,7 +1285,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { // List of tickets if ($type == Categorie::TYPE_TICKET) { if ($user->hasRight("ticket", "read")) { - $permission = ($user->rights->categorie->creer || $user->rights->categorie->creer); + $permission = $user->hasRight('categorie', 'creer'); $tickets = $object->getObjectsInCateg($type, 0, $limit, $offset); if ($tickets < 0) { @@ -1363,7 +1365,7 @@ if ($type == Categorie::TYPE_TICKET) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Ticket"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'ticket'); + print_barre_liste($langs->trans("Ticket"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'ticket'); accessforbidden("NotEnoughPermissions", 0, 0); } } diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index bee5d778dc7..8b8b8f5df1a 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -163,7 +164,7 @@ $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans("WebsiteSetup"), $help_url, '', 0, '', '', '', '', '', ''."\n".'
'); +llxHeader('', $langs->trans("WebsiteSetup"), $help_url, '', 0, 0, '', '', '', '', ''."\n".'
'); print "\n".'
'; print ''; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 7faf66f0f2d..9bd9600d1c0 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -1,12 +1,13 @@ - * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2017 Open-DSI - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2020 Tobias Sekan +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2003 Eric Seigne + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2017 Open-DSI + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -295,7 +296,7 @@ $now = dol_now(); $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung'; $title = $langs->trans("Agenda"); -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist'); // Define list of all external calendars $listofextcals = array(); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 1ee52af1ccc..0c6a2f89113 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2014 Cedric GROSS - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Florian HENRY * Copyright (C) 2024 MDW * @@ -508,7 +508,7 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda' $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', $urltocreateaction); } -$num = ''; +$num = 0; print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.''.$newcardbutton, '', $limit, 1, 0, 1, $viewmode); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index fc5a015e820..46758f40670 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1436,7 +1436,7 @@ if ($object->id > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture'; $sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $object->id); $sql .= " AND f.entity IN (".getEntity('invoice').")"; - $sql .= ' GROUP BY f.rowid, f.ref, f.type, f.total_ht, f.total_tva, f.total_ttc,'; + $sql .= ' GROUP BY f.rowid, f.ref, f.type, f.ref_client, f.total_ht, f.total_tva, f.total_ttc,'; $sql .= ' f.entity, f.datef, f.date_lim_reglement, f.datec, f.paye, f.fk_statut,'; $sql .= ' s.nom, s.rowid'; $sql .= " ORDER BY f.datef DESC, f.datec DESC"; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index d317f33e8b0..aa713ed13cb 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -1,7 +1,8 @@ - * Copyright (C) 2005-2010 Regis Houssin +/* Copyright (C) 2005-2023 Laurent Destailleur + * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -268,7 +269,7 @@ if ($filteremail) { $title .= ' ('.$langs->trans("SentTo", $filteremail).')'; } -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 397a6ac51df..b33b51daa94 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1,23 +1,24 @@ - * Copyright (C) 2004-2022 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2023 Juanjo Menent - * Copyright (C) 2010-2022 Philippe Grand - * Copyright (C) 2012-2023 Christophe Battarel - * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014 Ferran Marcet - * Copyright (C) 2016 Marcos García - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2020 Nicolas ZABOURI - * Copyright (C) 2022 Gauthier VERDOL - * Copyright (C) 2023 Lenin Rivas - * Copyright (C) 2023 William Mead +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2022 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2023 Juanjo Menent + * Copyright (C) 2010-2022 Philippe Grand + * Copyright (C) 2012-2023 Christophe Battarel + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2016 Marcos García + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2020 Nicolas ZABOURI + * Copyright (C) 2022 Gauthier VERDOL + * Copyright (C) 2023 Lenin Rivas + * Copyright (C) 2023 William Mead * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -2264,7 +2265,7 @@ if ($action == 'create') { } $head = propal_prepare_head($object); - print dol_get_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal'); + print dol_get_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal', 0, '', '', 0, '', 1); $formconfirm = ''; diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 2749800b0dd..9497526b4aa 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -157,10 +157,11 @@ class Proposals extends DolibarrApi * @param int $page Page number * @param string $thirdparty_ids Thirdparty ids to filter commercial proposals (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'2016-01-01')" - * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of order objects */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('propal', 'lire')) { throw new RestException(403); @@ -201,6 +202,9 @@ class Proposals extends DolibarrApi } } + //this query will return total proposals with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -235,6 +239,23 @@ class Proposals extends DolibarrApi throw new RestException(503, 'Error when retrieve propal list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ef52235ec00..103b025b1ad 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1,22 +1,22 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2011 Juanjo Menent - * Copyright (C) 2010-2022 Philippe Grand - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016-2021 Ferran Marcet - * Copyright (C) 2017-2023 Charlene Benke - * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2019-2021 Alexandre Spangaro - * Copyright (C) 2021 Anthony Berton - * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2022 Josep Lluís Amador +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2022 Philippe Grand + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016-2021 Ferran Marcet + * Copyright (C) 2017-2023 Charlene Benke + * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2019-2024 Alexandre Spangaro + * Copyright (C) 2021 Anthony Berton + * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2022 Josep Lluís Amador * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -272,7 +272,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -876,7 +876,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s } $help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist'); $param = '&search_status='.urlencode($search_status); if (!empty($mode)) { diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index fdf2d48735c..9474ede15d9 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -158,12 +158,13 @@ class Orders extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @param string $sqlfilterlines Other criteria to filter answers separated by a comma. Syntax example "(tl.fk_product:=:'17') and (tl.price:<:'250')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of order objects * * @throws RestException 404 Not found * @throws RestException 503 Error */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('commande', 'lire')) { throw new RestException(403); @@ -213,6 +214,10 @@ class Orders extends DolibarrApi throw new RestException(400, 'Error when validating parameter sqlfilterlines -> '.$errormessage); } } + + //this query will return total orders with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -251,6 +256,23 @@ class Orders extends DolibarrApi throw new RestException(503, 'Error when retrieve commande list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index e280fcb49e0..31c69233ada 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1,20 +1,21 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2012 Juanjo Menent - * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015-2024 Frédéric France - * Copyright (C) 2015 Marcos García - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016-2023 Ferran Marcet - * Copyright (C) 2018-2023 Charlene Benke - * Copyright (C) 2021-2024 Anthony Berton - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Noé Cendrier - * Copyright (C) 2024 Benjamin Falière +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2013 Cédric Salvado + * Copyright (C) 2015-2024 Frédéric France + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016-2023 Ferran Marcet + * Copyright (C) 2018-2023 Charlene Benke + * Copyright (C) 2021-2024 Anthony Berton + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Noé Cendrier + * Copyright (C) 2024 Benjamin Falière + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -1216,7 +1217,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-list'); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-order page-list'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 03350ec8936..2abf61b537a 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -1,18 +1,19 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2012 Juanjo Menent - * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015-2024 Frédéric France - * Copyright (C) 2015 Marcos García - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016-2021 Ferran Marcet - * Copyright (C) 2018-2023 Charlene Benke - * Copyright (C) 2021-2023 Anthony Berton +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015-2024 Frédéric France + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016-2021 Ferran Marcet + * Copyright (C) 2018-2023 Charlene Benke + * Copyright (C) 2021-2023 Anthony Berton * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -29,7 +30,7 @@ */ /** - * \file htdocs/commande/list.php + * \file htdocs/commande/list_det.php * \ingroup order * \brief Page to list orders */ @@ -213,10 +214,10 @@ $arrayfields = array( 'c.fk_warehouse' => array('label' => 'Warehouse', 'checked' => 0, 'enabled' => (!isModEnabled('stock') && !getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') ? 0 : 1), 'position' => 110), 'u.login' => array('label' => "Author", 'checked' => 1, 'position' => 115), 'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => 0, 'position' => 116), - 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), - 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), - 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)), - 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)), + 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)), + 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)), + 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)), + 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)), 'c.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 120), 'c.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 125), 'c.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 130), diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 620ecbae808..d5a617b95f6 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -659,21 +659,23 @@ if ($search_thirdparty_user) { $sql .= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; $sql .= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; $sql .= " JOIN ".MAIN_DB_PREFIX."user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)"; - $sql .= " WHERE ". natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, '', 1).")"; + $sql .= " WHERE ". natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, 0, 1).")"; $sql .= " OR b.rowid IN "; $sql .= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; $sql .= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; $sql .= " JOIN ".MAIN_DB_PREFIX."societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)"; - $sql .= " WHERE ". natural_search(array("subSoc.nom"), $search_thirdparty_user, '', 1); + $sql .= " WHERE ". natural_search(array("subSoc.nom"), $search_thirdparty_user, 0, 1); $sql .= "))"; } if ($search_description) { $search_description_to_use = $search_description; $arrayoffixedlabels = array( 'payment_salary', - 'CustomerInvoicePayment', 'CustomerInvoicePaymentBack', - 'SupplierInvoicePayment', 'SupplierInvoicePaymentBack', + 'CustomerInvoicePayment', + 'CustomerInvoicePaymentBack', + 'SupplierInvoicePayment', + 'SupplierInvoicePaymentBack', 'DonationPayment', 'ExpenseReportPayment', 'SocialContributionPayment', diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 12243827cbf..09aca21d8bb 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2522,7 +2522,7 @@ class AccountLine extends CommonObjectLine // TODO Do no try the insert if link already exists } - $this->rappro = 1; + $this->rappro = (int) $conciliated; $this->db->commit(); return 1; diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index b1bb5851e89..0102a6215e4 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -1,11 +1,12 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2020 Tobias Sekan +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -307,7 +308,7 @@ if ($resql) { -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index f264fd9b0b6..e9fab5a8e38 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -1,8 +1,8 @@ - * Copyright (C) 2017 Laurent Destailleur - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2020 Tobias Sekan +/* Copyright (C) 2017-2024 Alexandre Spangaro + * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2018 Frédéric France + * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -368,7 +368,7 @@ if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sear // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index d5cdc5bc832..ec21da52ca6 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -110,7 +110,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 05038d07ff0..920a30c334c 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -108,7 +108,7 @@ if ($sortorder) { $param .= '&sortorder='.$sortorder; } -$totalnboflines = 0; +$totalnboflines = ''; $num = 0; print ''; @@ -123,6 +123,7 @@ print ''; print ''; $nav = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 1); if ($year) { @@ -133,24 +134,6 @@ print ''.$langs->trans("DescTaxAndDividendsArea").'< print "
"; if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { - // Social contributions only - print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); - - print '
".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."".$langs->trans("RuleForStockReplenishment")." ".img_help(1, $langs->trans("VirtualDiffersFromPhysical"))."'.$langs->trans("Status").'
'; - print ''; - print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, '', $sortfield, $sortorder, 'nowraponall '); - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); - if (isModEnabled("bank")) { - print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); - } - print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder); - print "\n"; - $sql = "SELECT c.id, c.libelle as label,"; $sql .= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total,"; $sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,"; @@ -183,11 +166,33 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { if ($resql) { $num = $db->num_rows($resql); + // Social contributions only + //print_barre_liste($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, $nav, '', $limit, 1); + print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); + + print '
'; + print ''; + print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall '); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); + if (isModEnabled("bank")) { + print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); + } + print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder); + print "\n"; + + $total = 0; $totalpaid = 0; $i = 0; - while ($i < min($num, $limit)) { + //$imaxinloop = ($limit ? min($num, $limit) : $num); + $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown) + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); print ''; @@ -205,7 +210,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print $socialcontrib->getNomUrl(1, '20'); print ''; // Type - print ''; + print ''; // Expected to pay print ''; // Ref payment @@ -214,12 +219,17 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print '\n"; // Date payment print ''; - // Type payment - print ''; + $s .= $obj->num_payment; + print ''; + // Account if (isModEnabled("bank")) { print '
'.$obj->label.''.$obj->label.''.price($obj->total).''.$payment_sc_static->getNomUrl(1)."'.dol_print_date($db->jdate($obj->datep), 'day').''; + + // Payment mode + $s = ''; if ($obj->payment_code) { - print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' '; } - print $obj->num_payment.''; + print $s; + print ''; @@ -275,12 +285,6 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { // VAT if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { - print "
"; - - $tva = new Tva($db); - - print load_fiche_titre($langs->trans("VATDeclarations").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); - $sql = "SELECT ptva.rowid, pv.rowid as id_tva, pv.amount as amount_tva, ptva.amount, pv.label, pv.datev as dm, ptva.datep as date_payment, ptva.fk_bank, ptva.num_paiement as num_payment,"; $sql .= " pct.code as payment_code,"; $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel"; @@ -307,27 +311,35 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { $total = 0; $totaltopay = 0; + print "
"; + + $labeltax = $langs->transcountry("VAT", $mysoc->country_code); + + print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); + print ''; print ''; - print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, '', $sortfield, $sortorder, 'nowraponall '); + print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall '); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); if (isModEnabled("bank")) { print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } - print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, '', $sortfield, $sortorder, 'right '); print "\n"; - while ($i < $num) { + //$imaxinloop = ($limit ? min($num, $limit) : $num); + $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown) + + while ($i < $imaxinloop) { $obj = $db->fetch_object($result); $totaltopay = $totaltopay + $obj->amount_tva; $total = $total + $obj->amount; - print ''; print ''."\n"; @@ -346,12 +358,15 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { // Date print '\n"; - // Type payment - print ''; + $s .= $obj->num_payment; + print ''; // Account if (isModEnabled("bank")) { @@ -378,6 +393,8 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { $i++; } + + print ''; print ''; @@ -424,9 +441,9 @@ if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { while ($j < $numlt) { print "
"; - $tva = new Tva($db); + $labeltax = $langs->transcountry(($j == 1 ? "LT1" : "LT2"), $mysoc->country_code); - print load_fiche_titre($langs->transcountry(($j == 1 ? "LT1Payments" : "LT2Payments"), $mysoc->country_code).($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); + print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.datep as dp"; @@ -481,7 +498,7 @@ while ($j < $numlt) { $i++; } - print ''; + print ''; print '"; print ''; print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 72238eab75e..e82b155a7d3 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1530,11 +1530,12 @@ if (empty($reshook)) { $element = $subelement = 'expedition'; } - $object->origin = $origin; + $object->origin = $origin; // deprecated + $object->origin_type = $origin; $object->origin_id = $originid; // Possibility to add external linked objects with hooks - $object->linked_objects[$object->origin] = $object->origin_id; + $object->linked_objects[$object->origin_type] = $object->origin_id; // link with order if it is a shipping invoice if ($object->origin == 'shipping') { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; @@ -1903,7 +1904,7 @@ if (empty($reshook)) { }*/ // Hooks - $parameters = array('objFrom' => $srcobject); + $parameters = array('origin_type' => $object->origin_type, 'origin_id' => $object->origin_id, 'objFrom' => $srcobject); $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been // modified by hook if ($reshook < 0) { @@ -1959,7 +1960,8 @@ if (empty($reshook)) { if (!empty($origin) && !empty($originid)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - $object->origin = $origin; + $object->origin = $origin; // deprecated + $object->origin_type = $origin; $object->origin_id = $originid; // retained warranty @@ -1981,8 +1983,6 @@ if (empty($reshook)) { } foreach ($object->lines as $i => &$line) { - $line->origin = $object->origin; - $line->origin_id = $line->id; $line->fk_prev_id = $line->id; $line->fetch_optionals(); if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { @@ -2023,6 +2023,7 @@ if (empty($reshook)) { $object->note = trim(GETPOST('note', 'restricthtml')); $object->note_private = trim(GETPOST('note', 'restricthtml')); $object->ref_client = GETPOST('ref_client', 'alpha'); + $object->ref_customer = GETPOST('ref_client', 'alpha'); $object->model_pdf = GETPOST('model', 'alpha'); $object->fk_project = GETPOSTINT('projectid'); $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); @@ -2035,6 +2036,7 @@ if (empty($reshook)) { // Special properties of replacement invoice $object->situation_counter += 1; + $id = $object->createFromCurrent($user); if ($id <= 0) { $mesg = $object->error; @@ -2048,6 +2050,15 @@ if (empty($reshook)) { if ($ret > 0) { $nextSituationInvoice->insertExtraFields(); } + + // Hooks + $parameters = array('origin_type' => $object->origin_type, 'origin_id' => $object->origin_id); + $reshook = $hookmanager->executeHooks('createFrom', $parameters, $nextSituationInvoice, $action); // Note that $action and $object may have been + // modified by hook + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + $error++; + } } } } diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 07abf2c4c33..a7197f3c0d4 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -178,13 +178,14 @@ class Invoices extends DolibarrApi * @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $status Filter by invoice status : draft | unpaid | paid | cancelled * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" - * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0 * @return array Array of invoice objects * * @throws RestException 404 Not found * @throws RestException 503 Error */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('facture', 'lire')) { throw new RestException(403); @@ -238,6 +239,9 @@ class Invoices extends DolibarrApi } } + //this query will return total invoices with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -280,6 +284,23 @@ class Invoices extends DolibarrApi throw new RestException(503, 'Error when retrieve invoice list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 22ccb88cdfd..faac43d02e5 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1,24 +1,24 @@ - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2015 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2020 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015-2022 Ferran Marcet - * Copyright (C) 2017 Josep Lluís Amador - * Copyright (C) 2018 Charlene Benke - * Copyright (C) 2019-2021 Alexandre Spangaro +/* Copyright (C) 2002-2006 Rodolphe Quiedeville + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2015 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2020 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015-2022 Ferran Marcet + * Copyright (C) 2017 Josep Lluís Amador + * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2019-2024 Alexandre Spangaro * Copyright (C) 2023 Nick Fragoulis - * Copyright (C) 2023 Joachim Kueter - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2021-2024 Anthony Berton + * Copyright (C) 2023 Joachim Kueter + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2021-2024 Anthony Berton * * 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 @@ -287,7 +287,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$newkey] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => empty($val['help']) ? '' : $val['help'], ); @@ -1010,7 +1010,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist'); $param = '&socid='.urlencode((string) ($socid)); if (!empty($mode)) { diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index b4386092f5f..67f942d54c6 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -60,7 +60,7 @@ $categ_id = GETPOSTINT('categ_id'); $userid = GETPOSTINT('userid'); $socid = GETPOSTINT('socid'); -$custcats = GETPOST('custcats', 'array'); +$select_categ_categ_id = GETPOST('select_categ_categ_id', 'array'); // Security check if ($user->socid > 0) { $action = ''; @@ -111,18 +111,18 @@ if ($mode == 'customer') { if ($object_status != '' && $object_status >= 0) { $stats->where .= ' AND f.fk_statut IN ('.$db->sanitize($object_status).')'; } - if (is_array($custcats) && !empty($custcats)) { + if (is_array($select_categ_categ_id) && !empty($select_categ_categ_id)) { $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat ON (f.fk_soc = cat.fk_soc)'; - $stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $custcats)).')'; + $stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $select_categ_categ_id)).')'; } } if ($mode == 'supplier') { if ($object_status != '' && $object_status >= 0) { $stats->where .= ' AND f.fk_statut IN ('.$db->sanitize($object_status).')'; } - if (is_array($custcats) && !empty($custcats)) { + if (is_array($select_categ_categ_id) && !empty($select_categ_categ_id)) { $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_fournisseur as cat ON (f.fk_soc = cat.fk_soc)'; - $stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $custcats)).')'; + $stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $select_categ_categ_id)).')'; } } @@ -319,7 +319,7 @@ if (isModEnabled('category')) { print ''; } diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 40e9c1e7dd8..d4350cac98c 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -1,9 +1,9 @@ - * Copyright (C) 2007-2016 Laurent Destailleur - * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2014 Alexandre Spangaro - * Copyright (C) 2016 Juanjo Menent +/* Copyright (C) 2006 Rodolphe Quiedeville + * Copyright (C) 2007-2016 Laurent Destailleur + * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2014-2024 Alexandre Spangaro + * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -141,7 +141,7 @@ if (empty($reshook)) { $form = new Form($db); -llxHeader('', $langs->trans("ChequeDeposits")); +llxHeader('', $langs->trans("ChequeDeposits"), '', 0, 0, '', '', '', 'bodyforlist'); $sql = "SELECT bc.rowid, bc.ref, bc.date_bordereau,"; $sql .= " bc.nbcheque, bc.amount, bc.statut, bc.type,"; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 106fe1d56f4..ac0315ee660 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -1,14 +1,14 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2017-2023 Alexandre Spangaro - * Copyright (C) 2018-2021 Ferran Marcet - * Copyright (C) 2018 Charlene Benke - * Copyright (C) 2020 Tobias Sekan +/* Copyright (C) 2001-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2017-2024 Alexandre Spangaro + * Copyright (C) 2018-2021 Ferran Marcet + * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -180,7 +180,7 @@ $accountstatic = new Account($db); $companystatic = new Societe($db); $bankline = new AccountLine($db); -llxHeader('', $langs->trans('ListPayment')); +llxHeader('', $langs->trans('ListPayment'), '', 0, 0, '', '', '', 'bodyforlist'); if (GETPOST("orphelins", "alpha")) { // Payments not linked to an invoice. Should not happen. For debug only. diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 8ac9dff407a..72ce59256d5 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -1,9 +1,9 @@ - * Copyright (C) 2005-2016 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2010-2018 Juanjo Menent - * Copyright (C) 2022 Alexandre Spangaro +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2016 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2010-2018 Juanjo Menent + * Copyright (C) 2022-2024 Alexandre Spangaro * * 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 @@ -247,7 +247,7 @@ $num = $db->num_rows($resql); // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index fbf0519c6e8..c8da5cfdd48 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -1,8 +1,9 @@ - * Copyright (C) 2005-2017 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2010-2012 Juanjo Menent +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2017 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -231,7 +232,7 @@ $num = $db->num_rows($resql); // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 78a2f180dd6..1a5cbbd740d 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -65,6 +65,8 @@ class ChargeSociales extends CommonObject public $label; public $type; public $type_label; + public $type_code; + public $type_accountancy_code; public $amount; public $paye; @@ -142,7 +144,7 @@ class ChargeSociales extends CommonObject $sql = "SELECT cs.rowid, cs.date_ech"; $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode as period, cs.import_key"; $sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user, note_public, note_private"; - $sql .= ", c.libelle as type_label"; + $sql .= ", c.libelle as type_label, c.code as type_code, c.accountancy_code as type_accountancy_code"; $sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as c ON cs.fk_type = c.id"; @@ -167,6 +169,8 @@ class ChargeSociales extends CommonObject $this->label = $obj->label; $this->type = $obj->fk_type; $this->type_label = $obj->type_label; + $this->type_code = $obj->type_code; + $this->type_accountancy_code = $obj->type_accountancy_code; $this->fk_account = $obj->fk_account; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; @@ -573,7 +577,7 @@ class ChargeSociales extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $short = 0, $save_lastsearch_value = -1) { - global $langs, $conf, $user, $form, $hookmanager; + global $langs, $conf, $user, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -614,6 +618,9 @@ class ChargeSociales extends CommonObject } if (!empty($this->type_label)) { $label .= '
'.$langs->trans('Type').': '.$this->type_label; + if (!empty($this->type_accountancy_code)) { + $label .= ' ('.$langs->trans('AccountancyCode').': '.$this->type_accountancy_code.')'; + } } $linkclose = ''; @@ -638,6 +645,7 @@ class ChargeSociales extends CommonObject $result .= $this->ref; } $result .= $linkend; + global $action; $hookmanager->initHooks(array($this->element . 'dao')); $parameters = array('id' => $this->id, 'getnomurl' => &$result); @@ -647,6 +655,7 @@ class ChargeSociales extends CommonObject } else { $result .= $hookmanager->resPrint; } + return $result; } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 2c1288ac2cc..654b9e1ec99 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2017 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2016 Frédéric France - * Copyright (C) 2020 Pierre Ardoin - * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2021-2023 Alexandre Spangaro +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2016 Frédéric France + * Copyright (C) 2020 Pierre Ardoin + * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021-2024 Alexandre Spangaro * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -195,7 +195,7 @@ $formsocialcontrib = new FormSocialContrib($db); $chargesociale_static = new ChargeSociales($db); $projectstatic = new Project($db); -llxHeader('', $langs->trans("SocialContributions")); +llxHeader('', $langs->trans("SocialContributions"), '', 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 576d7db852a..01f69811fd3 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -1,10 +1,10 @@ - * Copyright (C) 2004-2020 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011-2019 Alexandre Spangaro - * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2021 Gauthier VERDOL +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2011-2024 Alexandre Spangaro + * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -259,7 +259,7 @@ $num = $db->num_rows($resql); // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 25ed645538a..9d4c63c0e75 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -4,10 +4,10 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006-2015 Yannick Warnier * Copyright (C) 2014 Ferran Marcet - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2019 Eric Seigne * Copyright (C) 2021-2022 Open-Dsi - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * 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 diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index db3fc45d2b4..5a4ac3ad1c1 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -1,13 +1,13 @@ - * Copyright (C) 2004-2018 Laurent Destailleur - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2004-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2018 Laurent Destailleur + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -24,9 +24,9 @@ */ /** - * \file htdocs/contact/card.php + * \file htdocs/contact/agenda.php * \ingroup societe - * \brief Card of a contact + * \brief Card agenda of a contact */ @@ -149,7 +149,8 @@ if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contactnameonly/', get $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas|DE:Modul_Partner'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_agenda'); if ($socid > 0) { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index b8aa8fe81e8..66241726b61 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1,16 +1,16 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2023 Frédéric France - * Copyright (C) 2019 Josep Lluís Amador - * Copyright (C) 2020 Open-Dsi +/* Copyright (C) 2004-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2019 Josep Lluís Amador + * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -579,7 +579,7 @@ if (empty($object->id)) { } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 888f90822ab..44a4b4247e9 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2013-2015 Juanjo Menent - * Copyright (C) 2015 Marcos García - * Copyright (C) 2015-2017 Ferran Marcet +/* Copyright (C) 2012-2013 Philippe Berthet + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2013-2015 Juanjo Menent + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015-2017 Ferran Marcet + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -113,7 +114,8 @@ $objsoc = new Societe($db); $title = $langs->trans("ContactRelatedItems"); $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_consumption'); if (empty($id)) { dol_print_error($db); diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index f4e2d3d6b03..fddfac390ab 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -1,7 +1,7 @@ - * Copyright (C) 2015-2021 Frederic France - * Copyright (C) 2017 Regis Houssin +/* Copyright (C) 2014-2024 Alexandre Spangaro + * Copyright (C) 2015-2021 Frederic France + * Copyright (C) 2017 Regis Houssin * * 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 @@ -115,7 +115,8 @@ if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contactnameonly/', get $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_documents'); if ($object->id) { $head = contact_prepare_head($object); diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index d1248286792..22ca6701673 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2015 Regis Houssin +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2015 Regis Houssin + * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,10 +21,9 @@ /** * \file htdocs/contact/info.php * \ingroup societe - * \brief Onglet info d'un contact + * \brief Contact info tab */ - // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -52,8 +52,9 @@ $object = new Contact($db); $form = new Form($db); $title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'; -llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_info'); if ($id > 0) { $result = $object->fetch($id, $user); diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 337966133c5..fa7659dfbe3 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -1,6 +1,7 @@ - * Copyright (C) 2006-2021 Regis Houssin +/* Copyright (C) 2006-2010 Laurent Destailleur + * Copyright (C) 2006-2021 Regis Houssin + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -81,8 +82,9 @@ if ($action == 'dolibarr2ldap') { $form = new Form($db); $title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'; -llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_ldap'); $head = contact_prepare_head($object); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index f50e643a843..44dd60289f7 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1,19 +1,19 @@ - * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013-2015 Raphaël Doursenaud - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013 Alexandre Spangaro - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2019 Frédéric France - * Copyright (C) 2019 Josep Lluís Amador - * Copyright (C) 2020 Open-Dsi +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2003 Eric Seigne + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013-2015 Raphaël Doursenaud + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Josep Lluís Amador + * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 MDW - * Copyright (C) 2024 Benjamin Falière + * Copyright (C) 2024 Benjamin Falière * * 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 @@ -232,7 +232,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['p.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -819,7 +819,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && ($ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-societe page-contact-list bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index e979fa93103..70fa0def19e 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2013 Florian Henry +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -83,7 +84,8 @@ $title = $langs->trans("ContactNotes"); $form = new Form($db); $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_note'); if ($id > 0) { /* diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 0661a80b685..52dc8746d96 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2018-2021 Frédéric France +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -22,7 +23,7 @@ /** * \file htdocs/contact/perso.php * \ingroup societe - * \brief Onglet information personnelles d'un contact + * \brief Contact personal information tab */ // Load Dolibarr environment @@ -125,7 +126,8 @@ if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contactnameonly/', get $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_perso'); $form = new Form($db); $formcompany = new FormCompany($db); diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index 2112b4aa9f5..d4b56b31d06 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -1,6 +1,6 @@ +/* Copyright (C) 2021 VIAL-GOUTEYRON Quentin + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -66,7 +66,9 @@ if ($id) { if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) { $title = $object->name." - ".$title; } - llxHeader('', $title); + $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; + + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_project'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 5756d23472f..076c0131704 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -1,10 +1,11 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2018 Philippe Grand +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2018 Philippe Grand + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -62,9 +63,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; * View */ -$textobject = $langs->transnoentitiesnoconv('Contracts'); +$title = $langs->transnoentitiesnoconv('Contracts'); +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader(); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-admin_extrafields'); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index cbefbdb0faf..44e82ef0639 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -1,10 +1,11 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2014 Florian Henry - * Copyright (C) 2013 Philippe Grand +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -62,9 +63,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; * View */ -$textobject = $langs->transnoentitiesnoconv('Contracts'); +$title = $langs->transnoentitiesnoconv('Contracts'); +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader(); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-admin_extrafields_lines'); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index dbdb930bb6a..1e3f4e86d52 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -1,6 +1,7 @@ - * Copyright (C) 2017 Ferran Marcet +/* Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -151,9 +152,9 @@ if ($object->id > 0) { if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contractrefonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { $title = $object->ref." - ".$title; } - $help_url = 'EN:Module_Contracts|FR:Module_Contrat'; + $help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_agenda'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3cdbac83901..260b22cecef 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1,18 +1,19 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005-2014 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2017 Juanjo Menent - * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014-2020 Ferran Marcet - * Copyright (C) 2014-2016 Marcos García - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2021 Frédéric France - * Copyright (C) 2023 Charlene Benke - * Copyright (C) 2023 Nick Fragoulis +/* Copyright (C) 2003-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2017 Juanjo Menent + * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014-2020 Ferran Marcet + * Copyright (C) 2014-2016 Marcos García + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2023 Charlene Benke + * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -67,6 +68,7 @@ $id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $origin = GETPOST('origin', 'alpha'); $originid = GETPOSTINT('originid'); +$idline = GETPOSTINT('elrowid') ? GETPOSTINT('elrowid') : GETPOSTINT('rowid'); // PDF $hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); @@ -707,13 +709,12 @@ if (empty($reshook)) { if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) { setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); $action = 'editline'; - $_GET['rowid'] = GETPOST('elrowid'); // Keep $_GET here. Used by GETPOST('rowid') later $error++; } if (!$error) { $objectline = new ContratLigne($db); - if ($objectline->fetch(GETPOSTINT('elrowid')) < 0) { + if ($objectline->fetch($idline) < 0) { setEventMessages($objectline->error, $objectline->errors, 'errors'); $error++; } @@ -813,6 +814,7 @@ if (empty($reshook)) { $result = $objectline->update($user); if ($result < 0) { $error++; + $action = 'editline'; setEventMessages($objectline->error, $objectline->errors, 'errors'); } } @@ -1077,14 +1079,13 @@ if (empty($reshook)) { * View */ -$help_url = 'EN:Module_Contracts|FR:Module_Contrat'; - $title = $object->ref." - ".$langs->trans('Contract'); if ($action == 'create') { $title = $langs->trans("NewContract"); } +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card'); $form = new Form($db); $formfile = new FormFile($db); @@ -1594,7 +1595,7 @@ if ($action == 'create') { // Line in view mode - if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) { + if ($action != 'editline' || $idline != $objp->rowid) { $moreparam = ''; if (getDolGlobalString('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT') && $objp->statut == ContratLigne::STATUS_CLOSED && $action != 'showclosedlines') { $moreparam = 'style="display: none;"'; @@ -1663,19 +1664,19 @@ if ($action == 'create') { // Icon move, update et delete (status contract 0=draft,1=validated,2=closed) print '
'; print ''; // VAT print ''; // Price - print ''; + print ''; // Price multicurrency /*if (isModEnabled("multicurrency")) { @@ -1788,24 +1791,24 @@ if ($action == 'create') { }*/ // Quantity - print ''; + print ''; // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { print ''; } // Discount - print ''; + print ''; if (!empty($usemargins)) { print ''; + print ''; } print '
'.dol_print_date($db->jdate($obj->dm), 'day').''.dol_print_date($db->jdate($obj->date_payment), 'day')."'; + // Payment mode + $s = ''; if ($obj->payment_code) { - print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' '; } - print $obj->num_payment.''; + print $s; + print '
'.$langs->trans("Total").'
'.$langs->trans("Total").'
'.$langs->trans("Total").''.price($total)."  
'.$cat_label.''; $cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1); print img_picto('', 'category', 'class="pictofixedwidth"'); - print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), 0, 0, 'widthcentpercentminusx maxwidth300'); + print $form->multiselectarray('select_categ_categ_id', $cate_arbo, GETPOST('select_categ_categ_id', 'array'), 0, 0, 'widthcentpercentminusx maxwidth300'); //print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); print '
'; - if ($user->hasRight('contrat', 'creer') && is_array($arrayothercontracts) && count($arrayothercontracts) && ($object->statut >= 0)) { + if ($user->hasRight('contrat', 'creer') && is_array($arrayothercontracts) && count($arrayothercontracts) && ($object->status >= 0)) { print ''; - print ''; + print ''; print img_picto($langs->trans("MoveToAnotherContract"), 'uparrow'); print ''; } if ($user->hasRight('contrat', 'creer') && ($object->statut >= 0)) { - print ''; + print ''; print img_edit(); print ''; } if ($user->hasRight('contrat', 'creer') && ($object->statut >= 0)) { - print ''; + print ''; print img_delete(); print ''; } @@ -1738,8 +1739,11 @@ if ($action == 'create') { // Ligne carac print '
'; + $currentLineProductId=GETPOSTISSET('idprod')?GETPOST('idprod'):(!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0); if ($objp->fk_product > 0) { $canchangeproduct = 1; + + // TODO: As $canchangeproduct is set just before, in what usecase it can be empty ? if (empty($canchangeproduct)) { $productstatic->id = $objp->fk_product; $productstatic->type = $objp->ptype; @@ -1747,19 +1751,19 @@ if ($action == 'create') { $productstatic->entity = $objp->pentity; print $productstatic->getNomUrl(1, '', 32); print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; - print ''; + print ''; } else { $senderissupplier = 0; if (empty($senderissupplier)) { - print $form->select_produits((!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0), 'idprod'); + print $form->select_produits($currentLineProductId, 'idprod'); } else { - $form->select_produits_fournisseurs((!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0), 'idprod'); + $form->select_produits_fournisseurs($currentLineProductId, 'idprod'); } } print '
'; } else { print $objp->label ? $objp->label.'
' : ''; - print ''; + print ''; } // editeur wysiwyg @@ -1768,19 +1772,18 @@ if ($action == 'create') { if (getDolGlobalString('MAIN_INPUT_DESC_HEIGHT')) { $nbrows = getDolGlobalString('MAIN_INPUT_DESC_HEIGHT'); } - $enable = (isset($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0); - $doleditor = new DolEditor('product_desc', $objp->description, '', 92, 'dolibarr_details', '', false, true, $enable, $nbrows, '90%'); + $doleditor = new DolEditor('product_desc', (GETPOSTISSET('product_desc')?GETPOST('product_desc'):$objp->description), '', 92, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), $nbrows, '90%'); $doleditor->Create(); print '
'; - print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code ? (' ('.$objp->vat_src_code.')') : ''), $mysoc, $object->thirdparty, $objp->fk_product, $objp->info_bits, $objp->product_type, 0, 1); + print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code ? (' ('.$objp->vat_src_code.')') : ''), $mysoc, $object->thirdparty, $currentLineProductId, $objp->info_bits, $objp->product_type, 0, 1); print ''; - print $form->selectUnits($objp->fk_unit, "unit"); + print $form->selectUnits((GETPOSTISSET('unit')?GETPOST('unit'):$objp->fk_unit), "unit"); print '%%'; if ($objp->fk_product) { print ''; } - print ''; print ''; @@ -1872,17 +1875,17 @@ if ($action == 'create') { /* * Confirmation to delete service line of contract */ - if ($action == 'deleteline' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) { - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'), $langs->trans("DeleteContractLine"), $langs->trans("ConfirmDeleteContractLine"), "confirm_deleteline", '', 0, 1); + if ($action == 'deleteline' && !$cancel && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == $idline) { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".((int) $object->id)."&lineid=".((int) $idline), $langs->trans("DeleteContractLine"), $langs->trans("ConfirmDeleteContractLine"), "confirm_deleteline", '', 0, 1); if ($ret == 'html') { - print '
'; + print '
'; } } /* * Confirmation to move service toward another contract */ - if ($action == 'move' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) { + if ($action == 'move' && !$cancel && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == $idline) { $arraycontractid = array(); foreach ($arrayothercontracts as $contractcursor) { $arraycontractid[$contractcursor->id] = $contractcursor->ref; @@ -1893,8 +1896,8 @@ if ($action == 'create') { 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), 0 => array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOSTINT('rowid'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); - print '
'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".((int) $object->id)."&lineid=".((int) $idline), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion, 'yes'); + print '
'; } // Area with status and activation info of line @@ -2315,64 +2318,64 @@ if ($action == 'create') { llxFooter(); $db->close(); -?> - - + }); '."\n"; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index dac55d099e3..f779a866aae 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1633,6 +1633,7 @@ class Contrat extends CommonObject if (empty($error)) { // Call trigger + $this->context['line_id'] = $contractlineid; $result = $this->call_trigger('LINECONTRACT_INSERT', $user); if ($result < 0) { $error++; @@ -1827,6 +1828,7 @@ class Contrat extends CommonObject if (empty($error)) { // Call trigger + $this->context['line_id'] = $rowid; $result = $this->call_trigger('LINECONTRACT_MODIFY', $user); if ($result < 0) { $this->db->rollback(); @@ -1861,6 +1863,7 @@ class Contrat extends CommonObject if ($this->statut >= 0) { // Call trigger + $this->context['line_id'] = $idline; $result = $this->call_trigger('LINECONTRACT_DELETE', $user); if ($result < 0) { return -1; diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index d9310761e02..f123a16d05f 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -1,9 +1,10 @@ - * Copyright (C) 2005-2009 Destailleur Laurent - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2023 Christian Foellmann +/* Copyright (C) 2005 Patrick Rouillon + * Copyright (C) 2005-2009 Destailleur Laurent + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2023 Christian Foellmann + * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,9 +122,9 @@ if (empty($reshook)) { */ $title = $langs->trans("Contract"); -$help_url = 'EN:Module_Contracts|FR:Module_Contrat'; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_contact'); $form = new Form($db); $formcompany = new FormCompany($db); @@ -132,7 +133,7 @@ $userstatic = new User($db); /* *************************************************************************** */ /* */ -/* Card view and edit mode */ +/* Card view and edit mode */ /* */ /* *************************************************************************** */ diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 180c7bd8913..2d4a02ada5d 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -1,11 +1,12 @@ - * Copyright (C) 2004-2009 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2005 Simon TOSSER - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2017 Ferran Marcet +/* Copyright (C) 2003-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005 Simon TOSSER + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -103,7 +104,7 @@ $form = new Form($db); $title = $langs->trans("Contract"); $help_url = 'EN:Module_Contracts|FR:Module_Contrat'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_documents'); if ($object->id) { diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 5a83982ed4f..2e0ec47b4d4 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -1,10 +1,11 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2019 Nicolas ZABOURI +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -75,9 +76,9 @@ $productstatic = new Product($db); $now = dol_now(); $title = $langs->trans("ContractsArea"); -$help_url = ''; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-index'); print load_fiche_titre($langs->trans("ContractsArea"), '', 'contract'); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index b43e84cdd30..60722a34607 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -1,17 +1,17 @@ - * Copyright (C) 2004-2020 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2014-2019 Juanjo Menent - * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016-2018 Ferran Marcet - * Copyright (C) 2019 Nicolas Zabouri - * Copyright (C) 2021 Alexandre Spangaro +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2014-2019 Juanjo Menent + * Copyright (C) 2015 Claudio Aschieri + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016-2018 Ferran Marcet + * Copyright (C) 2019 Nicolas Zabouri + * Copyright (C) 2021-2024 Alexandre Spangaro * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 Benjamin Falière + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Benjamin Falière * * 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 @@ -584,8 +584,10 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- +$title = $langs->trans("Contracts"); +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $langs->trans("Contracts")); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-list bodyforlist'); $i = 0; diff --git a/htdocs/contrat/messaging.php b/htdocs/contrat/messaging.php index 285ad325c28..6880ad9dffc 100644 --- a/htdocs/contrat/messaging.php +++ b/htdocs/contrat/messaging.php @@ -1,11 +1,12 @@ - * Copyright (C) 2005 Brice Davoleau - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006-2019 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2015 Marcos García +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2019 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -148,9 +149,9 @@ $title = $langs->trans("Agenda"); if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contractrefonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { $title = $object->ref." - ".$title; } -$help_url = 'EN:Module_Contracts|FR:Module_Contrat'; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_messaging'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 7a7f441375f..76d0d6cb6cc 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2017 Ferran Marcet +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -21,7 +22,7 @@ /** * \file htdocs/contrat/note.php * \ingroup contrat - * \brief Fiche de notes sur un contrat + * \brief Card with notes on contract */ // Load Dolibarr environment @@ -77,9 +78,9 @@ if (empty($reshook)) { */ $title = $langs->trans("Contract"); -$help_url = 'EN:Module_Contracts|FR:Module_Contrat'; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_note'); $form = new Form($db); diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 56bacf7159d..fb5b52abc46 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -1,13 +1,14 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2019 Juanjo Menent - * Copyright (C) 2023-2024 William Mead +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 Juanjo Menent + * Copyright (C) 2023-2024 William Mead * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -237,7 +238,7 @@ if ($search_status == "4" && $filter == "expired") { if ($search_status == "5") { $title = $langs->trans("ListOfClosedServices"); } -$help_url = ''; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; // Build and execute select // -------------------------------------------------------------------- @@ -432,7 +433,7 @@ if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sear // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-list_services bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/contrat/ticket.php b/htdocs/contrat/ticket.php index a4b37e28f71..067badc13c0 100644 --- a/htdocs/contrat/ticket.php +++ b/htdocs/contrat/ticket.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2012-2023 Charlene BENKE +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2012-2023 Charlene BENKE * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -60,8 +61,10 @@ $result = restrictedArea($user, 'contrat', $id); /* * View */ +$title = $langs->trans("Contract") . ' - ' . $langs->trans("Tickets"); +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader("", $langs->trans("Tickets"), "Contrat"); +llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_ticket'); $form = new Form($db); $userstatic = new User($db); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 16ff4c0e050..0aa6fc47f66 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1,10 +1,10 @@ - * Copyright (C) 2018-2021 Nicolas ZABOURI - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2015-2017 Laurent Destailleur + * Copyright (C) 2018-2021 Nicolas ZABOURI + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2019 Ferran Marcet + * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -761,7 +761,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto foreach ($listofobjectref as $tmppdf) { $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\'\&\.]+\.pdf$'; // To include PDF generated from ODX files } - $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true); + $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, 1); // build list of files with full path $files = array(); diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php index a24918273d8..06b855459ff 100644 --- a/htdocs/core/bookmarks_page.php +++ b/htdocs/core/bookmarks_page.php @@ -146,7 +146,7 @@ if (empty($reshook)) { print "\n"; print "\n"; -print '
'; +print '
'; print ''; print '
'."\n"; print $bookmarkList; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 315cb6fe63d..578799b7ee7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2864,7 +2864,7 @@ abstract class CommonObject 'HT', $line->info_bits, $line->product_type, - false, + 0, $line->date_start, $line->date_end, $line->array_options, @@ -2889,7 +2889,7 @@ abstract class CommonObject $line->info_bits, $line->product_type, $line->remise_percent, - false, + 0, $line->date_start, $line->date_end, $line->array_options, @@ -8459,6 +8459,17 @@ abstract class CommonObject if (!empty($classpath)) { dol_include_once($InfoFieldList[1]); + + if ($classname && !class_exists($classname)) { + // from V19 of Dolibarr, In some cases link use element instead of class, example project_task + // TODO use newObjectByElement() introduce in V20 by PR #30036 for better errors management + $element_prop = getElementProperties($classname); + if ($element_prop) { + $classname = $element_prop['classname']; + } + } + + if ($classname && class_exists($classname)) { $object = new $classname($this->db); if ($object->element === 'product') { // Special case for product because default valut of fetch are wrong diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 93ab2365139..2d74064a97b 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -1037,6 +1037,10 @@ class Conf extends stdClass $this->global->PRODUIT_MULTIPRICES_LIMIT = 5; } + if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1; + } + // For modules that want to disable top or left menu if (!empty($this->global->MAIN_HIDE_TOP_MENU)) { $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU; diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index a634d4a747f..db724f12152 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -1,7 +1,8 @@ * Copyright (C) 2020 Andreu Bisquerra - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Abbes Bahfir * * 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 @@ -698,6 +699,9 @@ class dolReceiptPrinter extends Printer return $reshook; } + // escape special characters for xml_parse_into_struct + $this->template = htmlspecialchars($this->template, ENT_QUOTES | ENT_XML1); + // parse template $this->template = str_replace("{", "<", $this->template); $this->template = str_replace("}", ">", $this->template); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 10184b4fcf3..cfaf357b749 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -246,7 +246,7 @@ class Form // When option to edit inline is activated if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;|day|datepicker|dayhour|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select - $ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); + $ret .= $this->editInPlace($object, $value, $htmlname, ($perm ? 1 : 0), $typeofdata, $editvalue, $extObject, $custommsg); } else { if ($editaction == '') { $editaction = GETPOST('action', 'aZ09'); @@ -1458,7 +1458,7 @@ class Form // Immediate load of all database $multiple = false; $disableifempty = 0; - $options_only = false; + $options_only = 0; $limitto = ''; $out .= $this->selectcontacts($socid, $selected, $htmlname, $showempty, $exclude, $limitto, $showfunction, $morecss, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid, $multiple, $disableifempty); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 49aec430b3f..84a7a948fa4 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2015-2017 Marcos García * Copyright (C) 2015-2017 Nicolas ZABOURI - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Anthony Berton * Copyright (C) 2024 MDW @@ -726,7 +726,7 @@ class FormMail extends Form // multiselect array convert html entities into options tags, even if we don't want this, so we encode them a second time $tmparray = $this->withtouser; foreach ($tmparray as $key => $val) { - $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); + $tmparray[$key] = dol_htmlentities($tmparray[$key], 0, 'UTF-8', true); } $withtoselected = GETPOST("receiveruser", 'array'); // Array of selected value if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') { @@ -775,7 +775,7 @@ class FormMail extends Form // multiselect array convert html entities into options tags, even if we don't want this, so we encode them a second time $tmparray = $this->withtoccuser; foreach ($tmparray as $key => $val) { - $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); + $tmparray[$key] = dol_htmlentities($tmparray[$key], 0, 'UTF-8', true); } $withtoselected = GETPOST("receiverccuser", 'array'); // Array of selected value if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') { diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 8895cdf83ec..d6c52dc39bb 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -47,7 +47,7 @@ abstract class DoliDB implements Database public $forcecollate = 'utf8_unicode_ci'; /** @var resource Resultset of last query */ - private $_results; + private $_results; // @phpstan-ignore-line /** @var bool true if connected, else false */ public $connected; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3e52db42821..c085cfa09ad 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2023 Eric Seigne * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1066,7 +1067,7 @@ function listOfSessions() /** * Purge existing sessions * - * @param int $mysessionid To avoid to try to delete my own session + * @param string $mysessionid To avoid to try to delete my own session * @return int >0 if OK, <0 if KO */ function purgeSessions($mysessionid) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 59d239032cd..8b8f5816c66 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1468,12 +1468,9 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable */ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, $object = null, $allowdotdot = false, $indexdatabase = 1, $nolog = 0) { - global $db, $user, $langs; + global $db, $user; global $hookmanager; - // Load translation files required by the page - $langs->loadLangs(array('other', 'errors')); - if (empty($nolog)) { dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 94d0677b202..985d8366c32 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1095,6 +1095,38 @@ function GETPOSTFLOAT($paramname, $rounding = '') } +/** + * Helper function that combines values of a dolibarr DatePicker (such as Form::selectDate) for year, month, day (and + * optionally hour, minute, second) fields to return a timestamp. + * + * @param string $prefix Prefix used to build the date selector (for instance using Form::selectDate) + * @param string $hourTime 'getpost' to include hour, minute, second values from the HTTP request, 'XX:YY:ZZ' to set + * hour, minute, second respectively (for instance '23:59:59') + * @param string $gm Passed to dol_mktime + * @return int|string Date as a timestamp, '' or false if error + */ +function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto') +{ + $m = array(); + if ($hourTime === 'getpost') { + $hour = GETPOSTINT($prefix . 'hour'); + $minute = GETPOSTINT($prefix . 'minute'); + $second = GETPOSTINT($prefix . 'second'); + } elseif (preg_match('/^(\d\d):(\d\d):(\d\d)$/', $hourTime, $m)) { + $hour = intval($m[1]); + $minute = intval($m[2]); + $second = intval($m[3]); + } else { + $hour = $minute = $second = 0; + } + // normalize out of range values + $hour = min($hour, 23); + $minute = min($minute, 59); + $second = min($second, 59); + return dol_mktime($hour, $minute, $second, GETPOSTINT($prefix . 'month'), GETPOSTINT($prefix . 'day'), GETPOSTINT($prefix . 'year'), $gm); +} + + /** * Return a sanitized or empty value after checking value against a rule. * @@ -5737,9 +5769,10 @@ function img_searchclear($titlealt = 'default', $other = '') * @param string $admin '1'=Info for admin users. '0'=Info for standard users (change only the look), 'error', 'warning', 'xxx'=Other * @param string $morecss More CSS ('', 'warning', 'error') * @param string $textfordropdown Show a text to click to dropdown the info box. + * @param string $picto '' or 'warning' * @return string String with info text */ -function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss = 'hideonsmartphone', $textfordropdown = '') +function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss = 'hideonsmartphone', $textfordropdown = '', $picto = '') { global $conf, $langs; @@ -5751,7 +5784,11 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss } $class = (empty($admin) ? 'undefined' : ($admin == '1' ? 'info' : $admin)); - $result = ($nodiv ? '' : '
').' '; + $fa = 'info-circle'; + if ($picto == 'warning') { + $fa = 'exclamation-triangle'; + } + $result = ($nodiv ? '' : '
').' '; $result .= dol_escape_htmltag($text, 1, 0, 'div,span,b,br,a'); $result .= ($nodiv ? '' : '
'); @@ -10174,8 +10211,8 @@ function verifCond($strToEvaluate, $onlysimplestring = '1') if (isset($strToEvaluate) && $strToEvaluate !== '') { //var_dump($strToEvaluate); //$rep = dol_eval($strToEvaluate, 1, 0, '1'); // to show the error - $rep = (int) dol_eval($strToEvaluate, 1, 1, $onlysimplestring); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition - $rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); + $rep = dol_eval($strToEvaluate, 1, 1, $onlysimplestring); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition + $rights = (bool) $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); //var_dump($rights); } return $rights; @@ -14335,37 +14372,6 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, } } -/** - * Helper function that combines values of a dolibarr DatePicker (such as Form::selectDate) for year, month, day (and - * optionally hour, minute, second) fields to return a timestamp. - * - * @param string $prefix Prefix used to build the date selector (for instance using Form::selectDate) - * @param string $hourTime 'getpost' to include hour, minute, second values from the HTTP request, 'XX:YY:ZZ' to set - * hour, minute, second respectively (for instance '23:59:59') - * @param string $gm Passed to dol_mktime - * @return int|string Date as a timestamp, '' or false if error - */ -function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto') -{ - $m = array(); - if ($hourTime === 'getpost') { - $hour = GETPOSTINT($prefix . 'hour'); - $minute = GETPOSTINT($prefix . 'minute'); - $second = GETPOSTINT($prefix . 'second'); - } elseif (preg_match('/^(\d\d):(\d\d):(\d\d)$/', $hourTime, $m)) { - $hour = intval($m[1]); - $minute = intval($m[2]); - $second = intval($m[3]); - } else { - $hour = $minute = $second = 0; - } - // normalize out of range values - $hour = min($hour, 23); - $minute = min($minute, 59); - $second = min($second, 59); - return dol_mktime($hour, $minute, $second, GETPOSTINT($prefix . 'month'), GETPOSTINT($prefix . 'day'), GETPOSTINT($prefix . 'year'), $gm); -} - /** * Helper function that combines values of a dolibarr DatePicker (such as Form::selectDate) for year, month, day (and * optionally hour, minute, second) fields to return a a portion of URL reproducing the values from the current HTTP diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 18914beba62..4a89aaf8f6b 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -42,14 +42,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; * @param integer $paymentdateafter Payment after date (must includes hour) * @param integer $paymentdatebefore Payment before date (must includes hour) * @param int $usestdout Add information onto standard output - * @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template + * @param string $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template * @param string $filesuffix Suffix to add into file name of generated PDF * @param string $paymentbankid Only if payment on this bank account id * @param array $thirdpartiesid List of thirdparties id when using filter=excludethirdpartiesid or filter=onlythirdpartiesid * @param string $fileprefix Prefix to add into filename of generated PDF * @return int Error code */ -function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate = 0, $filesuffix = '', $paymentbankid = '', $thirdpartiesid = [], $fileprefix = 'mergedpdf') +function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate = '', $filesuffix = '', $paymentbankid = '', $thirdpartiesid = [], $fileprefix = 'mergedpdf') { $sql = "SELECT DISTINCT f.rowid, f.ref"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4096253a94d..ba3988492e1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1380,14 +1380,14 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ /** * Show linked objects for PDF generation * - * @param TCPDF $pdf Object PDF + * @param TCPDF $pdf Object PDF * @param object $object Object * @param Translate $outputlangs Object lang * @param int $posx X * @param int $posy Y * @param float $w Width of cells. If 0, they extend up to the right margin of the page. * @param float $h Cell minimum height. The cell extends automatically if needed. - * @param int $align Align + * @param string $align Align * @param string $default_font_size Font size * @return float The Y PDF position */ diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 9632a893acd..98fb8dadb65 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -7,6 +7,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García * Copyright (C) 2021-2022 Open-Dsi + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,16 +99,16 @@ function tax_prepare_head(ChargeSociales $object) /** * Look for collectable VAT clients in the chosen year (and month) * - * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' - * @param DoliDB $db Database handle - * @param int $y Year - * @param string $date_start Start date - * @param string $date_end End date - * @param int $modetax Not used - * @param string $direction 'sell' or 'buy' - * @param int $m Month - * @param int $q Quarter - * @return array|int Array with details of VATs (per third parties), -1 if no accountancy module, -2 if not yet developed, -3 if error + * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' + * @param DoliDB $db Database handle + * @param int $y Year + * @param int|'' $date_start Start date + * @param int|'' $date_end End date + * @param int $modetax Not used + * @param 'sell'|'buy' $direction 'sell' or 'buy' + * @param int $m Month + * @param int $q Quarter + * @return array|int Array with details of VATs (per third parties), -1 if no accountancy module, -2 if not yet developed, -3 if error */ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $direction, $m = 0, $q = 0) { @@ -115,7 +116,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di // If we use date_start and date_end, we must not use $y, $m, $q if (($date_start || $date_end) && (!empty($y) || !empty($m) || !empty($q))) { - dol_print_error(null, 'Bad value of input parameter for tax_by_rate'); + dol_print_error(null, 'Bad value of input parameter for tax_by_thirdparty'); } $list = array(); @@ -473,14 +474,14 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di } if (!$sql) { - dol_syslog("Tax.lib.php::tax_by_rate no accountancy module enabled".$sql, LOG_ERR); + dol_syslog("Tax.lib.php::tax_by_thirdparty no accountancy module enabled".$sql, LOG_ERR); return -1; // -1 = Not accountancy module enabled } if ($sql == 'TODO') { return -2; // -2 = Feature not yet available } if ($sql != 'TODO') { - dol_syslog("Tax.lib.php::tax_by_rate", LOG_DEBUG); + dol_syslog("Tax.lib.php::tax_by_thirdparty", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $company_id = -1; @@ -595,14 +596,14 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " ORDER BY e.rowid"; if (!$sql) { - dol_syslog("Tax.lib.php::tax_by_rate no accountancy module enabled".$sql, LOG_ERR); + dol_syslog("Tax.lib.php::tax_by_thirdparty no accountancy module enabled".$sql, LOG_ERR); return -1; // -1 = Not accountancy module enabled } if ($sql == 'TODO') { return -2; // -2 = Feature not yet available } if ($sql != 'TODO') { - dol_syslog("Tax.lib.php::tax_by_rate", LOG_DEBUG); + dol_syslog("Tax.lib.php::tax_by_thirdparty", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $company_id = -1; @@ -687,16 +688,16 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di * The function gets the Tax in split results, as the Tax declaration asks * to report the amounts for different Tax rates as different lines. * - * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' - * @param DoliDB $db Database handler object - * @param int $y Year - * @param int $q Quarter - * @param string $date_start Start date - * @param string $date_end End date - * @param int $modetax Not used - * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices) - * @param int $m Month - * @return array|int Array with details of VATs (per rate), -1 if no accountancy module, -2 if not yet developed, -3 if error + * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' + * @param DoliDB $db Database handler object + * @param int $y Year + * @param int $q Quarter + * @param int|'' $date_start Start date + * @param int|'' $date_end End date + * @param int $modetax Not used + * @param 'sell'|'buy' $direction 'sell' (customer invoice) or 'buy' (supplier invoices) + * @param int $m Month + * @return array|int Array with details of VATs (per rate), -1 if no accountancy module, -2 if not yet developed, -3 if error */ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m = 0) { diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 5101f70959a..9986ccca60a 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -415,7 +415,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt $image = $event["image"]; } else { $reg = array(); - // IF we found a link like ... * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -166,7 +167,7 @@ class pdf_standard_actions $pdf = pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1, 0); diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index faedd65d993..0bc163732be 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -220,7 +220,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 50; // Height reserved to output the info and total part and payment part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { @@ -992,7 +992,7 @@ class pdf_standard_asset extends ModelePDFAsset $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); } - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 7f8ae3c09b5..daacb9aba68 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,7 +155,7 @@ class pdf_ban extends ModeleBankAccountDoc $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index babd72f3d68..684f52faa22 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -165,7 +165,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts // Create PDF instance $pdf = pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index fcbc54c7dab..dd5e21bc0fa 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1486,7 +1486,7 @@ class pdf_einstein extends ModelePDFCommandes $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index ab1a9f5c9c2..27de7592c59 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1672,7 +1672,7 @@ class pdf_eratosthene extends ModelePDFCommandes } $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 42eef159102..ab762c06e7c 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -6,7 +6,7 @@ * Copyright (C) 2011 Fabrice CHERRIER * Copyright (C) 2013-2024 Philippe Grand * Copyright (C) 2015 Marcos García - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -749,7 +749,7 @@ class pdf_strato extends ModelePDFContract $this->recipient->name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 018e97f75ac..626f7907165 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -230,7 +230,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 30; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -815,7 +815,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 1c4b158bbd4..f26095e885f 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -6,6 +6,7 @@ * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2015 Marcos García * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -197,7 +198,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 30; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -822,7 +823,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 17051e0c90e..732b92d1b9f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -241,7 +241,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -1170,7 +1170,7 @@ class pdf_espadon extends ModelePdfExpedition $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 53308cf110f..6a842cee2e6 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -5,6 +5,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -195,7 +196,7 @@ class pdf_merou extends ModelePdfExpedition $pdf = pdf_getInstance($this->format, 'mm', 'l'); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 0; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -651,7 +652,7 @@ class pdf_merou extends ModelePdfExpedition $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ((!empty($object->contact)) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ((!empty($object->contact)) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); $blDestX = $blExpX + 55; $blW = 54; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 20a809ea36a..05372549673 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -274,7 +274,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -1103,7 +1103,7 @@ class pdf_rouget extends ModelePdfExpedition $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php similarity index 99% rename from htdocs/core/modules/expensereport/doc/pdf_standard.modules.php rename to htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php index 16fc1284e34..14383a66e85 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2023 Philippe Grand - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Francis Appels * Copyright (C) 2019 Markus Welters * Copyright (C) 2019 Rafael Ingenleuf @@ -25,7 +25,7 @@ */ /** - * \file htdocs/core/modules/expensereport/doc/pdf_standard.modules.php + * \file htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php * \ingroup expensereport * \brief File of class to generate expense report from standard model */ @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; /** * Class to generate expense report based on standard model */ -class pdf_standard extends ModeleExpenseReport +class pdf_standard_expensereport extends ModeleExpenseReport { /** * @var DoliDB Database handler @@ -236,7 +236,7 @@ class pdf_standard extends ModeleExpenseReport $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 12; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 5fb82673a45..b9bf1e5f7d8 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -303,7 +303,7 @@ class pdf_crabe extends ModelePDFFactures if ($heightforinfotot > 220) { $heightforinfotot = 220; } - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -2122,7 +2122,7 @@ class pdf_crabe extends ModelePDFFactures $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; @@ -2168,7 +2168,7 @@ class pdf_crabe extends ModelePDFFactures $companystatic = new Societe($this->db); $companystatic->fetch($object->contact->fk_soc); $carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs); - $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, $usecontact, 'target', $object); + $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, ($usecontact ? 1 : 0), 'target', $object); } else { $carac_client_name_shipping = pdfBuildThirdpartyName($object->thirdparty, $outputlangs); $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object); diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index b401581ae7d..e0d5c731479 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -2330,7 +2330,7 @@ class pdf_octopus extends ModelePDFFactures $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; @@ -2376,7 +2376,7 @@ class pdf_octopus extends ModelePDFFactures $companystatic = new Societe($this->db); $companystatic->fetch($object->contact->fk_soc); $carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs); - $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, $usecontact, 'target', $object); + $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, ($usecontact ? 1 : 0), 'target', $object); } else { $carac_client_name_shipping = pdfBuildThirdpartyName($object->thirdparty, $outputlangs); $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0d7c33c3536..8266bed4ea3 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -333,7 +333,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetAutoPageBreak(1, 0); $this->heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part - $this->heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $this->heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) $heightforqrinvoice = $heightforqrinvoice_firstpage = 0; @@ -2403,7 +2403,7 @@ class pdf_sponge extends ModelePDFFactures $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; @@ -2449,7 +2449,7 @@ class pdf_sponge extends ModelePDFFactures $companystatic = new Societe($this->db); $companystatic->fetch($object->contact->fk_soc); $carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs); - $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, $usecontact, 'target', $object); + $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, ($usecontact ? 1 : 0), 'target', $object); } else { $carac_client_name_shipping = pdfBuildThirdpartyName($object->thirdparty, $outputlangs); $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index eb08a138e20..6d51ddbe1ed 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -187,7 +187,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -665,7 +665,7 @@ class pdf_soleil extends ModelePDFFicheinter $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php similarity index 98% rename from htdocs/core/modules/hrm/doc/pdf_standard.modules.php rename to htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php index 0fd40330124..f581c42901a 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2023 Philippe Grand - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Francis Appels * Copyright (C) 2019 Markus Welters * Copyright (C) 2019 Rafael Ingenleuf @@ -25,7 +25,7 @@ */ /** - * \file htdocs/core/modules/hrm/doc/pdf_standard.modules.php + * \file htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php * \ingroup hrm * \brief File of class to generate evaluation report from standard model */ @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; /** * Class to generate Evaluation Pdf based on standard model */ -class pdf_standard extends ModelePDFEvaluation +class pdf_standard_evaluation extends ModelePDFEvaluation { /** * @var DoliDB Database handler @@ -196,7 +196,7 @@ class pdf_standard extends ModelePDFEvaluation $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 0; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 12; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard_member.class.php similarity index 97% rename from htdocs/core/modules/member/doc/pdf_standard.class.php rename to htdocs/core/modules/member/doc/pdf_standard_member.class.php index b8b8acbbec1..7e9f438443f 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard_member.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2015 Francis Appels +/* Copyright (C) 2003 Steve Dillon + * Copyright (C) 2003 Laurent Passebecq + * Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2015 Francis Appels * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/modules/member/doc/pdf_standard.class.php + * \file htdocs/core/modules/member/doc/pdf_standard_member.class.php * \ingroup member * \brief File of class to generate PDF document of labels */ @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonstickergenerator.class.php'; /** * Class to generate stick sheet with format Avery or other personalised */ -class pdf_standard extends CommonStickerGenerator +class pdf_standard_member extends CommonStickerGenerator { /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index c2843fffcb7..9d60b72c6dd 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -1,8 +1,9 @@ - * Copyright (C) 2015 Laurent Destailleur - * Copyright (C) 2023 Alexandre Spangaro +/* Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2015 Laurent Destailleur + * Copyright (C) 2023 Alexandre Spangaro * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -261,8 +262,8 @@ class modExpenseReport extends DolibarrModules $this->remove($options); $sql = array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard' AND type='expensereport' AND entity = ".((int) $conf->entity), - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard','expensereport',".((int) $conf->entity).")" + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_expensereport' AND type='expensereport' AND entity = ".((int) $conf->entity), + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_expensereport','expensereport',".((int) $conf->entity).")" ); return $this->_init($sql, $options); diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index ad391a1ec92..de499e51e5c 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2021 Ferran Marcet * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,14 +83,14 @@ class modStock extends DolibarrModules $r++; $this->const[$r][0] = "STOCK_ADDON_PDF"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "standard"; + $this->const[$r][2] = "standard_stock"; $this->const[$r][3] = 'Name of PDF model of stock'; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "MOUVEMENT_ADDON_PDF"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "stdmovement"; + $this->const[$r][2] = "standard_movement_stock"; $this->const[$r][3] = 'Name of PDF model of stock movement'; $this->const[$r][4] = 0; diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php similarity index 98% rename from htdocs/core/modules/movement/doc/pdf_standard.modules.php rename to htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php index 319f8f39c3d..3324865d54c 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/modules/movement/doc/pdf_standard.modules.php + * \file htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php * \ingroup societe * \brief File of class to build PDF documents for stocks movements */ @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** * Class to build documents using ODF templates generator */ -class pdf_standard extends ModelePDFMovement +class pdf_standard_movementstock extends ModelePDFMovement { /** * @var int Save the name of generated file as the main doc when generating a doc with this template @@ -386,7 +386,7 @@ class pdf_standard extends ModelePDFMovement $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { @@ -904,7 +904,7 @@ class pdf_standard extends ModelePDFMovement * Show top header of page. * * @param TCPDF $pdf Object PDF - * @param Object $object Object to show + * @param MouvementStock|Entrepot $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @param string $titlekey Translation key to show as title of document @@ -919,17 +919,17 @@ class pdf_standard extends ModelePDFMovement $default_font_size = pdf_getPDFFontSize($outputlangs); - if ($object->type == 1) { - $titlekey = 'ServiceSheet'; - } else { - $titlekey = 'StockSheet'; - } + // if ($object->type == 1) { + // $titlekey = 'ServiceSheet'; + // } else { + // $titlekey = 'StockSheet'; + // } pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); // Show Draft Watermark - if ($object->statut == 0 && getDolGlobalString('COMMANDE_DRAFT_WATERMARK')) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('COMMANDE_DRAFT_WATERMARK')); + if ($object->status == 0 && getDolGlobalString('WAREHOUSE_DRAFT_WATERMARK')) { + pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('WAREHOUSE_DRAFT_WATERMARK')); } $pdf->SetTextColor(0, 0, 60); @@ -1127,7 +1127,7 @@ class pdf_standard extends ModelePDFMovement * Show footer of page. Need this->emetteur object * * @param TCPDF $pdf PDF - * @param Object $object Object to show + * @param MouvementStock|Entrepot $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 50bd5549d38..faa364523c0 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -210,7 +210,7 @@ class pdf_vinci extends ModelePDFMo $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 828688b2743..eacccaf96f7 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023 Anthony Berton * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -177,7 +178,7 @@ class pdf_standard extends ModelePDFProduct $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -731,7 +732,7 @@ class pdf_standard extends ModelePDFProduct pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); // Show Draft Watermark - if ($object->statut == 0 && getDolGlobalString('PRODUCT_DRAFT_WATERMARK')) { + if ($object->status == 0 && getDolGlobalString('PRODUCT_DRAFT_WATERMARK')) { pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('COMMANDE_DRAFT_WATERMARK')); } diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 3f26a05791c..797d643523f 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -194,7 +195,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 98b86f94000..e17ac35914f 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2015-2018 Charlene Benke * Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -225,7 +226,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index e806a681de0..9422abeacd5 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -189,7 +190,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 66a4ae61fcb..d69a12adad9 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -366,7 +366,7 @@ class pdf_azur extends ModelePDFPropales $heightforinfotot = 40; // Height reserved to output the info and total part $heightforsignature = !getDolGlobalString('PROPAL_DISABLE_SIGNATURE') ? (pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature")) + 10) : 0; - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -1694,7 +1694,7 @@ class pdf_azur extends ModelePDFPropales $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index c0d886f2aa5..c093e34f6ac 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -340,7 +340,7 @@ class pdf_cyan extends ModelePDFPropales $heightforinfotot = 40; // Height reserved to output the info and total part $heightforsignature = !getDolGlobalString('PROPAL_DISABLE_SIGNATURE') ? (pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature")) + 10) : 0; - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; @@ -1761,7 +1761,7 @@ class pdf_cyan extends ModelePDFPropales $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index f59c84f19c3..5ad5462ad1f 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -245,7 +245,7 @@ class pdf_squille extends ModelePdfReception $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1, 0); @@ -1076,7 +1076,7 @@ class pdf_squille extends ModelePdfReception $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 5e9b54f03c1..5a135ea49ef 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -120,7 +120,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc if (!is_dir($tmpdir)) { $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); } else { - $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment + $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, 1); // Disable hook for the moment if (count($tmpfiles)) { $listoffiles = array_merge($listoffiles, $tmpfiles); } diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php similarity index 99% rename from htdocs/core/modules/stock/doc/pdf_standard.modules.php rename to htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php index 7fac3e5ea6f..e54427d429a 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** * Class to build documents using ODF templates generator */ -class pdf_standard extends ModelePDFStock +class pdf_standard_stock extends ModelePDFStock { public $wref; public $posxdesc; @@ -188,7 +188,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index e06b579cbf3..82e331db31a 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -298,7 +298,7 @@ class pdf_eagle extends ModelePDFStockTransfer $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -1220,7 +1220,7 @@ class pdf_eagle extends ModelePDFStockTransfer $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); } - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 070bb27d5f4..76a2735dbfd 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -267,7 +267,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { @@ -1409,7 +1409,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); } - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 526490336d9..f226baf46da 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -238,7 +238,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if ($heightforinfotot > 220) { $heightforinfotot = 220; } - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -1229,7 +1229,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $mysoc, ((!empty($object->contact)) ? $object->contact : null), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $mysoc, ((!empty($object->contact)) ? $object->contact : null), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index d6247a50d43..c5bbc717e1b 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -265,7 +265,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -1406,7 +1406,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 49c81f064ea..525e7e89992 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -276,7 +276,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -1317,7 +1317,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php similarity index 97% rename from htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php rename to htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php index b1b6e28514f..4cfd1a03d79 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php @@ -1,8 +1,9 @@ - * Copyright (C) 2010-2014 Laurent Destailleur - * Copyright (C) 2015 Marcos García - * Copyright (C) 2022 Ferran Marcet +/* Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2014 Laurent Destailleur + * Copyright (C) 2015 Marcos García + * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ */ /** - * \file htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php + * \file htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php * \ingroup fournisseur * \brief Class file to generate the supplier invoice payment file with the standard model */ @@ -37,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php'; /** * Class to generate the supplier invoices payment file with the standard model */ -class pdf_standard extends ModelePDFSuppliersPayments +class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments { /** * @var DoliDB Database handler @@ -232,7 +233,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index ebb32a3949f..0d2515893d2 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -267,7 +267,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -1375,7 +1375,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $carac_client_name = pdfBuildThirdpartyName($socname, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 13a6948fb1a..9ccca2e64dd 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -264,7 +264,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -1392,7 +1392,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 199d54e3e50..5c6918d8aac 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -1,9 +1,10 @@ +/* Copyright (C) 2010-2015 Laurent Destailleur * Copyright (C) 2009 Meos - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -93,7 +94,7 @@ if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'serv } $accessallowed = 1; } elseif ($modulepart == 'medias') { - $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); + $permtoadd = ($user->hasRight('mailing', 'creer') || $user->hasRight('website', 'write')); if (!$permtoadd) { accessforbidden(); } diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 0f91b78b9ed..77746652771 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -192,7 +192,7 @@ if ($conf->dol_use_jmobile) { // Show all forms print "\n"; print "\n"; -print '
'; +print '
'; print ''; print '
'."\n"; print $searchform; diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 4c26b90462e..90e4f80065c 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -47,10 +47,10 @@ foreach ($object->fields as $key => $val) { if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4 && abs($val['visible']) != 5) { continue; } - if (array_key_exists('enabled', $val) && isset($val['enabled']) && !verifCond($val['enabled'])) { continue; // We don't want this field } + if (in_array($key, array('ref', 'status'))) { continue; // Ref and status are already in dol_banner } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 21e5d86d104..84916e00f73 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -1,9 +1,10 @@ - * Copyright (C) 2013-2021 Laurent Destailleur - * Copyright (C) 2019-2024 Frédéric France +/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2021 Laurent Destailleur + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -92,7 +93,7 @@ if (!$user->hasRight('cron', 'read')) { } $permissiontoread = $user->hasRight('cron', 'read'); -$permissiontoadd = $user->rights->cron->create ? $user->rights->cron->create : $user->rights->cron->write; +$permissiontoadd = $user->hasRight('cron', 'create') ? $user->hasRight('cron', 'create') : $user->hasRight('cron', 'write'); $permissiontodelete = $user->hasRight('cron', 'delete'); $permissiontoexecute = $user->hasRight('cron', 'execute'); @@ -237,9 +238,9 @@ if (empty($reshook)) { $form = new Form($db); $cronjob = new Cronjob($db); -$pagetitle = $langs->trans("CronList"); +$title = $langs->trans("CronList"); -llxHeader('', $pagetitle); +llxHeader('', $title, '', 0, 0, '', '', '', 'bodyforlist'); $TTestNotAllowed = array(); $sqlTest = 'SELECT rowid, test FROM '.MAIN_DB_PREFIX.'cronjob'; @@ -423,7 +424,7 @@ if ($mode == 'modulesetup') { } -print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode == 'modulesetup' ? '' : 'title_setup'), 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode == 'modulesetup' ? '' : 'title_setup'), 0, $newcardbutton, '', $limit); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendCronRef"; diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 1d5aad2ee74..dff1e149c6d 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -420,7 +420,7 @@ class Delivery extends CommonObject $soc->fetch($this->socid); if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life - $numref = $objMod->delivery_get_num($soc, $this); + $numref = $objMod->getNextValue($soc, $this); } else { $numref = $this->ref; } diff --git a/htdocs/document.php b/htdocs/document.php index e204956acd3..6356944cc27 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -6,6 +6,7 @@ * Copyright (C) 2010 Pierre Morin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,10 +78,24 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) { /** * Header empty * - * @ignore + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { } /** diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index f4ef3990726..a68e8a5273d 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Francis Appels * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * 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 @@ -884,6 +884,25 @@ class EcmFiles extends CommonObject } } + /** + * updateAfterRename update entries in ecmfiles if exist to avoid losing info + * + * @param string $olddir old directory + * @param string $newdir new directory + * @return void + */ + public function updateAfterRename($olddir, $newdir) + { + $sql = 'UPDATE '.MAIN_DB_PREFIX.'ecm_files SET'; + $sql .= ' filepath = "'.$this->db->escape($newdir).'"'; + //$sql .= ', fullpath_orig = "'.$dbs->escape($newdir)."'"; + $sql .= ' WHERE '; + $sql .= ' filepath = "'.$this->db->escape($olddir).'"'; + // $sql .= ' AND fullpath_orig = "'.$dbs->escape($olddir).'"'; + + $this->db->query($sql); + } + /** * Return a link to the object card (with optionally the picto) * @@ -906,7 +925,7 @@ class EcmFiles extends CommonObject $result = ''; - $label = ''.$langs->trans("MyModule").''; + $label = ''.$langs->trans("File").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index ad2b5b387c3..ff47ad9e272 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -1,7 +1,7 @@ - * Copyright (C) 2008-2012 Regis Houssin - * Copyright (C) 2015-2016 Alexandre Spangaro +/* Copyright (C) 2008-2017 Laurent Destailleur + * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2015-2024 Alexandre Spangaro * * 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 @@ -103,9 +103,9 @@ if ($module == 'ecm') { $permissiontoupload = $user->hasRight('ecm', 'upload'); } if ($module == 'medias') { - $permissiontoadd = ($user->rights->mailing->creer || $user->rights->website->write); - $permissiontodelete = ($user->rights->mailing->creer || $user->rights->website->write); - $permissiontoupload = ($user->rights->mailing->creer || $user->rights->website->write); + $permissiontoadd = ($user->hasRight('mailing', 'creer') || $user->hasRight('website', 'write')); + $permissiontodelete = ($user->hasRight('mailing', 'creer') || $user->hasRight('website', 'write')); + $permissiontoupload = ($user->hasRight('mailing', 'creer') || $user->hasRight('website', 'write')); } if (!$permissiontoadd) { diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 405fb76bc5d..433b763f842 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-2010 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -331,7 +332,7 @@ $moreheadjs .= ''."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $morejs, '', 0, 0); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', 0, 0); $head = ecm_prepare_dasboard_head(null); print dol_get_fiche_head($head, 'index', '', -1, ''); diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 8c54ffad45f..ce1b824db58 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -3,6 +3,7 @@ * Copyright (C) 2008-2010 Regis Houssin * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -304,7 +305,7 @@ $moreheadjs .= ''."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $morejs, '', 0, 0); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', 0, 0); // Add sections to manage diff --git a/htdocs/ecm/index_medias.php b/htdocs/ecm/index_medias.php index b435cc77e47..aec8bbbb5eb 100644 --- a/htdocs/ecm/index_medias.php +++ b/htdocs/ecm/index_medias.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-2010 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -296,7 +297,7 @@ $moreheadjs .= ''."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $morejs, '', 0, 0); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', 0, 0); $head = ecm_prepare_dasboard_head(null); print dol_get_fiche_head($head, 'index_medias', '', -1, ''); diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 5c00c56499d..cd023944416 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 Florian Henry +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 Florian Henry + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -88,7 +89,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'inclu // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; @@ -171,8 +172,9 @@ $formfile = new FormFile($db); $formproject = new FormProjets($db); $title = $langs->trans("ConferenceOrBooth"); -$help_url = ''; -llxHeader('', $title, $help_url); +$help_url='EN:Module_Event_Organization'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-card'); if ($action == 'create') { $result = $projectstatic->fetch(GETPOST('fk_project')); diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index bd7e7c087a5..32d1bb6ac85 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 Florian HENRY +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2021 Florian HENRY + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -79,7 +80,7 @@ $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_so $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; @@ -148,14 +149,14 @@ $contactstatic = new Contact($db); $userstatic = new User($db); $title = $langs->trans('ConferenceOrBooth')." - ".$langs->trans('ContactsAddresses'); -$help_url = ''; -//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); +$help_url='EN:Module_Event_Organization'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-card_contact'); /* *************************************************************************** */ /* */ -/* View and edit mode */ +/* View and edit mode */ /* */ /* *************************************************************************** */ diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index ab8cb6a96b8..679b83368ae 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 Florian Henry +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2021 Florian Henry + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -93,7 +94,7 @@ if ($id > 0 || !empty($ref)) { // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; @@ -130,8 +131,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $title = $langs->trans("ConferenceOrBooth").' - '.$langs->trans("Files"); -$help_url = ''; -llxHeader('', $title, $help_url); +$help_url='EN:Module_Event_Organization'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-card_documents'); $result = $projectstatic->fetch($object->fk_project); if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) { diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 4211eba558a..16a4dd3e6d7 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -1,7 +1,8 @@ - * Copyright (C) 2021 Florian Henry - * Copyright (C) 2023 Frédéric France +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2021 Florian Henry + * Copyright (C) 2023 Frédéric France + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -122,7 +123,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -275,7 +276,7 @@ $now = dol_now(); $title = $langs->trans("EventOrganizationConfOrBoothes"); $help_url = "EN:Module_Event_Organization"; -$help_url = ''; + $morejs = array(); $morecss = array(); @@ -305,7 +306,7 @@ if ($projectid > 0 || $projectref) { // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-list bodyforlist'); if ($projectid > 0) { diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index f400e55e38a..c32f06ee4af 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -115,7 +116,7 @@ if ($object->fk_project > 0) { // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; @@ -204,8 +205,9 @@ $formfile = new FormFile($db); $formproject = new FormProjets($db); $title = $langs->trans("ConferenceOrBoothAttendee"); -$help_url = ''; -llxHeader('', $title, $help_url); +$help_url='EN:Module_Event_Organization'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-attendee-card'); $result = $projectstatic->fetch(empty($confOrBooth->fk_project) ? $fk_project : $confOrBooth->fk_project); if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) { diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 262b1df7b51..442dc7fa80b 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 Florian Henry +/* Copyright (C) 2017-2024 Laurent Destailleur + * Copyright (C) 2021 Florian Henry + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -131,7 +132,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -237,8 +238,8 @@ if (empty($reshook)) { $form = new Form($db); $now = dol_now(); -//$help_url="EN:Module_ConferenceOrBoothAttendee|FR:Module_ConferenceOrBoothAttendee_FR|ES:Módulo_ConferenceOrBoothAttendee"; -$help_url = ''; +$help_url = "EN:Module_Event_Organization"; + $morejs = array(); $morecss = array(); @@ -390,7 +391,7 @@ if ($confOrBooth->id > 0) { // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-eventorganization page-attendee-list classforhorizontalscrolloftabs'); diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index 12cd4852d27..06887d59cc4 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -1,7 +1,7 @@ - * Copyright (C) ---Put here your own copyright and developer email--- - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -83,16 +83,17 @@ if (empty($reshook)) { $form = new Form($db); -//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; -$help_url = ''; -llxHeader('', $langs->trans('ConferenceOrBoothAttendee'), $help_url); +$title = $langs->trans('ConferenceOrBoothAttendee'); +$help_url = "EN:Module_Event_Organization"; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-attendee-card_note'); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); $head = conferenceorboothAttendeePrepareHead($object); - print dol_get_fiche_head($head, 'note', $langs->trans("ConferenceOrBoothAttendee"), -1, $object->picto); + print dol_get_fiche_head($head, 'note', $title, -1, $object->picto); // Object card // ------------------------------------------------------------ diff --git a/htdocs/eventorganization/eventorganizationindex.php b/htdocs/eventorganization/eventorganizationindex.php index fe1e16ba5a0..657be99060a 100644 --- a/htdocs/eventorganization/eventorganizationindex.php +++ b/htdocs/eventorganization/eventorganizationindex.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -62,8 +63,9 @@ $form = new Form($db); $formfile = new FormFile($db); $title = $langs->trans('EventOrganizationArea'); +$help_url='EN:Module_Event_Organization'; -llxHeader('', $title, ''); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-index'); print load_fiche_titre($langs->trans("EventOrganizationArea"), '', 'eventorganization.png@eventorganization'); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 9ec4182d0f9..2d24d873ed8 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -456,7 +456,7 @@ if (empty($reshook)) { if ($result > 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT.'/delivery/card.php?action=create_delivery&id='.$result); + header("Location: ".DOL_URL_ROOT.'/delivery/card.php?action=create_delivery&token='.newToken().'&id='.$result); exit; } else { $db->rollback(); diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index ce3d4c53096..51b3aa550b8 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -95,11 +95,12 @@ class Shipments extends DolibarrApi * @param string $thirdparty_ids Thirdparty ids to filter shipments of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of shipment objects * * @throws RestException */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('expedition', 'lire')) { throw new RestException(403); @@ -140,6 +141,9 @@ class Shipments extends DolibarrApi } } + //this query will return total shipments with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -169,6 +173,23 @@ class Shipments extends DolibarrApi throw new RestException(503, 'Error when retrieve commande list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index e1616338c6c..ef8616698e3 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -641,7 +641,10 @@ $companystatic = new Societe($db); $formcompany = new FormCompany($db); $shipment = new Expedition($db); -$helpurl = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; +$title = $langs->trans('ListOfSendings'); +$help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist'); $sql = 'SELECT'; if ($search_all || $search_user > 0) { diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index e6e1e44ba78..cd9cb9a2598 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -391,7 +391,7 @@ $num = $db->num_rows($resql); // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, ''); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index e064cbb3508..55d07767510 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -290,7 +290,7 @@ $i = 0; // Output page // -------------------------------------------------------------------- -llxHeader('', $langs->trans('ListPayment')); +llxHeader('', $langs->trans('ListPayment'), '', 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 59fd5121ba6..6a81d851db1 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1,17 +1,18 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2018 Regis Houssin - * Copyright (C) 2011-2020 Juanjo Menent - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2014-2018 Ferran Marcet - * Copyright (C) 2014-2022 Charlene Benke - * Copyright (C) 2015-2016 Abbes Bahfir - * Copyright (C) 2018-2022 Philippe Grand - * Copyright (C) 2020-2024 Frédéric France - * Copyright (C) 2023 Benjamin Grembi - * Copyright (C) 2023-2024 William Mead +/* Copyright (C) 2002-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2018 Regis Houssin + * Copyright (C) 2011-2020 Juanjo Menent + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014-2018 Ferran Marcet + * Copyright (C) 2014-2022 Charlene Benke + * Copyright (C) 2015-2016 Abbes Bahfir + * Copyright (C) 2018-2022 Philippe Grand + * Copyright (C) 2020-2024 Frédéric France + * Copyright (C) 2023 Benjamin Grembi + * Copyright (C) 2023-2024 William Mead * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -109,7 +110,7 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); $permissionnote = $user->hasRight('ficheinter', 'creer'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('ficheinter', 'creer'); // Used by the include of actions_dellink.inc.php -$permissiontodelete = (($object->statut == Fichinter::STATUS_DRAFT && $user->hasRight('ficheinter', 'creer')) || $user->rights->ficheinter->supprimer); +$permissiontodelete = (($object->statut == Fichinter::STATUS_DRAFT && $user->hasRight('ficheinter', 'creer')) || $user->hasRight('ficheinter', 'supprimer')); $usercancreate = $user->hasRight('ficheinter', 'creer'); diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 4c5cf0196ae..8998c20c866 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -268,7 +268,7 @@ define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core ph if (!file_exists(DOL_DOCUMENT_ROOT."/core/lib/functions.lib.php")) { print "Error: Dolibarr config file content seems to be not correctly defined.
\n"; print "Please run dolibarr setup by calling page /install.
\n"; - exit; + exit(1); } diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 13626a9e72e..730e4c07c6d 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -98,11 +98,12 @@ class SupplierInvoices extends DolibarrApi * @param string $status Filter by invoice status : draft | unpaid | paid | cancelled * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of invoice objects * * @throws RestException */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "lire")) { throw new RestException(403); @@ -156,6 +157,9 @@ class SupplierInvoices extends DolibarrApi } } + //this query will return total supplier invoices with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -183,6 +187,23 @@ class SupplierInvoices extends DolibarrApi throw new RestException(503, 'Error when retrieve supplier invoice list : ' . $this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index a770f53a39e..a8a42ce1457 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -95,11 +95,12 @@ class SupplierOrders extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')" * @param string $sqlfilterlines Other criteria to filter answers separated by a comma. Syntax example "(tl.fk_product:=:'17') and (tl.price:<:'250')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of order objects * * @throws RestException */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $product_ids = '', $status = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $product_ids = '', $status = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight("fournisseur", "commande", "lire")) { throw new RestException(403); @@ -181,6 +182,9 @@ class SupplierOrders extends DolibarrApi } } + //this query will return total supplier orders with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -208,6 +212,23 @@ class SupplierOrders extends DolibarrApi throw new RestException(503, 'Error when retrieve supplier order list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c130bbf50bf..950c1506fa4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1609,7 +1609,7 @@ class CommandeFournisseur extends CommonOrder 0, $line->product_type, $line->info_bits, - false, + 0, $line->date_start, $line->date_end, $line->array_options, diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 06f4076c605..d6e92cff23e 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -660,7 +660,7 @@ class FactureFournisseur extends CommonInvoice (!empty($this->lines[$i]->info_bits) ? $this->lines[$i]->info_bits : ''), $this->lines[$i]->product_type, $this->lines[$i]->remise_percent, - false, + 0, $this->lines[$i]->date_start, $this->lines[$i]->date_end, $this->lines[$i]->array_options, @@ -788,7 +788,7 @@ class FactureFournisseur extends CommonInvoice 'HT', 0, $_facrec->lines[$i]->rang, - false, + 0, $_facrec->lines[$i]->array_options, $_facrec->lines[$i]->fk_unit, 0, diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 75f01e33eb7..97639baed6d 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -202,7 +202,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['cf.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -1032,7 +1032,7 @@ if ($resql) { exit; } - llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-supplier-order page-list'); + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-supplier-order page-list'); $param = ''; if (!empty($mode)) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 1ede2ad14bd..b92065ee440 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1,20 +1,20 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2013-2019 Philippe Grand - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Marcos García - * Copyright (C) 2015-2007 Juanjo Menent - * Copyright (C) 2015 Abbes Bahfir - * Copyright (C) 2015-2016 Ferran Marcet - * Copyright (C) 2017 Josep Lluís Amador - * Copyright (C) 2018-2022 Charlene Benke - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2019-2023 Alexandre Spangaro +/* Copyright (C) 2002-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2013-2019 Philippe Grand + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015-2007 Juanjo Menent + * Copyright (C) 2015 Abbes Bahfir + * Copyright (C) 2015-2016 Ferran Marcet + * Copyright (C) 2017 Josep Lluís Amador + * Copyright (C) 2018-2022 Charlene Benke + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2019-2024 Alexandre Spangaro * Copyright (C) 2023 Nick Fragoulis - * Copyright (C) 2023 Joachim Kueter + * Copyright (C) 2023 Joachim Kueter * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -812,7 +812,7 @@ if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sear // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist'); if ($socid) { $soc = new Societe($db); diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index b8be196ef95..037fcfd7581 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -175,8 +175,10 @@ if (empty($reshook)) { /* * View */ +$title = $langs->trans('ListPayment'); +$help_url = ''; -llxHeader('', $langs->trans('ListPayment')); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist'); $form = new Form($db); $formother = new FormOther($db); diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 556241e456e..b5cb546b59e 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -234,16 +234,16 @@ if ($num == 1 && (GETPOST("mode") == 'search')) { } if (!empty($supplier->id)) { - $texte = $langs->trans("ListOfSupplierProductForSupplier", $supplier->name); + $title = $langs->trans("ListOfSupplierProductForSupplier", $supplier->name); } else { - $texte = $langs->trans("List"); + $title = $langs->trans("List"); } // Output page // -------------------------------------------------------------------- -llxHeader("", "", $texte); +llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -265,7 +265,7 @@ $param = "&sref=".$sref."&snom=".$snom."&fourn_id=".$fourn_id.(isset($type) ? "& $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/list.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); -print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton); if (!empty($catid)) { print "
"; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 520b0a7155a..05c5dec246a 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -257,7 +257,7 @@ print ''; print ''; $title = $langs->trans("MenuConfCP"); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, '', '', 'title_hrm', 0, '', '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, 0, '', 'title_hrm', 0, '', '', $limit, 0, 0, 1); include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 2938bf26101..dfef97403c3 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -241,7 +241,7 @@ $result = $object->updateBalance(); $title = $langs->trans('CPTitreMenu'); $help_url = ''; -llxHeader('', $title); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist'); $max_year = 5; $min_year = 10; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index f42a0a1fa0e..d0e3327c533 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -1,8 +1,9 @@ - * Copyright (C) 2011 Dimitri Mouillard - * Copyright (C) 2020 Tobias Sekan +/* Copyright (C) 2007-2016 Laurent Destailleur + * Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -286,7 +287,7 @@ print ''; print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=create', '', $user->rights->holiday->write); +$newcardbutton = dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=create', '', $user->hasRight('holiday', 'write')); // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('LogCP'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index 7e0aab08e4e..9974d4f8347 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -1,11 +1,12 @@ - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2021 Greg Rastklan - * Copyright (C) 2021 Jean-Pascal BOUDET - * Copyright (C) 2021 Grégory BLEMAND +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -25,11 +26,11 @@ * \brief This file compares skills of user groups * * Displays a table in three parts. - * 1- the left part displays the list of users of the selected group 1. + * 1- the left part displays the list of users for the selected group 1. * - * 2- the central part displays the skills. display of the maximum score for this group and the number of occurrences. + * 2- the central part displays the skills. Display of the maximum score for this group and the number of occurrences. * - * 3- the right part displays the members of group 2 or the job to be compared + * 3- the right part displays the members of group 2 or the job to be compared */ @@ -50,7 +51,7 @@ $langs->load('hrm'); $job = new Job($db); // Permissions -$permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read; +$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read') || $user->hasRight('hrm', 'compare_advance', 'read'); $permissiontoadd = 0; if (empty($conf->hrm->enabled)) { diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index b73e82956f9..d7e90e5bcee 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -119,11 +119,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 81f9f2b0c09..fc0f4ac614c 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -118,11 +118,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -342,7 +342,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Example : Adding jquery code // print '