diff --git a/.github/workflows/phpstan_baseline.yml b/.github/workflows/phpstan_baseline.yml index 618a2d26690..9503c25de77 100644 --- a/.github/workflows/phpstan_baseline.yml +++ b/.github/workflows/phpstan_baseline.yml @@ -1,9 +1,9 @@ name: 'PHPStan baseline' on: - # Every Thursday we want to refresh the baseline + # Every day we want to refresh the baseline schedule: - - cron: '0 6 * * 4' + - cron: '0 12 * * *' # We want to be able to manually refresh the baseline too workflow_dispatch: @@ -14,18 +14,21 @@ on: required: true type: string # Run PHPStan analyse on pull requests - #pull_request: + # pull_request: + +permissions: {} # none env: PHP_VERSION: '8.2' + GH_TOKEN: ${{ github.token }} gh_event: ${{ inputs.gh_event || github.event_name }} CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }} jobs: phpstan: runs-on: ubuntu-latest - permissions: write-all - # contents: write - # pull-requests: write + permissions: + contents: write + pull-requests: write steps: - name: Checkout uses: actions/checkout@v4 @@ -54,7 +57,7 @@ jobs: phpstan-cache-${{ env.PHP_VERSION }}- - uses: ruudk/phpstan-baseline-refresh-create-pr-action@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ env.GH_TOKEN }} phpstan_path: phpstan configuration_path: phpstan.neon.dist phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php @@ -63,8 +66,8 @@ jobs: commit_email: dolibarr-bot@users.noreply.github.com commit_message: PHPStan > Update baseline target_branch: develop - pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }} - # pr_create: 1 + # pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }} + pr_create: 1 pr_title: PHPStan > Update baseline pr_reviewer: eldy pr_body: | diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 81c348a83e0..3f1b83cbd41 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -1,29 +1,5 @@ parameters: ignoreErrors: - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/accountancy/admin/account.php - - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 3 - path: ../../htdocs/accountancy/admin/account.php - - - - message: '#^Ternary operator condition is always false\.$#' - identifier: ternary.alwaysFalse - count: 1 - path: ../../htdocs/accountancy/admin/account.php - - - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/accountancy/admin/account.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -816,12 +792,6 @@ parameters: count: 3 path: ../../htdocs/accountancy/journal/bankjournal.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/accountancy/journal/bankjournal.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -924,12 +894,6 @@ parameters: count: 1 path: ../../htdocs/accountancy/supplier/list.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/accountancy/tpl/export_journal.tpl.php - - message: '#^Variable \$mc might not be defined\.$#' identifier: variable.undefined @@ -1194,36 +1158,6 @@ parameters: count: 2 path: ../../htdocs/adherents/class/subscription.class.php - - - message: '#^Variable \$badgeStatus0 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/adherents/index.php - - - - message: '#^Variable \$badgeStatus1 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/adherents/index.php - - - - message: '#^Variable \$badgeStatus4 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/adherents/index.php - - - - message: '#^Variable \$badgeStatus6 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/adherents/index.php - - - - message: '#^Variable \$badgeStatus8 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/adherents/index.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -1716,12 +1650,6 @@ parameters: count: 2 path: ../../htdocs/admin/modules.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/admin/modules.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -1896,12 +1824,6 @@ parameters: count: 1 path: ../../htdocs/admin/system/dbtable.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/admin/system/dolibarr.php - - message: '#^Variable \$conffiletoshowshort might not be defined\.$#' identifier: variable.undefined @@ -2688,12 +2610,6 @@ parameters: count: 2 path: ../../htdocs/asset/class/assetmodel.class.php - - - message: '#^Property AssetModel\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, position\: 20, notnull\: 1, visible\: 1, index\: 1, searchall\: 1, \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, position\: 30, notnull\: 1, visible\: 1, searchall\: 1, css\: ''minwidth300'', \.\.\.\}, asset_type\: array\{type\: ''smallint'', label\: ''AssetType'', enabled\: 1, position\: 40, notnull\: 1, visible\: 1, arrayofkeyval\: array\{''AssetTypeIntangible'', ''AssetTypeTangible'', ''AssetTypeInProgress'', ''AssetTypeFinancial''\}, validate\: 1\}, note_public\: array\{type\: ''html'', label\: ''NotePublic'', enabled\: 1, position\: 300, notnull\: 0, visible\: 0, validate\: 1\}, note_private\: array\{type\: ''html'', label\: ''NotePrivate'', enabled\: 1, position\: 301, notnull\: 0, visible\: 0, validate\: 1\}, date_creation\: array\{type\: ''datetime'', label\: ''DateCreation'', enabled\: 1, position\: 500, notnull\: 1, visible\: \-2\}, tms\: array\{type\: ''timestamp'', label\: ''DateModification'', enabled\: 1, position\: 501, notnull\: 0, visible\: \-2\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/asset/class/assetmodel.class.php - - message: '#^Property AssetModel\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -2814,24 +2730,12 @@ parameters: count: 1 path: ../../htdocs/asset/tpl/accountancy_codes_view.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/asset/tpl/depreciation_options_edit.tpl.php - - message: '#^Variable \$parameters might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/asset/tpl/depreciation_options_edit.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/asset/tpl/depreciation_options_view.tpl.php - - message: '#^Variable \$db might not be defined\.$#' identifier: variable.undefined @@ -3120,12 +3024,6 @@ parameters: count: 1 path: ../../htdocs/bom/tpl/objectline_create.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/bom/tpl/objectline_create.tpl.php - - message: '#^Variable \$action might not be defined\.$#' identifier: variable.undefined @@ -3150,12 +3048,6 @@ parameters: count: 1 path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - message: '#^Variable \$action might not be defined\.$#' identifier: variable.undefined @@ -3246,12 +3138,6 @@ parameters: count: 1 path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - message: '#^Property CommonDict\:\:\$label \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -3366,12 +3252,6 @@ parameters: count: 1 path: ../../htdocs/bookcal/availabilities_list.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/bookcal/availabilities_list.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -3522,12 +3402,6 @@ parameters: count: 1 path: ../../htdocs/bookcal/calendar_list.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/bookcal/calendar_list.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -4488,12 +4362,6 @@ parameters: count: 1 path: ../../htdocs/comm/mailing/card.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/comm/mailing/cibles.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -4764,12 +4632,6 @@ parameters: count: 1 path: ../../htdocs/comm/propal/class/propal.class.php - - - message: '#^Property CommonObject\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/comm/propal/class/propal.class.php - - message: '#^Property CommonObject\:\:\$mode_reglement_id \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -4950,12 +4812,6 @@ parameters: count: 1 path: ../../htdocs/comm/propal/note.php - - - message: '#^Variable \$title might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/comm/propal/stats/index.php - - message: '#^Unable to resolve the template type T in call to function dol_sort_array$#' identifier: argument.templateType @@ -5184,12 +5040,6 @@ parameters: count: 1 path: ../../htdocs/commande/class/commande.class.php - - - message: '#^Property CommonObject\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/commande/class/commande.class.php - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -5382,12 +5232,6 @@ parameters: count: 1 path: ../../htdocs/commande/note.php - - - message: '#^Variable \$type might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/commande/stats/index.php - - message: '#^Unable to resolve the template type T in call to function dol_sort_array$#' identifier: argument.templateType @@ -5904,18 +5748,6 @@ parameters: count: 3 path: ../../htdocs/compta/cashcontrol/cashcontrol_card.php - - - message: '#^Variable \$posmodule might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/cashcontrol/cashcontrol_card.php - - - - message: '#^Variable \$terminaltouse might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/compta/cashcontrol/cashcontrol_card.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -5994,12 +5826,6 @@ parameters: count: 2 path: ../../htdocs/compta/clients.php - - - message: '#^Variable \$fileurl_avg might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/deplacement/stats/index.php - - message: '#^Variable \$mesg might not be defined\.$#' identifier: variable.undefined @@ -6132,12 +5958,6 @@ parameters: count: 1 path: ../../htdocs/compta/facture/card.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/compta/facture/class/api_invoices.class.php - - message: '#^Method Invoices\:\:_validate\(\) has parameter \$data with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -6237,17 +6057,11 @@ parameters: - message: '#^Parameter \#1 \$qty of function calcul_price_total expects float, string given\.$#' identifier: argument.type - count: 2 - path: ../../htdocs/compta/facture/class/facture-rec.class.php - - - - message: '#^Parameter \#1 \$vatrate of function getLocalTaxesFromRate expects int\|string, float given\.$#' - identifier: argument.type count: 1 path: ../../htdocs/compta/facture/class/facture-rec.class.php - - message: '#^Parameter \#15 \$pu_devise of function calcul_price_total expects float, string given\.$#' + message: '#^Parameter \#1 \$vatrate of function getLocalTaxesFromRate expects int\|string, float given\.$#' identifier: argument.type count: 1 path: ../../htdocs/compta/facture/class/facture-rec.class.php @@ -6261,12 +6075,6 @@ parameters: - message: '#^Parameter \#2 \$pu of function calcul_price_total expects float, string given\.$#' identifier: argument.type - count: 2 - path: ../../htdocs/compta/facture/class/facture-rec.class.php - - - - message: '#^Parameter \#3 \$remise_percent_ligne of function calcul_price_total expects float, string given\.$#' - identifier: argument.type count: 1 path: ../../htdocs/compta/facture/class/facture-rec.class.php @@ -6444,12 +6252,6 @@ parameters: count: 1 path: ../../htdocs/compta/facture/class/facture.class.php - - - message: '#^Property CommonObject\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/compta/facture/class/facture.class.php - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -6660,12 +6462,6 @@ parameters: count: 1 path: ../../htdocs/compta/facture/list.php - - - message: '#^Variable \$numprlv might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/facture/list.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -6696,48 +6492,12 @@ parameters: count: 1 path: ../../htdocs/compta/facture/prelevement.php - - - message: '#^Variable \$isdraft might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/compta/facture/prelevement.php - - message: '#^Variable \$num might not be defined\.$#' identifier: variable.undefined count: 2 path: ../../htdocs/compta/facture/prelevement.php - - - message: '#^Variable \$cat_label might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/facture/stats/index.php - - - - message: '#^Variable \$cat_type might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/facture/stats/index.php - - - - message: '#^Variable \$fileurl_avg might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/facture/stats/index.php - - - - message: '#^Variable \$fileurlamount might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/facture/stats/index.php - - - - message: '#^Variable \$fileurlnb might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/facture/stats/index.php - - message: '#^Variable \$type might not be defined\.$#' identifier: variable.undefined @@ -6786,12 +6546,6 @@ parameters: count: 2 path: ../../htdocs/compta/journal/purchasesjournal.php - - - message: '#^Variable \$tabfac might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/journal/purchasesjournal.php - - message: '#^Variable \$tabht might not be defined\.$#' identifier: variable.undefined @@ -6828,12 +6582,6 @@ parameters: count: 3 path: ../../htdocs/compta/journal/sellsjournal.php - - - message: '#^Variable \$tabfac might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/journal/sellsjournal.php - - message: '#^Variable \$tabht might not be defined\.$#' identifier: variable.undefined @@ -6864,12 +6612,6 @@ parameters: count: 1 path: ../../htdocs/compta/journal/sellsjournal.php - - - message: '#^Variable \$accountline might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/localtax/card.php - - message: '#^Variable \$morehtmlref might not be defined\.$#' identifier: variable.undefined @@ -6912,54 +6654,6 @@ parameters: count: 2 path: ../../htdocs/compta/localtax/class/localtax.class.php - - - message: '#^Variable \$builddate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/localtax/clients.php - - - - message: '#^Variable \$calcmode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/localtax/clients.php - - - - message: '#^Variable \$find might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/compta/localtax/clients.php - - - - message: '#^Variable \$period might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/localtax/clients.php - - - - message: '#^Variable \$q might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/localtax/clients.php - - - - message: '#^Variable \$replace might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/compta/localtax/clients.php - - - - message: '#^Variable \$x_coll_sum might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/localtax/clients.php - - - - message: '#^Variable \$x_paye_sum might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/localtax/clients.php - - message: '#^Variable \$arrayofselected might not be defined\.$#' identifier: variable.undefined @@ -7002,54 +6696,6 @@ parameters: count: 2 path: ../../htdocs/compta/paiement.php - - - message: '#^Variable \$multicurrency_creditnotes might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/paiement.php - - - - message: '#^Variable \$multicurrency_deposits might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/paiement.php - - - - message: '#^Variable \$multicurrency_payment might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/paiement.php - - - - message: '#^Variable \$multicurrency_remaintopay might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/compta/paiement.php - - - - message: '#^Variable \$paiement_id might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/paiement.php - - - - message: '#^Variable \$sign might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/compta/paiement.php - - - - message: '#^Variable \$text might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/compta/paiement.php - - - - message: '#^Variable \$tootltiponmulticurrencyfullamount might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/paiement.php - - message: '#^Variable \$marginInfo might not be defined\.$#' identifier: variable.undefined @@ -7062,12 +6708,6 @@ parameters: count: 2 path: ../../htdocs/compta/paiement/card.php - - - message: '#^Variable \$site_account_payment might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/compta/paiement/card.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -7080,12 +6720,6 @@ parameters: count: 3 path: ../../htdocs/compta/paiement/cheque/card.php - - - message: '#^Variable \$paiement might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/compta/paiement/cheque/card.php - - message: '#^Call to function method_exists\(\) with \$this\(RemiseCheque\) and ''LibStatut'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -7212,12 +6846,6 @@ parameters: count: 4 path: ../../htdocs/compta/paiement/class/cpaiement.class.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/compta/paiement/class/paiement.class.php - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -7272,12 +6900,6 @@ parameters: count: 1 path: ../../htdocs/compta/paiement_charge.php - - - message: '#^Variable \$sumpaid might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/compta/paiement_charge.php - - message: '#^Comparison operation "\>" between 1 and 1 is always false\.$#' identifier: greater.alwaysFalse @@ -7290,18 +6912,6 @@ parameters: count: 2 path: ../../htdocs/compta/paiement_vat.php - - - message: '#^Variable \$sumpaid might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/compta/paiement_vat.php - - - - message: '#^Variable \$outputlangs might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/payment_vat/card.php - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -7314,18 +6924,6 @@ parameters: count: 1 path: ../../htdocs/compta/prelevement/card.php - - - message: '#^Variable \$thirdparty might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/prelevement/card.php - - - - message: '#^Variable \$userSalary might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/prelevement/card.php - - message: '#^Call to function method_exists\(\) with \$this\(BonPrelevement\) and ''LibStatut'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -7422,18 +7020,6 @@ parameters: count: 1 path: ../../htdocs/compta/prelevement/demandes.php - - - message: '#^Variable \$invoicetmpcustomer might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/prelevement/factures.php - - - - message: '#^Variable \$invoicetmpsupplier might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/prelevement/factures.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -7446,30 +7032,6 @@ parameters: count: 1 path: ../../htdocs/compta/prelevement/orders_list.php - - - message: '#^Variable \$nbignored might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/prelevement/orders_list.php - - - - message: '#^Variable \$nbok might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/compta/prelevement/orders_list.php - - - - message: '#^Variable \$nbtotal might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/compta/prelevement/stats.php - - - - message: '#^Variable \$total might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/compta/prelevement/stats.php - - message: '#^Offset ''checked'' on array\{label\: ''Date'', checked\: 1\} in empty\(\) always exists and is not falsy\.$#' identifier: empty.offset @@ -7488,70 +7050,28 @@ parameters: count: 2 path: ../../htdocs/compta/recap-compta.php - - - message: '#^Variable \$builddate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/clientfourn.php - - message: '#^Variable \$description might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/compta/resultat/clientfourn.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/clientfourn.php - - - - message: '#^Variable \$period might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/clientfourn.php - - message: '#^Variable \$sql might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/compta/resultat/clientfourn.php - - - message: '#^Variable \$builddate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/index.php - - message: '#^Variable \$description might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/compta/resultat/index.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/index.php - - - - message: '#^Variable \$period might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/index.php - - - - message: '#^Variable \$periodlink might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/index.php - - message: '#^Variable \$sql might not be defined\.$#' identifier: variable.undefined - count: 6 + count: 5 path: ../../htdocs/compta/resultat/index.php - @@ -7566,18 +7086,6 @@ parameters: count: 1 path: ../../htdocs/compta/resultat/result.php - - - message: '#^Variable \$builddate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/result.php - - - - message: '#^Variable \$calcmode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/result.php - - message: '#^Variable \$code might not be defined\.$#' identifier: variable.undefined @@ -7590,18 +7098,6 @@ parameters: count: 1 path: ../../htdocs/compta/resultat/result.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/result.php - - - - message: '#^Variable \$period might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/resultat/result.php - - message: '#^Variable \$sommes in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -7812,30 +7308,12 @@ parameters: count: 1 path: ../../htdocs/compta/stats/cabyprodserv.php - - - message: '#^Variable \$builddate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/cabyprodserv.php - - - - message: '#^Variable \$calcmode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/cabyprodserv.php - - message: '#^Variable \$description might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/compta/stats/cabyprodserv.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/cabyprodserv.php - - message: '#^Variable \$searchCategorySocieteList in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -7866,30 +7344,12 @@ parameters: count: 1 path: ../../htdocs/compta/stats/cabyuser.php - - - message: '#^Variable \$builddate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/cabyuser.php - - - - message: '#^Variable \$calcmode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/cabyuser.php - - message: '#^Variable \$description might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/compta/stats/cabyuser.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/cabyuser.php - - message: '#^Variable \$sql might not be defined\.$#' identifier: variable.undefined @@ -7902,30 +7362,12 @@ parameters: count: 1 path: ../../htdocs/compta/stats/casoc.php - - - message: '#^Variable \$builddate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/casoc.php - - - - message: '#^Variable \$calcmode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/casoc.php - - message: '#^Variable \$description might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/compta/stats/casoc.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/casoc.php - - message: '#^Variable \$sql might not be defined\.$#' identifier: variable.undefined @@ -7944,18 +7386,6 @@ parameters: count: 1 path: ../../htdocs/compta/stats/index.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/index.php - - - - message: '#^Variable \$periodlink might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/index.php - - message: '#^Variable \$sql might not be defined\.$#' identifier: variable.undefined @@ -7974,18 +7404,6 @@ parameters: count: 1 path: ../../htdocs/compta/stats/supplier_turnover.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/supplier_turnover.php - - - - message: '#^Variable \$periodlink might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/supplier_turnover.php - - message: '#^Variable \$sql might not be defined\.$#' identifier: variable.undefined @@ -7998,30 +7416,12 @@ parameters: count: 1 path: ../../htdocs/compta/stats/supplier_turnover_by_prodserv.php - - - message: '#^Variable \$calcmode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/supplier_turnover_by_prodserv.php - - message: '#^Variable \$description might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/compta/stats/supplier_turnover_by_prodserv.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/supplier_turnover_by_prodserv.php - - - - message: '#^Variable \$q might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/supplier_turnover_by_prodserv.php - - message: '#^Variable \$result might not be defined\.$#' identifier: variable.undefined @@ -8052,24 +7452,12 @@ parameters: count: 1 path: ../../htdocs/compta/stats/supplier_turnover_by_thirdparty.php - - - message: '#^Variable \$calcmode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/supplier_turnover_by_thirdparty.php - - message: '#^Variable \$description might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/compta/stats/supplier_turnover_by_thirdparty.php - - - message: '#^Variable \$name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/stats/supplier_turnover_by_thirdparty.php - - message: '#^Variable \$result might not be defined\.$#' identifier: variable.undefined @@ -8100,18 +7488,6 @@ parameters: count: 1 path: ../../htdocs/compta/tva/card.php - - - message: '#^Variable \$accountline might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/compta/tva/card.php - - - - message: '#^Variable \$resteapayer might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/compta/tva/card.php - - message: '#^Property PaymentVAT\:\:\$amount \(float\|int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -8250,12 +7626,6 @@ parameters: count: 8 path: ../../htdocs/compta/tva/clients.php - - - message: '#^Variable \$my_coll_thirdpartyid might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/compta/tva/clients.php - - message: '#^Variable \$year_current might not be defined\.$#' identifier: variable.undefined @@ -8328,12 +7698,6 @@ parameters: count: 1 path: ../../htdocs/compta/tva/quadri_detail.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/compta/tva/quadri_detail.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -8598,12 +7962,6 @@ parameters: count: 1 path: ../../htdocs/contact/consumption.php - - - message: '#^Variable \$documentstaticline might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/contact/consumption.php - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -8826,12 +8184,6 @@ parameters: count: 1 path: ../../htdocs/contrat/class/contrat.class.php - - - message: '#^Property CommonObject\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/contrat/class/contrat.class.php - - message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -9054,12 +8406,6 @@ parameters: count: 1 path: ../../htdocs/contrat/tpl/linkedobjectblock.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/actions_addupdatedelete.inc.php - - message: '#^Loose comparison using \=\= between 1 and 0 will always evaluate to false\.$#' identifier: equal.alwaysFalse @@ -9210,12 +8556,6 @@ parameters: count: 2 path: ../../htdocs/core/actions_massactions.inc.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 2 - path: ../../htdocs/core/actions_massactions.inc.php - - message: '#^Expression "\<\<\<''EOPHAN''…" on a separate line does not do anything\.$#' identifier: expr.resultUnused @@ -9288,12 +8628,6 @@ parameters: count: 2 path: ../../htdocs/core/actions_massactions.inc.php - - - message: '#^Variable \$pagecount might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/actions_massactions.inc.php - - message: '#^Variable \$permissiontoadd might not be defined\.$#' identifier: variable.undefined @@ -9336,12 +8670,6 @@ parameters: count: 1 path: ../../htdocs/core/actions_sendmails.inc.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/actions_sendmails.inc.php - - message: '#^Parameter \#1 \$filenb of function dol_remove_file_process expects int, array\\|string given\.$#' identifier: argument.type @@ -9378,12 +8706,6 @@ parameters: count: 1 path: ../../htdocs/core/actions_sendmails.inc.php - - - message: '#^Variable \$sendtosocid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/actions_sendmails.inc.php - - message: '#^Variable \$thirdparty might not be defined\.$#' identifier: variable.undefined @@ -9402,12 +8724,6 @@ parameters: count: 1 path: ../../htdocs/core/actions_setmoduleoptions.inc.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/actions_setmoduleoptions.inc.php - - message: '#^Variable \$modulepart might not be defined\.$#' identifier: variable.undefined @@ -9426,12 +8742,6 @@ parameters: count: 1 path: ../../htdocs/core/actions_setnotes.inc.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/ajax/ajaxdirpreview.php - - message: '#^Loose comparison using \=\= between ''directory'' and ''directory'' will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -9480,12 +8790,6 @@ parameters: count: 1 path: ../../htdocs/core/ajax/ajaxdirpreview.php - - - message: '#^Property User\:\:\$lastname \(string\) does not accept int\.$#' - identifier: assign.propertyType - count: 1 - path: ../../htdocs/core/ajax/ajaxdirtree.php - - message: '#^Variable \$action might not be defined\.$#' identifier: variable.undefined @@ -9498,12 +8802,6 @@ parameters: count: 2 path: ../../htdocs/core/ajax/ajaxdirtree.php - - - message: '#^Variable \$fullpathpreopened might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/ajax/ajaxdirtree.php - - message: '#^Variable \$module might not be defined\.$#' identifier: variable.undefined @@ -9600,12 +8898,6 @@ parameters: count: 1 path: ../../htdocs/core/ajax/selectobject.php - - - message: '#^Variable \$objecttmp might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/ajax/selectobject.php - - message: '#^Constructor of class box_accountancy_last_manual_entries has an unused parameter \$param\.$#' identifier: constructor.unusedParameter @@ -11130,12 +10422,6 @@ parameters: count: 4 path: ../../htdocs/core/class/ctyperesource.class.php - - - message: '#^Property CUnits\:\:\$scale \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 4 - path: ../../htdocs/core/class/cunits.class.php - - message: '#^Property CUnits\:\:\$short_label \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -11646,12 +10932,6 @@ parameters: count: 1 path: ../../htdocs/core/class/html.formorder.class.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/class/html.formother.class.php - - message: '#^Parameter \#3 \$zone of static method InfoBox\:\:listBoxes\(\) expects int, string given\.$#' identifier: argument.type @@ -12174,12 +11454,6 @@ parameters: count: 1 path: ../../htdocs/core/commonfieldsinexport.inc.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/commonfieldsinexport.inc.php - - message: '#^Variable \$r might not be defined\.$#' identifier: variable.undefined @@ -12252,12 +11526,6 @@ parameters: count: 2 path: ../../htdocs/core/customreports.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/customreports.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -12432,12 +11700,6 @@ parameters: count: 1 path: ../../htdocs/core/extrafieldsinexport.inc.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/extrafieldsinexport.inc.php - - message: '#^Variable \$conf might not be defined\.$#' identifier: variable.undefined @@ -13086,12 +12348,6 @@ parameters: count: 1 path: ../../htdocs/core/lib/project.lib.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 5 - path: ../../htdocs/core/lib/project.lib.php - - message: '#^Parameter \#1 \$inc of function projectLinesPerDay expects string, \(float\|int\) given\.$#' identifier: argument.type @@ -17844,12 +17100,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/admin_extrafields_view.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/advtarget.tpl.php - - message: '#^Variable \$id might not be defined\.$#' identifier: variable.undefined @@ -17880,12 +17130,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/bloc_showhide.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/card_presend.tpl.php - - message: '#^Variable \$action might not be defined\.$#' identifier: variable.undefined @@ -17988,12 +17232,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/contacts.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/contacts.tpl.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -18078,24 +17316,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/document_actions_post_headers.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/extrafields_add.tpl.php - - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 2 - path: ../../htdocs/core/tpl/extrafields_edit.tpl.php - - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/extrafields_list_array_fields.tpl.php - - message: '#^Variable \$object might not be defined\.$#' identifier: variable.undefined @@ -18270,12 +17490,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/filemanager.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/formlayoutai.tpl.php - - message: '#^Variable \$showlinktoai might not be defined\.$#' identifier: variable.undefined @@ -18312,24 +17526,6 @@ parameters: count: 2 path: ../../htdocs/core/tpl/list_print_total.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/login.tpl.php - - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/massactions_pre.tpl.php - - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/object_currency_amount.tpl.php - - message: '#^Variable \$action might not be defined\.$#' identifier: variable.undefined @@ -18450,12 +17646,6 @@ parameters: count: 4 path: ../../htdocs/core/tpl/objectline_create.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/objectline_edit.tpl.php - - message: '#^Variable \$buyer might not be defined\.$#' identifier: variable.undefined @@ -18510,12 +17700,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/objectline_title.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/objectline_view.tpl.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -18732,12 +17916,6 @@ parameters: count: 4 path: ../../htdocs/core/tpl/resource_add.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - message: '#^Variable \$db might not be defined\.$#' identifier: variable.undefined @@ -19062,12 +18240,6 @@ parameters: count: 1 path: ../../htdocs/cron/list.php - - - message: '#^Variable \$head might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/cron/list.php - - message: '#^Variable \$texttoshow might not be defined\.$#' identifier: variable.undefined @@ -20160,12 +19332,6 @@ parameters: count: 2 path: ../../htdocs/eventorganization/conferenceorboothattendee_list.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -21804,12 +20970,6 @@ parameters: count: 1 path: ../../htdocs/fourn/class/fournisseur.commande.class.php - - - message: '#^Property CommonObject\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/fourn/class/fournisseur.commande.class.php - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -22050,12 +21210,6 @@ parameters: count: 1 path: ../../htdocs/fourn/class/fournisseur.facture.class.php - - - message: '#^Property CommonObject\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/fourn/class/fournisseur.facture.class.php - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -22254,12 +21408,6 @@ parameters: count: 1 path: ../../htdocs/fourn/class/fournisseur.product.class.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/fourn/class/paiementfourn.class.php - - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue @@ -22332,12 +21480,6 @@ parameters: count: 1 path: ../../htdocs/fourn/commande/card.php - - - message: '#^Variable \$text might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/fourn/commande/card.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -22485,7 +21627,7 @@ parameters: - message: '#^Variable \$billed might not be defined\.$#' identifier: variable.undefined - count: 2 + count: 1 path: ../../htdocs/fourn/commande/list.php - @@ -22938,12 +22080,6 @@ parameters: count: 1 path: ../../htdocs/fourn/facture/rapport.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php - - message: '#^Variable \$object might not be defined\.$#' identifier: variable.undefined @@ -23820,12 +22956,6 @@ parameters: count: 2 path: ../../htdocs/hrm/core/tpl/objectline_view.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/hrm/core/tpl/skilldet.fiche.tpl.php - - message: '#^Variable \$colwidth might not be defined\.$#' identifier: variable.undefined @@ -24078,12 +23208,6 @@ parameters: count: 1 path: ../../htdocs/hrm/skill_tab.php - - - message: '#^Variable \$head might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/hrm/skill_tab.php - - message: '#^Variable \$object might not be defined\.$#' identifier: variable.undefined @@ -24993,7 +24117,7 @@ parameters: - message: '#^Variable \$groupby might not be defined\.$#' identifier: variable.undefined - count: 2 + count: 1 path: ../../htdocs/intracommreport/list.php - @@ -25152,48 +24276,6 @@ parameters: count: 1 path: ../../htdocs/knowledgemanagement/knowledgerecord_list.php - - - message: '#^Variable \$staytopay might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/loan/card.php - - - - message: '#^Call to function method_exists\(\) with \$this\(Loan\) and ''LibStatut'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/loan/class/loan.class.php - - - - message: '#^Call to function method_exists\(\) with \$this\(Loan\) and ''getNomUrl'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/loan/class/loan.class.php - - - - message: '#^Call to function property_exists\(\) with \$this\(Loan\) and ''capital'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/loan/class/loan.class.php - - - - message: '#^Call to function property_exists\(\) with \$this\(Loan\) and ''dateend'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/loan/class/loan.class.php - - - - message: '#^Call to function property_exists\(\) with \$this\(Loan\) and ''datestart'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/loan/class/loan.class.php - - - - message: '#^Parameter \#2 \$alreadypaid of method Loan\:\:getLibStatut\(\) expects int, float given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/loan/class/loan.class.php - - message: '#^Property Loan\:\:\$account_capital \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -25338,36 +24420,6 @@ parameters: count: 3 path: ../../htdocs/loan/class/paymentloan.class.php - - - message: '#^Variable \$maxlength might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/loan/document.php - - - - message: '#^Variable \$morehtmlright might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/loan/document.php - - - - message: '#^Variable \$search_all might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/loan/list.php - - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/loan/note.php - - - - message: '#^Variable \$maxlength might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/loan/note.php - - message: '#^Variable \$object might not be defined\.$#' identifier: variable.undefined @@ -25416,12 +24468,6 @@ parameters: count: 4 path: ../../htdocs/loan/payment/payment.php - - - message: '#^Variable \$maxlength might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/loan/schedule.php - - message: '#^Variable \$result might not be defined\.$#' identifier: variable.undefined @@ -25656,12 +24702,6 @@ parameters: count: 2 path: ../../htdocs/master.inc.php - - - message: '#^Variable \$head might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/modulebuilder/admin/setup.php - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -27276,12 +26316,6 @@ parameters: count: 1 path: ../../htdocs/partnership/partnership_card.php - - - message: '#^Variable \$upload_dir might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/partnership/partnership_document.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -27402,12 +26436,6 @@ parameters: count: 1 path: ../../htdocs/product/admin/product_tools.php - - - message: '#^Variable \$arrayresult might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/ajax/products.php - - message: '#^Property ActionsCardProduct\:\:\$field_list has no type specified\.$#' identifier: missingType.property @@ -27792,36 +26820,18 @@ parameters: count: 1 path: ../../htdocs/product/class/product.class.php - - - message: '#^Property Product\:\:\$type \(int\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../htdocs/product/class/product.class.php - - message: '#^Result of && is always true\.$#' identifier: booleanAnd.alwaysTrue count: 1 path: ../../htdocs/product/class/product.class.php - - - message: '#^Result of \|\| is always true\.$#' - identifier: booleanOr.alwaysTrue - count: 1 - path: ../../htdocs/product/class/product.class.php - - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue count: 1 path: ../../htdocs/product/class/product.class.php - - - message: '#^Strict comparison using \!\=\= between mixed~\(0\.0\|''''\|''0''\|array\{\}\|false\|null\) and '''' will always evaluate to true\.$#' - identifier: notIdentical.alwaysTrue - count: 1 - path: ../../htdocs/product/class/product.class.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -27834,24 +26844,12 @@ parameters: count: 1 path: ../../htdocs/product/class/product.class.php - - - message: '#^Variable \$prodDurationHours might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/class/product.class.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue count: 1 path: ../../htdocs/product/class/productbatch.class.php - - - message: '#^Property CommonObject\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 3 - path: ../../htdocs/product/class/productbatch.class.php - - message: '#^Property Productbatch\:\:\$batch \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -27882,12 +26880,6 @@ parameters: count: 6 path: ../../htdocs/product/class/productcustomerprice.class.php - - - message: '#^Property CommonObject\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 4 - path: ../../htdocs/product/class/productcustomerprice.class.php - - message: '#^Property ProductCustomerPrice\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -28038,12 +27030,6 @@ parameters: count: 3 path: ../../htdocs/product/class/propalmergepdfproduct.class.php - - - message: '#^Property CommonObject\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../htdocs/product/class/propalmergepdfproduct.class.php - - message: '#^Property Propalmergepdfproduct\:\:\$file_name \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -28365,7 +27351,7 @@ parameters: - message: '#^Variable \$type might not be defined\.$#' identifier: variable.undefined - count: 6 + count: 1 path: ../../htdocs/product/reassort.php - @@ -28395,7 +27381,7 @@ parameters: - message: '#^Variable \$type might not be defined\.$#' identifier: variable.undefined - count: 6 + count: 1 path: ../../htdocs/product/reassortlot.php - @@ -28518,24 +27504,6 @@ parameters: count: 1 path: ../../htdocs/product/stats/facturerec.php - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/product/stats/mo.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stats/mo.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stats/mo.php - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -28968,12 +27936,6 @@ parameters: count: 3 path: ../../htdocs/product/stock/movement_card.php - - - message: '#^Variable \$optioncss might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/product/stock/movement_card.php - - message: '#^Variable \$result1 might not be defined\.$#' identifier: variable.undefined @@ -29190,30 +28152,12 @@ parameters: count: 1 path: ../../htdocs/product/stock/productlot_card.php - - - message: '#^Variable \$batch might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/productlot_document.php - - - - message: '#^Variable \$productid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/productlot_document.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 1 path: ../../htdocs/product/stock/productlot_list.php - - - message: '#^Variable \$show_files might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/productlot_list.php - - message: '#^Variable \$draftchecked in isset\(\) always exists and is not nullable\.$#' identifier: isset.variable @@ -29238,114 +28182,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/replenishorders.php - - - message: '#^Variable \$morehtmlref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/commande_fournisseur.php - - - - message: '#^Variable \$option might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/commande_fournisseur.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/commande_fournisseur.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/commande_fournisseur.php - - - - message: '#^Variable \$morehtmlref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/expedition.php - - - - message: '#^Variable \$option might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/expedition.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/expedition.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/expedition.php - - - - message: '#^Variable \$batch might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$morehtmlref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$objectid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$socid might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$morehtmlref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/reception.php - - - - message: '#^Variable \$option might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/reception.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/reception.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/reception.php - - message: '#^Variable \$nbofmovement might not be defined\.$#' identifier: variable.undefined @@ -29454,18 +28290,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/stocktransfer/stocktransfer_card.php - - - message: '#^Variable \$sortfield might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../htdocs/product/stock/stocktransfer/stocktransfer_card.php - - - - message: '#^Variable \$sortorder might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../htdocs/product/stock/stocktransfer/stocktransfer_card.php - - message: '#^Variable \$text might not be defined\.$#' identifier: variable.undefined @@ -29502,24 +28326,12 @@ parameters: count: 1 path: ../../htdocs/product/stock/stocktransfer/stocktransfer_list.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/product/stock/tpl/extrafields_add.tpl.php - - message: '#^Variable \$extrafields might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/product/stock/tpl/extrafields_add.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' identifier: argument.type @@ -29544,12 +28356,6 @@ parameters: count: 2 path: ../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/product/stock/tpl/stocktransfer.tpl.php - - message: '#^Variable \$object might not be defined\.$#' identifier: variable.undefined @@ -30456,18 +29262,6 @@ parameters: count: 1 path: ../../htdocs/projet/tasks/comment.php - - - message: '#^Variable \$mode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/projet/tasks/comment.php - - - - message: '#^Variable \$socid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/projet/tasks/comment.php - - message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -31266,12 +30060,6 @@ parameters: count: 1 path: ../../htdocs/public/payment/newpayment.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/public/payment/newpayment.php - - message: '#^Parameter \#1 \$paymentAmount of function print_paypal_redirect expects float, string given\.$#' identifier: argument.type @@ -31758,18 +30546,6 @@ parameters: count: 2 path: ../../htdocs/public/test/test_arrays.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/public/test/test_arrays.php - - - - message: '#^Variable \$dolibarr_main_prod might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/public/test/test_arrays.php - - message: '#^Variable \$filter might not be defined\.$#' identifier: variable.undefined @@ -31782,30 +30558,12 @@ parameters: count: 1 path: ../../htdocs/public/test/test_arrays.php - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/public/test/test_arrays.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 24 - path: ../../htdocs/public/test/test_arrays.php - - message: '#^Variable \$moreforfilter in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 1 path: ../../htdocs/public/test/test_arrays.php - - - message: '#^Variable \$optioncss might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/public/test/test_arrays.php - - message: '#^Variable \$param might not be defined\.$#' identifier: variable.undefined @@ -32112,24 +30870,6 @@ parameters: count: 1 path: ../../htdocs/public/website/styles.css.php - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/public/website/styles.css.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/public/website/styles.css.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/public/website/styles.css.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -33666,12 +32406,6 @@ parameters: count: 1 path: ../../htdocs/societe/ajax/company.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/societe/canvas/actions_card_common.class.php - - message: '#^Variable \$canvas might not be defined\.$#' identifier: variable.undefined @@ -34326,12 +33060,6 @@ parameters: count: 14 path: ../../htdocs/societe/price.php - - - message: '#^Variable \$extralabels might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/societe/price.php - - message: '#^Variable \$prodcustprice might not be defined\.$#' identifier: variable.undefined @@ -34914,12 +33642,6 @@ parameters: count: 3 path: ../../htdocs/takepos/pay.php - - - message: '#^Variable \$servicestatus might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/takepos/pay.php - - message: '#^Variable \$stripeacc might not be defined\.$#' identifier: variable.undefined @@ -34980,12 +33702,6 @@ parameters: count: 2 path: ../../htdocs/takepos/split.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/theme/eldy/badges.inc.php - - message: '#^Variable \$fontlist might not be defined\.$#' identifier: variable.undefined @@ -35040,12 +33756,6 @@ parameters: count: 1 path: ../../htdocs/theme/eldy/dropdown.inc.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/theme/eldy/global.inc.php - - message: '#^Parameter \#2 \$steps of function colorAdjustBrightness expects int, string given\.$#' identifier: argument.type @@ -35112,24 +33822,12 @@ parameters: count: 1 path: ../../htdocs/theme/eldy/progress.inc.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/theme/eldy/style.css.php - - message: '#^Variable \$menumanager might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/theme/eldy/style.css.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/theme/md/badges.inc.php - - message: '#^Variable \$badgeDanger might not be defined\.$#' identifier: variable.undefined @@ -35292,12 +33990,6 @@ parameters: count: 1 path: ../../htdocs/theme/md/progress.inc.php - - - message: '#^Expression "''…" on a separate line does not do anything\.$#' - identifier: expr.resultUnused - count: 1 - path: ../../htdocs/theme/md/style.css.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -37590,54 +36282,18 @@ parameters: count: 1 path: ../../scripts/product/migrate_picture_path.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../scripts/product/migrate_picture_path.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/product/migrate_picture_path.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/product/migrate_picture_path.php - - message: '#^Result of \|\| is always false\.$#' identifier: booleanOr.alwaysFalse count: 1 path: ../../scripts/product/regenerate_thumbs.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/product/regenerate_thumbs.php - - message: '#^Variable \$dir in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 1 path: ../../scripts/product/regenerate_thumbs.php - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/product/regenerate_thumbs.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/product/regenerate_thumbs.php - - message: '#^Variable \$subdir in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -37650,44 +36306,8 @@ parameters: count: 1 path: ../../scripts/user/migrate_picture_path.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../scripts/user/migrate_picture_path.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/user/migrate_picture_path.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/user/migrate_picture_path.php - - - - message: '#^Variable \$user might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../scripts/user/sync_groups_dolibarr2ldap.php - - - - message: '#^Variable \$user might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../scripts/user/sync_users_dolibarr2ldap.php - - message: '#^Unable to resolve the template type T in call to function array_values$#' identifier: argument.templateType count: 1 path: ../../scripts/user/sync_users_ldap2dolibarr.php - - - - message: '#^Variable \$user might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../scripts/user/sync_users_ldap2dolibarr.php diff --git a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql index c6d16c22e45..f94c3238db3 100644 --- a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql @@ -1150,7 +1150,7 @@ CREATE TABLE `llx_c_field_list` ( LOCK TABLES `llx_c_field_list` WRITE; /*!40000 ALTER TABLE `llx_c_field_list` DISABLE KEYS */; -INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'$conf->barcode->enabled',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'$conf->stock->enabled',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8); +INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'isModEnabled("barcode")',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'isModEnabled("stock")',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8); /*!40000 ALTER TABLE `llx_c_field_list` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 79549d03b3f..b6fd7ed4adb 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -149,7 +149,7 @@ $phpstanversion = $output_arrtd[0]; $output_arrtd = array(); if ($dirphpstan != 'disabled') { - $commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github'; + $commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github -c ~/preview.dolibarr.org/dolibarr/phpstan.v1.neon'; print 'Execute PHPStan to get the technical debt: '.$commandcheck."\n"; $resexectd = 0; exec($commandcheck, $output_arrtd, $resexectd); diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 85e1a4e33c7..209abe87e07 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -10,31 +10,31 @@ return [ // # Issue statistics: // PhanUndeclaredProperty : 560+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 500+ occurrences - // PhanUndeclaredGlobalVariable : 350+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 270+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 370+ occurrences + // PhanUndeclaredGlobalVariable : 300+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 230+ occurrences // PhanPluginUnknownArrayMethodReturnType : 180+ occurrences // PhanTypeMismatchProperty : 140+ occurrences // PhanPluginUnknownPropertyType : 130+ occurrences // PhanPluginUnknownArrayMethodParamType : 120+ occurrences // PhanPossiblyUndeclaredVariable : 110+ occurrences - // PhanPluginUndeclaredVariableIsset : 65+ occurrences + // PhanPluginUndeclaredVariableIsset : 60+ occurrences // PhanRedefineFunction : 45+ occurrences // PhanTypeExpectedObjectPropAccess : 45+ occurrences - // PhanTypeMismatchArgumentNullableInternal : 45+ occurrences - // PhanTypeInvalidDimOffset : 35+ occurrences - // PhanPluginEmptyStatementIf : 30+ occurrences + // PhanTypeMismatchArgumentNullableInternal : 40+ occurrences + // PhanTypeInvalidDimOffset : 30+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences + // PhanPluginEmptyStatementIf : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences - // PhanEmptyForeach : 10+ occurrences // PhanPluginUnknownObjectMethodCall : 10+ occurrences - // PhanTypeArraySuspiciousNull : 10+ occurrences // PhanTypeComparisonFromArray : 10+ occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences // PhanUndeclaredMethod : 10+ occurrences - // PhanPluginBothLiteralsBinaryOp : 8 occurrences + // PhanEmptyForeach : 9 occurrences + // PhanPluginBothLiteralsBinaryOp : 7 occurrences // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences // PhanPluginSuspiciousParamPosition : 7 occurrences + // PhanTypeArraySuspiciousNull : 7 occurrences // PhanPossiblyNullTypeMismatchProperty : 5 occurrences // PhanParamTooMany : 4 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences @@ -108,85 +108,36 @@ return [ 'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/various_payment/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], - 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchProperty'], - 'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/deplacement/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginEmptyStatementIf'], 'htdocs/compta/facture/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/facture/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/invoicetemplate_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/prelevement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/tpl/linkedobjectblock.tpl.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/journal/purchasesjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/journal/sellsjournal.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/localtax/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/localtax/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/localtax/index.php' => ['PhanRedefineFunction'], + 'htdocs/compta/localtax/card.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/compta/localtax/clients.php' => ['PhanTypeExpectedObjectPropAccess'], 'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/compta/paiement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetch'], - 'htdocs/compta/paiement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/compta/paiement/cheque/card.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/compta/paiement.php' => ['PhanTypeMismatchDimFetch'], + 'htdocs/compta/paiement/card.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/paiement_charge.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/paiement_vat.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/payment_vat/card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/compta/prelevement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/prelevement/demandes.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/prelevement/factures.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/prelevement/line.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/prelevement/orders_list.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/compta/prelevement/stats.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/resultat/clientfourn.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/resultat/index.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/resultat/result.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/sociales/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/compta/sociales/list.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/compta/sociales/payments.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/stats/byratecountry.php' => ['PhanPluginEmptyStatementIf'], - 'htdocs/compta/stats/cabyprodserv.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/stats/cabyuser.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/stats/casoc.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/stats/supplier_turnover.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/stats/supplier_turnover_by_prodserv.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/stats/supplier_turnover_by_thirdparty.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/tva/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/tva/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/tva/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'], 'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'], - 'htdocs/contact/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/contact/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/contact/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contact/perso.php' => ['PhanTypeMismatchProperty'], 'htdocs/contrat/agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/contrat/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/contrat/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/contrat/messaging.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/contrat/services_list.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/actions_comments.inc.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/core/actions_lineupdown.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/actions_linkedfiles.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/actions_massactions.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], + 'htdocs/core/actions_massactions.inc.php' => ['PhanUndeclaredProperty'], 'htdocs/core/actions_printing.inc.php' => ['PhanUndeclaredProperty'], 'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/actions_setmoduleoptions.inc.php' => ['PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/ajax/ajaxdirpreview.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/ajax/selectobject.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/ajax/selectsearchbox.php' => ['PhanPluginUndeclaredVariableIsset'], + 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/boxes/box_actions.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_actions_future.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_external_rss.php' => ['PhanPluginUnknownPropertyType'], @@ -300,7 +251,6 @@ return [ 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'], 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/bloc_comment.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/commonfields_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/core/tpl/document_actions_post_headers.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/extrafields_edit.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], @@ -439,10 +389,9 @@ return [ 'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/loan/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/loan/document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/loan/note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/loan/document.php' => ['PhanUndeclaredProperty'], + 'htdocs/loan/note.php' => ['PhanUndeclaredProperty'], 'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/loan/schedule.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/margin/customerMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/margin/productMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/master.inc.php' => ['PhanUndeclaredGlobalVariable'], @@ -555,7 +504,6 @@ return [ 'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/public/test/test_forms.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'], 'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'], @@ -599,7 +547,7 @@ return [ 'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], - 'htdocs/societe/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/societe/price.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition'], @@ -640,7 +588,6 @@ return [ 'htdocs/user/class/api_users.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/user/class/user.class.php' => ['PhanUndeclaredProperty'], 'htdocs/user/class/usergroup.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/user/param_ihm.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/variants/ajax/get_attribute_values.php' => ['PhanTypeComparisonFromArray'], 'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 77f3fb2f042..8b1eebb24c3 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -71,9 +71,10 @@ $permissiontodelete = $user->hasRight('accounting', 'chartofaccount'); if ($user->socid > 0) { accessforbidden(); } -if (!$user->hasRight('accounting', 'chartofaccount')) { +if (!$permissiontoadd) { accessforbidden(); } +// now $permissiontoadd or $user->hasRight('accounting', 'chartofaccount') are always equal to 1 // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; @@ -162,7 +163,7 @@ if (empty($reshook)) { || (GETPOSTINT('chartofaccounts') > 0 && GETPOSTINT('chartofaccounts') != getDolGlobalInt('CHARTOFACCOUNTS'))) { // a submit of form is done and chartofaccounts combo has been modified $error = 0; - if ($chartofaccounts > 0 && $permissiontoadd) { + if ($chartofaccounts > 0 /* && $permissiontoadd */) { $country_code = ''; // Get language code for this $chartofaccounts $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a'; @@ -209,7 +210,7 @@ if (empty($reshook)) { } } - if ($action == 'disable' && $permissiontoadd) { + if ($action == 'disable' /* && $permissiontoadd */) { if ($accounting->fetch($id)) { $mode = GETPOSTINT('mode'); $result = $accounting->accountDeactivate($id, $mode); @@ -219,7 +220,7 @@ if (empty($reshook)) { } $action = 'update'; - } elseif ($action == 'enable' && $permissiontoadd) { + } elseif ($action == 'enable' /* && $permissiontoadd */) { if ($accounting->fetch($id)) { $mode = GETPOSTINT('mode'); $result = $accounting->accountActivate($id, $mode); @@ -350,7 +351,8 @@ if ($resql) { $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + // if null contextpage is forced to 'accountingaccountlist' so never empty + if (/* !empty($contextpage) && */$contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { @@ -398,9 +400,9 @@ if ($resql) { // List of mass actions available $arrayofmassactions = array(); - if ($user->hasRight('accounting', 'chartofaccount')) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); - } + // if ($permissiontoadd) { // test is always true + $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + // } if (in_array($massaction, array('presend', 'predelete', 'closed'))) { $arrayofmassactions = array(); } @@ -471,20 +473,21 @@ if ($resql) { $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); - $moreforfilter = ''; - if ($moreforfilter) { - print '
'; - print $moreforfilter; - print '
'; - } - $accountstatic = new AccountingAccount($db); $accountparent = new AccountingAccount($db); $totalarray = array(); $totalarray['nbfield'] = 0; + $moreforfilter = ''; + // if ($moreforfilter) { + // print '
'; + // print $moreforfilter; + // print '
'; + // } + print '
'; - print ''."\n"; + // print '
'."\n"; + print '
'."\n"; // Fields title search // -------------------------------------------------------------------- @@ -623,7 +626,7 @@ if ($resql) { // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''."\n"; if (!$i) { $totalarray['nbfield']++; @@ -779,7 +782,7 @@ if ($resql) { // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''."\n"; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 0bf41cf2e42..d71dc306478 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -775,10 +775,11 @@ class AccountancyCategory // extends CommonObject * * @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups * @param int $active 1= active, 0=not active + * @param int $id_report id of the report * @return never|array|int Array of groups or -1 if error * @see getCatsCpts(), getCptsCat() */ - public function getCats($categorytype = -1, $active = 1) + public function getCats($categorytype = -1, $active = 1, $id_report = 1) { global $conf, $mysoc; @@ -790,6 +791,7 @@ class AccountancyCategory // extends CommonObject $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens"; $sql .= " FROM ".$this->db->prefix().$this->table_element." as c"; $sql .= " WHERE c.active = " . (int) $active; + $sql .= " AND c.fk_report=".((int) $id_report); $sql .= " AND c.entity = ".$conf->entity; if ($categorytype >= 0) { $sql .= " AND c.category_type = 1"; diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index 980779ff254..8fdbd1a300c 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -1,9 +1,9 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2023 Frédéric France - * Copyright (C) 2024 Alexandre Janniaux +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2023-2024 Frédéric France + * Copyright (C) 2024 Alexandre Janniaux * * 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/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 63ec5e4c772..fb48539e467 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -626,7 +626,9 @@ class Adherent extends CommonObject $now = dol_now(); // Clean parameters - $this->import_key = trim($this->import_key); + if (isset($this->import_key)) { + $this->import_key = trim($this->import_key); + } // Check parameters if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail($this->email)) { diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 26fb38c0562..e7b26e6a3d2 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -689,6 +689,12 @@ class Members extends DolibarrApi throw new RestException(403); } + $member = new Adherent($this->db); + $result = $member->fetch($id); + if (0 === $result) { + throw new RestException(404, 'Member not found'); + } + $categories = new Categorie($this->db); $result = $categories->getListForItem($id, 'member', $sortfield, $sortorder, $limit, $page); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index bc86a13d033..05f86c5989d 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -136,6 +136,13 @@ if ($conf->use_javascript_ajax) { $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), $sumMembers['total']['members_excluded']); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), $sumMembers['total']['members_resiliated']); + /** + * @var string $badgeStatus0 + * @var string $badgeStatus1 + * @var string $badgeStatus4 + * @var string $badgeStatus6 + * @var string $badgeStatus8 + */ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 9ce6cbdf83e..c6aad6f2e1c 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -390,7 +390,7 @@ foreach ($dirmodels as $reldir) { // Default print '
'; - if ($user->hasRight('accounting', 'chartofaccount')) { + // if ($permissiontoadd) { // test is always true print ''; print img_edit(); print ''; @@ -632,14 +635,14 @@ if ($resql) { print img_delete(); print ''; print ' '; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; - } - print ''; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; } + print ''; } + // } print ''; - if ($user->hasRight('accounting', 'chartofaccount')) { + // if ($permissiontoadd) { // test is always true print ''; print img_edit(); print ''; @@ -788,14 +791,14 @@ if ($resql) { print img_delete(); print ''; print ' '; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; - } - print ''; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; } + print ''; } + // } print ''; - if ($conf->global->BANKADDON_PDF == $name) { + if (getDolGlobalString('BANKADDON_PDF') == $name) { print img_picto($langs->trans("Default"), 'on'); } else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; @@ -499,13 +499,13 @@ print load_fiche_titre($langs->trans("Other"), '', ''); print '
'; print ''."\n"; print ''."\n"; -print ''; -print ''; -print '\n"; +print ''; +print "\n"; print "\n"; +// Disable direct input print ''; -print ''; +print ''; if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) { print ''; -print ''; // Active @@ -539,10 +538,9 @@ print "\n"; // Allow SEPA Mandate OnLine Sign if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT')) { print ''; - print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index d850d5f6eb3..f60f8cb8d44 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -540,14 +540,18 @@ print ''; print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index f18c2c4b7bd..45c74c98523 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -487,7 +487,7 @@ print ''; print ''; print ''; print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Parameter").'
'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").''.$langs->trans("BANK_DISABLE_DIRECT_INPUT").''; print img_picto($langs->trans("Activated"), 'switch_on'); @@ -517,9 +517,8 @@ if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) { } print '
'; -print $langs->trans('AccountStatement'); -print "\n"; +// Autofill bank statement +print '
'."\n"; print $langs->trans('AutoReportLastAccountStatement'); print '
'.$langs->trans("AllowOnLineSign").''.$langs->trans("AllowOnLineSignDesc").''.$form->textwithpicto($langs->trans("AllowOnLineSign"), $langs->trans("AllowOnLineSignDesc")).''; - print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1); + print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature")); print '
'.$langs->trans("AllowOnlineSign").''; -if (getDolGlobalString('CONTRACT_ALLOW_ONLINESIGN')) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('CONTRACT_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature")); } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; + if (getDolGlobalString('CONTRACT_ALLOW_ONLINESIGN')) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } } print '
'.$langs->trans("AllowOnLineSign"); print ''; -print ajax_constantonoff('EXPEDITION_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1); +print ajax_constantonoff('EXPEDITION_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature")); print '
'; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index aff41e9c1cd..6f79d58551a 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -496,6 +496,9 @@ if (empty($reshook)) { if ($field == 'content_lines') { $_POST['content_lines'] = GETPOST('content_lines-'.$rowid, 'restricthtml'); } + if ($field == 'email_from') { + $_POST['email_from'] = GETPOST('email_from-'.$rowid, 'restricthtml'); + } if ($i) { $sql .= ", "; @@ -1138,6 +1141,10 @@ if ($num) { if (getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) { $fieldsforcontent[] = 'content_lines'; } + + $parameters = array('fieldsforcontent' => &$fieldsforcontent, 'tabname' => $tabname[$id]); + $hookmanager->executeHooks('editEmailTemplateFieldsForContent', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + foreach ($fieldsforcontent as $tmpfieldlist) { $showfield = 1; $css = "left"; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 9e91aac4327..6b6faa7d481 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; require_once DOL_DOCUMENT_ROOT.'/admin/remotestore/class/dolistore.class.php'; ' @@ -745,7 +746,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter = '
'; $moreforfilter .= '
'; - print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), ''); + print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'); @@ -259,7 +259,7 @@ if (isModEnabled('order')) { print ''; print ''; print ''; print ''; print ''; print ''; print ''; @@ -718,35 +718,21 @@ print '
'; - -/* - * Directory - */ -print '
'; -print load_fiche_titre($langs->trans("PathToDocuments"), '', ''); - -print "
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; - print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), ''); + print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER'); @@ -373,7 +373,7 @@ if (isModEnabled('invoice')) { print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; - print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), ''); + print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE'); diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 09ddd0877ae..5b68c10a838 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -677,7 +677,7 @@ print '
'.$langs->trans("AllowOnLineSign").''; -print ajax_constantonoff('PROPOSAL_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1); +print ajax_constantonoff('PROPOSAL_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature")); print '
\n"; -print "\n"; -print " \n"; -print " \n"; -print "\n"; -print "\n \n \n\n"; print "
".$langs->trans("Name")."".$langs->trans("Value")."
".$langs->trans("PathDirectory")."".$conf->propal->multidir_output[$conf->entity]."
\n
"; +print '

'; + + /* - * Notifications + * Other */ -print load_fiche_titre($langs->trans("Notifications"), '', ''); print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; -print '\n \n \n\n"; + +print '\n"; diff --git a/htdocs/admin/remotestore/ajax/image.php b/htdocs/admin/remotestore/ajax/image.php index c32791685fa..b78bab01011 100644 --- a/htdocs/admin/remotestore/ajax/image.php +++ b/htdocs/admin/remotestore/ajax/image.php @@ -1,7 +1,7 @@ . - * Copyright (C) 2008-2011 Laurent Destailleur - * Copyright (C) 2020 Frédéric France +/* Copyright (C) 2017 Oscss-Shop . + * Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2020-2024 Frédéric France * * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); * it under the terms of the GNU General Public License as published bypliance with the License. diff --git a/htdocs/admin/tools/ui/class/documentation.class.php b/htdocs/admin/tools/ui/class/documentation.class.php index f7f00b5dc52..584f6c36a7f 100644 --- a/htdocs/admin/tools/ui/class/documentation.class.php +++ b/htdocs/admin/tools/ui/class/documentation.class.php @@ -26,7 +26,6 @@ */ class Documentation { - /** * Views * @@ -206,7 +205,7 @@ class Documentation */ public function docFooter() { - global $conf, $langs; + global $langs; // DIV FOR SCROLL ANIMATION print '
'; @@ -320,9 +319,6 @@ class Documentation */ public function showSummary($showsubmenu = 1, $showsubmenu_summary = 1) { - - global $langs; - $i = 0; if (!empty($this->view)) : // On se place au bon niveau diff --git a/htdocs/admin/tools/ui/content/tables.php b/htdocs/admin/tools/ui/content/tables.php index a39ac89d44b..00fd9bbf666 100644 --- a/htdocs/admin/tools/ui/content/tables.php +++ b/htdocs/admin/tools/ui/content/tables.php @@ -62,7 +62,7 @@ $documentation->showSidebar(); ?>

trans('DocTableTitle'); ?>

-

trans('DocTableMainDescription'); ?>

+

trans('Description'); ?>

showSummary(); ?> @@ -70,37 +70,37 @@ $documentation->showSidebar(); ?>
-

trans('DocTableBasic'); ?>

+

Table with a title line

trans('DocTableBasicDescription'); ?>

-
'.$langs->trans("Parameter").' 
'; +print "
".$langs->trans("PathToDocuments")."".$conf->propal->multidir_output[$conf->entity]."
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print '
'; print "
+
- + - + - + - + @@ -115,15 +115,15 @@ $documentation->showSidebar(); ?> echo $documentation->showCode($lines); ?> - +
-

trans('DocTableWithFilters'); ?>

+

Table with a filter line and title line

trans('DocTableWithFiltersDescription'); ?>

-
First Name Last Name Age Country
John Doe 37 U.S.A
Jack Sparrow 29 Caribbean
Sacha Ketchum 16 Kanto
Albert Einstein 72
+
@@ -136,25 +136,25 @@ $documentation->showSidebar(); ?> - + - + - + - + @@ -170,6 +170,48 @@ $documentation->showSidebar(); ?> + +
+ +

Table with no filter, no title line

+ +

trans('Description'); ?>

+
+
+
Age Country
John Doe 37 U.S.A
Jack Sparrow 29 Caribbean
Sacha Ketchum 16 Kanto
Albert Einstein 72
+ + + + + + + + + + + + + + + + + + + + + + + + +
JohnDoe37U.S.A
JackSparrow29Caribbean
SachaKetchum16Kanto
AlbertEinstein72Germany
+ + + showCode($lines); ?> + + diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 51fcb84f201..bbc06499e6e 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -148,12 +148,14 @@ $head = user_admin_prepare_head(); print dol_get_fiche_head($head, 'card', $langs->trans("MenuUsersAndGroups"), -1, 'user'); +print '
'; + print '
'; print ''; print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; print ''; diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 204ba843373..ca2060ac4b2 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -882,6 +882,10 @@ class Asset extends CommonObject return -1; } + if (! empty($this->not_depreciated)) { + return 1; + } + // Get depreciation options //--------------------------- require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php'; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index c39d6eb47f5..1f2442e2418 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -94,7 +94,8 @@ class AssetModel extends CommonObject public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1), - 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2', 'validate' => 1,), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'position' => 25, 'notnull' => 0, 'visible' => 0), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,), 'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetTypeIntangible', 1 => 'AssetTypeTangible', 2 => 'AssetTypeInProgress', 3 => 'AssetTypeFinancial'), 'validate' => 1,), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 300, 'notnull' => 0, 'visible' => 0, 'validate' => 1,), 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 301, 'notnull' => 0, 'visible' => 0, 'validate' => 1,), diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index f0d3e729791..1483c1b7790 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -484,7 +484,9 @@ class Categorie extends CommonObject $this->description = trim($this->description); $this->color = trim($this->color); $this->position = (int) $this->position; - $this->import_key = trim($this->import_key); + if (isset($this->import_key)) { + $this->import_key = trim($this->import_key); + } $this->ref_ext = trim($this->ref_ext); if (empty($this->visible)) { $this->visible = 0; @@ -1103,7 +1105,7 @@ class Categorie extends CommonObject return -1; } if (!count($categories)) { - return 0; + return []; } return $categories; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index c45c5f016e9..211e2d1f7b4 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -634,7 +634,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { print '
'.$langs->trans("Parameter").' '.$langs->trans("Value").'
'; print ''; print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 5cff3073b8b..90718bbe85f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -367,6 +367,8 @@ if (empty($reshook) && $action == 'add' && $usercancreate) { $object->type_code = GETPOST('actioncode', 'aZ09'); } + $listofresourceid = array(); + if (!$error) { // Initialisation of object actioncomm $object->priority = GETPOSTISSET("priority") ? GETPOSTINT("priority") : 0; @@ -430,6 +432,11 @@ if (empty($reshook) && $action == 'add' && $usercancreate) { if (!empty($_SESSION['assignedtouser'])) { $listofuserid = json_decode($_SESSION['assignedtouser'], true); } + + if (!empty($_SESSION['assignedtoresource'])) { + $listofresourceid = json_decode($_SESSION['assignedtoresource'], true); + } + $i = 0; foreach ($listofuserid as $key => $value) { if ($i == 0) { // First entry @@ -541,6 +548,74 @@ if (empty($reshook) && $action == 'add' && $usercancreate) { if ($idaction > 0) { if (!$object->error) { + if (is_array($listofresourceid) && count($listofresourceid)) { + foreach ($listofresourceid as $resource_id => $val) { + $resource_type = 'dolresource'; + $busy = 1;//GETPOSTINT('busy'); + + // Resources association + if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK')) { + $eventDateStart = $object->datep; + $eventDateEnd = $object->datef; + $isFullDayEvent = $object->fulldayevent; + if (empty($eventDateEnd)) { + if ($isFullDayEvent) { + $eventDateStartArr = dol_getdate($eventDateStart); + $eventDateStart = dol_mktime(0, 0, 0, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + $eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + } + } + + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= " WHERE er.resource_id = " . ((int) $resource_id); + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $object->error = $db->lasterror(); + $object->errors[] = $object->error; + } else { + if ($db->num_rows($resql) > 0) { + // Resource already in use + $error++; + $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $object->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $object->errors[] = $object->error; + } + $db->free($resql); + } + } + + if (!$error) { + $res = $object->add_element_resource($resource_id, $resource_type, $busy, $val['mandatory']); + } + } + } + + unset($_SESSION['assignedtoresource']); + // Category association $categories = GETPOST('categories', 'array'); $object->setCategories($categories); @@ -2148,6 +2223,7 @@ if ($id > 0) { // Related contact print ''."\n"; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 9e569f25967..36c2f2cd02f 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -570,6 +570,8 @@ if ($action == 'makepayment_confirm' && $user->hasRight('facture', 'paiement')) $result_sql = $db->query($rsql); if ($result_sql) { $numprlv = $db->num_rows($result_sql); + } else { + $numprlv = 0; } if ($numprlv > 0) { @@ -633,9 +635,11 @@ if ($socid > 0) { if (empty($search_company)) { $search_company = $soc->name; } +} else { + $soc = null; } -$title = $langs->trans('BillsCustomers').' '.($socid > 0 ? ' - '.$soc->name : ''); +$title = $langs->trans('BillsCustomers').' '.(($socid > 0 && $soc !== null) ? ' - '.$soc->name : ''); $help_url = 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; @@ -1341,7 +1345,7 @@ if (isModEnabled('category') && $user->hasRight("categorie", "lire") && ($user-> include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); - $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 0, 0, 1); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= '
'; } @@ -1509,7 +1513,7 @@ if (!empty($arrayfields['state.nom']['checked'])) { // Country if (!empty($arrayfields['country.code_iso']['checked'])) { print ''; } // Company type @@ -2051,10 +2055,10 @@ if ($num > 0) { $multicurrency_remaintopay = 0; } if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consumed - $remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id); + $remaincreditnote = $discount->getAvailableDiscounts($companystatic, null, 'rc.fk_facture_source='.$facturestatic->id); $remaintopay = -$remaincreditnote; $totalallpayments = price2num($facturestatic->total_ttc - $remaintopay); - $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1); + $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($companystatic, null, 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1); $multicurrency_remaintopay = -$multicurrency_remaincreditnote; $multicurrency_totalpay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay); } @@ -2146,7 +2150,9 @@ if ($num > 0) { } $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($obj->ref); + $filepath = $conf->invoice->multidir_output[$obj->entity] ?? $conf->invoice->dir_output; + $filedir = $filepath.'/'.$filename; + $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->id; print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 68550e0422d..23f84543622 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -5,6 +5,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Ferran Marcet * Copyright (C) 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 @@ -54,7 +55,7 @@ $action = GETPOST('action', 'aZ09'); $object = new Facture($db); // Load object if ($id > 0 || !empty($ref)) { - $object->fetch($id, $ref, '', '', (getDolGlobalString('INVOICE_USE_SITUATION') ? $conf->global->INVOICE_USE_SITUATION : 0)); + $object->fetch($id, $ref, '', 0, getDolGlobalInt('INVOICE_USE_SITUATION')); } $permissionnote = $user->hasRight('facture', 'creer'); // Used by the include of actions_setnotes.inc.php diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 69b68a1695d..29d6488f4ab 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -75,6 +75,7 @@ if ($type == 'bank-transfer') { } // Load object +$isdraft = 1; if ($id > 0 || !empty($ref)) { $ret = $object->fetch($id, $ref); $isdraft = (($object->status == FactureFournisseur::STATUS_DRAFT) ? 1 : 0); @@ -310,8 +311,8 @@ if ($object->id > 0) { $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')"; } - $absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount, 0, 1); - $absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote, 0, 1); + $absolute_discount = $object->thirdparty->getAvailableDiscounts(null, $filterabsolutediscount, 0, 1); + $absolute_creditnote = $object->thirdparty->getAvailableDiscounts(null, $filtercreditnote, 0, 1); $absolute_discount = price2num($absolute_discount, 'MT'); $absolute_creditnote = price2num($absolute_creditnote, 'MT'); } else { @@ -323,8 +324,8 @@ if ($object->id > 0) { $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')"; } - $absolute_discount = $object->thirdparty->getAvailableDiscounts('', $filterabsolutediscount); - $absolute_creditnote = $object->thirdparty->getAvailableDiscounts('', $filtercreditnote); + $absolute_discount = $object->thirdparty->getAvailableDiscounts(null, $filterabsolutediscount); + $absolute_creditnote = $object->thirdparty->getAvailableDiscounts(null, $filtercreditnote); $absolute_discount = price2num($absolute_discount, 'MT'); $absolute_creditnote = price2num($absolute_creditnote, 'MT'); } @@ -821,7 +822,7 @@ if ($object->id > 0) { print img_warning('Error on default bank number for IBAN : '.$langs->trans($companyBankAccount->error)); } } elseif ($numopen || ($type != 'bank-transfer' && $object->mode_reglement_code == 'PRE') || ($type == 'bank-transfer' && $object->mode_reglement_code == 'VIR')) { - print img_warning($langs->trans("NoDefaultIBANFound")); + print img_warning($langs->trans("NoDefaultIBANFound")); } //print ''; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 28ae66bcb53..8e9c2c9ce8d 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -142,6 +142,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); //var_dump($data); $filenamenb = $dir."/invoicesnbinyear-".$year.".png"; +$fileurlnb = ''; if ($mode == 'customer') { $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png'; } @@ -178,6 +179,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) $filenameamount = $dir."/invoicesamountinyear-".$year.".png"; +$fileurlamount = ''; if ($mode == 'customer') { $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png'; } @@ -212,6 +214,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); +$fileurl_avg = ''; if (!$user->hasRight('societe', 'client', 'voir')) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { @@ -318,6 +321,8 @@ print ''; // Category if (isModEnabled('category')) { + $cat_type = ''; + $cat_label = ''; if ($mode == 'customer') { $cat_type = Categorie::TYPE_CUSTOMER; $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); @@ -327,7 +332,7 @@ if (isModEnabled('category')) { $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); } print '
'; print $langs->trans("AddCustomerIntoCategory").'  '; - $filter = '(s.client:IN:1,3)'; + $filter = '(s.client:IN:1,2,3)'; print $form->select_company('', 'elemid', $filter); print '
'.$langs->trans("ActionOnContact").''; print '
'; + print img_picto('', 'contact', 'class="paddingrightonly"'); if (getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT') && $conf->use_javascript_ajax) { // FIXME Use the select_contact supporting the "multiple" diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 63048fefeb9..770f78b0304 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1411,9 +1411,9 @@ if (count($listofextcals)) { $event->datep = $datestart + $usertime; $event->datef = $dateend + $usertime; - if ($icalevent['SUMMARY']) { + if (isset($icalevent['SUMMARY']) && $icalevent['SUMMARY']) { $event->label = dol_string_nohtmltag($icalevent['SUMMARY']); - } elseif ($icalevent['DESCRIPTION']) { + } elseif (isset($icalevent['DESCRIPTION']) && $icalevent['DESCRIPTION']) { $event->label = dol_nl2br(dol_string_nohtmltag($icalevent['DESCRIPTION']), 1); } else { $event->label = $langs->trans("ExtSiteNoLabel"); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 0ef32d3547b..3f67f1ed4c6 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -927,9 +927,9 @@ if ($object->id > 0) { $filedir = $conf->propal->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -1046,9 +1046,9 @@ if ($object->id > 0) { $filedir = $conf->commande->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -1147,9 +1147,9 @@ if ($object->id > 0) { $filedir = $conf->expedition->multidir_output[$objp->entity].'/sending/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -1261,9 +1261,9 @@ if ($object->id > 0) { $filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -1361,9 +1361,9 @@ if ($object->id > 0) { $filedir = $conf->ficheinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -1590,9 +1590,9 @@ if ($object->id > 0) { $filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index ce3c6f96804..c42b5b22c93 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -402,8 +402,8 @@ class Propal extends CommonObject 'fk_delivery_address' => array('type' => 'integer', 'label' => 'DeliveryAddress', 'enabled' => 1, 'visible' => 0, 'position' => 200), // deprecated 'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 205), 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 215), - 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 220), - 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 225), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 220), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 225), 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 1, 'visible' => -1, 'position' => 230), 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'MulticurrencyCurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 235), 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240, 'isameasure' => 1), diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index f062c118f8b..513b4d697a7 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -171,7 +171,7 @@ print '
'; * Last modified proposals */ -$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, date_cloture as datec, c.tms as datem,"; +$sql = "SELECT c.rowid, c.entity, c.ref, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status, date_cloture as datec, c.tms as datem,"; $sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta as code_compta_client"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as c,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; @@ -211,6 +211,9 @@ if ($resql) { $propalstatic->id = $obj->rowid; $propalstatic->ref = $obj->ref; + $propalstatic->total_ht = $obj->total_ht; + $propalstatic->total_tva = $obj->total_tva; + $propalstatic->total_ttc = $obj->total_ttc; $companystatic->id = $obj->socid; $companystatic->name = $obj->socname; @@ -263,7 +266,7 @@ if ($resql) { */ if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta as code_compta_client,"; - $sql .= " p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; + $sql .= " p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,"; $sql .= " ".MAIN_DB_PREFIX."propal as p"; $sql .= " WHERE p.fk_soc = s.rowid"; @@ -302,6 +305,9 @@ if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $propalstatic->id = $obj->propalid; $propalstatic->ref = $obj->ref; + $propalstatic->total_ht = $obj->total_ht; + $propalstatic->total_tva = $obj->total_tva; + $propalstatic->total_ttc = $obj->total_ttc; $companystatic->id = $obj->socid; $companystatic->name = $obj->socname; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 55c4d15f18f..ff88cc5e51f 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -97,18 +97,12 @@ $formother = new FormOther($db); $langs->loadLangs(array('propal', 'other', 'companies')); -$picto = null; -$dir = null; -$cat_type = null; -$cat_label = null; +$picto = 'propal'; +$title = $langs->trans("ProposalsStatistics"); +$dir = $conf->propal->dir_temp; +$cat_type = Categorie::TYPE_CUSTOMER; +$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); -if ($mode == 'customer') { - $picto = 'propal'; - $title = $langs->trans("ProposalsStatistics"); - $dir = $conf->propal->dir_temp; - $cat_type = Categorie::TYPE_CUSTOMER; - $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); -} if ($mode == 'supplier') { $picto = 'supplier_proposal'; $title = $langs->trans("ProposalsStatisticsSuppliers"); diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 7f3eedd4c9f..550baca1931 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -62,7 +62,7 @@ if ($socid > 0) { $societe->fetch($socid); /* - * Affichage onglets + * Show tabs */ $head = societe_prepare_head($societe); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 6366fbe34b9..372c85dcdc7 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -987,17 +987,17 @@ if (empty($reshook)) { // Set unit price to use if (!empty($price_ht) || $price_ht === '0') { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num((float) $pu_ht * (1 + ($tmpvat / 100)), 'MU'); + $pu_ht = (float) price2num($price_ht, 'MU'); + $pu_ttc = (float) price2num((float) $pu_ht * (1 + ($tmpvat / 100)), 'MU'); } elseif (!empty($price_ttc) || $price_ttc === '0') { - $pu_ttc = price2num($price_ttc, 'MU'); - $pu_ht = price2num((float) $pu_ttc / (1 + ($tmpvat / 100)), 'MU'); + $pu_ttc = (float) price2num($price_ttc, 'MU'); + $pu_ht = (float) price2num((float) $pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } elseif ($tmpvat != $tmpprodvat) { // Is this still used ? if ($price_base_type != 'HT') { - $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); + $pu_ht = (float) price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } else { - $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); + $pu_ttc = (float) price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 555c04558e5..cc2aac53b02 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -304,9 +304,8 @@ $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -if ($mode == 'customer') { - $type = 'order_stats'; -} +$type = 'order_stats'; + if ($mode == 'supplier') { $type = 'supplier_order_stats'; } diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 511b2b52a22..a3faa4870f5 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -174,7 +174,8 @@ if ($user->hasRight('banque', 'modifier') && $action == "update") { $sql .= " SET "; // Always opened if (GETPOSTISSET('value')) { - $sql .= " fk_type='".$db->escape(GETPOST('value'))."',"; + $type = GETPOST('value'); + $sql .= " fk_type='".$db->escape(empty($type) && $object->fk_type == 'SOLD' ? 'SOLD' : $type)."',"; } if (GETPOSTISSET('num_chq')) { $sql .= " num_chq='".$db->escape(GETPOST("num_chq"))."',"; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 89675f57f08..66dc032dd2a 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -280,6 +280,9 @@ $theoricalnbofinvoiceforterminal = array(); llxHeader('', $langs->trans("CashControl")); +$terminalid = ''; +$terminaltouse = ''; + if ($action == "create" || $action == "start" || $action == 'close') { if ($action == 'close') { $posmodule = $object->posmodule; @@ -305,7 +308,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { } } - if (isset($terminalid) && $terminalid != '') { + if (isset($terminalid) && $terminalid != '' && isset($posmodule)) { // Calculate $initialbalanceforterminal for terminal 0 foreach ($arrayofpaymentmode as $key => $val) { if ($key != 'cash') { diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 9299b55c2cb..76dde4ff08b 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -166,7 +166,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= ")"; } - if (preg_match('/^cs\./', $sortfield) || preg_match('/^c\./', $sortfield) || preg_match('/^pc\./', $sortfield) || preg_match('/^pct\./', $sortfield)) { + if (preg_match('/^(cs?|pct?)\./', (string) $sortfield)) { $sql .= $db->order($sortfield, $sortorder); } //$sql.= $db->plimit($limit+1,$offset); @@ -310,7 +310,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { // so we are compatible when period is not mandatory $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; } - if (preg_match('/^pv\./', $sortfield) || preg_match('/^ptva\./', $sortfield)) { + if (preg_match('/^(pv|ptva)\./', (string) $sortfield)) { $sql .= $db->order($sortfield, $sortorder); } @@ -465,7 +465,7 @@ while ($j < $numlt) { // so we are compatible when period is not mandatory $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; } - if (preg_match('/^pv/', $sortfield)) { + if (preg_match('/^pv/', (string) $sortfield)) { $sql .= $db->order($sortfield, $sortorder); } diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index d2f0ef05647..79f3f16c9d8 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -176,6 +176,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); $filename_avg = ''; +$fileurl_avg = ''; if (!$user->hasRight('societe', 'client', 'voir')) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { diff --git a/htdocs/compta/facture/agenda-rec.php b/htdocs/compta/facture/agenda-rec.php index 5ae579f5a82..6cdbed1196e 100644 --- a/htdocs/compta/facture/agenda-rec.php +++ b/htdocs/compta/facture/agenda-rec.php @@ -1,6 +1,7 @@ * Copyright (C) 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 @@ -227,15 +228,15 @@ if ($object->id > 0) { //$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; //$morehtmlstatus .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); - if (isModEnabled('agenda')) { - /* - if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { - $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); - } else { - $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0); - } - */ + //if (isModEnabled('agenda')) { + /* + if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { + $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); + } else { + $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0); } + */ + //} if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index cd34ce11682..c8242aa1753 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1172,19 +1172,19 @@ class FactureRec extends CommonInvoice } // Clean parameters - $remise_percent = price2num($remise_percent); - $qty = price2num($qty); + $remise_percent = (float) price2num($remise_percent); + $qty = (float) price2num($qty); if (empty($info_bits)) { $info_bits = 0; } - $pu_ht = price2num($pu_ht); - $pu_ttc = price2num($pu_ttc); - $pu_ht_devise = price2num($pu_ht_devise); + $pu_ht = (float) price2num($pu_ht); + $pu_ttc = (float) price2num($pu_ttc); + $pu_ht_devise = (float) price2num($pu_ht_devise); if (!preg_match('/\((.*)\)/', (string) $txtva)) { $txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' } - $txlocaltax1 = price2num($txlocaltax1); - $txlocaltax2 = price2num($txlocaltax2); + $txlocaltax1 = price2num($txlocaltax1); + $txlocaltax2 = price2num($txlocaltax2); if (empty($txlocaltax1)) { $txlocaltax1 = 0; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 24b2fac72c6..dacff6569d8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -361,15 +361,15 @@ class Facture extends CommonInvoice 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 210), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 215), 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 225), - 'situation_cycle_ref' => array('type' => 'smallint(6)', 'label' => 'Situation cycle ref', 'enabled' => '$conf->global->INVOICE_USE_SITUATION', 'visible' => -1, 'position' => 230), - 'situation_counter' => array('type' => 'smallint(6)', 'label' => 'Situation counter', 'enabled' => '$conf->global->INVOICE_USE_SITUATION', 'visible' => -1, 'position' => 235), - 'situation_final' => array('type' => 'smallint(6)', 'label' => 'Situation final', 'enabled' => 'empty($conf->global->INVOICE_USE_SITUATION) ? 0 : 1', 'visible' => -1, 'position' => 240), - 'retained_warranty' => array('type' => 'double', 'label' => 'Retained warranty', 'enabled' => '$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible' => -1, 'position' => 245), - 'retained_warranty_date_limit' => array('type' => 'date', 'label' => 'Retained warranty date limit', 'enabled' => '$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible' => -1, 'position' => 250), - 'retained_warranty_fk_cond_reglement' => array('type' => 'integer', 'label' => 'Retained warranty fk cond reglement', 'enabled' => '$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible' => -1, 'position' => 255), - 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 260), - 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 265), - 'date_pointoftax' => array('type' => 'date', 'label' => 'DatePointOfTax', 'enabled' => '$conf->global->INVOICE_POINTOFTAX_DATE', 'visible' => -1, 'position' => 270), + 'situation_cycle_ref' => array('type' => 'smallint(6)', 'label' => 'Situation cycle ref', 'enabled' => 'getDolGlobalInt("INVOICE_USE_SITUATION")', 'visible' => -1, 'position' => 230), + 'situation_counter' => array('type' => 'smallint(6)', 'label' => 'Situation counter', 'enabled' => 'getDolGlobalInt("INVOICE_USE_SITUATION")', 'visible' => -1, 'position' => 235), + 'situation_final' => array('type' => 'smallint(6)', 'label' => 'Situation final', 'enabled' => 'getDolGlobalInt("INVOICE_USE_SITUATION")', 'visible' => -1, 'position' => 240), + 'retained_warranty' => array('type' => 'double', 'label' => 'Retained warranty', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 245), + 'retained_warranty_date_limit' => array('type' => 'date', 'label' => 'Retained warranty date limit', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 250), + 'retained_warranty_fk_cond_reglement' => array('type' => 'integer', 'label' => 'Retained warranty fk cond reglement', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 255), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 260), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 265), + 'date_pointoftax' => array('type' => 'date', 'label' => 'DatePointOfTax', 'enabled' => 'getDolGlobalString("INVOICE_POINTOFTAX_DATE")', 'visible' => -1, 'position' => 270), 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 275), 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Currency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 280), 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'CurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 285, 'isameasure' => 1), @@ -2572,7 +2572,7 @@ class Facture extends CommonInvoice $sql .= " localtax2=".(isset($this->total_localtax2) ? (float) $this->total_localtax2 : "null").","; $sql .= " total_ht=".(isset($this->total_ht) ? (float) $this->total_ht : "null").","; $sql .= " total_ttc=".(isset($this->total_ttc) ? (float) $this->total_ttc : "null").","; - $sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (int) $this->revenuestamp : "null").","; + $sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (float) $this->revenuestamp : "null").","; $sql .= " fk_statut=".(isset($this->status) ? (int) $this->status : "null").","; $sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? (int) $this->fk_user_valid : "null").","; $sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? (int) $this->fk_facture_source : "null").","; @@ -3634,7 +3634,7 @@ class Facture extends CommonInvoice $this->date_validation = $now; $i = 0; - if (getDolGlobalString('INVOICE_USE_SITUATION')) { + if (getDolGlobalInt('INVOICE_USE_SITUATION')) { $final = true; $nboflines = count($this->lines); while (($i < $nboflines) && $final) { diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 65aff00aa88..884a954e758 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -6,6 +6,7 @@ * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2023 Christian Foellmann * Copyright (C) 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 @@ -63,7 +64,7 @@ if ($user->socid) { $object = new Facture($db); // Load object if ($id > 0 || !empty($ref)) { - $ret = $object->fetch($id, $ref, '', '', (getDolGlobalString('INVOICE_USE_SITUATION') ? $conf->global->INVOICE_USE_SITUATION : 0)); + $ret = $object->fetch($id, $ref, '', 0, getDolGlobalInt('INVOICE_USE_SITUATION')); } // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('invoicecontactcard', 'globalcard')); @@ -77,7 +78,7 @@ $usercancreate = $user->hasRight("facture", "creer"); * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index cf8faf85f15..c3a18a0aa26 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -927,7 +927,7 @@ while ($i < $imaxinloop) { // Payment term if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { print '
'; - $form->form_conditions_reglement('', $objp->fk_cond_reglement, 'none'); + $form->form_conditions_reglement(0, $objp->fk_cond_reglement, 'none'); print ''; - print $form->select_country($search_country, 'search_country', '', 0, 'minwidth150imp maxwidth150', 'code2', 1, 0, 1, null, 1); + print $form->select_country($search_country, 'search_country', '', 0, 'minwidth150imp maxwidth150', 'code2', 1, 0, 1, array(), 1); print '
'.$cat_label.''; - $cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1); + $cate_arbo = $form->select_all_categories($cat_type, '', 'parent', 0, 0, 1); print img_picto('', 'category', 'class="pictofixedwidth"'); 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); diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 1c398bb3633..f7e14b0a4c2 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -147,6 +147,8 @@ if (in_array($db->type, array('mysql', 'mysqli'))) { $db->query('SET SQL_BIG_SELECTS=1'); } +$tabfac = array(); + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -154,7 +156,6 @@ if ($result) { $cptfour = ((getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef")); $cpttva = (getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT') ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); - $tabfac = array(); $tabht = array(); $tabtva = array(); $tabttc = array(); diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index 82dcf48aa4b..6b9157e1de2 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -161,9 +161,10 @@ if (in_array($db->type, array('mysql', 'mysqli'))) { $db->query('SET SQL_BIG_SELECTS=1'); } +$tabfac = array(); + $result = $db->query($sql); if ($result) { - $tabfac = array(); $tabht = array(); $tabtva = array(); $tablocaltax1 = array(); diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 2a88632027b..5a4077091d5 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2018-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 @@ -118,6 +119,8 @@ if ($action == 'delete' && $permissiontodelete) { if ($result > 0) { $result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) } + } else { + $accountline = null; } if ($result >= 0) { @@ -125,7 +128,7 @@ if ($action == 'delete' && $permissiontodelete) { header("Location: ".DOL_URL_ROOT.'/compta/localtax/list.php?localTaxType='.$object->ltt); exit; } else { - $object->error = $accountline->error; + $object->error = $accountline !== null ? $accountline->error : "No account line / no bank identified found"; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 818696545cd..c4946dafa5d 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -57,6 +57,7 @@ if (empty($year)) { } $date_start = dol_mktime(0, 0, 0, GETPOSTINT("date_startmonth"), GETPOSTINT("date_startday"), GETPOSTINT("date_startyear")); $date_end = dol_mktime(23, 59, 59, GETPOSTINT("date_endmonth"), GETPOSTINT("date_endday"), GETPOSTINT("date_endyear")); +$q = 0; // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end $q = GETPOST("q"); @@ -124,7 +125,12 @@ if (empty($local)) { accessforbidden('Parameter localTaxType is missing'); } +$builddate = dol_now(); $calc = 0; +$calcmode = "Unknown"; +$find = ''; +$replace = ''; +$period = ''; /* * View */ @@ -203,6 +209,9 @@ $vatsup = $langs->transcountry($local == 1 ? "LT1" : "LT2", $mysoc->country_code print '
'; print ''; +$x_coll_sum = 0; // Initialize value +$x_paye_sum = 0; // Initialize value + // IRPF that the customer has retained me if ($calc == 0 || $calc == 2) { print ''; @@ -231,11 +240,11 @@ if ($calc == 0 || $calc == 2) { $total = 0; $totalamount = 0; $i = 1; - foreach ($coll_list as $coll) { - if (($min == 0 || ($min > 0 && $coll->amount > $min)) && ($local == 1 ? $coll->localtax1 : $coll->localtax2) != 0) { - $intra = str_replace($find, $replace, $coll->tva_intra); + foreach ($coll_list as $coll_obj) { + if (($min == 0 || ($min > 0 && $coll_obj->amount > $min)) && ($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2) != 0) { + $intra = str_replace($find, $replace, $coll_obj->tva_intra); if (empty($intra)) { - if ($coll->assuj == '1') { + if ($coll_obj->assuj == '1') { $intra = $langs->trans('Unknown'); } else { $intra = ''; @@ -243,16 +252,16 @@ if ($calc == 0 || $calc == 2) { } print ''; print '"; - $company_static->id = $coll->socid; - $company_static->name = $coll->name; + $company_static->id = $coll_obj->socid; + $company_static->name = $coll_obj->name; print ''; $find = array(' ', '.'); $replace = array('', ''); print ''; - print ''; - print ''; - $totalamount += $coll->amount; - $total += ($local == 1 ? $coll->localtax1 : $coll->localtax2); + print ''; + print ''; + $totalamount += $coll_obj->amount; + $total += ($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2); print "\n"; $i++; } @@ -296,11 +305,11 @@ if ($calc == 0 || $calc == 1) { $total = 0; $totalamount = 0; $i = 1; - foreach ($coll_list as $coll) { - if (($min == 0 || ($min > 0 && $coll->amount > $min)) && ($local == 1 ? $coll->localtax1 : $coll->localtax2) != 0) { - $intra = str_replace($find, $replace, $coll->tva_intra); + foreach ($coll_list as $coll_obj) { + if (($min == 0 || ($min > 0 && $coll_obj->amount > $min)) && ($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2) != 0) { + $intra = str_replace($find, $replace, $coll_obj->tva_intra); if (empty($intra)) { - if ($coll->assuj == '1') { + if ($coll_obj->assuj == '1') { $intra = $langs->trans('Unknown'); } else { $intra = ''; @@ -308,16 +317,16 @@ if ($calc == 0 || $calc == 1) { } print ''; print '"; - $company_static->id = $coll->socid; - $company_static->name = $coll->name; + $company_static->id = $coll_obj->socid; + $company_static->name = $coll_obj->name; print ''; $find = array(' ', '.'); $replace = array('', ''); print '"; - print ''; - print ''; - $totalamount += $coll->amount; - $total += ($local == 1 ? $coll->localtax1 : $coll->localtax2); + print ''; + print ''; + $totalamount += $coll_obj->amount; + $total += ($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2); print "\n"; $i++; } diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index a45def867f3..212055a9612 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -114,7 +114,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); * @param string $date Date * @return void */ -function pt($db, $sql, $date) +function localtax_pt($db, $sql, $date) { global $conf, $bc, $langs; @@ -600,7 +600,7 @@ $sql .= " GROUP BY dm"; $sql .= " ORDER BY dm ASC, mode ASC"; //print $sql; -pt($db, $sql, $langs->trans("Month")); +localtax_pt($db, $sql, $langs->trans("Month")); print ''; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 941a3813fe9..17bf8c8534c 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -106,10 +106,10 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } +$paiement_id = 0; if (empty($reshook)) { if (($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes')) && $usercanissuepayment) { $datepaye = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); - $paiement_id = 0; $totalpayment = 0; $multicurrency_totalpayment = 0; $atleastonepaymentnotnull = 0; @@ -277,6 +277,7 @@ if (empty($reshook)) { $paiement->note_private = GETPOST('comment', 'alpha'); $paiement->fk_account = GETPOSTINT('accountid'); + $paiement_id = 0; if (!$error) { // Create payment and update this->multicurrency_amounts if this->amounts filled or // this->amounts if this->multicurrency_amounts filled. @@ -648,6 +649,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $totalrecu = 0; $totalrecucreditnote = 0; $totalrecudeposits = 0; + $sign = 1; while ($i < $num) { $objp = $db->fetch_object($resql); @@ -669,6 +671,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); // Multicurrency Price + $tooltiponmulticurrencyfullamount = ''; + $multicurrency_remaintopay = ''; + $multicurrency_payment = 0; + $multicurrency_creditnotes = 0; + $multicurrency_deposits = 0; if (isModEnabled('multicurrency')) { $multicurrency_payment = $invoice->getSommePaiement(1); $multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1); @@ -676,15 +683,15 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $multicurrency_alreadypayed = price2num($multicurrency_payment + $multicurrency_creditnotes + $multicurrency_deposits, 'MT'); $multicurrency_remaintopay = price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits, 'MT'); // Multicurrency full amount tooltip - $tootltiponmulticurrencyfullamount = $langs->trans('AmountHT') . ": " . price($objp->multicurrency_total_ht, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "
"; - $tootltiponmulticurrencyfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->multicurrency_total_tva, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "
"; - $tootltiponmulticurrencyfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "
"; + $tooltiponmulticurrencyfullamount = $langs->trans('AmountHT') . ": " . price($objp->multicurrency_total_ht, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "
"; + $tooltiponmulticurrencyfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->multicurrency_total_tva, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "
"; + $tooltiponmulticurrencyfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $objp->multicurrency_code) . "
"; } // Full amount tooltip - $tootltiponfullamount = $langs->trans('AmountHT') . ": " . price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . "
"; - $tootltiponfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . "
"; - $tootltiponfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . "
"; + $tooltiponfullamount = $langs->trans('AmountHT') . ": " . price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . "
"; + $tooltiponfullamount .= $langs->trans('AmountVAT') . ": " . price($objp->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . "
"; + $tooltiponfullamount .= $langs->trans('AmountTTC') . ": " . price($objp->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . "
"; print ''; @@ -721,7 +728,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if (isModEnabled('multicurrency')) { print ''; @@ -767,7 +774,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } // Full amount - print ''; + print ''; // Received + already paid print ''; print ''; $disable_delete = 0; +$bankline = null; + // Bank account if (isModEnabled("bank")) { $bankline = new AccountLine($db); @@ -392,7 +394,7 @@ if (isModEnabled("bank")) { print ''; print ''; print '\n"; print '\n"; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index f0282be603d..3b16804da9f 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 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 @@ -215,6 +216,7 @@ if ($sourcetype != 'salary') { } // Count total nb of records $nbtotalofrecords = ''; +$resql = null; if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 02c7838809d..4e0a003aba9 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 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 @@ -329,6 +330,10 @@ if ($resql) { $totalinvoices = 0; $totalamount_requested = 0; + $salarytmp = null; + $usertmp = null; + $invoicetmpcustomer = null; + $invoicetmpsupplier = null; if ($salaryBonPl) { $salarytmp = new Salary($db); diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 507b469f8ee..e6637617ab1 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -93,7 +93,7 @@ $error = 0; if ($action == 'confirm_rejet' && $permissiontoadd) { if (GETPOST("confirm") == 'yes') { - $datarej = null; + $daterej = null; if (GETPOSTINT('remonth')) { $daterej = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); } diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 474c9782b5c..8e2d0ab15ef 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -5,6 +5,7 @@ * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 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 @@ -118,6 +119,8 @@ if (($massaction == "delete" || ($action == 'delete' && $confirm == 'yes')) && $ $TMsg = array(); $db->begin(); $objecttmp = new BonPrelevement($db); + $nbignored = 0; + $nbok = 0; foreach ($toselect as $toselectid) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 8c22fea81a6..80b4c1803af 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 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 @@ -79,6 +80,8 @@ if ($type == 'bank-transfer') { $sql .= " AND pb.type = 'debit-order'"; } $sql .= " AND pb.entity = ".$conf->entity; +$total = 0; +$nbtotal = 0; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 4cd75354d10..34610f8d98a 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -10,6 +10,7 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2021 Alexandre Spangaro + * 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 @@ -185,6 +186,10 @@ $exportlink = ''; $total_ht = 0; $total_ttc = 0; +$builddate = ''; +$name = ''; +$period = ''; + // Affiche en-tete de rapport if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups"); @@ -211,7 +216,7 @@ if ($modecompta == "CREANCES-DETTES") { } elseif ($modecompta == "BOOKKEEPING") { $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups"); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); - $arraylist = array('no'=>$langs->trans("CustomerCode"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All")); + $arraylist = array('no' => $langs->trans("CustomerCode"), 'yes' => $langs->trans("AccountWithNonZeroValues"), 'all' => $langs->trans("All")); $period .= '     '.$langs->trans("DetailBy").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0); $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesResultBookkeepingPredefined"); @@ -238,7 +243,7 @@ if (isModEnabled('accounting')) { $calcmode .= ''; -report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'showaccountdetail'=>$showaccountdetail), $calcmode); +report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta' => $modecompta, 'showaccountdetail' => $showaccountdetail), $calcmode); if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, '1'); diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 55d4af8e15f..fbc2401a179 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -7,7 +7,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Maxime DEMAREST - * 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 @@ -150,6 +150,11 @@ llxHeader(); $form = new Form($db); + +$builddate = 0; +$name = ''; +$period = ''; +$periodlink = ''; $exportlink = ''; $encaiss = array(); @@ -209,7 +214,6 @@ if (isModEnabled('accounting')) { } $calcmode .= ''; - report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { @@ -277,9 +281,9 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta } else { dol_print_error($db); } -} elseif ($modecompta == "BOOKKEEPING") { - // Nothing from this table -} +} // elseif ($modecompta == "BOOKKEEPING") { +// Nothing from this table +//} if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { // On ajoute les paiements clients anciennes version, non lies par paiement_facture @@ -322,12 +326,12 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta } else { dol_print_error($db); } - } elseif ($modecompta == "RECETTES-DEPENSES") { - // Nothing from this table - } -} elseif ($modecompta == "BOOKKEEPING") { + } //elseif ($modecompta == "RECETTES-DEPENSES") { // Nothing from this table -} + //} +} //elseif ($modecompta == "BOOKKEEPING") { +// Nothing from this table +//} /* @@ -391,9 +395,9 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta } else { dol_print_error($db); } -} elseif ($modecompta == "BOOKKEEPING") { - // Nothing from this table -} +} //elseif ($modecompta == "BOOKKEEPING") { +// Nothing from this table +//} @@ -557,9 +561,9 @@ if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == " dol_print_error($db); } } -} elseif ($modecompta == "BOOKKEEPING") { - // Nothing from this table -} +}// elseif ($modecompta == "BOOKKEEPING") { +// Nothing from this table +//} /* * Social contributions @@ -616,9 +620,9 @@ if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == " } else { dol_print_error($db); } -} elseif ($modecompta == "BOOKKEEPING") { - // Nothing from this table -} +} //elseif ($modecompta == "BOOKKEEPING") { +// Nothing from this table +//} /* @@ -626,6 +630,7 @@ if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == " */ if (isModEnabled('salaries') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { + $sql = ''; if ($modecompta == 'CREANCES-DETTES') { $column = 's.dateep'; // we use the date of end of period of salary @@ -678,9 +683,9 @@ if (isModEnabled('salaries') && ($modecompta == 'CREANCES-DETTES' || $modecompta } else { dol_print_error($db); } -} elseif ($modecompta == "BOOKKEEPING") { - // Nothing from this table -} +} //elseif ($modecompta == "BOOKKEEPING") { +// Nothing from this table +//} /* @@ -740,9 +745,9 @@ if (isModEnabled('expensereport') && ($modecompta == 'CREANCES-DETTES' || $modec } else { dol_print_error($db); } -} elseif ($modecompta == 'BOOKKEEPING') { - // Nothing from this table -} +} //elseif ($modecompta == 'BOOKKEEPING') { +// Nothing from this table +//} /* @@ -800,9 +805,9 @@ if (isModEnabled('don') && ($modecompta == 'CREANCES-DETTES' || $modecompta == " } else { dol_print_error($db); } -} elseif ($modecompta == 'BOOKKEEPING') { - // Nothing from this table -} +} //elseif ($modecompta == 'BOOKKEEPING') { +// Nothing from this table +//} /* * Various Payments diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 5d20a92b03d..9a0c75af9f3 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyreport.class.php'; /** * @var Conf $conf @@ -45,6 +46,8 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy')); +$id_report = GETPOSTINT('id_report'); + $error = 0; $mesg = ''; @@ -197,13 +200,17 @@ $months = array( llxHeader('', $langs->trans('ReportInOut')); +$builddate = 0; +$name = ''; +$period = ''; +$calcmode = 0; + $form = new Form($db); $textprevyear = ''.img_previous().''; $textnextyear = '   '.img_next().''; - // Affiche en-tete de rapport if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("AnnualByAccountDueDebtMode"); @@ -238,7 +245,12 @@ if ($modecompta == "CREANCES-DETTES") { $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "BOOKKEEPING") { - $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups"); + $accountingreportstatic = new AccountancyReport($db); + $accountingreportstatic->fetch($id_report); + $reportLabel = ''; + $reportLabel = $accountingreportstatic->label; + + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups").' '.$reportLabel; $calcmode = $langs->trans("CalcModeBookkeeping"); //$calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; @@ -292,8 +304,8 @@ if ($modecompta == 'CREANCES-DETTES') { // $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } elseif ($modecompta == "BOOKKEEPING") { // Get array of all report groups that are active - $cats = $AccCat->getCats(); // WARNING: Computed groups must be after group they include - $unactive_cats = $AccCat->getCats(-1, 0); + $cats = $AccCat->getCats(-1, 1, $id_report); // WARNING: Computed groups must be after group they include + $unactive_cats = $AccCat->getCats(-1, 0, $id_report); /* $sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa'; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index df9f47b227b..72283b129b3 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -356,6 +356,8 @@ $title = $langs->trans("SocialContribution").' - '.$langs->trans("Card"); $help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module_Taxes_et_charges_spéciales|ES:Módulo Impuestos y cargas sociales (IVA, impuestos)'; llxHeader("", $title, $help_url); +$reseapayer = 0; + // Form to create a social contribution if ($action == 'create') { diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index ced08e8c80d..cc84c6c53bd 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -651,10 +651,8 @@ $totalarray = array(); $totalarray['nbfield'] = 0; $totalarray['val'] = array('totalttcfield' => 0); $imaxinloop = ($limit ? min($num, $limit) : $num); -if (!isset($TLoadedUsers) || !is_array($TLoadedUsers)) { - // Ensure array is initialised - $TLoadedUsers = array(); -} +$TLoadedUsers = array(); + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 4e67bfe53b1..a32d652fd1c 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -189,6 +189,7 @@ if ($sortfield !== null // Count total nb of records $nbtotalofrecords = ''; +$resql = null; if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index e9a2dd49be7..70f69885a5a 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -2,6 +2,7 @@ /* Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Alexandre Spangaro + * 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 @@ -280,9 +281,9 @@ if ($modecompta == "CREANCES-DETTES") { $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); -} elseif ($modecompta == "BOOKKEEPING") { -} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { -} +} //elseif ($modecompta == "BOOKKEEPING") { +//} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { +//} $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0); $period .= ' - '; $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index bad0f6a6648..a76a053dc27 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -216,7 +216,7 @@ if (!empty($selected_catsoc)) { if (!empty($selected_soc)) { $tableparams['search_soc'] = $selected_soc; } -if (!empty($selected_type)) { +if ($selected_type > 0) { $tableparams['search_type'] = $selected_type; } if (!empty($typent_id)) { @@ -254,6 +254,12 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $exportlink = ""; $namelink = ""; +$builddate = 0; +$calcmode = ''; +$name = ''; +$period = ''; +$periodlink = ''; + // Show report header if ($modecompta == "CREANCES-DETTES") { @@ -277,9 +283,9 @@ if ($modecompta == "CREANCES-DETTES") { $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); -} elseif ($modecompta == "BOOKKEEPING") { -} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { -} +} // elseif ($modecompta == "BOOKKEEPING") { +// } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { +// } $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); $period .= ' - '; @@ -290,6 +296,12 @@ if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) { $periodlink = ''; } +$builddate = 0; +$calcmode = ''; +$name = ''; +$period = ''; +$periodlink = ''; + report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode); if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { @@ -477,7 +489,7 @@ if ($modecompta == 'CREANCES-DETTES') { print '>'; print ''; // type filter (produit/service) - $form->select_type_of_lines(isset($selected_type) ? $selected_type : -1, 'search_type', $langs->trans("Type"), 1, 1); + $form->select_type_of_lines($selected_type, 'search_type', $langs->trans("Type"), 1, 1); // Third party filter print '
'; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index cf5b5a53edc..343a026733e 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -5,6 +5,7 @@ * Copyright (C) 2013 Antoine Iauch * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Alexandre Spangaro + * 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 @@ -197,6 +198,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $exportlink = ""; $namelink = ""; +$builddate = 0; +$calcmode = ''; +$name = ''; // Show report header if ($modecompta == "CREANCES-DETTES") { @@ -285,9 +289,9 @@ if ($modecompta == 'CREANCES-DETTES') { if ($date_start && $date_end) { $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } -} elseif ($modecompta == "BOOKKEEPING") { -} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { -} +} // elseif ($modecompta == "BOOKKEEPING") { +// } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { +// } $sql .= " AND f.entity IN (".getEntity('invoice').")"; if ($socid) { $sql .= " AND f.fk_soc = ".((int) $socid); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 2adb147bc81..edc41356a36 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -233,6 +233,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $exportlink = ""; $namelink = ""; +$builddate = 0; +$calcmode = ''; +$name = ''; // Show report header if ($modecompta == "CREANCES-DETTES") { @@ -255,9 +258,9 @@ if ($modecompta == "CREANCES-DETTES") { $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} elseif ($modecompta == "BOOKKEEPING") { -} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { -} +} // elseif ($modecompta == "BOOKKEEPING") { +// } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { +// } $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); $period .= ' - '; $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); @@ -340,9 +343,9 @@ if ($modecompta == 'CREANCES-DETTES') { $sql .= ")"; $sql .= " AND cs.fk_categorie = c.rowid AND cs.fk_soc = s.rowid"; } -} elseif ($modecompta == "BOOKKEEPING") { -} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { -} +} // elseif ($modecompta == "BOOKKEEPING") { +// } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { +// } if (!empty($search_societe)) { $sql .= natural_search('s.nom', $search_societe); } diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index d62e9d343d9..e6371094690 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -158,6 +158,8 @@ $form = new Form($db); $exportlink = ''; $namelink = ''; $builddate = dol_now(); +$periodlink = ''; +$name = ''; // Affiche en-tete du rapport if ($modecompta == "CREANCES-DETTES") { diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index fbec309c467..a7b2a19770d 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -1,6 +1,7 @@ * Copyright (C) 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 @@ -143,6 +144,8 @@ $form = new Form($db); $exportlink = ''; $namelink = ''; $builddate = dol_now(); +$periodlink = ''; +$name = ''; // TODO Report from bookkeeping not yet available, so we switch on report on business events /*if ($modecompta == "BOOKKEEPING") { diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index d0309274c48..d0800daddee 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -98,6 +98,7 @@ $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_starty $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver'); // We use timezone of server so report is same from everywhere // We define date_start and date_end +$q = 0; if (empty($date_start) || empty($date_end)) { // We define date_start and date_end $q = GETPOSTINT("q"); if (empty($q)) { @@ -189,7 +190,7 @@ if (!empty($selected_cat)) { if (!empty($selected_soc)) { $tableparams['search_soc'] = $selected_soc; } -if (!empty($selected_type)) { +if ($selected_type > 0) { $tableparams['search_type'] = $selected_type; } $tableparams['subcat'] = $subcat ? 'yes' : ''; @@ -235,6 +236,11 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $modecompta = "RECETTES-DEPENSES"; } +$builddate = dol_now(); +$periodlink = ''; +$name = ''; +$calcmode = ''; + // Show report header if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("PurchaseTurnover").', '.$langs->trans("ByProductsAndServices"); @@ -253,7 +259,7 @@ if ($modecompta == "CREANCES-DETTES") { // TODO } -$builddate = dol_now(); + $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); $period .= ' - '; $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); @@ -402,7 +408,7 @@ if ($modecompta == 'CREANCES-DETTES') { print '>'; // type filter (produit/service) print '   '; - $form->select_type_of_lines(isset($selected_type) ? $selected_type : -1, 'search_type', $langs->trans("Type"), 1, 1); + $form->select_type_of_lines($selected_type, 'search_type', $langs->trans("Type"), 1, 1); //select thirdparty print '
'; diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index b7b7526dcf9..3293403644d 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -213,6 +213,10 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $modecompta = "RECETTES-DEPENSES"; } + +$calcmode = ''; +$name = ''; + // Show report header if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("PurchaseTurnover").', '.$langs->trans("ByThirdParties"); diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 4cc212f6006..dcf5d5b3248 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -106,10 +106,13 @@ if (!empty($user->socid)) { $result = restrictedArea($user, 'tax', $object->id, 'tva', 'charges'); +$resteapayer = 0; + /* * Actions */ + $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -279,6 +282,7 @@ if (empty($reshook)) { $ret = $object->delete($user); if ($ret > 0) { + $accountline = null; if ($object->fk_bank) { $accountline = new AccountLine($db); $result = $accountline->fetch($object->fk_bank); @@ -292,7 +296,7 @@ if (empty($reshook)) { header("Location: ".DOL_URL_ROOT.'/compta/tva/list.php'); exit; } else { - $object->error = $accountline->error; + $object->error = $accountline !== null ? $accountline->error : 'No account line (no bank)'; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 0887b7cf2ae..13ffb65097d 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -1,11 +1,11 @@ - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2018 Laurent Destailleur - * Copyright (C) 2006 Yannick Warnier - * Copyright (C) 2014 Ferran Marcet - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2004-2018 Laurent Destailleur + * Copyright (C) 2006 Yannick Warnier + * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2018-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 @@ -55,6 +55,17 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php'; +' +@phan-var-force int $date_start +@phan-var-force int $date_end +@phan-var-force string $date_start_month +@phan-var-force string $date_start_year +@phan-var-force string $date_start_day +@phan-var-force string $date_end_month +@phan-var-force string $date_end_year +@phan-var-force string $date_end_day +@phan-var-force int $year_current +'; $min = price2num(GETPOST("min", "alpha")); if (empty($min)) { @@ -258,7 +269,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $company_static->name = $x_coll[$my_coll_thirdpartyid]['company_name'][$id]; $company_static->name_alias = $x_coll[$my_coll_thirdpartyid]['company_alias'][$id]; $company_static->email = $x_coll[$my_coll_thirdpartyid]['company_email'][$id]; - $company_static->tva_intra = isset($x_coll[$my_coll_thirdpartyid]['tva_intra'][$id]) ? $x_coll[$my_coll_thirdpartyid]['tva_intra'][$id] : '0'; + $company_static->tva_intra = isset($x_coll[$my_coll_thirdpartyid]['tva_intra'][$id]) ? $x_coll[$my_coll_thirdpartyid]['tva_intra'][$id] : '0'; // @phan-suppress-current-line PhanTypeInvalidDimOffset,PhanTypeArraySuspiciousNull $company_static->client = $x_coll[$my_coll_thirdpartyid]['company_client'][$id]; $company_static->fournisseur = $x_coll[$my_coll_thirdpartyid]['company_fournisseur'][$id]; $company_static->status = $x_coll[$my_coll_thirdpartyid]['company_status'][$id]; @@ -274,8 +285,8 @@ if (!is_array($x_coll) || !is_array($x_paye)) { 'pid' => $x_coll[$my_coll_thirdpartyid]['pid'][$id], 'pref' => isset($x_coll[$my_coll_thirdpartyid]['pref'][$id]) ? $x_coll[$my_coll_thirdpartyid]['pref'][$id] : '', 'ptype' => $x_coll[$my_coll_thirdpartyid]['ptype'][$id], - 'pstatus' => isset($x_paye[$my_coll_thirdpartyid]['pstatus'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatus'][$id] : '', - 'pstatusbuy' => isset($x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id] : '', + 'pstatus' => isset($x_paye[$my_coll_thirdpartyid]['pstatus'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatus'][$id] : '', // @phan-suppress-current-line PhanTypeInvalidDimOffset,PhanTypeArraySuspiciousNull + 'pstatusbuy' => isset($x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id]) ? $x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id] : '', // @phan-suppress-current-line PhanTypeInvalidDimOffset,PhanTypeArraySuspiciousNull 'payment_id' => $x_coll[$my_coll_thirdpartyid]['payment_id'][$id], 'payment_ref' => isset($x_coll[$my_coll_thirdpartyid]['payment_ref'][$id]) ? $x_coll[$my_coll_thirdpartyid]['payment_ref'][$id] : '', @@ -331,7 +342,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { 'ftotal_ttc' => price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]), 'dtotal_ttc' => price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]), 'dtype' => $x_paye[$my_paye_thirdpartyid]['dtype'][$id], - 'drate' => $x_paye[$my_coll_thirdpartyid]['drate'][$id], + 'drate' => $x_paye[$my_paye_thirdpartyid]['drate'][$id], 'ddate_start' => $x_paye[$my_paye_thirdpartyid]['ddate_start'][$id], 'ddate_end' => $x_paye[$my_paye_thirdpartyid]['ddate_end'][$id], 'totalht' => price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]), @@ -373,7 +384,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { 'ftotal_ttc' => price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]), 'dtotal_ttc' => price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]), 'dtype' => $x_paye[$my_paye_thirdpartyid]['dtype'][$id], - 'drate' => $x_paye[$my_coll_thirdpartyid]['drate'][$id], + 'drate' => $x_paye[$my_paye_thirdpartyid]['drate'][$id], 'datef' => $x_paye[$my_paye_thirdpartyid]['datef'][$id], 'datep' => $x_paye[$my_paye_thirdpartyid]['datep'][$id], diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index fc4bd35c4f8..4cce111a099 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -57,6 +57,16 @@ $month_start = $month_current; $refresh = true; include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php'; +' +@phan-var-force int $date_start +@phan-var-force int $date_end +@phan-var-force string $date_start_month +@phan-var-force string $date_start_year +@phan-var-force string $date_start_day +@phan-var-force string $date_end_month +@phan-var-force string $date_end_year +@phan-var-force string $date_end_day +'; // Define modetax (0 or 1) // 0=normal, 1=option vat for services is on debit, 2=option on payments for products diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 969b5e8ea71..9384a292aff 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -67,7 +67,7 @@ if (empty($page) || $page == -1) { $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortfield) { +if (empty($sortfield)) { $sortfield = "ptva.datep"; } if (!$sortorder) { diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 80103961416..54fee8c2882 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -276,7 +276,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $company_static->name = $x_coll[$my_coll_rate]['company_name'][$id]; $company_static->name_alias = $x_coll[$my_coll_rate]['company_alias'][$id]; $company_static->email = $x_coll[$my_coll_rate]['company_email'][$id]; - $company_static->tva_intra = isset($x_coll[$my_coll_rate]['tva_intra'][$id]) ? $x_coll[$my_coll_rate]['tva_intra'][$id] : '0'; + $company_static->tva_intra = isset($x_coll[$my_coll_rate]['tva_intra'][$id]) ? $x_coll[$my_coll_rate]['tva_intra'][$id] : '0'; // @phan-suppress-current-line PhanTypeArraySuspiciousNull,PhanTypeInvalidDimOffset $company_static->client = $x_coll[$my_coll_rate]['company_client'][$id]; $company_static->fournisseur = $x_coll[$my_coll_rate]['company_fournisseur'][$id]; $company_static->status = $x_coll[$my_coll_rate]['company_status'][$id]; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 866cb459058..e5cb083f5b0 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -716,7 +716,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; } else { print ''; } } @@ -888,7 +888,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Default language if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; print ''; } @@ -897,7 +897,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print '"; } @@ -1176,7 +1176,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Default language if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; print ''; } @@ -1210,7 +1210,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); + print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, $arrayselected, 0, 0, '', 0, '90%'); print ""; } diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 0515698a685..72eedc7bbe5 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -6,6 +6,7 @@ * Copyright (C) 2015-2017 Ferran Marcet * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 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 @@ -212,7 +213,13 @@ print '
'; print '
'; print ''; +$documentstatic = null; +$documentstaticline = null; $sql_select = ''; +$doc_number = ''; +$dateprint = ''; +$tables_from = ''; +$where = ''; if ($type_element == 'fichinter') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $documentstatic = new Fichinter($db); @@ -318,6 +325,8 @@ if ($type_element == 'fichinter') { // Customer : show products from invoices } $parameters = array(); +$totalnboflines = 0; +$sql = ''; $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook if (!empty($sql_select)) { @@ -343,7 +352,7 @@ if (!empty($sql_select)) { // if ($type_element != 'fichinter') $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid '; $sql .= $where; $sql .= dolSqlDateFilter($dateprint, 0, $month, $year); - if ($sref) { + if ($sref && !empty($doc_number)) { $sql .= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'"; } if ($sprod_fulldescr) { @@ -386,7 +395,7 @@ $param .= "&type_element=".urlencode($type_element); $total_qty = 0; $num = 0; -if ($sql_select) { +if ($sql_select && $documentstatic !== null) { $resql = $db->query($sql); if (!$resql) { dol_print_error($db); @@ -584,7 +593,7 @@ if ($sql_select) { } } else { if ($objp->fk_product > 0) { - echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, ''); + echo $form->textwithtooltip($text, $description, 3, 0, '', $i, 0, ''); // Show range echo get_date_range($objp->date_start, $objp->date_end); @@ -603,7 +612,7 @@ if ($sql_select) { if (!empty($objp->label)) { $text .= ' '.$objp->label.''; - echo $form->textwithtooltip($text, dol_htmlentitiesbr($objp->description), 3, '', '', $i, 0, ''); + echo $form->textwithtooltip($text, dol_htmlentitiesbr($objp->description), 3, 0, '', $i, 0, ''); } else { echo $text.' '.dol_htmlentitiesbr($objp->description); } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index f6aedacb6bf..0d971f01723 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -330,7 +330,7 @@ if ($action == "change" && $user->hasRight('takepos', 'run')) { // Change custom if (!isset($invoice)) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $invoice = new Facture($db); - $invoice->fetch(null, "(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")"); + $invoice->fetch(0, "(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")"); $invoice->delete_linked_contact('external', 'BILLING'); } $invoice->add_contact($idcontact, 'BILLING'); ?> @@ -1600,7 +1600,7 @@ while ($i < $imaxinloop) { // EMail if (!empty($arrayfields['p.email']['checked'])) { - print '
'; while ($i < $num) { $objp = $this->db->fetch_object($resqllist); - + $alreadylinked = false; + if (!empty($object->linkedObjectsIds[$possiblelink['linkname'] ?? $key])) { + if (in_array($objp->rowid, array_values($object->linkedObjectsIds[$possiblelink['linkname'] ?? $key]))) { + $alreadylinked = true; + } + } $htmltoenteralink .= ''; $htmltoenteralink .= ''; $htmltoenteralink .= ''; $htmltoenteralink .= ''; @@ -11298,14 +11325,14 @@ class Form $ret .= ''; - $ret .= '
'; + $ret .= '
'; $ret .= $form->selectarray('search_filter_field', $arrayoffilterfieldslabel, '', $langs->trans("Fields"), 0, 0, '', 0, 0, 0, '', 'width250', 1); $ret .= '
'; $ret .= ''; // Operator selector (will be populated dynamically) - $ret .= '
'; + $ret .= '
'; $ret .= ''; $ret .= '
'.$i."'.$company_static->getNomUrl(1).''.$intra.''.price($coll->amount).''.price($local == 1 ? $coll->localtax1 : $coll->localtax2).''.price($coll_obj->amount).''.price($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2).'
'.$i."'.$company_static->getNomUrl(1).''.$intra."'.price($coll->amount).''.price($local == 1 ? $coll->localtax1 : $coll->localtax2).''.price($coll_obj->amount).''.price($local == 1 ? $coll_obj->localtax1 : $coll_obj->localtax2).'
'; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { - print '' . price($sign * $objp->multicurrency_total_ttc); + print '' . price($sign * $objp->multicurrency_total_ttc); } print ''.price($sign * $objp->total_ttc).''.price($sign * $objp->total_ttc).''.price($sign * $paiement); @@ -908,6 +915,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $preselectedchoice = $addwarning ? 'no' : 'yes'; print '
'; + $text = ''; if (!empty($totalpayment)) { $text = $langs->trans('ConfirmCustomerPayment', $totalpayment, $langs->transnoentitiesnoconv("Currency".$conf->currency)); } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 8eb7138377d..2e671025ebf 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -330,6 +330,8 @@ print '
'.$langs->trans('Amount').''.price($object->amount, 0, $langs, 0, -1, -1, $conf->currency).'
'.$langs->trans('BankTransactionLine').''; - if ($object->fk_account > 0) { + if ($object->fk_account > 0 && $bankline !== null) { print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted'); } else { $langs->load("admin"); @@ -442,6 +444,7 @@ if (!empty($object->ext_payment_id)) { print '
'.$langs->trans("StripePaymentId").''; if (isModEnabled('stripe') && in_array($object->ext_payment_site, array('Stripe', 'StripeLive'))) { $tmp1 = explode('@', $object->ext_payment_id); + $site_account_payment = ''; if (!empty($tmp1[1])) { $site_account_payment = $tmp1[1]; // pk_live_... } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index b82395149ac..9b87416d801 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -6,6 +6,7 @@ * Copyright (C) 2013 Philippe Grand * Copyright (C) 2015-2016 Alexandre Spangaro * Copyright (C) 2018-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 @@ -203,7 +204,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('banque' header("Location: index.php"); exit; } else { - setEventMessages($paiement->error, $paiement->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 7331d02cde8..f1a51a873a5 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2016-2024 Frédéric France * Copyright (C) 2022 Alexandre Spangaro + * 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 @@ -201,6 +202,7 @@ if ($action == 'create') { $sql = "SELECT sum(p.amount) as total"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; $sql .= " WHERE p.fk_charge = ".((int) $chid); + $sumpaid = 0; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index dbed9d041ee..3012d287a28 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -203,6 +203,7 @@ if ($action == 'create') { $sql = "SELECT sum(p.amount) as total"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_vat as p"; $sql .= " WHERE p.fk_tva = ".((int) $chid); + $sumpaid = 0; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 602759e5af9..8096aa9fb7e 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -87,6 +87,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('tax', ' } } +$outputlangs = $langs; + // Validate social contribution /* if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->charges->creer) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index d85886673a1..60d398f35b7 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2018-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 @@ -245,7 +246,7 @@ if ($id > 0 || $ref) { print '
'; print ''; print ''; - print $form->selectDate($object->date_trans ? $object->date_trans : -1, 'date_trans', 0, 0, "setdate_trans"); + print $form->selectDate($object->date_trans ? $object->date_trans : -1, 'date_trans', 0, 0, 0, "setdate_trans"); print ''; print '
'; } else { @@ -564,12 +565,14 @@ if ($id > 0 || $ref) { if (!$salaryBonPl) { $thirdparty = new Societe($db); $thirdparty->fetch($obj->socid); + $name = $thirdparty->getNomUrl(1); } else { $userSalary = new User($db); $userSalary->fetch($obj->fk_user); + $name = $userSalary->getNomUrl(-1); } print '
'; - print(!$salaryBonPl ? $thirdparty->getNomUrl(1) : $userSalary->getNomUrl(-1)); + print($name); print "'.price($obj->amount)."
'; - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company($socid, 'socid', '', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company($socid, 'socid', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; - print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); + print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, array(), 1, 0, 0, 'maxwidth200onsmartphone'); print '
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, '', 'parent', 64, 0, 3); - print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%'); + print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), 0, 0, '', 0, '90%'); print "
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; - print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); + print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, array(), 1, 0, 0, 'maxwidth200onsmartphone'); print '
'; + print ''; if ($contextpage == 'poslist') { print $obj->email; } else { @@ -1640,7 +1640,7 @@ while ($i < $imaxinloop) { // Company / Third Party if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; if ($obj->socid) { $objsoc = new Societe($db); $objsoc->fetch($obj->socid); diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 0e361fab772..4a10306005f 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -96,7 +96,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact if ($id > 0) { /* - * Affichage onglets + * Show tabs */ if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 4bc907f6c15..9316a38927b 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -75,7 +75,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->hasRight('societe', 'con $result = $object->update_perso($id, $user); if ($result > 0) { - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppres-current-line PhanTypeMismatchProperty // Logo/Photo save $dir = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos'; diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index a372c40d4ae..031456f31eb 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -3,6 +3,7 @@ * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 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 @@ -181,7 +182,7 @@ if ($object->id > 0) { $morehtmlref .= $object->ref; } else { $morehtmlref .= $form->editfieldkey("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 3); - $morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 2); + $morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', null, 0, 2); } $permtoedit = 0; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 7fab37fabc7..86a46a1919a 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -795,7 +795,7 @@ if (empty($reshook)) { if (GETPOST('buying_price')) { $pa_ht = price2num(GETPOST('buying_price'), '', 2); } else { - $pa_ht = null; + $pa_ht = 0; } $fk_unit = GETPOSTINT('unit'); @@ -811,9 +811,9 @@ if (empty($reshook)) { $objectline->fk_product = GETPOSTINT('idprod'); $objectline->description = GETPOST('product_desc', 'restricthtml'); - $objectline->price_ht = $price_ht; - $objectline->subprice = price2num(GETPOST('elprice'), 'MU'); - $objectline->qty = price2num(GETPOST('elqty'), 'MS'); + $objectline->price_ht = (float) $price_ht; + $objectline->subprice = (float) price2num(GETPOST('elprice'), 'MU'); + $objectline->qty = (float) price2num(GETPOST('elqty'), 'MS'); $objectline->remise_percent = $remise_percent; $objectline->tva_tx = ($txtva ? $txtva : 0); // Field may be disabled, so we use vat rate 0 $objectline->vat_src_code = $vat_src_code; @@ -1821,7 +1821,12 @@ if ($action == 'create') { } else { $senderissupplier = 0; // @TODO Option to allow purchased products ? if (empty($senderissupplier)) { - print $form->select_produits($currentLineProductId, 'idprod', '', 0, 0, 1, 2, '', 0, array(), 0, 1, 0, 'minwidth250onall maxwidth500 widthcentpercentminusx'); + if (getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) { + $filtertype = ''; + } else { + $filtertype = '1'; + } + print $form->select_produits($currentLineProductId, 'idprod', $filtertype, 0, 0, 1, 2, '', 0, array(), 0, 1, 0, 'minwidth250onall maxwidth500 widthcentpercentminusx'); } else { $form->select_produits_fournisseurs($currentLineProductId, 'idprod'); } diff --git a/htdocs/contrat/messaging.php b/htdocs/contrat/messaging.php index aced39823b5..879f1aaddf5 100644 --- a/htdocs/contrat/messaging.php +++ b/htdocs/contrat/messaging.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 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 @@ -177,7 +178,7 @@ if (!empty($modCodeContract->code_auto)) { $morehtmlref .= $object->ref; } else { $morehtmlref .= $form->editfieldkey("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 3); - $morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 2); + $morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->hasRight('contrat', 'creer'), 'string', '', null, 2); } $permtoedit = 0; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index cb3ec8f7c44..fb32ec1747e 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -555,7 +555,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort if (!empty($sall)) { $fieldstosearchall = array(); - foreach ($fieldstosearchall as $key => $val) { + foreach ($fieldstosearchall as $key => $val) { // @phan-suppress-current-line PhanEmptyForeach $fieldstosearchall[$key] = $langs->trans($val); } print '
'.$langs->trans("FilterOnInto", $sall).implode(', ', $fieldstosearchall).'
'; @@ -569,7 +569,7 @@ if (isModEnabled('category') && ($user->hasRight('produit', 'lire') || $user->ha include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); - $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 0, 0, 1); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'widthcentpercentminusx maxwidth300', 1); $moreforfilter .= '
'; } diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 3df93958453..a9a51bf849a 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -416,7 +416,7 @@ if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOSTINT('id') > 0 && !empty( if ($action == "update_extras" && GETPOSTINT('id') > 0 && !empty($permissiontoadd)) { $object->fetch(GETPOSTINT('id')); - $object->oldcopy = dol_clone($object, 2); + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty $attribute = GETPOST('attribute', 'alphanohtml'); @@ -644,6 +644,7 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) { // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd)) { + // @phan-suppress-next-line PhanPluginBothLiteralsBinaryOp if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } else { diff --git a/htdocs/core/actions_comments.inc.php b/htdocs/core/actions_comments.inc.php index 19c79357081..fbbe2955d5d 100644 --- a/htdocs/core/actions_comments.inc.php +++ b/htdocs/core/actions_comments.inc.php @@ -1,6 +1,7 @@ * Copyright (C) 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 @@ -32,6 +33,12 @@ * @var string $contextpage */ +// Next should be define in the including php source file +' +@phan-var-force int $withproject +@phan-var-force int $idcomment +'; + require_once DOL_DOCUMENT_ROOT.'/core/class/comment.class.php'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; diff --git a/htdocs/core/actions_lineupdown.inc.php b/htdocs/core/actions_lineupdown.inc.php index 4e99c6c3661..a787ea604dd 100644 --- a/htdocs/core/actions_lineupdown.inc.php +++ b/htdocs/core/actions_lineupdown.inc.php @@ -1,6 +1,7 @@ * Copyright (C) 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 @@ -27,7 +28,11 @@ // $permissiontoedit must be defined to permission to edit object // $object must be defined // $langs must be defined -// $hidedetails, $hidedesc, $hideref must de defined +// $hidedetails, $hidedesc, $hideref must defined +' +@phan-var-force bool $permissiontoedit +@phan-var-force CommonObject $object +'; /** * @var CommonObject $object * @var Conf $conf diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index fd2757c3f1d..9c77041439d 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -3,6 +3,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Ferran Marcet * Copyright (C) 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 @@ -37,6 +38,10 @@ * @var string $confirm * @var string $forceFullTextIndexation */ +' +@phan-var-force string $upload_dir +@phan-var-force string $forceFullTextIndexation +'; // Protection to understand what happen when submitting files larger than post_max_size if (GETPOSTINT('uploadform') && empty($_POST) && empty($_FILES)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 77e8bcf5240..872aa9ae73a 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -545,6 +545,11 @@ if (!$error && $massaction == 'confirm_presend') { $substitutionarray['__EMAIL__'] = $thirdparty->email; $substitutionarray['__CHECK_READ__'] = ''; + if ($oneemailperrecipient) { + $substitutionarray['__ONLINE_PAYMENT_URL__'] = ''; + $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = ''; + } + $parameters = array('mode' => 'formemail'); if (!empty($listofobjectthirdparties)) { @@ -923,6 +928,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto $pdf->SetCompression(false); } + $pagecount = 0; // Add all others foreach ($files as $file) { // Charge un document PDF depuis un fichier. @@ -1924,7 +1930,7 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf } if (empty($toselect)) { - $toselect=[]; + $toselect = []; } $parameters['toselect'] = &$toselect; $parameters['uploaddir'] = $uploaddir; diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index f6f812d86b0..255cd8818f4 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -138,10 +138,11 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $langs->load('mails'); + $sendtosocid = 0; // Id of related thirdparty + if (is_object($object)) { $result = $object->fetch($id); - $sendtosocid = 0; // Id of related thirdparty if (method_exists($object, "fetch_thirdparty") && !in_array($object->element, array('member', 'user', 'expensereport', 'societe', 'contact'))) { $resultthirdparty = $object->fetch_thirdparty(); $thirdparty = $object->thirdparty; @@ -339,7 +340,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO // $message = preg_replace('/()/', '\1'.$urlwithroot.'/viewimage.php\2modulepart=medias\3file=\4\5', $message); - $sendtobcc = GETPOST('sendtoccc'); + $sendtobcc = GETPOST('sendtoccc', 'alphawithlgt'); // Autocomplete the $sendtobcc // $autocopy can be MAIN_MAIL_AUTOCOPY_PROPOSAL_TO, MAIN_MAIL_AUTOCOPY_ORDER_TO, MAIN_MAIL_AUTOCOPY_INVOICE_TO, MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO... if (!empty($autocopy)) { @@ -436,7 +437,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO // Call of triggers (you should have set $triggersendname to execute trigger. $trigger_name is deprecated) if (!empty($triggersendname) || !empty($trigger_name)) { // Call trigger - $result = $object->call_trigger(empty($triggersendname) ? $trigger_name : $triggersendname, $user); + $result = $object->call_trigger(empty($triggersendname) ? $trigger_name : $triggersendname, $user); // @phan-suppress-current-line PhanPossiblyUndeclaredGlobalVariable if ($result < 0) { $error++; } @@ -454,7 +455,8 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO setEventMessages($mesg, null, 'mesgs'); $moreparam = ''; - if (isset($paramval2)) { + if (isset($paramval2)) { // @phan-var-suppress-current-line PhanPluginUndeclaredVariableIsset + // @phan-var-suppress-next-line PhanUndeclaredGlobalVariable $moreparam .= '&'.($paramname2 ? $paramname2 : 'mid').'='.$paramval2; } header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname ?? 'id').'='.(is_object($object) ? $object->id : '').$moreparam); diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index fd622c1017f..8439660f6c8 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -41,15 +41,15 @@ * @var ?int $nomessageinsetmoduleoptions */ +' +@phan-var-force FormSetup $formSetup +'; + if ($action == 'update' && !empty($formSetup) && is_object($formSetup) && !empty($user->admin)) { $formSetup->saveConfFromPost(); return; } -' -@phan-var-force FormSetup $formSetup -'; - $upload_dir = null; if ($action == 'update' && !empty($arrayofparameters) && is_array($arrayofparameters) && !empty($user->admin)) { @@ -129,13 +129,19 @@ if ($action == 'setModuleOptions' && !empty($user->admin)) { foreach ($_POST as $key => $val) { $reg = array(); if (preg_match('/^param(\d*)$/', $key, $reg)) { // Works for POST['param'], POST['param1'], POST['param2'], ... - $param = GETPOST("param".$reg[1], 'alpha'); + $param = GETPOST("param".$reg[1], 'aZ09'); $value = GETPOST("value".$reg[1], 'alpha'); if ($param) { $res = dolibarr_set_const($db, $param, $value, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } + + // Case we modify the list of directories for ODT templases, we want to be sure directory exists + if (preg_match('/_ADDON_PDF_ODT_PATH$/', $param) && preg_match('/^DOL_DATA_ROOT/', $value)) { + $tmpdir = preg_replace('/^DOL_DATA_ROOT/', DOL_DATA_ROOT, $value); + dol_mkdir($tmpdir, DOL_DATA_ROOT); + } } } } diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index ec7c39aecf6..51f053c9eda 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -67,6 +67,8 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call $sortfield = GETPOST("sortfield", 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); + $showonrightsize = ''; + if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 330f398feed..2c4bca52883 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -90,6 +90,7 @@ $langs->load("ecm"); // Define fullpathselecteddir. $fullpathselecteddir = ''; +$fullpathpreopened = ''; if ($modulepart == 'ecm') { $fullpathselecteddir = $conf->ecm->dir_output.'/'.($selecteddir != '/' ? $selecteddir : ''); $fullpathpreopened = $conf->ecm->dir_output.'/'.($preopened != '/' ? $preopened : ''); @@ -367,7 +368,7 @@ if ((!isset($mode) || $mode != 'noajax') && is_object($db)) { /** * treeOutputForAbsoluteDir * - * @param array $sqltree Sqltree + * @param array $sqltree Sqltree * @param string $selecteddir Selected dir * @param string $fullpathselecteddir Full path of selected dir * @param string $modulepart Modulepart diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index 735c14c7a03..f7d12c6477e 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -1,6 +1,7 @@ * Copyright (C) 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 @@ -91,6 +92,7 @@ if (!empty($objectfield)) { } } +$objecttmp = null; if ($objectdesc) { // Example of value for $objectdesc: // Bom:bom/class/bom.class.php:0:t.status=1 @@ -145,10 +147,10 @@ if ($usesublevelpermission && !isset($user->rights->$module->$element)) { // The $searchkey = (($id && GETPOST((string) $id, 'alpha')) ? GETPOST((string) $id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : '')); // Add a security test to avoid to get content of all tables -if (!empty($objecttmp->module)) { +if ($objecttmp !== null && !empty($objecttmp->module)) { restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element); } else { - restrictedArea($user, $objecttmp->element, $id); + restrictedArea($user, $objecttmp !== null ? $objecttmp->element : '', $id); } @@ -162,7 +164,7 @@ top_httphead($outjson ? 'application/json' : 'text/html'); //print ''."\n"; -$arrayresult = $form->selectForFormsList($objecttmp, $htmlname, '', 0, $searchkey, '', '', '', 0, 1, 0, '', $filter); +$arrayresult = $form->selectForFormsList($objecttmp, $htmlname, 0, 0, $searchkey, '', '', '', 0, 1, 0, '', $filter); $db->close(); diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 7b35d487bb3..366b2efdc19 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -1,6 +1,7 @@ * Copyright (C) 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 @@ -30,6 +31,7 @@ * @var Translate $langs * @var User $user */ +'@phan-var-force ?int<0,1> $usedbyinclude'; if (!isset($usedbyinclude) || empty($usedbyinclude)) { if (!defined('NOTOKENRENEWAL')) { @@ -127,7 +129,7 @@ if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERM $arrayresult['searchintosupplierorder'] = array('position' => 110, 'img' => 'object_supplier_order', 'label' => $langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text' => img_picto('', 'object_supplier_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url' => DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } if (isModEnabled('reception') && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_RECEPTION_DISABLED') && $user->hasRight('reception', 'lire')) { - $arrayresult['searchintoreception'] = array('position'=>115, 'img'=>'object_reception', 'label'=>$langs->trans("SearchIntoSupplierReceptions", $search_boxvalue), 'text'=>img_picto('', 'object_reception', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierReceptions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/reception/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintoreception'] = array('position' => 115, 'img' => 'object_reception', 'label' => $langs->trans("SearchIntoSupplierReceptions", $search_boxvalue), 'text' => img_picto('', 'object_reception', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierReceptions", $search_boxvalue), 'url' => DOL_URL_ROOT.'/reception/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'facture', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED')) { $arrayresult['searchintosupplierinvoice'] = array('position' => 120, 'img' => 'object_supplier_invoice', 'label' => $langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text' => img_picto('', 'object_supplier_invoice', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url' => DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php index e59b2ef2edb..e3fcdbc8545 100644 --- a/htdocs/core/bookmarks_page.php +++ b/htdocs/core/bookmarks_page.php @@ -97,7 +97,7 @@ $bookmarkList = ''; $searchForm = ''; -if (empty($conf->bookmark->enabled)) { +if (!isModEnabled('bookmark')) { $langs->load("admin"); $bookmarkList .= '
'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Bookmarks")).''; $bookmarkList .= '

'; diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index f5c5c6b49d3..d10a3db50fd 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -58,7 +58,7 @@ class box_last_modified_ticket extends ModeleBoxes */ public function loadBox($max = 5) { - global $conf, $user, $langs; + global $user, $langs; $this->max = $max; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index e7edd7ea7c4..268de88d57f 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -803,7 +803,6 @@ class CMailFile $this->errors[] = $e->getMessage(); } } - //if (!empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to)); if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) { try { $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from)); diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index c574c2be541..0443099f9dd 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1565,6 +1565,14 @@ abstract class CommonDocGenerator $extrafieldOutputContent = dol_string_nohtmltag($extrafieldOutputContent); } + // Display stars extrafield as simple string + if ($extrafields->attributes[$object->table_element]['type'][$extrafieldKey] == 'stars') { + $extrafieldOutputContent = ''; + for ($i = 0; $i < $object->array_options[$extrafieldOptionsKey]; $i++) { + $extrafieldOutputContent .= ' *'; + } + } + $parameters = array( 'object' => $object, 'extrafields' => $extrafields, diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fd132fc9b28..80bbf2c800f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -129,7 +129,7 @@ abstract class CommonObject public $ismultientitymanaged; /** - * @var string Key value used to track if data is coming from import wizard + * @var ?string Key value used to track if data is coming from import wizard */ public $import_key; @@ -1708,7 +1708,7 @@ abstract class CommonObject $tab = array(); - $sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle as type_label, tc.position, tc.element"; + $sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle as type_label, tc.position, tc.element, tc.module"; $sql .= " FROM ".$this->db->prefix()."c_type_contact as tc"; $sqlWhere = array(); @@ -1745,7 +1745,7 @@ abstract class CommonObject $langs->loadLangs(array("propal", "orders", "bills", "suppliers", "contracts", "supplier_proposal")); while ($obj = $this->db->fetch_object($resql)) { - $modulename = $obj->element; + $modulename = $obj->module ?? $obj->element; if (strpos($obj->element, 'project') !== false) { $modulename = 'projet'; } elseif ($obj->element == 'contrat') { @@ -4292,7 +4292,7 @@ abstract class CommonObject */ public function fetchObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '', $clause = 'OR', $alsosametype = 1, $orderby = 'sourcetype', $loadalsoobjects = 1) { - global $conf, $hookmanager, $action; + global $hookmanager, $action; // Important for pdf generation time reduction // This boolean is true if $this->linkedObjects has already been loaded with all objects linked without filter @@ -7424,6 +7424,8 @@ abstract class CommonObject { global $conf, $langs, $form; + // TODO pass the current object as a parameter to give more flexibility (like disable showing input for extra fields when canAlwaysBeEdited is false and $object->status is not draft...) + if (!is_object($form)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $form = new Form($this->db); @@ -8324,6 +8326,8 @@ abstract class CommonObject { global $conf, $langs, $form; + // TODO pass the current object as a parameter to give more flexibility (like disable ajax update when canAlwaysBeEdited is false and $object->status is not draft...) + if (!is_object($form)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $form = new Form($this->db); @@ -8676,7 +8680,7 @@ abstract class CommonObject $sql = "SELECT ".$keyList; $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; - if (strpos($InfoFieldList[4], 'extra') !== false) { + if (isset($InfoFieldList[4]) && strpos($InfoFieldList[4], 'extra') !== false) { $sql .= ' as main'; } // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; @@ -9297,7 +9301,7 @@ abstract class CommonObject } } $datekey = $keyprefix.'options_'.$key.$keysuffix; - $value = (GETPOSTISSET($datekey)) ? dol_mktime(12, 0, 0, GETPOSTINT($datekey.'month', 3), GETPOSTINT($datekey.'day', 3), GETPOSTINT($datekey.'year', 3)) : $datenotinstring; + $value = (GETPOSTISSET($datekey) && $this->id == GETPOST('elrowid', 'int')) ? dol_mktime(12, 0, 0, GETPOSTINT($datekey.'month', 3), GETPOSTINT($datekey.'day', 3), GETPOSTINT($datekey.'year', 3)) : $datenotinstring; } if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('datetime'))) { $datenotinstring = null; diff --git a/htdocs/core/class/commonpeople.class.php b/htdocs/core/class/commonpeople.class.php index 222fe8b5424..8bd31082ba7 100644 --- a/htdocs/core/class/commonpeople.class.php +++ b/htdocs/core/class/commonpeople.class.php @@ -128,6 +128,27 @@ trait CommonPeople return dol_string_nohtmltag(dol_trunc($ret, $maxlen)); } + + /** + * Return civility label of object + * + * @return string Translated name of civility + */ + public function getCivilityLabel() + { + global $langs; + + $code = (!empty($this->civility_code) ? $this->civility_code : (!empty($this->civility_id) ? $this->civility : (!empty($this->civilite) ? $this->civilite : ''))); + if (empty($code)) { + return ''; + } + + $langs->load("dict"); + return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civility", "code", "label", $code); + } + + + /** * Return full address for banner * diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index a86f0551bab..02e4d63e5f0 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -951,11 +951,14 @@ class Conf extends stdClass } // conf->liste_limit = constant to limit size of lists + // This value can be overwritten by user choice in main.inc.php $this->liste_limit = getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT', 15); if ((int) $this->liste_limit <= 0) { - // Mode automatic. + // Mode automatic. Similar code than into main.inc.php $this->liste_limit = 15; - if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { + if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 700) { + $this->liste_limit = 8; + } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { $this->liste_limit = 10; } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] > 1130) { $this->liste_limit = 20; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 49a2f02f004..ca71e0df442 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -782,6 +782,9 @@ class DolGraph { // phpcs:enable $max = $this->GetMaxValueInData(); + if (!isset($max)) { + $max = 0; + } if ($max != 0) { $max++; } @@ -792,9 +795,7 @@ class DolGraph } $res = 0; - if (is_numeric($max)) { - $res = ceil($max / $factor) * $factor; - } + $res = ceil($max / $factor) * $factor; //print "max=".$max." res=".$res; return (int) $res; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 85b02f4069b..913c8937a7a 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -619,7 +619,9 @@ class ExtraFields $sql = "DELETE FROM ".$this->db->prefix()."extrafields"; $sql .= " WHERE name = '".$this->db->escape($attrname)."'"; $sql .= " AND entity IN (0,".$conf->entity.')'; - $sql .= " AND elementtype = '".$this->db->escape($elementtype)."'"; + if (!empty($elementtype)) { + $sql .= " AND elementtype = '".$this->db->escape($elementtype)."'"; + } dol_syslog(get_class($this)."::delete_label", LOG_DEBUG); $resql = $this->db->query($sql); @@ -2028,6 +2030,14 @@ class ExtraFields $list = (string) dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2'); $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $cssview = $this->attributes[$extrafieldsobjectkey]['cssview'][$key]; + $alwayseditable = $this->attributes[$extrafieldsobjectkey]['alwayseditable'][$key]; + + // If alwayseditable is false, and object is not in draft, then we show value instead of input field + $showValueInsteadOfInputField = 0; // Variable used to disable update of fields via ajax + // @phan-suppress-next-line PhanUndeclaredConstantOfClass + if ($alwayseditable == 0 && !is_numeric($object) && isset($object->status) && $object->status != $object::STATUS_DRAFT) { + $showValueInsteadOfInputField = 1; + } $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) @@ -2370,7 +2380,12 @@ class ExtraFields $value = dol_trunc(preg_replace('/./i', '*', $value), 8, 'right', 'UTF-8', 1); } elseif ($type == 'stars') { $objectid = (int) $object->id; - $value = ''; + if ($showValueInsteadOfInputField == 1) { + $value = ''; + } else { + $value = ''; + } + $value .= '
'; $i = 1; while ($i <= $size) { @@ -2380,11 +2395,13 @@ class ExtraFields $value .= '
'; $value .= ''; } else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c471ea18b23..e61568e6209 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7207,7 +7207,7 @@ class Form $shour = ''; $smin = ''; $ssec = ''; - if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/', $set_time, $reg)) { // deprecated usage + if (!empty($set_time) && preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/', $set_time, $reg)) { // deprecated usage // Date format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' $syear = (!empty($reg[1]) ? $reg[1] : ''); $smonth = (!empty($reg[2]) ? $reg[2] : ''); @@ -9698,10 +9698,12 @@ class Form */ public function showLinkToObjectBlock($object, $restrictlinksto = array(), $excludelinksto = array(), $nooutput = 0) { - global $conf, $langs, $hookmanager; + global $conf, $langs, $hookmanager, $form; global $action; - $form = new Form($this->db); + if (empty($form)) { + $form = new Form($this->db); + } $linktoelem = ''; $linktoelemlist = ''; @@ -9716,16 +9718,16 @@ class Form $dontIncludeCompletedItems = getDolGlobalString('DONT_INCLUDE_COMPLETED_ELEMENTS_LINKS'); if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $listofidcompanytoscan = $object->thirdparty->id; + $listofidcompanytoscan = (int) $object->thirdparty->id; if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; + $listofidcompanytoscan .= ',' . (int) $object->thirdparty->parent; } if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; $tmpproject = new Project($this->db); $tmpproject->fetch($object->fk_project); if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { - $listofidcompanytoscan .= ',' . $tmpproject->socid; + $listofidcompanytoscan .= ',' . (int) $tmpproject->socid; } unset($tmpproject); } @@ -9735,63 +9737,76 @@ class Form 'enabled' => isModEnabled('propal'), 'perms' => 1, 'label' => 'LinkToProposal', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : '')), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''), + ), 'shipping' => array( 'enabled' => isModEnabled('shipping'), 'perms' => 1, 'label' => 'LinkToExpedition', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : '')), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : ''), + ), 'order' => array( 'enabled' => isModEnabled('order'), 'perms' => 1, 'label' => 'LinkToOrder', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : '')), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : ''), + 'linkname' => 'commande', + ), 'invoice' => array( 'enabled' => isModEnabled('invoice'), 'perms' => 1, 'label' => 'LinkToInvoice', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''), + 'linkname' => 'facture', + ), 'invoice_template' => array( 'enabled' => isModEnabled('invoice'), 'perms' => 1, 'label' => 'LinkToTemplateInvoice', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''), + ), 'contrat' => array( 'enabled' => isModEnabled('contract'), 'perms' => 1, 'label' => 'LinkToContract', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht - FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' + FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier', ), 'fichinter' => array( 'enabled' => isModEnabled('intervention'), 'perms' => 1, 'label' => 'LinkToIntervention', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')'), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')', + ), 'supplier_proposal' => array( 'enabled' => isModEnabled('supplier_proposal'), 'perms' => 1, 'label' => 'LinkToSupplierProposal', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : '')), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''), + ), 'order_supplier' => array( 'enabled' => isModEnabled("supplier_order"), 'perms' => 1, 'label' => 'LinkToSupplierOrder', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : '')), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : ''), + ), 'invoice_supplier' => array( 'enabled' => isModEnabled("supplier_invoice"), 'perms' => 1, 'label' => 'LinkToSupplierInvoice', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''), + ), 'ticket' => array( 'enabled' => isModEnabled('ticket'), 'perms' => 1, 'label' => 'LinkToTicket', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : '')), + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : ''), + ), 'mo' => array( 'enabled' => isModEnabled('mrp'), 'perms' => 1, 'label' => 'LinkToMo', - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : '')) + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''), + ), ); } @@ -9819,11 +9834,14 @@ class Form } } + if (!empty($possiblelinks)) { + $object->fetchObjectLinked(); + } + // Build the html part with possible suggested links $htmltoenteralink = ''; foreach ($possiblelinks as $key => $possiblelink) { $num = 0; - if (empty($possiblelink['enabled'])) { continue; } @@ -9879,10 +9897,19 @@ class Form $htmltoenteralink .= '
'; - $htmltoenteralink .= ''; + if ($alreadylinked) { + $htmltoenteralink .= img_picto('', 'link'); + } else { + $htmltoenteralink .= ''; + } $htmltoenteralink .= '' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '