diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d23fe1be28a..5c0b747191d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -210,7 +210,7 @@ repos: - -x - dev/tools/codespell/codespell-lines-ignore.txt exclude_types: [image] - exclude: (?x)^(.phan/stubs/.*)$ + exclude: (?x)^(.phan/stubs/.*|phpstan\.neon.*)$ additional_dependencies: [tomli] - alias: codespell-lang-en_US # Only for translations with specialised exceptions diff --git a/ChangeLog b/ChangeLog index 7f4bf72cd74..a8241b7557a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,10 @@ NEW: Accountancy - Add possibility for specific format FEC to sort with the FEC NEW: Accountancy - Expense report - Add an option to use end period for transfer (#26706) NEW: Accountancy - Show accounting result on balance NEW: Accountancy - Show import key if exist (#29265) +NEW: Accountancy - Auto-determine piece number in FEC import (#29672) +NEW: Accountancy - Option to transfer only reconciled lines from bank (#29408) +NEW: Accountancy - Separation of accounting default account for salary and expense report +NEW: Various payment - Use list of accounting account when edit (#27992) NEW: Add option to change all service dates at once NEW: Add a default limit in nb to agenda export NEW: Add a Feedback-ID into email headers @@ -97,7 +101,6 @@ NEW: Allow smileys into emailing html content NEW: Allow to set a default project for POS sales (#27042) NEW: animation for display spinner when waiting response NEW: Asset Module - make asset model creation in a single step (#26982) -NEW: auto-determine piece number in FEC import (#29672) NEW: auto fill infos in template email NEW: Automatically fill matching extra fields of object on line creation. (#27240) NEW: Can add documents on a payment (#29660) @@ -134,7 +137,7 @@ NEW: fetch object by element for website account card NEW: filter on sale representative in contact list NEW: Filter shipments by selecting multiple shipping methods (#28376) NEW: Font param Look and Feel (#29302) -NEW: fuctionnality for stock configuration prompt in AI module (#28030) +NEW: functionality for stock configuration prompt in AI module (#28030) NEW: functionality to delete contact of company list NEW: functionality to display codebar on pdf files (#29623) NEW: functionality to list event for user @@ -166,7 +169,6 @@ NEW: notification action triggers for cancelling orders and invoices NEW: now button when editing an event NEW: online signature of shipments (#29559) NEW: On OAuth Google login, no prompt at all if already logged in Google -NEW: Option to transfer only reconciliated lines from bank (#29408) NEW: Param to show main menu logo in color look and feel (#29305) NEW: Payment page received from donations NEW: possibility to define a completely inactive module (#29289) @@ -179,7 +181,6 @@ NEW: resource address, phone, email & maxusers (#28185) NEW: Script for fast identification of missing/unused/duplicate translations NEW: search member by date NEW: See the documents of my subordinates (#28318) -NEW: separation of expense report from salary accounting code NEW: Show error on ical parse NEW: Show the profit per attendee on events NEW: signed status CRUD to contract and fichinter @@ -206,7 +207,6 @@ NEW: Update expense report card.php to allow pdf preview even without thumbnail NEW: update price with auto to use const for rounding prices (#29350) NEW: Use a nicer combo list to select the export accounting format NEW: users can set their own length for short lists -NEW: Various payment - Use list of account when edit (#27992) NEW: warning message when cloning a product whose status is not to sell (#28374) PERF: Performance enhancement on Invoice/Paiement area page PERF: Use cache for loaded users/contact on project list @@ -219,6 +219,7 @@ SEC: Reduce nb of var without WAF used when using the website module For developers or integrators: ------------------------------ +NEW: Situation invoice - Add new official progressive mode - (constant INVOICE_USE_SITUATION = 2) NEW: $noescapetags param of dol_escape_html works if attributes NEW: Add createInvoiceFromContract to API invoice (#27277) NEW: add debugging info to api/status if non-production diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index e08db3c0ccb..c97194efa18 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -1,6 +1,7 @@ #!/usr/bin/env php + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -199,7 +200,7 @@ fputs($fp, ' '."\n"); fputs($fp, ''."\n"); asort($checksumconcat); // Sort list of checksum -//var_dump($checksumconcat); + fputs($fp, ''."\n"); fputs($fp, md5(join(',', $checksumconcat))."\n"); fputs($fp, ''."\n"); diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 442d991a453..9bc83dec400 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -2,6 +2,7 @@ * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2024 Frédéric France * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -225,7 +226,6 @@ if (!empty($argv[4])) { $user=new User($db); } -//var_dump($user->db->database_name); $ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'An admin user with login "admin" must exists to use this script.'."\n"; diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index e2acab0de53..b3557522702 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -81,7 +81,7 @@ $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 .= ", '".$this->db->idate($this->periode)."'"; $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode as period, cs.import_key"; - $sql .= ", periode='".$this->db->idate($this->periode)."'"; + $sql .= ", periode = '".$this->db->idate($this->period ? $this->period : $this->periode)."'"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, fk_user, date_creation)"; $sql = "SELECT id_users, nom as name, id_sondage, reponses"; $sql = "SELECT id_users, nom as name, reponses"; diff --git a/dev/tools/fixcopyrightheader.php b/dev/tools/fixcopyrightheader.php index cc0e40b8517..bda934bf3b7 100755 --- a/dev/tools/fixcopyrightheader.php +++ b/dev/tools/fixcopyrightheader.php @@ -42,6 +42,32 @@ const PREFIXES = [ 'php' => ['/* ', ' * ', ' */', '\d{4}))\s+{$r_name}\s*\<{$r_email}>~"; + // Based on the tendency to limit the length of the spacing between the name + // and email to the smallest one, determine the biggest offset from the start + // of a name to the start of the email, and use that for the current name/email + // offset if it is sufficient. + // Pattern to match any copyright already present + $allpattern = "~(?:{$r_prefix0}|{$r_prefix1})Copyright \(C\)\s+(?:(?:\d{4}-)?(?:\d{4}))\s+(\S.*)<\S+>~"; + // Set minimum offset based of width of new name + $nameStartToMailStartOffset = 4 * (int) ((mb_strlen($r_name) + 4) / 4); + + if (preg_match_all($allpattern, $lines, $allmatches)) { + foreach ($allmatches[1] as $nameAndSpaces) { + //print $nameAndSpaces."\n"; + $nameAndSpaces = expandTabs($nameAndSpaces, 4); + $currentOffset = mb_strlen($nameAndSpaces); + $currentOffset = 4 * (int) ((3 + $currentOffset) / 4); + //print "Other offset $nameAndSpaces: $currentOffset\n"; + if ($currentOffset > $nameStartToMailStartOffset) { + $nameStartToMailStartOffset = $currentOffset; + } + } + } + + // Pattern to match the line matching the current developer + $pattern = "~(?:{$r_prefix0}|{$r_prefix1})Copyright \(C\)\s+(?:(?:(?\d{4})-)?(?\d{4}))\s+{$r_name}\s*\<{$r_email}>~"; // Check if the lines match the pattern $matches = array(); if (preg_match($pattern, $lines, $matches)) { - $existingYear = $matches['year']; + $existingYear = $matches['last']; + if (array_key_exists('start', $matches)) { + $startYear = $matches['start']; + } else { + $startYear = $existingYear; + } // Check if the existing year is different from the current year if ($existingYear !== date('Y')) { - // Update the year range to include or be up to the current year - $updatedNotice = preg_replace('/(\d{4})(-\d{4})?\s+/', $existingYear . '-' . date('Y') . "\t", $matches[0]); + // Extend the year range to the current year + $updatedNotice = preg_replace('/(?:\d{4}-)?\d{4}\s+/', $startYear . '-' . date('Y') . "\t", $matches[0]); // Replace the old notice with the updated one in the file file_put_contents($filename, preg_replace($pattern, $updatedNotice, file_get_contents($filename))); @@ -90,7 +143,8 @@ function updateCopyrightNotice($filename, $fileType, $name, $email) // If the existing year is the same, no need to update } else { // Adjust tabs for proper alignment - $emailTabs = str_repeat("\t", (int) (max(0, (31 - mb_strlen($name)) / 4))); + // print "Offset:".$nameStartToMailStartOffset."\n"; + $emailTabs = str_repeat("\t", (int) (max(0, ($nameStartToMailStartOffset + 4 - mb_strlen($name)) / 4))); // No match found, add a new line to the header $newNotice = "Copyright (C) " . date('Y') . "\t\t" . $name . $emailTabs . "<" . $email . ">"; @@ -114,6 +168,7 @@ function updateCopyrightNotice($filename, $fileType, $name, $email) // Write the updated content back to the file file_put_contents($filename, $fileContent); + // print $fileContent; return true; // Change detected } diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 23be6232f60..b0be4551f2b 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,40 +9,40 @@ */ return [ // # Issue statistics: - // PhanPluginUnknownPropertyType : 1550+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 920+ occurrences - // PhanUndeclaredProperty : 840+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 750+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 480+ occurrences - // PhanUndeclaredGlobalVariable : 470+ occurrences - // PhanPluginUnknownArrayMethodParamType : 410+ occurrences - // PhanPossiblyUndeclaredVariable : 350+ occurrences - // PhanPluginUnknownObjectMethodCall : 330+ occurrences - // PhanPluginUnknownArrayFunctionReturnType : 220+ occurrences - // PhanTypeMismatchProperty : 210+ occurrences - // PhanPluginUnknownArrayFunctionParamType : 160+ occurrences + // PhanPluginUnknownPropertyType : 1490+ occurrences + // PhanUndeclaredProperty : 830+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 740+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 720+ occurrences + // PhanUndeclaredGlobalVariable : 440+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 430+ occurrences + // PhanPluginUnknownArrayMethodParamType : 360+ occurrences + // PhanPossiblyUndeclaredVariable : 320+ occurrences + // PhanPluginUnknownObjectMethodCall : 200+ occurrences + // PhanTypeMismatchProperty : 200+ occurrences + // PhanPluginUnknownArrayFunctionReturnType : 160+ occurrences + // PhanPluginUnknownArrayFunctionParamType : 150+ occurrences // PhanTypeMismatchArgumentNullableInternal : 110+ occurrences // PhanPluginUnknownArrayPropertyType : 80+ occurrences // PhanPluginUndeclaredVariableIsset : 70+ occurrences - // PhanPluginEmptyStatementIf : 60+ occurrences - // PhanRedefineFunction : 55+ occurrences - // PhanTypeExpectedObjectPropAccess : 50+ occurrences + // PhanPluginEmptyStatementIf : 55+ occurrences + // PhanRedefineFunction : 50+ occurrences // PhanTypeSuspiciousNonTraversableForeach : 50+ occurrences - // PhanTypeMismatchDimFetch : 40+ occurrences + // PhanTypeMismatchDimFetch : 35+ occurrences + // PhanTypeExpectedObjectPropAccess : 25+ occurrences // PhanPossiblyNullTypeMismatchProperty : 15+ occurrences // PhanTypeComparisonFromArray : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences // PhanEmptyForeach : 10+ occurrences - // PhanPluginBothLiteralsBinaryOp : 10+ occurrences // PhanPluginConstantVariableNull : 10+ occurrences - // PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences // PhanPluginSuspiciousParamPosition : 10+ occurrences - // PhanTypeExpectedObjectPropAccessButGotNull : 9 occurrences // PhanUndeclaredMethod : 9 occurrences + // PhanPluginBothLiteralsBinaryOp : 8 occurrences // PhanPluginDuplicateArrayKey : 8 occurrences + // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences // PhanTypeMismatchDimFetchNullable : 7 occurrences + // PhanTypeExpectedObjectPropAccessButGotNull : 6 occurrences + // PhanParamTooMany : 3 occurrences // PhanInvalidFQSENInClasslike : 2 occurrences - // PhanParamTooMany : 2 occurrences // PhanAccessMethodProtected : 1 occurrence // PhanEmptyFQSENInClasslike : 1 occurrence @@ -52,10 +52,7 @@ return [ 'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'], 'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => [/* Traverses Adherent as array, ignore */ 'PhanTypeSuspiciousNonTraversableForeach'], 'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/admin/dict.php' => ['PhanRedefineFunction'], 'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/admin/mails_templates.php' => ['PhanRedefineFunction'], - 'htdocs/admin/security_file.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], @@ -63,7 +60,7 @@ return [ 'htdocs/api/class/api_status.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/asset/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/asset/class/assetaccountancycodes.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'], @@ -96,11 +93,10 @@ return [ 'htdocs/bookcal/lib/bookcal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/bookcal/lib/bookcal_availabilities.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/bookcal/lib/bookcal_calendar.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/bookmarks/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/bookmarks/class/bookmark.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/categories/class/categorie.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanTypeMismatchProperty'], - 'htdocs/categories/edit.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch'], + 'htdocs/categories/edit.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/categories/index.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/categories/info.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/categories/photos.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch'], @@ -118,24 +114,22 @@ return [ 'htdocs/comm/action/list.php' => ['PhanTypeMismatchProperty'], 'htdocs/comm/action/pertype.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchDimFetch'], 'htdocs/comm/action/peruser.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanTypeComparisonFromArray'], - 'htdocs/comm/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/mailing/cibles.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/comm/mailing/class/advtargetemailing.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], 'htdocs/comm/mailing/class/html.formadvtargetemailing.class.php' => ['PhanPluginUnknownArrayMethodParamType'], - 'htdocs/comm/mailing/class/mailing.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], + 'htdocs/comm/mailing/class/mailing.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'], - 'htdocs/comm/propal/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/propal/class/propal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/comm/propal/class/propalestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/commande/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/commande/class/commande.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], + 'htdocs/commande/class/commande.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/commande/class/commandestats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/commande/customer.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/commande/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/commande/list_det.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/commande/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -145,7 +139,7 @@ return [ 'htdocs/compta/bank/annuel.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/bank/bankentries_list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/bank/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/bank/class/account.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/compta/bank/class/account.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/class/api_bankaccounts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/bank/class/bankcateg.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/compta/bank/graph.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -157,10 +151,10 @@ 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', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/cashcontrol/class/cashcontrol.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/compta/deplacement/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/deplacement/class/deplacement.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/compta/deplacement/class/deplacementstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], @@ -196,8 +190,8 @@ return [ 'htdocs/compta/paiement/class/cpaiement.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/compta/paiement/class/paiement.class.php' => ['PhanEmptyForeach', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/paiement_charge.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/paiement_vat.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + '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/class/bonprelevement.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'], @@ -220,13 +214,13 @@ return [ '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', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/compta/stats/cabyprodserv.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/compta/stats/cabyuser.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/stats/casoc.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + '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', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/stats/supplier_turnover_by_thirdparty.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + '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', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/compta/tva/class/tva.class.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -243,7 +237,7 @@ return [ 'htdocs/contact/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contact/perso.php' => ['PhanTypeMismatchProperty'], 'htdocs/contrat/agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/contrat/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/contrat/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/contrat/messaging.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contrat/services_list.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgumentProbablyReal'], @@ -253,10 +247,10 @@ return [ 'htdocs/core/actions_comments.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/actions_extrafields.inc.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/actions_lineupdown.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/actions_linkedfiles.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/actions_linkedfiles.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/actions_massactions.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/actions_printing.inc.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/actions_setmoduleoptions.inc.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/core/ajax/ajaxdirpreview.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -270,16 +264,15 @@ return [ 'htdocs/core/boxes/box_actions_future.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_external_rss.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/boxes/box_funnel_of_prospection.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/boxes/box_graph_invoices_permonth.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/boxes/box_graph_invoices_peryear.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/boxes/box_graph_invoices_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/boxes/box_graph_invoices_permonth.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/boxes/box_graph_invoices_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/boxes/box_graph_nb_tickets_type.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/boxes/box_graph_new_vs_close_ticket.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_graph_orders_permonth.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/boxes/box_graph_orders_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/boxes/box_graph_product_distribution.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/boxes/box_graph_propales_permonth.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/boxes/box_graph_orders_permonth.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/boxes/box_graph_orders_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/boxes/box_graph_product_distribution.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/boxes/box_graph_propales_permonth.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/boxes/box_graph_ticket_by_severity.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/boxes/box_last_modified_ticket.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/boxes/box_last_ticket.php' => ['PhanPluginUnknownPropertyType'], @@ -293,10 +286,10 @@ return [ 'htdocs/core/class/canvas.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/ccountry.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/core/class/cgenericdic.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/core/class/commondocgenerator.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], + 'htdocs/core/class/commondocgenerator.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], 'htdocs/core/class/commonhookactions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/commoninvoice.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/class/commonobject.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], + 'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanUndeclaredProperty'], 'htdocs/core/class/commonobjectline.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/class/commonorder.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'], @@ -307,7 +300,6 @@ return [ 'htdocs/core/class/ctypent.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/class/ctyperesource.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/core/class/cunits.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/class/defaultvalues.class.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/diasporahandler.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/discount.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/class/doleditor.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], @@ -322,7 +314,7 @@ return [ 'htdocs/core/class/extralanguages.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], 'htdocs/core/class/fediverseparser.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/class/fileupload.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch'], - 'htdocs/core/class/fiscalyear.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'], + 'htdocs/core/class/fiscalyear.class.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/class/hookmanager.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/html.formaccounting.class.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/class/html.formbarcode.class.php' => ['PhanPluginUnknownArrayMethodParamType'], @@ -335,7 +327,6 @@ return [ 'htdocs/core/class/html.formother.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/html.formprojet.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/html.formsetup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/html.formsms.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccessButGotNull'], 'htdocs/core/class/html.formticket.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/class/html.formwebsite.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/infobox.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -346,7 +337,7 @@ return [ 'htdocs/core/class/notify.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/openid.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/core/class/reddithandler.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType'], - 'htdocs/core/class/rssparser.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccess'], + 'htdocs/core/class/rssparser.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/class/smtps.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchDimFetch'], 'htdocs/core/class/socialnetworkmanager.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/class/stats.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchDimFetch'], @@ -369,23 +360,18 @@ return [ 'htdocs/core/lib/ajax.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/lib/asset.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/bank.lib.php' => ['PhanPluginEmptyStatementIf', 'PhanUndeclaredProperty'], - 'htdocs/core/lib/categories.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/company.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'], - 'htdocs/core/lib/contact.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/contract.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/cron.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/customreports.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchDimFetch'], 'htdocs/core/lib/date.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/doc.lib.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/donation.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/ecm.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/emailing.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/eventorganization.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/expedition.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/expensereport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/fichinter.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/core/lib/fiscalyear.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], + 'htdocs/core/lib/files.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/fourn.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/ftp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/functions.lib.php' => ['PhanPluginDuplicateArrayKey'], @@ -403,16 +389,15 @@ return [ 'htdocs/core/lib/loan.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/mailmanspip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/memory.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/multicurrency.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], + 'htdocs/core/lib/multicurrency.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/lib/oauth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/openid_connect.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/order.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/payments.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/pdf.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/lib/pdf.lib.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], 'htdocs/core/lib/prelevement.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/product.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/project.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/propal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/lib/receiptprinter.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/reception.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], @@ -421,18 +406,16 @@ return [ 'htdocs/core/lib/salaries.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/security.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], 'htdocs/core/lib/security2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/lib/sendings.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/lib/sendings.lib.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/lib/signature.lib.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/socialnetwork.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/stock.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/supplier_proposal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/lib/takepos.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/tax.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable'], + 'htdocs/core/lib/tax.lib.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/lib/ticket.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/core/lib/treeview.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'], - 'htdocs/core/lib/trip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/core/lib/usergroups.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/lib/vat.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], + 'htdocs/core/lib/usergroups.lib.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/lib/website.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/lib/xcal.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/DolibarrModules.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], @@ -532,10 +515,9 @@ return [ 'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'], 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'], - 'htdocs/core/tpl/advtarget.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/bloc_comment.tpl.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/card_presend.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/tpl/card_presend.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/commonfields_add.tpl.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/core/tpl/commonfields_edit.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/commonfields_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -556,8 +538,8 @@ return [ 'htdocs/core/tpl/objectline_title.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/tpl/onlinepaymentlinks.tpl.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/resource_add.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/resource_view.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/triggers/dolibarrtriggers.class.php' => ['PhanPluginUnknownArrayPropertyType'], @@ -568,13 +550,12 @@ return [ 'htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess'], 'htdocs/core/triggers/interface_80_modStripe_Stripe.class.php' => ['PhanPluginEmptyStatementIf', 'PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/cron/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/cron/class/cronjob.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], + 'htdocs/cron/card.php' => ['PhanPluginBothLiteralsBinaryOp'], + 'htdocs/cron/class/cronjob.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/cron/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/datapolicy/class/datapolicy.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/datapolicy/lib/datapolicy.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/dav/dav.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/debugbar/class/DataCollector/DolConfigCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/debugbar/class/DataCollector/DolMemoryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'], @@ -626,7 +607,7 @@ return [ 'htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/expedition/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/expedition/class/api_shipments.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/expedition/class/expedition.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/expedition/class/expedition.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/expedition/class/expeditionlinebatch.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/expedition/class/expeditionstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expedition/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -636,24 +617,22 @@ return [ 'htdocs/expedition/note.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/expedition/shipment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/expedition/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/expensereport/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/expensereport/class/expensereport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeExpectedObjectPropAccessButGotNull'], - 'htdocs/expensereport/class/expensereport_ik.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/expensereport/class/expensereport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeExpectedObjectPropAccessButGotNull'], 'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/expensereport/payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/payment/info.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/expensereport/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/expensereport/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/expensereport/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/expensereport/tpl/expensereport_addfile.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/tpl/expensereport_linktofile.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/fichinter/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], - 'htdocs/fichinter/class/fichinter.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], + 'htdocs/fichinter/class/fichinter.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/fichinterstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -680,16 +659,16 @@ return [ 'htdocs/fourn/facture/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], 'htdocs/fourn/facture/list-rec.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/fourn/facture/paiement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/fourn/facture/paiement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], 'htdocs/fourn/paiement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/product/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/ftp/admin/ftpclient.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/holiday/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/holiday/card_group.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], - 'htdocs/holiday/class/holiday.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/holiday/class/holiday.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/holiday/define_holiday.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/holiday/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/hrm/admin/admin_hrm.php' => ['PhanEmptyForeach', 'PhanTypeMismatchArgumentProbablyReal'], @@ -735,9 +714,8 @@ return [ 'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/intracommreport/class/intracommreport.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/intracommreport/lib/intracommreport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/intracommreport/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], @@ -769,14 +747,14 @@ return [ 'htdocs/multicurrency/class/multicurrency.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/opcachepreload.php' => ['PhanEmptyForeach'], 'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty'], + 'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchProperty'], 'htdocs/opensurvey/lib/opensurvey.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/opensurvey/list.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/results.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/opensurvey/wizard/choix_date.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/wizard/create_survey.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/partnership/class/api_partnerships.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/partnership/class/partnership.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/partnership/class/partnership.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/partnership/class/partnership_type.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/partnership/class/partnershiputils.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/partnership/core/modules/partnership/modules_partnership.php' => ['PhanPluginUnknownArrayMethodReturnType'], @@ -794,7 +772,7 @@ return [ 'htdocs/product/ajax/products.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/canvas/product/actions_card_product.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeSuspiciousNonTraversableForeach'], 'htdocs/product/canvas/service/actions_card_service.class.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/product/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/product/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], 'htdocs/product/class/html.formproduct.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/product/class/product.class.php' => ['PhanPluginUnknownArrayMethodParamType'], @@ -808,41 +786,34 @@ return [ 'htdocs/product/dynamic_price/class/price_parser.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType'], 'htdocs/product/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/inventory/class/inventory.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/product/inventory/class/inventory.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/product/inventory/inventory.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/inventory/lib/inventory.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/product/inventory/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/product/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'], 'htdocs/product/stats/card.php' => ['PhanTypeComparisonFromArray'], - 'htdocs/product/stats/commande.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/stats/commande_fournisseur.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/stats/facture.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/stats/facture_fournisseur.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/stats/facturerec.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/stats/mo.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/stats/propal.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/stock/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/product/stock/class/api_stockmovements.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/product/stock/class/api_warehouses.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/product/stock/class/entrepot.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/product/stock/class/entrepot.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/product/stock/class/mouvementstock.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/stock/class/productlot.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], + 'htdocs/product/stock/class/productlot.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/product/stock/class/productstockentrepot.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/product/stock/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/stock/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/massstockmove.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/product/stock/massstockmove.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/stock/movement_list.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/stock/product.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/stock/productlot_card.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/productlot_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/stock/replenish.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/stock/stats/commande_fournisseur.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/stats/expedition.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/stats/mo.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/stats/reception.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/product/stock/stats/commande_fournisseur.php' => ['PhanUndeclaredProperty'], + 'htdocs/product/stock/stats/expedition.php' => ['PhanUndeclaredProperty'], + 'htdocs/product/stock/stats/mo.php' => ['PhanUndeclaredProperty'], + 'htdocs/product/stock/stats/reception.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/stockatdate.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/stock/stocktransfer/class/stocktransfer.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/product/stock/stocktransfer/class/stocktransferline.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], @@ -854,16 +825,15 @@ return [ 'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/projet/activity/index.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable'], 'htdocs/projet/activity/perday.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/activity/permonth.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/activity/perweek.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/admin/project.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/ajax/projects.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/projet/class/api_projects.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/projet/class/api_projects.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/projet/class/project.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/projet/class/project.class.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/projet/class/projectstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/projet/class/task.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/projet/class/task.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/projet/class/taskstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], 'htdocs/projet/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/element.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -909,7 +879,7 @@ return [ 'htdocs/public/stripe/ipn.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/public/test/test_forms.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'], + 'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'], 'htdocs/public/ticket/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/webportal/index.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], @@ -952,15 +922,15 @@ return [ 'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/recruitment/recruitmentjobposition_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/resource/class/dolresource.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], + 'htdocs/resource/class/dolresource.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'], 'htdocs/resource/class/html.formresource.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeExpectedObjectPropAccess'], 'htdocs/resource/element_resource.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/admin/salaries.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/salaries/class/paymentsalary.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/salaries/class/paymentsalary.class.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/class/salariesstats.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/salaries/class/salary.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], + 'htdocs/salaries/class/salary.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType'], 'htdocs/salaries/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/info.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -970,14 +940,14 @@ return [ 'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'], 'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/societe/canvas/actions_card_common.class.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/societe/card.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], + 'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'], 'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach', 'PhanUndeclaredProperty'], 'htdocs/societe/class/client.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/societe/class/companybankaccount.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/societe/class/companypaymentmode.class.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/societe/class/societeaccount.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], + 'htdocs/societe/class/societeaccount.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], @@ -987,26 +957,23 @@ return [ 'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/admin/stripe.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/charge.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], 'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/stripe/lib/stripe.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], - 'htdocs/stripe/payout.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/transaction.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/supplier_proposal/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], - 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/support/inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanRedefineFunction'], 'htdocs/takepos/admin/orderprinters.php' => ['PhanTypeMismatchDimFetch'], - 'htdocs/takepos/admin/terminal.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/takepos/admin/terminal.php' => ['PhanPluginUnknownObjectMethodCall'], 'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/takepos/invoice.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/takepos/public/menu.php' => ['PhanUndeclaredProperty'], 'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/theme/eldy/badges.inc.php' => ['PhanRedefineFunction'], @@ -1036,16 +1003,15 @@ return [ 'htdocs/user/bank.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/user/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], 'htdocs/user/class/api_users.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], - 'htdocs/user/class/user.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/user/class/user.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/user/class/usergroup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/user/group/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/user/param_ihm.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/user/passwordforgotten.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/variants/ajax/get_attribute_values.php' => ['PhanTypeComparisonFromArray'], - 'htdocs/variants/class/ProductAttribute.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/variants/class/ProductAttribute.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], - 'htdocs/variants/lib/variants.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/viewimage.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanRedefineFunction'], @@ -1061,18 +1027,16 @@ return [ 'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanPluginUnknownArrayPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/webportal/class/html.formwebportal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchDimFetch'], 'htdocs/webportal/class/webPortalTheme.class.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/webportal/class/webportalinvoice.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/webportal/class/webportalmember.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/webportal/class/webportalorder.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/webportal/class/webportalpartnership.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/webportal/class/webportalpropal.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/webportal/class/webportalinvoice.class.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/webportal/class/webportalmember.class.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/webportal/class/webportalorder.class.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/webportal/class/webportalpropal.class.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], 'htdocs/webportal/lib/webportal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], 'htdocs/webservices/server_actioncomm.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_category.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_contact.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_invoice.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_order.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredProperty'], - 'htdocs/webservices/server_other.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_payment.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_productorservice.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_project.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], @@ -1086,7 +1050,7 @@ return [ 'htdocs/website/samples/wrapper.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/website/websiteaccount_card.php' => ['PhanUndeclaredProperty'], 'htdocs/workstation/class/api_workstations.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/workstation/class/workstation.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], + 'htdocs/workstation/class/workstation.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredProperty'], 'htdocs/workstation/class/workstationresource.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/workstation/class/workstationusergroup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/workstation/lib/workstation.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'], diff --git a/dev/tools/phan/plugins/ParamMatchRegexPlugin.php b/dev/tools/phan/plugins/ParamMatchRegexPlugin.php index 674631aa459..8c53fb96694 100644 --- a/dev/tools/phan/plugins/ParamMatchRegexPlugin.php +++ b/dev/tools/phan/plugins/ParamMatchRegexPlugin.php @@ -135,8 +135,16 @@ class ParamMatchVisitor extends PluginAwarePostAnalysisVisitor { $class_name = $node->children['class']->children['name'] ?? null; if (!\is_string($class_name)) { - throw new NodeException($expr, 'does not have class'); + // May happen for $this->className::$name(...$arguments); (variable class name) + $location = $this->context->getFile().":".$node->lineno; + print "$location: Node does not have fixed string class_name - node type ".(is_object($class_name) ? get_class_name($class_name) : gettype($class_name)).PHP_EOL; + return; + // throw new NodeException($node, 'does not have class'); } + // } else { + // $location = $this->context->getFile().":".$node->lineno; + // print "$location: Static call - node type ".get_class($node).PHP_EOL; + //} try { $class_name = (string) FullyQualifiedClassName::fromFullyQualifiedString($class_name); } catch (FQSENException $_) { diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index fcde147d65f..46124cff57e 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -143,7 +143,7 @@ BAN BI BOMs Back -Bad value for email, email lwas not verified by Google +Bad value for email, email was not verified by Google Bad value for returned userinfo[aud] Bad value for returned userinfo[exp]. Token expired. Bad value for returned userinfo[iss] @@ -302,8 +302,6 @@ ECMAreaDesc2 ECMDocsByProducts ECMSectionAutoDesc ECMSectionManualDesc -EMail -EMails EcmFiles EditAdherent EditAdherentAddress diff --git a/htdocs/accountancy/admin/closure.php b/htdocs/accountancy/admin/closure.php index a11c83cea46..982222bf20d 100644 --- a/htdocs/accountancy/admin/closure.php +++ b/htdocs/accountancy/admin/closure.php @@ -148,16 +148,20 @@ print ''; // Accounting groups used for the balance sheet account print ''; -print ''.$langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT").''; +print ''; +print $form->textwithpicto($langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT"), $langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNTHelp")); +print ''; print ''; -print ''; +print ''; print ''; // Accounting groups used for the income statement print ''; -print ''.$langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT").''; +print ''; +print $form->textwithpicto($langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT"), $langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENTHelp")); +print ''; print ''; -print ''; +print ''; print ''; print "\n"; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 5d856d5027c..ca68c0f5aed 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -314,7 +314,7 @@ if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_D print '' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . ''; if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) { print ''; - print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning'); + print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning'); print ''; } else { print ''; @@ -341,7 +341,7 @@ if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_D print '' . img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnSupplierDeposit") . ''; if (getDolGlobalInt('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) { print ''; - print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning'); + print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning'); print ''; } else { print ''; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 4025db92cab..a0f34150a8d 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2021 Ferran Marcet + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -414,7 +415,7 @@ print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").''; if (getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { print ''; - print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning'); + print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning'); print ''; } else { print ''; @@ -427,7 +428,7 @@ print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").''; if (getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_PURCHASES')) { print ''; - print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning'); + print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning'); print ''; } else { print ''; @@ -440,7 +441,7 @@ print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").''; if (getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) { print ''; - print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning'); + print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning'); print ''; } else { print ''; diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index ace31d2caa2..a0d23a13beb 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -567,7 +567,7 @@ if ($resql) { } $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 43ed4e3a09d..71b749794dd 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -393,7 +393,7 @@ if ($action != 'export_csv') { print '
'; print $moreforfilter; $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; } diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 096c2a88d50..1cc28021ef8 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -35,18 +35,20 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; // Load translation files required by the page $langs->loadLangs(array("accountancy", "bills", "compta")); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOSTINT('id'); // id of record $mode = GETPOST('mode', 'aZ09'); // '' or '_tmp' -$piece_num = GETPOSTINT("piece_num"); // id of transaction (several lines share the same transaction id) +$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); // id of transaction (several lines share the same transaction id) $accountingaccount = new AccountingAccount($db); $accountingjournal = new AccountingJournal($db); @@ -78,6 +80,9 @@ if (!empty($update)) { $action = 'confirm_update'; } +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context +$hookmanager->initHooks(array('bookkeepingcard', 'globalcard')); + $object = new BookKeeping($db); // Security check @@ -92,6 +97,7 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) { } $permissiontoadd = $user->hasRight('accounting', 'mouvements', 'creer'); +$permissiontodelete = $user->hasRight('accounting', 'mouvements', 'supprimer'); /* @@ -180,7 +186,11 @@ if (empty($reshook)) { } if (!$error) { - $datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); + if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) { + $datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); + } else { + $datedoc = (int) GETPOSTINT('doc_date'); // TODO Use instead the mode day-month-year + } $object = new BookKeeping($db); @@ -213,6 +223,7 @@ if (empty($reshook)) { } $result = $object->createStd($user, false, $mode); + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -226,7 +237,7 @@ if (empty($reshook)) { $action = ''; } } - } elseif ($action == "confirm_delete" && $permissiontoadd) { + } elseif ($action == "confirm_delete" && $permissiontoadd) { // Delete line $object = new BookKeeping($db); $result = $object->fetch($id, null, $mode); @@ -277,6 +288,7 @@ if (empty($reshook)) { $object->amount = 0; $result = $object->createStd($user, 0, $mode); + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -343,6 +355,66 @@ if (empty($reshook)) { exit; } } + + // Delete all lines into the transaction + $toselect = explode(',', GETPOST('toselect', 'alphanohtml')); + + if ($action == 'deletebookkeepingwriting' && $confirm == "yes" && $permissiontodelete) { + $db->begin(); + + if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING')) { + $lettering = new Lettering($db); + $nb_lettering = $lettering->bookkeepingLetteringAll($toselect, true); + if ($nb_lettering < 0) { + setEventMessages('', $lettering->errors, 'errors'); + $error++; + } + } + + $nbok = 0; + $result = 0; + if (!$error) { + foreach ($toselect as $toselectid) { + $result = $object->fetch($toselectid); + if ($result >= 0 && (!isset($object->date_validation) || $object->date_validation === '')) { + $result = $object->deleteMvtNum($object->piece_num); + if ($result >= 0) { + $nbok += $result; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + break; + } + } elseif ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + break; + } elseif (isset($object->date_validation) && $object->date_validation != '') { + setEventMessages($langs->trans("ValidatedRecordWhereFound"), null, 'errors'); + $error++; + break; + } + } + } + + if (!$error) { + $db->commit(); + + // Message for elements well deleted + if ($nbok > 1) { + setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); + } elseif ($nbok > 0) { + setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs'); + } else { + setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs'); + } + + header("Location: ".DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?noreset=1'); + exit; + } else { + $db->rollback(); + } + } } @@ -356,6 +428,7 @@ $formaccounting = new FormAccounting($db); $title = $langs->trans("CreateMvts"); $help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double'; + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-consultation page-card'); // Confirmation to delete the command @@ -435,11 +508,11 @@ if ($action == 'create') { if (!empty($object->piece_num)) { $backlink = '
'.$langs->trans('BackToList').''; - if ($mode == '_tmp') { + /*if ($mode == '_tmp') { print load_fiche_titre($langs->trans("CreateMvts"), $backlink); } else { print load_fiche_titre($langs->trans("UpdateMvts"), $backlink); - } + }*/ $head = array(); $h = 0; @@ -450,13 +523,22 @@ if ($action == 'create') { print dol_get_fiche_head($head, 'transaction', '', -1); - //dol_banner_tab($object, '', $backlink); + $object->ref = (string) $object->piece_num; + $object->label = $object->doc_ref; + + $morehtmlref = '
'; + $morehtmlref .= '
'; + $morehtmlref .= $object->label; + $morehtmlref .= '
'; + + dol_banner_tab($object, 'ref', $backlink, 1, 'piece_num', 'piece_num', $morehtmlref); print '
'; + print '
'; print '
'; - print ''; + print '
'; // Account movement print ''; @@ -464,6 +546,37 @@ if ($action == 'create') { print ''; print ''; + // Ref document + print ''; + print ''; + // Date print ''; print ''; + // Due date (if invoice) + //if (in_array($object->doc_type, array('customer_invoice', 'supplier_invoice'))) { + print ''; + print ''; + print ''; + print ''; + //} + // Don't show in tmp mode, inevitably empty if ($mode != "_tmp") { // Date document export @@ -611,14 +704,6 @@ if ($action == 'create') { } } - // Due date - print ''; - print ''; - print ''; - print ''; - // Validate /* print ''; @@ -663,21 +748,52 @@ if ($action == 'create') { print ''; - print dol_get_fiche_end(); - + print ''; print '
'; - print '
'; + + print dol_get_fiche_end(); + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { + // Variable that contains all transaction lines + $tmptoselect = array(); + $atleastonevalidated = 0; + $atleastoneexported = 0; + foreach ($object->linesmvt as $line) { + $tmptoselect[] = $line->id; + if (!empty($line->date_validation)) { + $atleastonevalidated = 1; + } + if (!empty($line->date_export) || !empty($line->date_validation)) { + $atleastoneexported = 1; + } + } + + if ($mode != '_tmp' && !$atleastonevalidated) { + print "\n".'
'."\n"; + + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + if ($permissiontodelete) { + if (!isset($hookmanager->resArray['no_button_edit']) || $hookmanager->resArray['no_button_edit'] != 1) { + print dolGetButtonAction('', $langs->trans('Delete'), 'delete', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=deletebookkeepingwriting&confirm=yes&token='.newToken().'&piece_num='.((int) $object->piece_num).'&toselect='.implode(',', $tmptoselect), '', $permissiontodelete); + } + } + } + + print '
'; + } + // List of movements print load_fiche_titre($langs->trans("ListeMvts"), '', ''); - print ''; + print ''; if ($optioncss != '') { print ''; } @@ -757,7 +873,7 @@ if ($action == 'create') { print ''; print ''; print ''; print ''; + for ($i = 2; $i <= 13; $i++) { $cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2); if ($cursormonth > 12) { @@ -429,17 +419,19 @@ if ($resql) { $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); - print ''; } - print ''; + + print ''; + print ''; } $db->free($resql); @@ -585,7 +577,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa print '
'; print '
'.($mode == '_tmp' ? ''.$langs->trans("Draft").'' : $object->piece_num).'
'; + print ''; + if ($action != 'editdocref') { + print ''; + } + print '
'; + print $langs->trans('Piece'); + print ''; + if ($permissiontoadd) { + print 'piece_num).'&mode='.urlencode((string) $mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; + } + print '
'; + print '
'; + if ($action == 'editdocref') { + print '
'; + if ($optioncss != '') { + print ''; + } + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + } else { + print $object->doc_ref; + } + print '
'; print ''; print ''; - // Ref document - print ''; - print ''; - print '
'; @@ -526,41 +639,11 @@ if ($action == 'create') { print '
'; - print ''; - if ($action != 'editdocref') { - print ''; - } - print '
'; - print $langs->trans('Piece'); - print ''; - if ($permissiontoadd) { - print 'piece_num).'&mode='.urlencode((string) $mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; - } - print '
'; - print '
'; - if ($action == 'editdocref') { - print '
'; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'; - } else { - print $object->doc_ref; - } - print '
'; print ''; + print '
'; print '
'; @@ -582,6 +665,16 @@ if ($action == 'create') { print '
' . $form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")) . ''; + print $object->date_lim_reglement ? dol_print_date($object->date_lim_reglement, 'day') : ' '; + print '
' . $langs->trans('DateDue') . ''; - print $object->date_lim_reglement ? dol_print_date($object->date_lim_reglement, 'day') : ' '; - print '
'; - print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, 'minwidth200 maxwidth500'); + print $formaccounting->select_account($action == 'add' ? GETPOST('accountingaccount_number') : '', 'accountingaccount_number', 1, array(), 1, 1, 'minwidth200 maxwidth500'); print ''; // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because: @@ -842,10 +958,12 @@ if ($action == 'create') { if ($mode == '_tmp' && $action == '' && $permissiontoadd) { print '
'; print '
'; - if ($total_debit == $total_credit) { - print ''.$langs->trans("ValidTransaction").''; + if (empty($total_debit) && empty($total_credit)) { + print ''; + } elseif ($total_debit == $total_credit) { + print ''.$langs->trans("ValidTransaction").''; } else { - print ''; + print ''; } print '   '; diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index bf97689732f..33e35a6a7c4 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -846,7 +846,7 @@ $moreforfilter .= '
'; $moreforfilter .= ''; $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 89ed928d99b..dbe2101cd3e 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1706,7 +1706,7 @@ class BookKeeping extends CommonObject * * @param int $piecenum Piecenum to delete * @param string $mode Mode ('' or '_tmp') - * @return int Result + * @return int Nb of record deleted */ public function deleteMvtNum($piecenum, $mode = '') { @@ -1717,6 +1717,8 @@ class BookKeeping extends CommonObject return -1; } + $nbprocessed = 0; + $this->db->begin(); // first check if line not yet in bookkeeping @@ -1737,10 +1739,13 @@ class BookKeeping extends CommonObject } $this->db->rollback(); return -1; + } else { + $nbprocessed = $this->db->affected_rows($resql); } $this->db->commit(); - return 1; + + return $nbprocessed; } /** @@ -2349,12 +2354,20 @@ class BookKeeping extends CommonObject $sql_list = array(); if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { + $i = 0; foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { - $sql_list[] = "('" . $this->db->idate($fiscal_period['date_start']) . "' <= ".$this->db->sanitize($alias)."doc_date AND ".$this->db->sanitize($alias)."doc_date <= '" . $this->db->idate($fiscal_period['date_end']) . "')"; + $sql_list[$i] = "("; + $sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start']) . "' <= ".$this->db->sanitize($alias)."doc_date"; + if (!empty($fiscal_period['date_end'])) { + $sql_list[$i] .= " AND "; + $sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '" . $this->db->idate($fiscal_period['date_end'])."'"; + } + $sql_list[$i] .= ")"; + $i++; } } $sqlsanitized = implode(' OR ', $sql_list); - self::$can_modify_bookkeeping_sql_cached[$alias] = !empty($sql_list) ? " AND (".$sqlsanitized.")" : ""; + self::$can_modify_bookkeeping_sql_cached[$alias] = empty($sql_list) ? "" : " AND (".$sqlsanitized.")"; } return self::$can_modify_bookkeeping_sql_cached[$alias]; diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 8aab1a26575..8b359b1ebc9 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -124,14 +124,28 @@ if (empty($reshook)) { $separate_auxiliary_account = GETPOST('separate_auxiliary_account', 'aZ09'); $generate_bookkeeping_records = GETPOST('generate_bookkeeping_records', 'aZ09'); - $result = $object->closeFiscalPeriod($current_fiscal_period['id'], $new_fiscal_period_id, $separate_auxiliary_account, $generate_bookkeeping_records); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } else { - setEventMessages($langs->trans("AccountancyClosureCloseSuccessfully"), null, 'mesgs'); + $error = 0; + if ($generate_bookkeeping_records) { + if (!getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT')) { + $error++; + setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors'); + } + if (!getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT')) { + $error++; + setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors'); + } + } - header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : '')); - exit; + if (!$error) { + $result = $object->closeFiscalPeriod($current_fiscal_period['id'], $new_fiscal_period_id, $separate_auxiliary_account, $generate_bookkeeping_records); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + setEventMessages($langs->trans("AccountancyClosureCloseSuccessfully"), null, 'mesgs'); + + header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : '')); + exit; + } } } elseif ($action == 'confirm_step_3' && $confirm == "yes") { $inventory_journal_id = GETPOSTINT('inventory_journal_id'); @@ -301,7 +315,7 @@ if (!empty($current_fiscal_period)) { print load_fiche_titre($langs->trans("Closure") . " - " . $fiscal_period_nav_text, '', 'title_accountancy'); if (empty($current_fiscal_period)) { - print $langs->trans('ErrorNoFiscalPeriodActiveFound', $langs->trans("Accounting"), $langs->trans("Setup"), $langs->trans("FiscalPeriod")); + print $langs->trans('ErrorNoFiscalPeriodActiveFound', $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("FiscalPeriod")); } if (isset($current_fiscal_period)) { diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index f606cc48868..a7e20f22b74 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -101,13 +101,14 @@ $formaccounting = new FormAccounting($db); if (!empty($id)) { $sql = "SELECT f.ref, f.rowid as facid, l.fk_product, l.description, l.price,"; - $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,"; + $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, l.fk_code_ventilation,"; + $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label,"; if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { $sql .= " ppe.accountancy_code_sell as code_sell,"; } else { $sql .= " p.accountancy_code_sell as code_sell,"; } - $sql .= " l.fk_code_ventilation, aa.account_number, aa.label"; + $sql .= " aa.account_number, aa.label"; $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { @@ -139,18 +140,23 @@ if (!empty($id)) { print ''; - // Ref facture + // Ref invoice print ''; $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + + print ''; + print ''; + + print ''; + print '
'.$langs->trans("Invoice").''.$facture_static->getNomUrl(1).'
'.$langs->trans("Line").''.nl2br($objp->description).'
'.$langs->trans("Account").''; + print '
'.$langs->trans("Description").''.dolPrintHTML($objp->description).'
'.$langs->trans("ProductLabel").''.dol_trunc($objp->product_label, 24).'
'.$langs->trans("Account").''; print $formaccounting->select_account($objp->fk_code_ventilation, 'codeventil', 1); print '
'; print dol_get_fiche_end(); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 5a0cec8d64d..5390cbedd72 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -18,7 +18,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /** @@ -41,17 +40,6 @@ $langs->loadLangs(array("compta", "bills", "other", "accountancy")); $validatemonth = GETPOSTINT('validatemonth'); $validateyear = GETPOSTINT('validateyear'); -// Security check -if (!isModEnabled('accounting')) { - accessforbidden(); -} -if ($user->socid > 0) { - accessforbidden(); -} -if (!$user->hasRight('accounting', 'bind', 'write')) { - accessforbidden(); -} - $accountingAccount = new AccountingAccount($db); $month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); @@ -85,7 +73,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (!$user->hasRight('accounting', 'mouvements', 'lire')) { +if (!$user->hasRight('accounting', 'bind', 'write')) { accessforbidden(); } @@ -260,7 +248,7 @@ if ($action == 'validatehistory' && $user->hasRight('accounting', 'bind', 'write } if ($suggestedid > 0) { - $sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet"; + $sqlupdate = "UPDATE ".$db->prefix()."facturedet"; $sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid); $sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $facture_static_det->id); @@ -321,7 +309,7 @@ if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { $y = $year_current; -$buttonbind = ''.img_picto($langs->trans("ValidateHistory"), 'link', 'class="pictofixedwidth fa-color-unset"').$langs->trans("ValidateHistory").''; +$buttonbind = ''.img_picto($langs->trans("ValidateHistory"), 'link', 'class="pictofixedwidth fa-color-unset"').$langs->trans("ValidateHistory").''; print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1, 0, $buttonbind); //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); @@ -363,8 +351,9 @@ for ($i = 1; $i <= 12; $i++) { $j -= 12; } $sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((string) $j), "fd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; + $sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((string) $j), "1", "0").") AS nbmonth".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; } -$sql .= " SUM(fd.total_ht) as total"; +$sql .= " SUM(fd.total_ht) as total, COUNT(fd.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; @@ -421,6 +410,7 @@ if ($resql) { print $row[1]; } print '
'; - print price($row[$i]); + print ''; + print price($row[2*$i - 2]); // Add link to make binding - if (!empty(price2num($row[$i]))) { + if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { print ''; print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"'); print ''; } print ''.price($row[14]).''.price($row[26]).'
'; - print ''; + print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1; if ($j > 12) { diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 6d8dd13951f..cb14e29cce5 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -390,7 +390,7 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneCustomer").'
'; - print '
'.$langs->trans("ChangeAccount").' '; + print '
'.$langs->trans("ChangeAccount").'
'; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); print '
'; diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 3085d1ecb86..3685ea9fa1e 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -78,17 +78,17 @@ if (!$user->hasRight('accounting', 'bind', 'write')) { */ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) { - // Clean database + // Clean database by removing binding done on non existing or no more existing accounts $db->begin(); - $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd"; + $sql1 = "UPDATE ".$db->prefix()."expensereport_det as erd"; $sql1 .= " SET fk_code_ventilation = 0"; $sql1 .= ' WHERE erd.fk_code_ventilation NOT IN'; $sql1 .= ' (SELECT accnt.rowid '; - $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt'; - $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst'; + $sql1 .= ' FROM '.$db->prefix().'accounting_account as accnt'; + $sql1 .= ' INNER JOIN '.$db->prefix().'accounting_system as syst'; $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) getDolGlobalInt('CHARTOFACCOUNTS')).' AND accnt.entity = '.((int) $conf->entity).')'; - $sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'expensereport WHERE entity = '.((int) $conf->entity).')'; - $sql1 .= ' AND fk_code_ventilation <> 0'; + $sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.$db->prefix().'expensereport WHERE entity = '.((int) $conf->entity).')'; + $sql1 .= " AND fk_code_ventilation <> 0"; dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); $resql1 = $db->query($sql1); if (!$resql1) { @@ -195,7 +195,7 @@ print '
'; $y = $year_current; -$buttonbind = ''.img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("ValidateHistory").''; +$buttonbind = ''.img_picto($langs->trans("ValidateHistory"), 'link', 'class="pictofixedwidth fa-color-unset"').$langs->trans("ValidateHistory").''; print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1, 0, $buttonbind); @@ -239,8 +239,9 @@ for ($i = 1; $i <= 12; $i++) { $j -= 12; } $sql .= " SUM(".$db->ifsql("MONTH(er.date_debut) = ".((int) $j), "erd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; + $sql .= " SUM(".$db->ifsql("MONTH(er.date_debut) = ".((string) $j), "1", "0").") AS nbmonth".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; } -$sql .= " SUM(erd.total_ht) as total"; +$sql .= " SUM(erd.total_ht) as total, COUNT(erd.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_expensereport"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation"; @@ -295,17 +296,17 @@ if ($resql) { $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); - print '
'; } - print ''; + print ''; print ''; } $db->free($resql); @@ -372,14 +373,12 @@ if ($resql) { while ($row = $db->fetch_row($resql)) { print ''; - print ''; - //print ''; } - print ''; + print ''; print ''; } $db->free($resql); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 5245c67d683..44ba2ce010f 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -398,7 +398,7 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneSupplier").'
'; - print '
'.$langs->trans("ChangeAccount").' '; + print '
'.$langs->trans("ChangeAccount").'
'; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); print '
'; diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 0a1ab7f6610..c680bc676b4 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -505,6 +505,7 @@ print "\n"; $startpoint = array(); $startpoint[0] = $langs->trans("NoCorrection"); $startpoint["m"] = $langs->trans("Month"); +$startpoint["3m"] = $langs->trans("Quarter"); $startpoint["Y"] = $langs->trans("Year"); print '
'."\n"; // Telephone print ''; print ''."\n"; // Fax print ''; print ''."\n"; // eMail print ''; print ''."\n"; // Web print ''; print ''."\n"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index f24416400b3..de572cf1a27 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -483,31 +483,31 @@ print ''."\n"; // Phone print ''; print ''."\n"; // Phone mobile print ''; print ''."\n"; // Fax print ''; print ''."\n"; // Email print ''; print ''."\n"; // Web print ''; print ''."\n"; diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 887bf83120d..2425a488f4a 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -6,7 +6,7 @@ * Copyright (C) 2011-2017 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2017 Rui Strecht - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2020-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -119,7 +119,7 @@ print ''; print "\n"; $listofnetworks = dol_sort_array($listofnetworks, 'label'); -//var_dump($listofnetworks); + foreach ($listofnetworks as $key => $value) { if (!empty($value['active'])) { print ''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 6c02cf37ae4..f121b013d78 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -100,6 +100,7 @@ if ($action == 'updateMask') { $module = new $classname($db); '@phan-var-force ModelePDFContract $module'; + /** @var ModelePDFContract $module */ if ($module->write_file($contract, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf"); return; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 58230d830cd..a31c09375b0 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1385,7 +1385,6 @@ if ($id > 0) { } elseif ($search_active == 'no') { $sql .= " AND ".$db->sanitize($tableprefix)."active = 0"; } - //var_dump($sql); // Count total nb of records $nbtotalofrecords = ''; @@ -1776,7 +1775,7 @@ if ($id > 0) { } if (empty($reshook)) { - fieldList($fieldlist, $obj, $tabname[$id], 'add'); + dictFieldList($fieldlist, $obj, $tabname[$id], 'add'); } if ($id == DICT_COUNTRY) { @@ -2281,7 +2280,7 @@ if ($id > 0) { // Show fields if (empty($reshook)) { - $withentity = fieldList($fieldlist, $obj, $tabname[$id], 'edit'); + $withentity = dictFieldList($fieldlist, $obj, $tabname[$id], 'edit'); } print ''; // Coef echo ''; // Total for one - echo ''; + echo ''; // Action echo ''; print ''; print ''; print ''; +$vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING'; -print ''; +print ''; +print ''; + +print ''; +print ''; +print ''; +print ''; + +print ''; print ''; @@ -294,14 +355,38 @@ print ''; print $form->buttonsSaveCancel("Add", ''); print ''; print ''; print ''; diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 4647f807755..43b2b25d261 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -6,6 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,7 +42,6 @@ if (!$user->admin) { } -$type = array('yesno', 'texte', 'chaine'); $action = GETPOST('action', 'aZ09'); $testsubscribeemail = GETPOST("testsubscribeemail"); @@ -57,13 +57,14 @@ $error = 0; // Action updated or added a constant if ($action == 'update' || $action == 'add') { $tmparray = GETPOST('constname', 'array'); + $tmpvalue = GETPOST('constvalue', 'array'); + $tmpnote = GETPOST('constnote', 'array'); if (is_array($tmparray)) { foreach ($tmparray as $key => $val) { $constname = $tmparray[$key]; - $constvalue = $tmparray[$key]; - $consttype = $tmparray[$key]; - $constnote = $tmparray[$key]; - $res = dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity); + $constvalue = $tmpvalue[$key]; + $constnote = $tmpnote[$key]; + $res = dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, $constnote, $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 053c87ad69c..5532b8e4e50 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -531,9 +531,6 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; print '
'; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 7e5e28adec1..80ba435d9a9 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -165,7 +165,7 @@ if (GETPOST('buttonreset', 'alpha')) { if ($action == 'install' && $allowonlineinstall) { $error = 0; - + $modulenameval = ''; // $original_file should match format module_modulename-x.y[.z].zip $original_file = basename($_FILES["fileinstall"]["name"]); $original_file = preg_replace('/\s*\(\d+\)\.zip$/i', '.zip', $original_file); @@ -282,8 +282,20 @@ if ($action == 'install' && $allowonlineinstall) { } if (!$error) { - $message = $langs->trans("SetupIsReadyForUse", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")); + $searchParams = array( + 'search_keyword' => $modulenameval, + 'search_status' => '-1', + 'search_nature' => '-1', + 'search_version' => '-1' + ); + $queryString = http_build_query($searchParams); + $redirectUrl = DOL_URL_ROOT . '/admin/modules.php?' . $queryString; + + $message = $langs->trans("SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")); + setEventMessages($message, null, 'warnings'); + header('Location: ' . $redirectUrl); + exit; } } elseif ($action == 'install' && !$allowonlineinstall) { httponly_accessforbidden("You try to bypass the protection to disallow deployment of an external module. Hack attempt ?"); @@ -690,7 +702,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { if (!empty($moreforfilter)) { print $moreforfilter; $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; } @@ -905,7 +917,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) { $codeenabledisable .= $langs->trans("Used"); } else { - $codeenabledisable .= img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium valignmiddle'); + $codeenabledisable .= img_picto($langs->trans("Required"), 'switch_on', '', 0, 0, 0, '', 'opacitymedium valignmiddle'); //print $langs->trans("Required"); } if (isModEnabled('multicompany') && $user->entity) { @@ -964,20 +976,20 @@ if ($mode == 'common' || $mode == 'commonkanban') { } else { if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) { $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); - $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; + $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', 0, 0, 0, '', 'fa-15').''; } else { $urltouse = $urlpage; - $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; + $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', 0, 0, 0, '', 'fa-15').''; } } } } elseif (preg_match('/^([^@]+)@([^@]+)$/i', (string) $objMod->config_page_url, $regs)) { - $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; + $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', 0, 0, 0, '', 'fa-15').''; } else { - $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; + $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', 0, 0, 0, '', 'fa-15').''; } } else { - $codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15'); + $codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', 0, 0, 0, '', 'fa-15'); } } else { // Module not yet activated // Set $codeenabledisable diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 33f76eaa5c6..7c8de60082e 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2022 Laurent Destailleur * diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 43819c9e093..33b5d985d00 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014-2018 Frederic France + * Copyright (C) 2014-2024 Frédéric France * Copyright (C) 2020 Nicolas ZABOURI * Copyright (C) 2024 MDW * diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 0dc8cda23f5..f4e12fd480f 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -638,7 +638,11 @@ if ($conf->use_javascript_ajax) { print '
'; print ''; print '
'.$langs->trans("TotalVente").'
'.$langs->trans("TotalVente").''; - print price($row[$i]); + print ''; + print price($row[2*$i - 2]); // Add link to make binding - if (!empty(price2num($row[$i]))) { + if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { print ''; print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"'); print ''; } print ''.price($row[14]).''.price($row[26]).'
'; + print ''; if ($row[0] == 'tobind') { //print ''.$langs->trans("Unknown").''; } else { print length_accountg($row[0]).' - '; } - //print ''; if ($row[0] == 'tobind') { print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind")); } else { diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 66cc1ebd48a..fdd9b4d75fb 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -318,7 +318,7 @@ if ($result) { print_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneExpenseReport").'
'; - print '
'.$langs->trans("ChangeAccount").' '; + print '
'.$langs->trans("ChangeAccount").'
'; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); print '
'; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index c07fab944a8..8ec10ca961e 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -623,13 +623,6 @@ if ($result) { dol_print_error($db); } - -//var_dump($tabpay); -//var_dump($tabcompany); -//var_dump($tabbq); -//var_dump($tabtp); -//var_dump($tabtype); - // Write bookkeeping if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'bind', 'write')) { $now = dol_now(); @@ -663,9 +656,6 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b $db->begin(); // Introduce a protection. Total of tabtp must be total of tabbq - //var_dump($tabpay); - //var_dump($tabtp); - //var_dump($tabbq);exit; // Bank if (!$errorforline && is_array($tabbq[$key])) { @@ -1388,9 +1378,6 @@ if (empty($action) || $action == 'view') { $accounttoshowsubledger = length_accounta($k); if ($accounttoshow != $accounttoshowsubledger) { if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') { - //var_dump($tabpay[$key]); - //var_dump($tabtype[$key]); - //var_dump($tabbq[$key]); //print ''.$langs->trans("ThirdpartyAccountNotDefined").''; if (!empty($tabcompany[$key]['code_compta'])) { if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) { diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 086cb033bca..0929cc70717 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -374,6 +374,20 @@ if ($result) { } // After the loop on each line + $parameters = array( + 'tabfac' => &$tabfac, + 'tabht' => &$tabht, + 'tabtva' => &$tabtva, + 'def_tva' => &$def_tva, + 'tabwarranty' => &$tabwarranty, + 'tabrevenuestamp' => &$tabrevenuestamp, + 'tabttc' => &$tabttc, + 'tablocaltax1' => &$tablocaltax1, + 'tablocaltax2' => &$tablocaltax2, + 'tabcompany' => &$tabcompany, + 'vatdata_cache' => &$vatdata_cache, + ); + $reshook = $hookmanager->executeHooks('processedJournalData', $parameters); // Note that $action and $object may have been modified by hook } else { dol_print_error($db); } diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 153c86b7c6c..03332e9a862 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -141,20 +141,23 @@ if (!empty($id)) { print ''; - // ref invoice + // Ref invoice print ''; $facturefournisseur_static->ref = $objp->ref; $facturefournisseur_static->id = $objp->facid; print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + + print ''; + print ''; + + print ''; + print '
'.$langs->trans("BillsSuppliers").''.$facturefournisseur_static->getNomUrl(1).'
'.$langs->trans("Line").''.stripslashes(nl2br($objp->description)).'
'.$langs->trans("ProductLabel").''.dol_trunc($objp->product_label, 24).'
'.$langs->trans("Account").''; + print '
'.$langs->trans("Description").''.dolPrintHTML($objp->description).'
'.$langs->trans("ProductLabel").''.dol_trunc($objp->product_label, 24).'
'.$langs->trans("Account").''; print $formaccounting->select_account($objp->fk_code_ventilation, 'codeventil', 1); print '
'; print dol_get_fiche_end(); diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 4af41e92e51..76e578183dc 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -82,7 +82,7 @@ if (!$user->hasRight('accounting', 'bind', 'write')) { */ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) { - // Clean database + // Clean database by removing binding done on non existing or no more existing accounts $db->begin(); $sql1 = "UPDATE ".$db->prefix()."facture_fourn_det as fd"; $sql1 .= " SET fk_code_ventilation = 0"; @@ -179,31 +179,31 @@ if ($action == 'validatehistory' && $user->hasRight('accounting', 'bind', 'write while ($i < min($num_lines, 10000)) { // No more than 10000 at once $objp = $db->fetch_object($result); - $thirdpartystatic->id = $objp->socid; - $thirdpartystatic->name = $objp->name; - $thirdpartystatic->client = $objp->client; - $thirdpartystatic->fournisseur = $objp->fournisseur; - $thirdpartystatic->code_client = $objp->code_client; - $thirdpartystatic->code_compta_client = $objp->code_compta_client; - $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; - $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; - $thirdpartystatic->email = $objp->email; - $thirdpartystatic->country_code = $objp->country_code; - $thirdpartystatic->tva_intra = $objp->tva_intra; + $thirdpartystatic->id = !empty($objp->socid) ? $objp->socid : 0; + $thirdpartystatic->name = !empty($objp->name) ? $objp->name : ""; + $thirdpartystatic->client = !empty($objp->client) ? $objp->client : ""; + $thirdpartystatic->fournisseur = !empty($objp->fournisseur) ? $objp->fournisseur : ""; + $thirdpartystatic->code_client = !empty($objp->code_client) ? $objp->code_client : ""; + $thirdpartystatic->code_compta_client = !empty($objp->code_compta_client) ? $objp->code_compta_client : ""; + $thirdpartystatic->code_fournisseur = !empty($objp->code_fournisseur) ? $objp->code_fournisseur : ""; + $thirdpartystatic->code_compta_fournisseur = !empty($objp->code_compta_fournisseur) ? $objp->code_compta_fournisseur : ""; + $thirdpartystatic->email = !empty($objp->email) ? $objp->email : ""; + $thirdpartystatic->country_code = !empty($objp->country_code) ? $objp->country_code : ""; + $thirdpartystatic->tva_intra = !empty($objp->tva_intra) ? $objp->tva_intra : ""; $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; $product_static->type = $objp->type; $product_static->label = $objp->product_label; - $product_static->status = $objp->status; - $product_static->status_buy = $objp->status_buy; + $product_static->status = !empty($objp->status) ? $objp->status : 0; + $product_static->status_buy = !empty($objp->status_buy) ? $objp->status_buy : 0; $product_static->accountancy_code_sell = $objp->code_sell; $product_static->accountancy_code_sell_intra = $objp->code_sell_intra; $product_static->accountancy_code_sell_export = $objp->code_sell_export; - $product_static->accountancy_code_buy = $objp->code_buy; - $product_static->accountancy_code_buy_intra = $objp->code_buy_intra; - $product_static->accountancy_code_buy_export = $objp->code_buy_export; + $product_static->accountancy_code_buy = !empty($objp->code_buy) ? $objp->code_buy : ""; + $product_static->accountancy_code_buy_intra = !empty($objp->code_buy_intra) ? $objp->code_buy_intra : ""; + $product_static->accountancy_code_buy_export = !empty($objp->code_buy_export) ? $objp->code_buy_export : ""; $product_static->tva_tx = $objp->tva_tx_prod; $facture_static->ref = $objp->ref; @@ -302,7 +302,7 @@ print '
'; $y = $year_current; -$buttonbind = ''.img_picto('', 'link', 'class="paddingright fa-color-unset smallpaddingimp"').$langs->trans("ValidateHistory").''; +$buttonbind = ''.img_picto($langs->trans("ValidateHistory"), 'link', 'class="pictofixedwidth fa-color-unset"').$langs->trans("ValidateHistory").''; print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1, 0, $buttonbind); @@ -345,8 +345,9 @@ for ($i = 1; $i <= 12; $i++) { $j -= 12; } $sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((int) $j), "ffd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; + $sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((string) $j), "1", "0").") AS nbmonth".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; } -$sql .= " SUM(ffd.total_ht) as total"; +$sql .= " SUM(ffd.total_ht) as total, COUNT(ffd.rowid) as nb"; $sql .= " FROM ".$db->prefix()."facture_fourn_det as ffd"; $sql .= " LEFT JOIN ".$db->prefix()."facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn"; $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation"; @@ -406,17 +407,17 @@ if ($resql) { $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); - print '
'; - print price($row[$i]); + print ''; + print price($row[2*$i - 2]); // Add link to make binding - if (!empty(price2num($row[$i]))) { + if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { print ''; print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"'); print ''; } print ''.price($row[14]).''.price($row[26]).'
'; print $langs->trans("MemberSubscriptionStartFirstDayOf"); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index bd40ed7166e..cc81b058d87 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -192,7 +192,16 @@ if ($object->id > 0) { $param .= '&limit='.$limit; } - print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $newcardbutton, '', 0, 1, 0); + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; + $cachekey = 'count_events_member_'.$object->id; + $nbEvent = dol_getcache($cachekey); + + $titlelist = $langs->trans("ActionsOnMember").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''); + if (!empty($conf->dol_optimize_smallscreen)) { + $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''); + } + + print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $newcardbutton, '', 0, 1, 0); // List of all actions $filters = array(); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index b5413c0384e..0715d558d01 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2248,7 +2248,7 @@ class Adherent extends CommonObject * getTooltipContentArray * @param array $params params to construct tooltip data * @since v18 - * @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} + * @return array{picto?:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} */ public function getTooltipContentArray($params) { @@ -3288,12 +3288,9 @@ class Adherent extends CommonObject if ($selected >= 0) { $return .= ''; } - if (property_exists($this, 'type')) { - $return .= '
'.$this->type.''; - } - if (method_exists($this, 'getmorphylib')) { - $return .= '
'.$this->getmorphylib('', 2).''; - } + $return .= '
'.$this->getmorphylib('', 2).''; + $return .= ''.$this->type.''; + if (method_exists($this, 'getLibStatut')) { $return .= '
'; $return .= $this->LibStatut($this->status, $this->need_subscription, $this->datefin, 5); diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 8c1d1f90ec0..920f5f8838e 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -683,7 +683,7 @@ class AdherentType extends CommonObject * getTooltipContentArray * @param array $params params to construct tooltip data * @since v18 - * @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} + * @return array{picto?:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} */ public function getTooltipContentArray($params) { diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index f9ccf9e4af9..9c0b7643304 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -54,6 +54,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'me $backtopage = GETPOST('backtopage', 'alpha'); $optioncss = GETPOST('optioncss', 'aZ'); $mode = GETPOST('mode', 'alpha'); +$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut' // Search fields $search = GETPOST("search", 'alpha'); @@ -107,14 +108,15 @@ if ($search_status < -2) { $search_status = ''; } -// Pagination parameters +// Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); -if (empty($page) || $page == -1) { +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -131,7 +133,7 @@ $object = new Adherent($db); $hookmanager->initHooks(array('memberlist')); $extrafields = new ExtraFields($db); -// fetch optionals attributes and labels +// Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); @@ -192,12 +194,9 @@ $object->fields = dol_sort_array($object->fields, 'position'); // Complete array of fields for columns $tableprefix = 'd'; +$arrayfields = array(); foreach ($object->fields as $key => $val) { - if (!array_key_exists($tableprefix.'.'.$key, $arrayfields)) { // Discard record not into $arrayfields - continue; - } // If $val['visible']==0, then we never show the field - if (!empty($val['visible'])) { $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields[$tableprefix.'.'.$key] = array( @@ -209,9 +208,11 @@ foreach ($object->fields as $key => $val) { ); } } +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; + $arrayfields = dol_sort_array($arrayfields, 'position'); '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan -//var_dump($arrayfields);exit; // Security check $result = restrictedArea($user, 'adherent'); @@ -411,11 +412,7 @@ $morecss = array(); // Build and execute select // -------------------------------------------------------------------- -if (!empty($search_categ) && $search_categ > 0) { - $sql = "SELECT DISTINCT"; -} else { - $sql = "SELECT"; -} +$sql = "SELECT"; $sql .= " d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,"; $sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,"; $sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,"; @@ -429,7 +426,7 @@ $sql .= " state.code_departement as state_code, state.nom as state_name"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ""); } } @@ -442,7 +439,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); $sqlfields = $sql; // $sql fields to remove for count total // SQL Alias adherent -$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; // maybe better to use ad (adh) instead of d +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)"; } @@ -624,7 +621,7 @@ $num = $db->num_rows($resql); // Direct jump if only one record found -if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { +if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; header("Location: ".DOL_URL_ROOT.'/adherents/card.php?id='.$id); @@ -659,6 +656,9 @@ if ($limit > 0 && $limit != $conf->liste_limit) { if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } +if ($groupby != '') { + $param .= '&groupby='.urlencode($groupby); +} if ($search_all != "") { $param .= "&search_all=".urlencode($search_all); } @@ -778,13 +778,12 @@ print ''; $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); -if ($user->hasRight('adherent', 'creer')) { - $newcardbutton .= dolGetButtonTitleSeparator(); - $newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create'); -} +$newcardbutton .= dolGetButtonTitleSeparator(); +$newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create', '', $user->hasRight('adherent', 'creer')); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); +// Add code for pre mass action (confirmation or email presend form) $topicmail = "Information"; $modelmail = "member"; $objecttmp = new Adherent($db); @@ -854,9 +853,6 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; print '
'; } diff --git a/htdocs/adherents/messaging.php b/htdocs/adherents/messaging.php index 2ea83973919..e5aaa491bb2 100644 --- a/htdocs/adherents/messaging.php +++ b/htdocs/adherents/messaging.php @@ -193,7 +193,7 @@ if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || // Try to know count of actioncomm from cache require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; - $cachekey = 'count_events_user_'.$object->id; + $cachekey = 'count_events_member_'.$object->id; $nbEvent = dol_getcache($cachekey); // TODO Add nb into badge in menu so we can get it from cache also here $titlelist = $langs->trans("ActionsOnMember").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 297b0ea6284..21b08255eff 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 2024 MDW * diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index a1ccc1a2616..e15dbc4924c 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -978,6 +978,9 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h // Now do a correction of the suggested date if (getDolGlobalString('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF') === "m") { $datefrom = dol_get_first_day((int) dol_print_date($datefrom, "%Y"), (int) dol_print_date($datefrom, "%m")); + } elseif (getDolGlobalString('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF') === "3m") { + $datefrom = dol_time_plus_duree($object->datefin, -3, 'm'); + $datefrom = dol_get_first_day((int) dol_print_date($datefrom, "%Y"), (int) dol_print_date($datefrom, "%m")); } elseif (getDolGlobalString('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF') === "Y") { $datefrom = dol_get_first_day((int) dol_print_date($datefrom, "%Y")); } diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 3d69be5edf3..04dc1afccb6 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -411,9 +411,6 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; print '
'; } diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 61e3d483237..a78c9efba7d 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -153,25 +153,25 @@ print '
'; -print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); +print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; -print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); +print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; -print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); +print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; -print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); +print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; -print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); +print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; -print img_picto('', 'object_phoning_mobile', '', false, 0, 0, '', 'pictofixedwidth'); +print img_picto('', 'object_phoning_mobile', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; -print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); +print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; -print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); +print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; -print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); +print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth'); print '
'; @@ -2681,7 +2680,7 @@ $db->close(); * @param ''|'add'|'edit'|'hide' $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we don't want it to be rendered * @return string '' or value of entity into table */ -function fieldList($fieldlist, $obj = null, $tabname = '', $context = '') +function dictFieldList($fieldlist, $obj = null, $tabname = '', $context = '') { global $langs, $db, $mysoc; global $form; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 4eaf6cc9d04..32294308082 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -403,7 +403,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': '; - if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { - echo ''; + if ($action == 'edit' && $ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { + echo ''; } else { - echo $range->ik->ikoffset; + echo $ik->ikoffset; } echo ''; - if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { - echo ''; + if ($action == 'edit' && $ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { + echo ''; } else { - echo($range->ik->id > 0 ? $range->ik->coef : $langs->trans('expenseReportCoefUndefined')); + echo($ik->id > 0 ? $ik->coef : $langs->trans('expenseReportCoefUndefined')); } echo ''.$langs->trans('expenseReportPrintExample', price($range->ik->ikoffset + 5 * $range->ik->coef)).''.$langs->trans('expenseReportPrintExample', price($ik->ikoffset + 5 * $ik->coef)).''; if ($range->range_active == 1) { - if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { + if ($action == 'edit' && $ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { echo ''; echo ''; } else { - echo ''.img_edit().''; - if (!empty($range->ik->id)) { - echo ''.img_delete().''; + echo ''.img_edit().''; + if (!empty($ik->id)) { + echo ''.img_delete().''; } // TODO add delete link } diff --git a/htdocs/admin/fediverse.php b/htdocs/admin/fediverse.php index 7279d7c2ddb..dd04b1e6783 100644 --- a/htdocs/admin/fediverse.php +++ b/htdocs/admin/fediverse.php @@ -54,6 +54,24 @@ if (!isModEnabled('socialnetworks')) { accessforbidden('Module Social Networks is not enabled'); } +// List of oauth services +$oauthservices = array(); + +foreach ($conf->global as $key => $val) { + if (!empty($val) && preg_match('/^OAUTH_.*_ID$/', $key)) { + $key = preg_replace('/^OAUTH_/', '', $key); + $key = preg_replace('/_ID$/', '', $key); + if (preg_match('/^.*-/', $key)) { + $name = preg_replace('/^.*-/', '', $key); + } else { + $name = $langs->trans("NoName"); + } + $provider = preg_replace('/-.*$/', '', $key); + $provider = ucfirst(strtolower($provider)); + + $oauthservices[$key] = $name." (".$provider.")"; + } +} /* * Actions @@ -68,6 +86,9 @@ if ($action == 'add') { $socialNetworkName = GETPOST('socialnetwork_name', 'alpha'); $socialNetworkUrl = GETPOST('socialnetwork_url', 'alpha'); + if (GETPOSTISSET("OAUTH_SERVICE_SOCIAL_NETWORK")) { + dolibarr_set_const($db, "OAUTH_SERVICE_SOCIAL_NETWORK", GETPOST("OAUTH_SERVICE_SOCIAL_NETWORK", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + } // other params if exist $paramNames = GETPOST('param_name', 'array'); @@ -272,8 +293,48 @@ print ''.$langs->trans('SocialNetworkUrl').'https://mastodon.social/api/v1/accounts/id_user
'; +// Methods oauth +print ''.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; +print ''; +print ''; +if (!isModEnabled('oauth')) { + print '   '.$langs->trans("EnableModuleX", "OAuth").''; +} else { + print '   '.$langs->trans("SetupModuleX", " OAuth").''; +} +print '
'; print $form->textwithpicto($langs->trans("Others"), $langs->trans("AddMoreParams")); print 'Token : ****
Cookie : ****
'.$langs->trans("PDF_USE_A").''; -print $form->selectarray('PDF_USE_A', $arraylistofpdfformat, getDolGlobalString('PDF_USE_A', '0')); + +//$pdfa = false; // PDF default version +$pdfa = getDolGlobalInt('PDF_USE_A', 0); // PDF/A-1 ou PDF/A-3 + +print $form->selectarray('PDF_USE_A', $arraylistofpdfformat, $pdfa); print '
'; diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 16390896977..d3fd5c0917a 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -221,7 +221,7 @@ print ''; // Form to test upload print '
'; $formfile = new FormFile($db); -$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1, 50, '', '', 1, '', 0); +$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1, 50, null, '', 1, '', 0); // List of document $filearray = dol_dir_list($upload_dir, "files", 0, '', '', $sortfield, $sortorder == 'desc' ? SORT_DESC : SORT_ASC, 1); diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index c6bc1c5871b..b552609bc8d 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -7,6 +7,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,8 +43,6 @@ if (!$user->admin) { } -$type = array('yesno', 'texte', 'chaine'); - $action = GETPOST('action', 'aZ09'); @@ -55,7 +54,6 @@ $action = GETPOST('action', 'aZ09'); if ($action == 'update' || $action == 'add') { $constnamearray = GETPOST("constname", 'array'); $constvaluearray = GETPOST("constvalue", 'array'); - $consttypearray = GETPOST("consttype", 'array'); $constnotearray = GETPOST("constnote", 'array'); // Action mise a jour ou ajout d'une constante @@ -63,10 +61,9 @@ if ($action == 'update' || $action == 'add') { foreach ($constnamearray as $key => $val) { $constname = dol_escape_htmltag($constnamearray[$key]); $constvalue = dol_escape_htmltag($constvaluearray[$key]); - $consttype = (int) $consttypearray[$key]; $constnote = dol_escape_htmltag($constnotearray[$key]); - $res = dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity); + $res = dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, $constnote, $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 47f40b99091..0e2adbd8927 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2020 Laurent Destailleur * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2007-2012 Regis Houssin - * Copyright (C) 2015-2019 Frederic France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2017 Nicolas ZABOURI * Copyright (C) 2024 MDW * diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 0b02e78e344..44935e91607 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -660,7 +660,7 @@ if (getDolGlobalInt('MAIN_ACTIVATE_FILECACHE')) { } else { print img_picto('', 'minus', 'class="pictofixedwidth"'); } -print ' '.$form->textwithpicto($langs->trans("EnableFileCache").' ('.$langs->trans("Widgets").')', $langs->trans("Option").' MAIN_ACTIVATE_FILECACHE'); +print $form->textwithpicto($langs->trans("EnableFileCache").' ('.$langs->trans("Widgets").')', $langs->trans("Option").' MAIN_ACTIVATE_FILECACHE'); print ': '.yn(getDolGlobalInt('MAIN_ACTIVATE_FILECACHE')); print '
'; @@ -669,7 +669,7 @@ if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { } else { print img_picto('', 'minus', 'class="pictofixedwidth"'); } -print ' MAIN_ENABLE_AJAX_TOOLTIP : '; +print 'MAIN_ENABLE_AJAX_TOOLTIP : '; print yn(getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')); print '
'; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 42fb6b8ac3e..9671d5a6828 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -379,11 +379,12 @@ if (empty($dolibarr_main_stream_to_disable)) { } else { print implode(', ', $dolibarr_main_stream_to_disable); } -print ' -> Current PHP streams allowed = '; +print '   -> Current PHP streams allowed = '; $arrayofstreams = stream_get_wrappers(); if (!empty($arrayofstreams)) { sort($arrayofstreams); - print(implode(', ', $arrayofstreams)).'     ('.$langs->trans("Recommended").': '.$langs->trans("TryToKeepOnly", 'file,http,https,php,zip').')'."\n"; + print ''.implode(',', $arrayofstreams).''; + print '     ('.$langs->trans("Recommended").': '.$langs->trans("TryToKeepOnly", 'file,http,https,php,zip').')'."\n"; } print '
'; diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 8ae5a83cb02..d8e5f342494 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -167,21 +167,12 @@ if ($action == 'updateMask') { $error++; } - if (GETPOSTISSET('product_category_id')) { - $param_ticket_product_category = GETPOSTINT('product_category_id'); - $res = dolibarr_set_const($db, 'TICKET_PRODUCT_CATEGORY', $param_ticket_product_category, 'chaine', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - } - $param_status = GETPOST('TICKET_SET_STATUS_ON_ANSWER'); $res = dolibarr_set_const($db, 'TICKET_SET_STATUS_ON_ANSWER', $param_status, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } - $param_delay_first_response = GETPOSTINT('delay_first_response'); $res = dolibarr_set_const($db, 'TICKET_DELAY_BEFORE_FIRST_RESPONSE', $param_delay_first_response, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { @@ -625,37 +616,6 @@ print $formcategory->textwithpicto('', $langs->trans("TicketAutoCheckNotifyThird print ''; print ''; -// Assign contact to a message -print ''.$langs->trans("TicketAssignContactToMessage").''; -print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKET_ASSIGN_CONTACT_TO_MESSAGE'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $formcategory->selectarray("TICKET_ASSIGN_CONTACT_TO_MESSAGE", $arrval, getDolGlobalString('TICKET_ASSIGN_CONTACT_TO_MESSAGE')); -} -print ''; -print ''; -print $formcategory->textwithpicto('', $langs->trans("TicketAssignContactToMessageHelp"), 1, 'help'); -print ''; -print ''; - -if (isModEnabled('product')) { - $htmlname = "product_category_id"; - print ''.$langs->trans("TicketChooseProductCategory").''; - print ''; - print img_picto('', 'category', 'class="pictofixedwidth"'); - $formcategory->selectProductCategory(getDolGlobalString('TICKET_PRODUCT_CATEGORY'), $htmlname); - if ($conf->use_javascript_ajax) { - print ajax_combobox('select_'.$htmlname); - } - print ''; - print ''; - print $formcategory->textwithpicto('', $langs->trans("TicketChooseProductCategoryHelp"), 1, 'help'); - print ''; - print ''; -} - print ''; print ''.$langs->trans("TicketsDelayBeforeFirstAnswer").""; print ' diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 42bd9cc8900..7bb8e2c0b9d 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -28,6 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/html.formcategory.class.php"; // Load translation files required by the page $langs->loadLangs(array("admin", "ticket")); @@ -221,6 +222,7 @@ if ($action != '') { $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); $form = new Form($db); +$formcategory = new FormCategory($db); $help_url = "FR:Module_Ticket"; $page_name = "TicketSetup"; @@ -414,7 +416,7 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { } if (empty($conf->use_javascript_ajax)) { - print ''; + print ''; print ''; } @@ -458,9 +460,29 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help'); print ''; + // Add first contact id found in database from submitter email entered into public interface + // Feature disabled: This has a security trouble. The public interface is a no login interface, so being able to show the contact info from an + // email decided by the submiter allows anybody to get information on any contact (customer or supplier) in Dolibarr database. + // He can even check if contact exists by trying any email if this feature is enabled. + /* + print ''.$langs->trans("TicketAssignContactToMessage").''; + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_ASSIGN_CONTACT_TO_MESSAGE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $formcategory->selectarray("TICKET_ASSIGN_CONTACT_TO_MESSAGE", $arrval, getDolGlobalString('TICKET_ASSIGN_CONTACT_TO_MESSAGE')); + } + print ''; + print ''; + print $formcategory->textwithpicto('', $langs->trans("TicketAssignContactToMessageHelp"), 1, 'help'); + print ''; + print ''; + */ + // Url public interface $url_interface = getDolGlobalString("TICKET_URL_PUBLIC_INTERFACE"); - print ''.$langs->trans("UrlPublicInterfaceLabelAdmin").''; + print ''.$langs->trans("UrlPublicInterfaceLabelAdmin").''; print ''; print ''; print ''; @@ -470,15 +492,17 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { print ''; + print '

'; + print load_fiche_titre($langs->trans("Emails")); print '
'; print ''; // Activate email creation to user - print ''; print ''; // Activate email notification when a new message is added - print ''; print ''; // Send notification when a new message is added to a email if a user is not assigned to the ticket - print ''; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 5f043b13b7a..ec8a93fa52f 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -250,7 +250,7 @@ if ($transvalue) { print ''; -if (isset($optioncss) && $optioncss != '') { +if ($optioncss != '') { print ''; } print ''; diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index d5ba9c88431..3272e7174dc 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -234,6 +234,12 @@ $workflowcodes = array_filter( } ); +if ($action == 'setvarworkflow') { // Test on permission already done + if (GETPOSTISSET('product_category_id')) { + $param_ticket_product_category = GETPOSTINT('product_category_id'); + $res = dolibarr_set_const($db, 'TICKET_PRODUCT_CATEGORY', $param_ticket_product_category, 'chaine', 0, '', $conf->entity); + } +} /* @@ -261,22 +267,30 @@ if (count($workflowcodes) < 1) { // Sort on position $workflowcodes = dol_sort_array($workflowcodes, 'position'); -print '
'; + print '
'; print $form->textwithpicto($langs->trans("TicketsDisableCustomerEmail"), $langs->trans("TicketsDisableEmailHelp"), 1, 'help'); print ''; @@ -493,7 +517,7 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { // Text of email after creatio of a ticket $mail_mesg_new = getDolGlobalString("TICKET_MESSAGE_MAIL_NEW", $langs->trans('TicketNewEmailBody')); - print '
'; + print '
'; print $form->textwithpicto($langs->trans("TicketNewEmailBodyLabel"), $langs->trans("TicketNewEmailBodyHelp"), 1, 'help'); print ''; print ''; @@ -504,7 +528,7 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { print '
'; + print '
'; print $form->textwithpicto($langs->trans("TicketsPublicNotificationNewMessage"), $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help'); print ''; @@ -518,7 +542,7 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { print '
'; + print '
'; print $form->textwithpicto($langs->trans("TicketPublicNotificationNewMessageDefaultEmail"), $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help'); print ''; print '
'; +print ''; +print ''; +print ''; +print ''; $oldfamily = ''; +$tableopen = 0; +$atleastoneline = 0; foreach ($workflowcodes as $key => $params) { if ($params['family'] == 'separator') { - print '
'; - print '
'; - - print ''; + if ($atleastoneline) { + print '
'; + print '
'; + $oldfamily = ''; + $atleastoneline = 0; + } continue; } $reg = array(); if ($oldfamily != $params['family']) { + // New group if ($params['family'] == 'create') { $header = $langs->trans("AutomaticCreation"); } elseif (preg_match('/classify_(.*)/', $params['family'], $reg)) { @@ -308,6 +322,9 @@ foreach ($workflowcodes as $key => $params) { $header = $langs->trans("Description"); } + print ''; + $tableopen = 1; + print ''; print ''; print ''; @@ -316,6 +333,8 @@ foreach ($workflowcodes as $key => $params) { $oldfamily = $params['family']; } + $atleastoneline = 1; + print ''; print ''; print ''; } -print '
'.$header.''.$langs->trans("Status").'
'; print img_object('', $params['picto'], 'class="pictofixedwidth"'); @@ -328,6 +347,26 @@ foreach ($workflowcodes as $key => $params) { print ' '.img_warning($langs->transnoentitiesnoconv("Deprecated")); } + if ($key == 'WORKFLOW_TICKET_LINK_CONTRACT' && getDolGlobalString('WORKFLOW_TICKET_LINK_CONTRACT')) { + require_once DOL_DOCUMENT_ROOT."/core/class/html.formcategory.class.php"; + + $formcategory = new FormCategory($db); + + $htmlname = "product_category_id"; + print '
'; + print $formcategory->textwithpicto($langs->trans("TicketChooseProductCategory"), $langs->trans("TicketChooseProductCategoryHelp"), 1, 'help'); + if (isModEnabled('category')) { + print '   '.img_picto('', 'category', 'class="pictofixedwidth"'); + $formcategory->selectProductCategory(getDolGlobalInt('TICKET_PRODUCT_CATEGORY'), $htmlname, 1); + if ($conf->use_javascript_ajax) { + print ajax_combobox('select_'.$htmlname); + } + print ''; + } else { + print 'Module category must be enabled'; + } + } + print '
'; @@ -354,7 +393,12 @@ foreach ($workflowcodes as $key => $params) { print '
'; +if ($tableopen) { + print ''; +} + +print ''; + // End of page llxFooter(); diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 48df30067a1..74e846d8b47 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -943,7 +943,7 @@ class Documents extends DolibarrApi // Move the temporary file at its final emplacement $result = dol_move($destfiletmp, $dest_file, '0', $overwriteifexists, 1, 1, $moreinfo); if (!$result) { - throw new RestException(500, "Failed to move file into '".$destfile."'"); + throw new RestException(500, "Failed to move file into '".$dest_file."'"); } return dol_basename($destfile); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 00cff62c431..63f85a14a7a 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -439,7 +439,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': '; if (!empty($field_info['picto'])) { - print img_picto('', $field_info['picto'], '', false, 0, 0, '', 'pictofixedwidth'); + print img_picto('', $field_info['picto'], '', 0, 0, 0, '', 'pictofixedwidth'); } if (in_array($field_info['type'], array('int', 'integer'))) { $value = GETPOSTISSET($html_name) ? GETPOSTINT($html_name) : $assetdepreciationoptions->$field_key; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index ddbb7ac010e..d945541aa49 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -534,9 +534,6 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; print '
'; } diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 2faf82523e1..b88a007822c 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1074,9 +1074,9 @@ class BOM extends CommonObject /** * getTooltipContentArray - * @param array $params params to construct tooltip data + * @param array $params params to construct tooltip data * @since v18 - * @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} + * @return array{picto?:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} */ public function getTooltipContentArray($params) { diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 5d3e270e12a..b2bf4b25bca 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -137,9 +137,9 @@ if (isModEnabled("product") || isModEnabled("service")) { $statustoshow = -1; if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) { // hide products in closed warehouse, but show products for internal transfer - print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, 'warehouseopen,warehouseinternal', GETPOSTINT('combinations'), 1); + print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, 'warehouseopen,warehouseinternal', GETPOSTINT('combinations'), 1); } else { - print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOSTINT('combinations'), 1); + print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOSTINT('combinations'), 1); } $urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); print ''; diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index a496dc0554c..8eeb09661b1 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -511,9 +511,6 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; print '
'; } diff --git a/htdocs/bookcal/calendar_agenda.php b/htdocs/bookcal/calendar_agenda.php index e72b5e691a3..74d31b5c80d 100644 --- a/htdocs/bookcal/calendar_agenda.php +++ b/htdocs/bookcal/calendar_agenda.php @@ -265,6 +265,7 @@ if ($object->id > 0) { //$cachekey = 'count_events_myobject_'.$object->id; //$nbEvent = dol_getcache($cachekey); $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '('.$nbEvent.')': ''); + print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); // List of all actions diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index 983b5bc8b73..ed60c9741b6 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -492,9 +492,6 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; print '
'; } diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 8b8d15bd96e..47955005423 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -669,7 +669,7 @@ class Calendar extends CommonObject * getTooltipContentArray * @param array $params params to construct tooltip data * @since v18 - * @return array{picto:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} + * @return array{picto?:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} */ public function getTooltipContentArray($params) { diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index edd6988d38b..e61594d4026 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -93,7 +94,7 @@ function printDropdownBookmarksList() //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); $newbtn .= ''; - $newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; + $newbtn .= img_picto('', 'add', '', 0, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; } } diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index bbe79d12f7a..2dd9a0caf4f 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -57,7 +57,7 @@ restrictedArea($user, 'bookmark', $object); $permissiontoread = $user->hasRight('bookmark', 'lire'); $permissiontoadd = $user->hasRight('bookmark', 'creer'); -$permissiontodelete = $user->hasRight('bookmark', 'supprimer'); +$permissiontodelete = ($user->hasRight('bookmark', 'supprimer') || ($permissiontoadd && $object->fk_user == $user->id)); // Can always delete its own bookmark @@ -326,7 +326,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { // Buttons - print "
\n"; + print '
'."\n"; // Edit if ($permissiontoadd && $action != 'edit') { diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 8d9896433df..63b26c5f745 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -283,7 +283,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; $moreforfilter = ''; $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index dddde5cfccc..8851e8a8381 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -889,12 +889,14 @@ class Categorie extends CommonObject * @param string $sortfield Sort fields * @param string $sortorder Sort order ('ASC' or 'DESC'); * @param string $filter Filter as an Universal Search string. - * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')' + * For multilingual fields, use: '(ol.label:like:'%value%')' and set $filterlang parameter * @param string $filtermode No more used + * @param string $filterlang Language to use in Universal Search for multilingual fields ('fr_FR', 'en_US'...) * @return CommonObject[]|int[]|int Return -1 if KO, array of instance of object if OK * @see containsObject() */ - public function getObjectsInCateg($type, $onlyids = 0, $limit = 0, $offset = 0, $sortfield = '', $sortorder = 'ASC', $filter = '', $filtermode = 'AND') + public function getObjectsInCateg($type, $onlyids = 0, $limit = 0, $offset = 0, $sortfield = '', $sortorder = 'ASC', $filter = '', $filtermode = 'AND', $filterlang = '') { global $user; @@ -906,6 +908,9 @@ class Categorie extends CommonObject $sql = "SELECT c.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." as fk_object"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type])." as c"; $sql .= ", ".MAIN_DB_PREFIX.(empty($this->MAP_OBJ_TABLE[$type]) ? $type : $this->MAP_OBJ_TABLE[$type])." as o"; + if (!empty($filterlang)) { + $sql .= ", ".MAIN_DB_PREFIX.(empty($this->MAP_OBJ_TABLE[$type]) ? $type : $this->MAP_OBJ_TABLE[$type])."_lang as ol"; + } $sql .= " WHERE o.entity IN (".getEntity($obj->element).")"; $sql .= " AND c.fk_categorie = ".((int) $this->id); // Compatibility with actioncomm table which has id instead of rowid @@ -914,6 +919,10 @@ class Categorie extends CommonObject } else { $sql .= " AND c.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = o.rowid"; } + if (!empty($filterlang)) { + $sql .= " AND ol.fk_".(empty($this->MAP_OBJ_TABLE[$type]) ? $type : $this->MAP_OBJ_TABLE[$type])." = o.rowid"; + $sql .= " AND ol.lang = '".$this->db->escape($filterlang)."'"; + } // Protection for external users if (($type == 'customer' || $type == 'supplier') && $user->socid > 0) { $sql .= " AND o.rowid = ".((int) $user->socid); @@ -1703,9 +1712,9 @@ class Categorie extends CommonObject /** * getTooltipContentArray - * @param array $params params to construct tooltip data + * @param array $params params to construct tooltip data * @since v18 - * @return array + * @return array{picto?:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} */ public function getTooltipContentArray($params) { diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index a5af5901fcf..8c23bf972e9 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -572,7 +572,7 @@ if ($type == Categorie::TYPE_PRODUCT) { if ($permission) { print 'id.'">'; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; @@ -659,7 +659,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { if ($permission) { print "id."'>"; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; @@ -747,7 +747,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { if ($permission) { print 'id.($limit ? '&limit='.$limit : '').'">'; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; @@ -839,7 +839,7 @@ if ($type == Categorie::TYPE_MEMBER) { if ($permission) { print "id."'>"; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; @@ -932,7 +932,7 @@ if ($type == Categorie::TYPE_CONTACT) { if ($permission) { print "id."'>"; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; @@ -1022,7 +1022,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { if ($permission) { print "id."'>"; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; @@ -1112,7 +1112,7 @@ if ($type == Categorie::TYPE_PROJECT) { if ($permission) { print "id."'>"; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; @@ -1196,7 +1196,7 @@ if ($type == Categorie::TYPE_USER) { if ($user->hasRight('user', 'user', 'creer')) { print "id."'>"; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; @@ -1267,7 +1267,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { if ($permission) { print "id."'>"; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; @@ -1355,7 +1355,7 @@ if ($type == Categorie::TYPE_TICKET) { if ($permission) { print "id."'>"; print $langs->trans("DeleteFromCat"); - print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; } print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 3750da9a16f..cf7f82f83d2 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -331,6 +331,8 @@ if (empty($reshook) && $action == 'add' && $usercancreate) { $datep = dol_mktime(GETPOSTINT("aphour"), GETPOSTINT("apmin"), GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); $datef = dol_mktime(GETPOSTINT("p2hour"), GETPOSTINT("p2min"), GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); } + //set end date to now if percentage is set to 100 and end date not set + $datef = (!$datef && $percentage == 100)?dol_now():$datef; // Check parameters if (!$datef && $percentage == 100) { @@ -1225,7 +1227,29 @@ if ($action == 'create') { console.log("setdatefields"); setdatefields(); }); - + var old_startdate = null; + $("#ap").focus(function() { + old_startdate = new Date($("#apyear").val(), $("#apmonth").val() - 1, $("#apday").val()); + }); + $("#ap").next(".ui-datepicker-trigger").click(function() { + old_startdate = new Date($("#apyear").val(), $("#apmonth").val() - 1, $("#apday").val()); + }); + $("#ap").change(function() { + setTimeout(function() { + if ($("#p2").val() !== "") { + var new_startdate = new Date($("#apyear").val(), $("#apmonth").val() - 1, $("#apday").val()); + var old_enddate = new Date($("#p2year").val(), $("#p2month").val() - 1, $("#p2day").val()); + if (new_startdate > old_enddate) { + var timeDiff = old_enddate - old_startdate; + var new_enddate = new Date(new_startdate.getTime() + timeDiff); + $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '")); + $("#p2day").val(new_enddate.getDate()); + $("#p2month").val(new_enddate.getMonth() + 1); + $("#p2year").val(new_enddate.getFullYear()); + } + } + }, 0); + }); $("#actioncode").change(function() { if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired"); else $("#dateend").removeClass("fieldrequired"); @@ -1817,6 +1841,29 @@ if ($id > 0) { $("#fullday").change(function() { setdatefields(); }); + var old_startdate = null; + $("#ap").focus(function() { + old_startdate = new Date($("#apyear").val(), $("#apmonth").val() - 1, $("#apday").val()); + }); + $("#ap").next(".ui-datepicker-trigger").click(function() { + old_startdate = new Date($("#apyear").val(), $("#apmonth").val() - 1, $("#apday").val()); + }); + $("#ap").change(function() { + setTimeout(function() { + if ($("#p2").val() !== "") { + var new_startdate = new Date($("#apyear").val(), $("#apmonth").val() - 1, $("#apday").val()); + var old_enddate = new Date($("#p2year").val(), $("#p2month").val() - 1, $("#p2day").val()); + if (new_startdate > old_enddate) { + var timeDiff = old_enddate - old_startdate; + var new_enddate = new Date(new_startdate.getTime() + timeDiff); + $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '")); + $("#p2day").val(new_enddate.getDate()); + $("#p2month").val(new_enddate.getMonth() + 1); + $("#p2year").val(new_enddate.getFullYear()); + } + } + }, 0); + }); $("#actioncode").change(function() { if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired"); else $("#dateend").removeClass("fieldrequired"); @@ -2334,12 +2381,13 @@ if ($id > 0) { // Type if (getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { print ''.$langs->trans("Type").''; - $labeltoshow = $langs->trans("Action".$object->type_code); + $labeltype = ($langs->transnoentities("Action".$object->type_code) != "Action".$object->type_code) ? $langs->transnoentities("Action".$object->type_code) : $object->type_label; + $labeltoshow = $labeltype; if ($object->code) { $labeltoshow .= ' ('.$object->code.')'; } print $object->getTypePicto('pictofixedwidth paddingright', $labeltoshow); - print $langs->trans("Action".$object->type_code); + print $labeltype; print ''; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index eca23912930..1b253bc5aab 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -845,6 +845,7 @@ class ActionComm extends CommonObject $this->type_color = $obj->type_color; $this->type_picto = $obj->type_picto; $this->type = $obj->type_type; + $this->type_label = $obj->type_label; $this->code = $obj->code; $this->label = $obj->label; @@ -1869,32 +1870,32 @@ class ActionComm extends CommonObject $color = 'style="color: #'.$this->type_color.' !important;"'; } if ($this->type_picto) { - $imgpicto = img_picto($titlealt, $this->type_picto, '', false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, $this->type_picto, '', 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } else { if ($this->type_code == 'AC_RDV') { - $imgpicto = img_picto($titlealt, 'meeting', $color, false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'meeting', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif ($this->type_code == 'AC_TEL') { - $imgpicto = img_picto($titlealt, 'object_phoning', $color, false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'object_phoning', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif ($this->type_code == 'AC_FAX') { - $imgpicto = img_picto($titlealt, 'object_phoning_fax', $color, false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'object_phoning_fax', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN' || (!empty($this->code) && preg_match('/_SENTBYMAIL/', $this->code))) { - $imgpicto = img_picto($titlealt, 'object_email', $color, false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'object_email', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif ($this->type_code == 'AC_INT') { - $imgpicto = img_picto($titlealt, 'object_intervention', $color, false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'object_intervention', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif (!empty($this->code) && preg_match('/^TICKET_MSG/', $this->code)) { - $imgpicto = img_picto($titlealt, 'object_conversation', $color, false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'object_conversation', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } elseif ($this->type != 'systemauto') { - $imgpicto = img_picto($titlealt, 'user-cog', $color, false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'user-cog', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } else { - $imgpicto = img_picto($titlealt, 'cog', $color, false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'cog', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } } } else { // 2 picto: 1 for auto, 1 for manual if ($this->type != 'systemauto') { - $imgpicto = img_picto($titlealt, 'user-cog', '', false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'user-cog', '', 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } else { - $imgpicto = img_picto($titlealt, 'cog', '', false, 0, 0, '', ($morecss ? ' '.$morecss : '')); + $imgpicto = img_picto($titlealt, 'cog', '', 0, 0, 0, '', ($morecss ? ' '.$morecss : '')); } } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index a34d000e5cd..dfedaf09696 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1563,7 +1563,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month } echo ' '."\n"; - $todayarray = dol_getdate($now, 'fast'); + $todayarray = dol_getdate($now, true); $todaytms = dol_mktime(0, 0, 0, $todayarray['mon'], $todayarray['mday'], $todayarray['year']); // In loops, tmpday contains day nb in current month (can be zero or negative for days of previous month) @@ -1679,7 +1679,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month } $today = 0; - $todayarray = dol_getdate($now, 'fast'); + $todayarray = dol_getdate($now, true); if ($todayarray['mday'] == $tmpday && $todayarray['mon'] == $tmpmonth && $todayarray['year'] == $tmpyear) { $today = 1; } @@ -1709,7 +1709,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month // Code to show just one day $style = 'cal_current_month cal_current_month_oneday'; $today = 0; - $todayarray = dol_getdate($now, 'fast'); + $todayarray = dol_getdate($now, true); if ($todayarray['mday'] == $day && $todayarray['mon'] == $month && $todayarray['year'] == $year) { $today = 1; } diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 46a73a2381e..a3af20c887b 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -832,7 +832,7 @@ while ($obj = $db->fetch_object($resql)) { } // Loop on each user to show calendar -$todayarray = dol_getdate($now, 'fast'); +$todayarray = dol_getdate($now, true); $sav = $tmpday; $showheader = true; $var = false; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 56ec858b6c1..de89f87a6ef 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -999,7 +999,7 @@ while ($currentdaytoshow < $lastdaytoshow) { } // Loop on each user to show calendar - $todayarray = dol_getdate($now, 'fast'); + $todayarray = dol_getdate($now, true); $sav = $tmpday; $showheader = true; $var = false; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 260f4ea7341..9936beaae5f 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -530,7 +530,7 @@ if ($object->id > 0) { // Multiprice level - if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { + if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { print ''; print ''; print ''; print ''; - print ''; + print ''; print "\n"; $i = 0; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index f769b19ba90..e96bac0ec28 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -78,6 +78,7 @@ if (GETPOST('button_removefilter_x', 'alpha')) { $search_email = ''; } $array_query = array(); +'@phan-var-force array $array_query'; $object = new Mailing($db); $advTarget = new AdvanceTargetingMailing($db); @@ -465,6 +466,10 @@ if ($object->fetch($id) >= 0) { // Show email selectors if ($object->status == 0 && $user->hasRight('mailing', 'creer')) { + // @phan-assert FormAdvTargetEmailing $formadvtargetemaling + // @phan-assert AdvanceTargetingMailing $advTarget + + // @phan-assert array $val) { $out .= '
'; $out .= img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name']; - $out .= ' '; + $out .= ' '; $out .= '
'; } } else { diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 370ef3ca4db..70d219562f1 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -773,10 +773,9 @@ class Mailing extends CommonObject /** * getTooltipContentArray - * - * @param array $params ex option, infologin + * @param array $params params to construct tooltip data * @since v18 - * @return array + * @return array{picto?:string,ref?:string,refsupplier?:string,label?:string,date?:string,date_echeance?:string,amountht?:string,total_ht?:string,totaltva?:string,amountlt1?:string,amountlt2?:string,amountrevenustamp?:string,totalttc?:string}|array{optimize:string} */ public function getTooltipContentArray($params) { diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 80b11d9b450..eea6d8ac8f2 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -372,9 +372,6 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array('type' => $type); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; print '
'; } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index b29ea95e91c..4f458313b26 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -547,7 +547,7 @@ if (empty($reshook)) { $element = $subelement = 'contrat'; } if ($element == 'inter') { - $element = $subelement = 'ficheinter'; + $element = $subelement = 'fichinter'; } if ($element == 'shipping') { $element = $subelement = 'expedition'; @@ -568,6 +568,7 @@ if (empty($reshook)) { $classname = ucfirst($subelement); $srcobject = new $classname($db); + '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); $result = $srcobject->fetch($object->origin_id); @@ -705,7 +706,7 @@ if (empty($reshook)) { $ret = $object->fetch($id); // Reload to get new records $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { - dol_print_error($db, $result); + dol_print_error($db, $object->error, $object->errors); } } @@ -930,7 +931,10 @@ if (empty($reshook)) { // Go back to draft if ($action == 'modif' && $usercancreate) { - $object->setDraft($user); + $result = $object->setDraft($user); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) { // Define output language @@ -1137,8 +1141,51 @@ if (empty($reshook)) { $price_min_ttc = $prod->price_min_ttc; $price_base_type = $prod->price_base_type; - // If price per segment - if (getDolGlobalString('PRODUIT_MULTIPRICES') && $object->thirdparty->price_level) { + if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { + // If price per customer + require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; + $prodcustprice = new ProductCustomerPrice($db); + $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); + + // If a price per customer exist + $pricebycustomerexist = false; + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); + if ($result) { + // If there is some prices specific to the customer + if (count($prodcustprice->lines) > 0) { + $pricebycustomerexist = true; + $pu_ht = price($prodcustprice->lines[0]->price); + $pu_ttc = price($prodcustprice->lines[0]->price_ttc); + $price_min = price($prodcustprice->lines[0]->price_min); + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); + $price_base_type = $prodcustprice->lines[0]->price_base_type; + /*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); + if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { + $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')'; + } + $tva_npr = $prodcustprice->lines[0]->recuperableonly; + if (empty($tva_tx)) { + $tva_npr = 0; + }*/ + } + } + + if ( !$pricebycustomerexist && $object->thirdparty->price_level) { // If price per segment + $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; + $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; + $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; + $price_min_ttc = $prod->multiprices_min_ttc[$object->thirdparty->price_level]; + $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; + if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility + if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) { + $tva_tx = $prod->multiprices_tva_tx[$object->thirdparty->price_level]; + } + if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) { + $tva_npr = $prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + } + } + } + } elseif (getDolGlobalString('PRODUIT_MULTIPRICES') && $object->thirdparty->price_level) { // If price per segment $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; @@ -1276,7 +1323,7 @@ if (empty($reshook)) { if (!empty($product_desc) && getDolGlobalString('MAIN_NO_CONCAT_DESCRIPTION')) { $desc = $product_desc; } else { - $desc = dol_concatdesc($desc, $product_desc, '', getDolGlobalString('MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION')); + $desc = dol_concatdesc($desc, $product_desc, false, getDolGlobalString('MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION') ? true : false); } // Add custom code and origin country into description @@ -1549,11 +1596,11 @@ if (empty($reshook)) { $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); $price_min = $product->price_min; - if (getDolGlobalString('PRODUIT_MULTIPRICES') && !empty($object->thirdparty->price_level)) { + if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($object->thirdparty->price_level)) { $price_min = $product->multiprices_min[$object->thirdparty->price_level]; } $price_min_ttc = $product->price_min_ttc; - if (getDolGlobalString('PRODUIT_MULTIPRICES') && !empty($object->thirdparty->price_level)) { + if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($object->thirdparty->price_level)) { $price_min_ttc = $product->multiprices_min_ttc[$object->thirdparty->price_level]; } @@ -1839,6 +1886,7 @@ if ($action == 'create') { $classname = ucfirst($subelement); $objectsrc = new $classname($db); + '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic $objectsrc->fetch($originid); if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { $objectsrc->fetch_lines(); @@ -1956,7 +2004,7 @@ if ($action == 'create') { } else { print '
'; // Type $out .= ''; + // Label $out .= ''; $out .= ''; $out .= ''; @@ -2517,9 +2526,14 @@ function show_subsidiaries($conf, $langs, $db, $object) */ function addEventTypeSQL(&$sql, $actioncode, $sqlANDOR = "AND") { - global $conf, $db; + global $db; + // Condition on actioncode + if ((string) $actioncode == '-1') { + return $sql; + } + if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { if ($actioncode == 'AC_NON_AUTO') { $sql .= " $sqlANDOR c.type <> 'systemauto'"; diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 747540dbfde..747a5600735 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2010-2017 Regis Houssin * Copyright (C) 2015-2021 Frederic France * Copyright (C) 2015 Raphaël Doursenaud + * 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 @@ -28,7 +29,7 @@ * Prepare array with list of tabs * * @param Contact $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function contact_prepare_head(Contact $object) { diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 6b94903e3fc..b1a9f36432f 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2006-2012 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2023 Charlene BENKE + * 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,7 @@ * Prepare array with list of tabs * * @param Contrat $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function contract_prepare_head(Contrat $object) { @@ -99,7 +100,7 @@ function contract_prepare_head(Contrat $object) $head[$h][0] = DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); - if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { + if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $nbEvent = 0; // Enable caching of thirdparty count actioncomm require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 84dbc89d120..a8bdff59b97 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -763,7 +763,7 @@ function getGMTEasterDatetime($year) */ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includesaturday = -1, $includesunday = -1, $includefriday = -1, $includemonday = -1) { - global $db, $mysoc; + global $conf, $db, $mysoc; $nbFerie = 0; @@ -790,6 +790,34 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $country_id = dol_getIdFromCode($db, $country_code, 'c_country', 'code', 'rowid'); + if (empty($conf->cache['arrayOfActivePublicHolidays_'.$country_id])) { + // Loop on public holiday defined into hrm_public_holiday for the day, month and year analyzed + $tmpArrayOfPublicHolidays = array(); + $sql = "SELECT id, code, entity, fk_country, dayrule, year, month, day, active"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday"; + $sql .= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")"; + $sql .= " AND entity IN (0," .getEntity('holiday') .")"; + + $resql = $db->query($sql); + if ($resql) { + $num_rows = $db->num_rows($resql); + $i = 0; + while ($i < $num_rows) { + $obj = $db->fetch_object($resql); + $tmpArrayOfPublicHolidays[$obj->id] = array('dayrule' => $obj->dayrule, 'year' => $obj->year, 'month' => $obj->month, 'day' => $obj->day); + $i++; + } + } else { + dol_syslog($db->lasterror(), LOG_ERR); + return 'Error sql '.$db->lasterror(); + } + + //var_dump($tmpArrayOfPublicHolidays); + $conf->cache['arrayOfActivePublicHolidays_'.$country_id] = $tmpArrayOfPublicHolidays; + } + + $arrayOfPublicHolidays = $conf->cache['arrayOfActivePublicHolidays_'.$country_id]; + $i = 0; while ((($lastday == 0 && $timestampStart < $timestampEnd) || ($lastday && $timestampStart <= $timestampEnd)) && ($i < 50000)) { // Loop end when equals (Test on i is a security loop to avoid infinite loop) @@ -801,45 +829,27 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $annee = (int) gmdate("Y", $timestampStart); //print "jour=".$jour." month=".$mois." year=".$annee." includesaturday=".$includesaturday." includesunday=".$includesunday."\n"; - - // Loop on public holiday defined into hrm_public_holiday for the day, month and year analyzed - // TODO Execute this request first and store results into an array, then reuse this array. - $sql = "SELECT code, entity, fk_country, dayrule, year, month, day, active"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday"; - $sql .= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")"; - $sql .= " AND entity IN (0," .getEntity('holiday') .")"; - - $resql = $db->query($sql); - if ($resql) { - $num_rows = $db->num_rows($resql); - $i = 0; - while ($i < $num_rows) { - $obj = $db->fetch_object($resql); - - if (!empty($obj->dayrule) && $obj->dayrule != 'date') { // For example 'easter', '...' - $specialdayrule[$obj->dayrule] = $obj->dayrule; - } else { - $match = 1; - if (!empty($obj->year) && $obj->year != $annee) { - $match = 0; - } - if ($obj->month != $mois) { - $match = 0; - } - if ($obj->day != $jour) { - $match = 0; - } - - if ($match) { - $ferie = true; - } + foreach ($arrayOfPublicHolidays as $entrypublicholiday) { + if (!empty($entrypublicholiday['dayrule']) && $entrypublicholiday['dayrule'] != 'date') { // For example 'easter', '...' + $specialdayrule[$entrypublicholiday['dayrule']] = $entrypublicholiday['dayrule']; + } else { + $match = 1; + if (!empty($entrypublicholiday['year']) && $entrypublicholiday['year'] != $annee) { + $match = 0; + } + if ($entrypublicholiday['month'] != $mois) { + $match = 0; + } + if ($entrypublicholiday['day'] != $jour) { + $match = 0; } - $i++; + if ($match) { + $ferie = true; + } } - } else { - dol_syslog($db->lasterror(), LOG_ERR); - return 'Error sql '.$db->lasterror(); + + $i++; } //var_dump($specialdayrule)."\n"; //print "ferie=".$ferie."\n"; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 52ab3df958b..2c8077c2632 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -1,5 +1,6 @@ + * 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 @@ -24,7 +25,7 @@ /** * Prepare array with list of admin tabs * - * @return array Array of tabs to show + * @return array Array of tabs to show */ function donation_admin_prepare_head() { @@ -65,7 +66,7 @@ function donation_admin_prepare_head() * Prepare array with list of tabs * * @param Don $object Donation - * @return array Array of tabs to show + * @return array Array of tabs to show */ function donation_prepare_head($object) { diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index cfb3bacff68..ffdff4a5f43 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 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 @@ -28,7 +29,7 @@ * Prepare array with list of different ecm main dashboard * * @param object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function ecm_prepare_dasboard_head($object) { @@ -86,7 +87,7 @@ function ecm_prepare_dasboard_head($object) * @param object $object Object related to tabs * @param string $module Module * @param string $section Section - * @return array Array of tabs to show + * @return array Array of tabs to show */ function ecm_prepare_head($object, $module = 'ecm', $section = '') { @@ -113,7 +114,7 @@ function ecm_prepare_head($object, $module = 'ecm', $section = '') * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function ecm_file_prepare_head($object) { @@ -149,7 +150,7 @@ function ecm_file_prepare_head($object) * Prepare array with list of tabs * * @param object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function ecm_prepare_head_fm($object) { diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php index c5a185646b0..34055fb0f6f 100644 --- a/htdocs/core/lib/emailing.lib.php +++ b/htdocs/core/lib/emailing.lib.php @@ -1,5 +1,6 @@ + * 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 @@ -25,7 +26,7 @@ * Prepare array with list of tabs * * @param Mailing $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function emailing_prepare_head(Mailing $object) { diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index e765a0f030d..7510a73569b 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -31,7 +31,7 @@ * Prepare array with list of tabs * * @param Expedition $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function expedition_prepare_head(Expedition $object) { diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 592cfb4a638..518ed2d475f 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -27,7 +27,7 @@ * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function expensereport_prepare_head($object) { diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 7d2ad3a69a2..99e354a332e 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -32,7 +32,7 @@ * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function fichinter_prepare_head($object) { @@ -222,7 +222,7 @@ function fichinter_admin_prepare_head() * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function fichinter_rec_prepare_head($object) { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7a4084b34e5..1852eadebeb 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -930,6 +930,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep // Recursive function to copy all subdirectories and contents: if (is_dir($ossrcfile)) { $dir_handle = opendir($ossrcfile); + $tmpresult = 0; // Initialised before loop to keep old behavior, may be needed inside loop while ($file = readdir($dir_handle)) { if ($file != "." && $file != ".." && !is_link($ossrcfile."/".$file)) { if (is_dir($ossrcfile."/".$file)) { @@ -998,19 +999,19 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep * - Database indexes for files are updated. * - Test on virus is done only if param testvirus is provided and an antivirus was set. * - * @param string $srcfile Source file (can't be a directory. use native php @rename() to move a directory) - * @param string $destfile Destination file (can't be a directory. use native php @rename() to move a directory) - * @param string $newmask Mask in octal string for new file ('0' by default means $conf->global->MAIN_UMASK) - * @param int $overwriteifexists Overwrite file if exists (1 by default) - * @param int $testvirus Do an antivirus test. Move is canceled if a virus is found. - * @param int $indexdatabase Index new file into database. - * @param array $moreinfo Array with more information to set in index table + * @param string $srcfile Source file (can't be a directory. use native php @rename() to move a directory) + * @param string $destfile Destination file (can't be a directory. use native php @rename() to move a directory) + * @param string $newmask Mask in octal string for new file ('0' by default means $conf->global->MAIN_UMASK) + * @param int<0,1> $overwriteifexists Overwrite file if exists (1 by default) + * @param int<0,1> $testvirus Do an antivirus test. Move is canceled if a virus is found. + * @param int<0,1> $indexdatabase Index new file into database. + * @param array $moreinfo Array with more information to set in index table * @return boolean True if OK, false if KO * @see dol_move_uploaded_file() */ function dol_move($srcfile, $destfile, $newmask = '0', $overwriteifexists = 1, $testvirus = 0, $indexdatabase = 1, $moreinfo = array()) { - global $user, $db, $conf; + global $user, $db; $result = false; dol_syslog("files.lib.php::dol_move srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." overwritifexists=".$overwriteifexists); @@ -1795,9 +1796,12 @@ function dol_meta_create($object) dol_mkdir($dir); } + $meta = ''; if (is_dir($dir)) { if (is_countable($object->lines) && count($object->lines) > 0) { $nblines = count($object->lines); + } else { + $nblines = 0; } $client = $object->thirdparty->name." ".$object->thirdparty->address." ".$object->thirdparty->zip." ".$object->thirdparty->town; $meta = "REFERENCE=\"".$object->ref."\" @@ -1867,15 +1871,15 @@ function dol_init_file_process($pathtoscan = '', $trackid = '') * All information used are in db, conf, langs, user and _FILES. * Note: This function can be used only into a HTML page context. * - * @param string $upload_dir Directory where to store uploaded file (note: used to forge $destpath = $upload_dir + filename) - * @param int $allowoverwrite 1=Allow overwrite existing file - * @param int $updatesessionordb 1=Do no edit _SESSION variable but update database index. 0=Update _SESSION and not database index. -1=Do not update SESSION neither db. - * @param string $varfiles _FILES var name - * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' - * @param string $link Link to add (to add a link instead of a file) - * @param string $trackid Track id (used to prefix name of session vars to avoid conflict) - * @param int $generatethumbs 1=Generate also thumbs for uploaded image files - * @param Object $object Object used to set 'src_object_*' fields + * @param string $upload_dir Directory where to store uploaded file (note: used to forge $destpath = $upload_dir + filename) + * @param int<0,1> $allowoverwrite 1=Allow overwrite existing file + * @param int<-1,1> $updatesessionordb 1=Do no edit _SESSION variable but update database index. 0=Update _SESSION and not database index. -1=Do not update SESSION neither db. + * @param string $varfiles _FILES var name + * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' + * @param ?string $link Link to add (to add a link instead of a file) + * @param string $trackid Track id (used to prefix name of session vars to avoid conflict) + * @param int<0,1> $generatethumbs 1=Generate also thumbs for uploaded image files + * @param ?Object $object Object used to set 'src_object_*' fields * @return int Return integer <=0 if KO, >0 if OK * @see dol_remove_file_process() */ @@ -2351,6 +2355,7 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring dol_syslog("dol_compress_file mode=".$mode." inputfile=".$inputfile." outputfile=".$outputfile); $data = implode("", file(dol_osencode($inputfile))); + $compressdata = null; if ($mode == 'gz' && function_exists('gzencode')) { $foundhandler = 1; $compressdata = gzencode($data, 9); @@ -2385,6 +2390,7 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring new RecursiveDirectoryIterator($rootPath, FilesystemIterator::UNIX_PATHS), RecursiveIteratorIterator::LEAVES_ONLY ); + '@phan-var-force SplFileInfo[] $files'; foreach ($files as $name => $file) { // Skip directories (they would be added automatically) @@ -2437,7 +2443,7 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring } } - if ($foundhandler) { + if ($foundhandler && is_string($compressdata)) { $fp = fopen($outputfile, "w"); fwrite($fp, $compressdata); fclose($fp); @@ -2466,7 +2472,7 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring * * @param string $inputfile File to uncompress * @param string $outputdir Target dir name - * @return array array('error'=>'Error code') or array() if no error + * @return array{error?:string} array('error'=>'Error code') or array() if no error * @see dol_compress_file(), dol_compress_dir() */ function dol_uncompress($inputfile, $outputdir) @@ -2601,7 +2607,7 @@ function dol_uncompress($inputfile, $outputdir) * @param string $mode 'zip' * @param string $excludefiles A regex pattern to exclude files. For example: '/\.log$|\/temp\//' * @param string $rootdirinzip Add a root dir level in zip file - * @param string $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' + * @param string $newmask Mask for new file ('0' by default means getDolGlobalString('MAIN_UMASK')). Example: '0666' * @return int Return integer <0 if KO, >0 if OK * @see dol_uncompress(), dol_compress_file() */ @@ -2657,6 +2663,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = new RecursiveDirectoryIterator($inputdir, FilesystemIterator::UNIX_PATHS), RecursiveIteratorIterator::LEAVES_ONLY ); + '@phan-var-force SplFileInfo[] $files'; //var_dump($inputdir); foreach ($files as $name => $file) { @@ -2909,19 +2916,19 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = 1; } $original_file = $conf->contract->multidir_output[$entity].'/'.$original_file; - } elseif (($modulepart == 'apercusupplier_proposal' || $modulepart == 'apercusupplier_proposal') && !empty($conf->supplier_proposal->dir_output)) { + } elseif (($modulepart == 'apercusupplier_proposal') && !empty($conf->supplier_proposal->dir_output)) { // Wrapping pour les apercu supplier proposal if ($fuser->hasRight('supplier_proposal', $lire)) { $accessallowed = 1; } $original_file = $conf->supplier_proposal->dir_output.'/'.$original_file; - } elseif (($modulepart == 'apercusupplier_order' || $modulepart == 'apercusupplier_order') && !empty($conf->fournisseur->commande->dir_output)) { + } elseif (($modulepart == 'apercusupplier_order') && !empty($conf->fournisseur->commande->dir_output)) { // Wrapping pour les apercu supplier order if ($fuser->hasRight('fournisseur', 'commande', $lire)) { $accessallowed = 1; } $original_file = $conf->fournisseur->commande->dir_output.'/'.$original_file; - } elseif (($modulepart == 'apercusupplier_invoice' || $modulepart == 'apercusupplier_invoice') && !empty($conf->fournisseur->facture->dir_output)) { + } elseif (($modulepart == 'apercusupplier_invoice') && !empty($conf->fournisseur->facture->dir_output)) { // Wrapping pour les apercu supplier invoice if ($fuser->hasRight('fournisseur', $lire)) { $accessallowed = 1; @@ -3246,7 +3253,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->fournisseur->payment->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."paiementfournisseur WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif ($modulepart == 'payment') { - // Wrapping pour les rapport de paiements + // Wrapping pour les rapport de paiements if ($fuser->rights->facture->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } @@ -3584,12 +3591,12 @@ function dirbasename($pathfile) * Function to get list of updated or modified files. * $file_list is used as global variable * - * @param array $file_list Array for response + * @param array{insignature:string[],missing?:array,updated:array} $file_list Array for response * @param SimpleXMLElement $dir SimpleXMLElement of files to test - * @param string $path Path of files relative to $pathref. We start with ''. Used by recursive calls. - * @param string $pathref Path ref (DOL_DOCUMENT_ROOT) - * @param array $checksumconcat Array of checksum - * @return array Array of filenames + * @param string $path Path of files relative to $pathref. We start with ''. Used by recursive calls. + * @param string $pathref Path ref (DOL_DOCUMENT_ROOT) + * @param string[] $checksumconcat Array of checksum + * @return array{insignature:string[],missing?:array,updated:array} $file_list Array of filenames */ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathref = '', &$checksumconcat = array()) { diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php index 9b235287993..c995dcc1693 100644 --- a/htdocs/core/lib/fiscalyear.lib.php +++ b/htdocs/core/lib/fiscalyear.lib.php @@ -1,5 +1,6 @@ + * 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 @@ -25,7 +26,7 @@ * Prepare array with list of tabs * * @param Fiscalyear $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function fiscalyear_prepare_head(Fiscalyear $object) { diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 85d1323f6e7..121e41c3ee3 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -32,7 +32,7 @@ * Prepare array with list of tabs * * @param FactureFournisseur $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function facturefourn_prepare_head(FactureFournisseur $object) { @@ -170,7 +170,7 @@ function facturefourn_prepare_head(FactureFournisseur $object) * Prepare array with list of tabs * * @param CommandeFournisseur $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function ordersupplier_prepare_head(CommandeFournisseur $object) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ba47361a40b..9f6f53be514 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -263,7 +263,7 @@ function getDolUserString($key, $default = '', $tmpuser = null) $tmpuser = $user; } - return (string) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key); + return (string) (isset($tmpuser->conf->$key) ? $tmpuser->conf->$key : $default); } /** @@ -281,7 +281,7 @@ function getDolUserInt($key, $default = 0, $tmpuser = null) $tmpuser = $user; } - return (int) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key); + return (int) (isset($tmpuser->conf->$key) ? $tmpuser->conf->$key: $default); } @@ -448,7 +448,7 @@ function getEntity($element, $shared = 1, $currentobject = null) $out = $mc->getEntity($element, $shared, $currentobject); } else { $out = ''; - $addzero = array('user', 'usergroup', 'cronjob', 'c_email_templates', 'email_template', 'default_values', 'overwrite_trans'); + $addzero = array('user', 'usergroup', 'cronjob', 'c_email_templates', 'c_holiday_types', 'email_template', 'default_values', 'overwrite_trans'); if (in_array($element, $addzero)) { $out .= '0,'; } @@ -2768,19 +2768,19 @@ function dol_get_fiche_end($notab = 0) * Show tab footer of a card. * Note: $object->next_prev_filter can be set to restrict select to find next or previous record by $form->showrefnav. * - * @param CommonObject $object Object to show - * @param string $paramid Name of parameter to use to name the id into the URL next/previous link - * @param string $morehtml More html content to output just before the nav bar - * @param int|bool $shownav Show Condition (navigation is shown if value is 1 or true) - * @param string $fieldid Name of the field in DB to use to select next et previous (we make the select max and min on this field). Use 'none' for no prev/next search. - * @param string $fieldref Name of the field (object->ref) to use to select next et previous - * @param string $morehtmlref More html to show after the ref (see $morehtmlleft for before) - * @param string $moreparam More param to add in nav link url. - * @param int $nodbprefix Do not include DB prefix to forge table name - * @param string $morehtmlleft More html code to show before the ref (see $morehtmlref for after) - * @param string $morehtmlstatus More html code to show under navigation arrows - * @param int $onlybanner Put this to 1, if the card will contains only a banner (this add css 'arearefnobottom' on div) - * @param string $morehtmlright More html code to show before navigation arrows + * @param CommonObject $object Object to show + * @param string $paramid Name of parameter to use to name the id into the URL next/previous link + * @param string $morehtml More html content to output just before the nav bar + * @param int|bool $shownav Show Condition (navigation is shown if value is 1 or true) + * @param string $fieldid Name of the field in DB to use to select next et previous (we make the select max and min on this field). Use 'none' for no prev/next search. + * @param string $fieldref Name of the field (object->ref) to use to select next et previous + * @param string $morehtmlref More html to show after the ref (see $morehtmlleft for before) + * @param string $moreparam More param to add in nav link url. + * @param int $nodbprefix Do not include DB prefix to forge table name + * @param string $morehtmlleft More html code to show before the ref (see $morehtmlref for after) + * @param string $morehtmlstatus More html code to show under navigation arrows + * @param int $onlybanner Put this to 1, if the card will contains only a banner (this add css 'arearefnobottom' on div) + * @param string $morehtmlright More html code to show before navigation arrows * @return void */ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $onlybanner = 0, $morehtmlright = '') @@ -3126,6 +3126,11 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi $morehtmlref = $hookmanager->resPrint; } + // $morehtml is the right part (link "Back to list") + // $morehtmlleft is the picto or photo of banner + // $morehtmlstatus is part under the status + // $morehtmlright is part of htmlright + print '
'; print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright); print '
'; @@ -5050,7 +5055,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss', 'shapes', 'skill', 'square', 'sort-numeric-down', 'status', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'terminal', 'tick', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'trip', - 'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private', + 'uncheck', 'undo', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private', 'conferenceorbooth', 'eventorganization', 'stamp', 'signature', 'webportal' @@ -8413,7 +8418,7 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' // Keep only some html tags and remove also some 'javascript:' strings if ($check == 'restricthtmlallowlinkscript') { $out = dol_string_onlythesehtmltags($out, 0, 1, 0, 0, array(), 1, 1); - } elseif ($check == 'restricthtmlallowclass') { + } elseif ($check == 'restricthtmlallowclass' || $check == 'restricthtmlallowunvalid') { $out = dol_string_onlythesehtmltags($out, 0, 0, 1); } else { $out = dol_string_onlythesehtmltags($out, 0, 1, 1); @@ -12899,7 +12904,7 @@ function getElementProperties($elementType) $classfile = 'mailing'; $classname = 'Mailing'; $subelement = ''; - } elseif ($elementType == 'member') { + } elseif ($elementType == 'member' || $elementType == 'adherent') { $classpath = 'adherents/class'; $module = 'adherent'; $subelement = 'adherent'; @@ -13936,15 +13941,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $sql .= ", sp.lastname, sp.firstname"; } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { $sql .= ", m.lastname, m.firstname"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { - $sql .= ", o.ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { - $sql .= ", o.ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { - $sql .= ", o.ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') { - $sql .= ", o.ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { + } elseif (is_object($filterobj) && in_array(get_class($filterobj), array('Commande', 'CommandeFournisseur', 'Product', 'Ticket', 'BOM', 'Contrat', 'Facture', 'FactureFournisseur'))) { $sql .= ", o.ref"; } $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; @@ -13995,6 +13992,11 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, if ($filterobj->id) { $sql .= " AND a.fk_element = ".((int) $filterobj->id); } + } elseif (is_object($filterobj) && get_class($filterobj) == 'Commande') { + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order'"; + if ($filterobj->id) { + $sql .= " AND a.fk_element = ".((int) $filterobj->id); + } } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'"; if ($filterobj->id) { @@ -14026,9 +14028,14 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $sql .= " AND a.fk_contact = ".((int) $filterobj->id); } } elseif (is_object($filterobj) && get_class($filterobj) == 'Facture') { - $sql .= "AND a.fk_element = o.rowid"; + $sql .= " AND a.fk_element = o.rowid"; if ($filterobj->id) { - $sql .= " AND a.fk_element = ".((int) $filterobj->id); + $sql .= " AND a.fk_element = ".((int) $filterobj->id)." AND a.elementtype = 'invoice'"; + } + } elseif (is_object($filterobj) && get_class($filterobj) == 'FactureFournisseur') { + $sql .= " AND a.fk_element = o.rowid"; + if ($filterobj->id) { + $sql .= " AND a.fk_element = ".((int) $filterobj->id)." AND a.elementtype = 'invoice_supplier'"; } } } else { @@ -14036,7 +14043,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, } // Condition on actioncode - if (!empty($actioncode)) { + if (!empty($actioncode) && $actioncode != '-1') { if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { if ($actioncode == 'AC_NON_AUTO') { $sql .= " AND c.type != 'systemauto'"; @@ -14251,17 +14258,19 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $out .= ''; } - $out .= getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', '', $param, '', $sortfield, $sortorder, '')."\n"; + // Date + $out .= getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', '', $param, '', $sortfield, $sortorder, 'nowraponall nopaddingleftimp ')."\n"; - $out .= '
'; + $out .= ''; if ($donetodo) { $out .= ''; } + // Type of event $out .= ''; + // Label $out .= ''; @@ -14276,7 +14285,6 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $out .= ''; - $out .= '
'; print $langs->trans("PriceLevel"); diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 5bc57efbb12..61691055dc5 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -162,7 +162,7 @@ if ($resql) { print ' 
'; $filter = '((s.client:IN:1,2,3) AND (s.status:=:1))'; - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); // reload page to retrieve customer information if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) { print ''."\n"; $out .= ''; - $out .= ''.($revertonoff ? img_picto($langs->trans("Enabled"), 'switch_on', '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', '', $marginleftonlyshort)).''; - $out .= ''.($revertonoff ? img_picto($langs->trans("Disabled"), 'switch_off'.$suffix, '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Enabled"), 'switch_on'.$suffix, '', false, 0, 0, '', '', $marginleftonlyshort)).''; + $out .= ''.($revertonoff ? img_picto($langs->trans("Enabled"), 'switch_on', '', 0, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Disabled"), 'switch_off', '', 0, 0, 0, '', '', $marginleftonlyshort)).''; + $out .= ''.($revertonoff ? img_picto($langs->trans("Disabled"), 'switch_off'.$suffix, '', 0, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Enabled"), 'switch_on'.$suffix, '', 0, 0, 0, '', '', $marginleftonlyshort)).''; $out .= "\n"; } @@ -828,11 +828,11 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = } if (empty($conf->use_javascript_ajax) || $forcenojs) { - $out .= ''.img_picto($langs->trans($text_off), $switchoff, '', false, 0, 0, '', $cssswitchoff).''; - $out .= ''.img_picto($langs->trans($text_on), $switchon, '', false, 0, 0, '', $cssswitchon).''; + $out .= ''.img_picto($langs->trans($text_off), $switchoff, '', 0, 0, 0, '', $cssswitchoff).''; + $out .= ''.img_picto($langs->trans($text_on), $switchon, '', 0, 0, 0, '', $cssswitchon).''; } else { - $out .= ''.img_picto($langs->trans($text_off), $switchoff, '', false, 0, 0, '', $cssswitchoff).''; - $out .= ''.img_picto($langs->trans($text_on), $switchon, '', false, 0, 0, '', $cssswitchon).''; + $out .= ''.img_picto($langs->trans($text_off), $switchoff, '', 0, 0, 0, '', $cssswitchoff).''; + $out .= ''.img_picto($langs->trans($text_on), $switchon, '', 0, 0, 0, '', $cssswitchon).''; } return $out; diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index 2bc74923e52..ac0ecf9fc24 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -1,5 +1,6 @@ + * 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,7 @@ * * @param Categorie $object Object related to tabs * @param string $type Type of category - * @return array Array of tabs to show + * @return array Array of tabs to show */ function categories_prepare_head(Categorie $object, $type) { @@ -76,7 +77,7 @@ function categories_prepare_head(Categorie $object, $type) /** * Prepare array with list of tabs * - * @return array Array of tabs to show + * @return array Array of tabs to show */ function categoriesadmin_prepare_head() { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 076c4de2117..e1e369bbbb0 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -121,7 +121,7 @@ function societe_prepare_head(Societe $object) $head[$h][2] = 'customer'; $h++; - if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { + if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { $langs->load("products"); // price $head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id; @@ -1922,6 +1922,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr if ($filterobj->id) { $sql .= " AND a.fk_element = ".((int) $filterobj->id); } + } elseif (is_object($filterobj) && get_class($filterobj) == 'FactureFournisseur') { + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'invoice_supplier'"; + if ($filterobj->id) { + $sql .= " AND a.fk_element = ".((int) $filterobj->id); + } } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'"; if ($filterobj->id) { @@ -1977,6 +1982,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr if (is_array($actioncode) && !empty($actioncode)) { $sql .= ' AND ('; foreach ($actioncode as $key => $code) { + if ((string) $code == '-1') { + continue; + } if ($key != 0) { $sql .= " OR "; } @@ -1985,7 +1993,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr } } $sql .= ')'; - } elseif (!empty($actioncode)) { + } elseif (!empty($actioncode) && $actioncode != '-1') { addEventTypeSQL($sql, $actioncode); } @@ -2173,8 +2181,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr $out .= ''; - $out .= $formactions->select_type_actions($actioncode, "actioncode", '', getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1, 0, (getDolGlobalString('AGENDA_USE_MULTISELECT_TYPE') ? 1 : 0), 1, 'combolargeelem minwidth100 maxwidth150'); + $out .= $formactions->select_type_actions($actioncode, "actioncode", '', getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1, 0, (getDolGlobalString('AGENDA_USE_MULTISELECT_TYPE') ? 1 : 0), 1, 'selecttype combolargeelem minwidth100 maxwidth150', 1); $out .= ''.$langs->trans("Search").' : '.$langs->trans("Search").' : '; - $out .= ''; - //$out .= img_picto($langs->trans("Type"), 'type'); - $out .= $formactions->select_type_actions($actioncode, "actioncode", '', !getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? 1 : -1, 0, 0, 1, 'minwidth200imp'); + $out .= ''; + $out .= $formactions->select_type_actions($actioncode, "actioncode", '', getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1, 0, 0, 1, 'selecttype minwidth100', $langs->trans("Type")); $out .= ''; $out .= ''; $out .= '
'; $out .= ''; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 07fae627c56..e0e8360d234 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -894,11 +894,11 @@ function array2table($data, $tableMarkup = 1, $tableoptions = '', $troptions = ' * @param string $field Field containing already used values of counter * @param string $where To add a filter on selection (for example to filter on invoice types) * @param Societe|'' $objsoc The company that own the object we need a counter for - * @param string $date Date to use for the {y},{m},{d} tags. + * @param int|'' $date Date to use for the {y},{m},{d} tags. is timestamp or '' to use dol_now() * @param string $mode 'next' for next value or 'last' for last value * @param bool $bentityon Activate the entity filter. Default is true (for modules not compatible with multicompany) * @param User $objuser Object user we need data from. - * @param int $forceentity Entity id to force + * @param string $forceentity Entity id to force, can be '0' or '1' or '1,2' etc * @return string New value (numeric) or error message */ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $date = '', $mode = 'next', $bentityon = true, $objuser = null, $forceentity = null) diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php index a84123662b9..77c380918a4 100644 --- a/htdocs/core/lib/hrm.lib.php +++ b/htdocs/core/lib/hrm.lib.php @@ -1,5 +1,6 @@ + * 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 @@ -25,7 +26,7 @@ * Return head table for establishment tabs screen * * @param Establishment $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function establishment_prepare_head($object) { diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index 467b6575915..76bebe2d046 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -29,7 +29,7 @@ * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function loan_prepare_head($object) { diff --git a/htdocs/core/lib/multicurrency.lib.php b/htdocs/core/lib/multicurrency.lib.php index e77a9ee8081..1be514c60eb 100644 --- a/htdocs/core/lib/multicurrency.lib.php +++ b/htdocs/core/lib/multicurrency.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Regis Houssin + * 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 @@ -26,7 +27,7 @@ /** * Prepare array with list of tabs * - * @return array Array of tabs to show + * @return array Array of tabs to show */ function multicurrencyAdminPrepareHead() { @@ -56,7 +57,7 @@ function multicurrencyAdminPrepareHead() * Prepare array with list of currency tabs * * @param array $aCurrencies Currencies array - * @return array Array of tabs + * @return array Array of tabs to show */ function multicurrencyLimitPrepareHead($aCurrencies) { diff --git a/htdocs/core/lib/openid_connect.lib.php b/htdocs/core/lib/openid_connect.lib.php index 21cf8ef30cc..d79e6ec45a1 100644 --- a/htdocs/core/lib/openid_connect.lib.php +++ b/htdocs/core/lib/openid_connect.lib.php @@ -1,5 +1,6 @@ + * 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 @@ -24,7 +25,7 @@ /** * Prepare array with list of tabs * - * @return array Array of tabs to show + * @return array Array of tabs to show */ function openid_connect_prepare_head() { diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 2a8ccfef236..737279e4ae6 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2010 Juanjo Menent + * 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 @@ -29,7 +30,7 @@ * Prepare array with list of tabs * * @param Commande $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function commande_prepare_head(Commande $object) { @@ -131,7 +132,7 @@ function commande_prepare_head(Commande $object) $head[$h][0] = DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); - if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { + if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $nbEvent = 0; // Enable caching of thirdparty count actioncomm require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 46966f1749d..3e4c32493fd 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -14,7 +14,7 @@ * Copyright (C) 2020 Nicolas ZABOURI * Copyright (C) 2021-2022 Anthony Berton * Copyright (C) 2023-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; /** * Return array head with list of tabs to view object information. * - * @return array head array with tabs + * @return array head array with tabs */ function pdf_admin_prepare_head() { @@ -180,10 +180,8 @@ function pdf_getInstance($format = '', $metric = 'mm', $pagetype = 'P') //$format=array($arrayformat['width'],$arrayformat['height']); //$metric=$arrayformat['unit']; - $pdfa = false; // PDF-1.3 - if (getDolGlobalString('PDF_USE_A')) { - $pdfa = getDolGlobalString('PDF_USE_A'); // PDF/A-1 ou PDF/A-3 - } + //$pdfa = false; // PDF default version + $pdfa = getDolGlobalInt('PDF_USE_A', 0); // PDF/A-1 ou PDF/A-3 if (!getDolGlobalString('MAIN_DISABLE_TCPDI') && class_exists('TCPDI')) { $pdf = new TCPDI($pagetype, $metric, $format, true, 'UTF-8', false, $pdfa); @@ -209,13 +207,13 @@ function pdf_getInstance($format = '', $metric = 'mm', $pagetype = 'P') $pdfrights = (getDolGlobalString('PDF_SECURITY_ENCRYPTION_RIGHTS') ? json_decode($conf->global->PDF_SECURITY_ENCRYPTION_RIGHTS, true) : array('modify', 'copy')); // Json format in llx_const // Password for the end user - $pdfuserpass = (getDolGlobalString('PDF_SECURITY_ENCRYPTION_USERPASS') ? $conf->global->PDF_SECURITY_ENCRYPTION_USERPASS : ''); + $pdfuserpass = getDolGlobalString('PDF_SECURITY_ENCRYPTION_USERPASS'); // Password of the owner, created randomly if not defined - $pdfownerpass = (getDolGlobalString('PDF_SECURITY_ENCRYPTION_OWNERPASS') ? $conf->global->PDF_SECURITY_ENCRYPTION_OWNERPASS : null); + $pdfownerpass = (getDolGlobalString('PDF_SECURITY_ENCRYPTION_OWNERPASS') ? getDolGlobalString('PDF_SECURITY_ENCRYPTION_OWNERPASS') : null); // For encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit - $encstrength = (getDolGlobalString('PDF_SECURITY_ENCRYPTION_STRENGTH') ? $conf->global->PDF_SECURITY_ENCRYPTION_STRENGTH : 0); + $encstrength = getDolGlobalInt('PDF_SECURITY_ENCRYPTION_STRENGTH', 0); // Array of recipients containing public-key certificates ('c') and permissions ('p'). // For example: array(array('c' => 'file://../examples/data/cert/tcpdf.crt', 'p' => array('print'))) @@ -382,7 +380,7 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) * * @param Societe|Contact $thirdparty Contact or thirdparty * @param Translate $outputlangs Output language - * @param int $includealias 1=Include alias name after name + * @param int<0,1> $includealias 1=Include alias name after name * @return string String with name of thirdparty (+ alias if requested) */ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias = 0) @@ -430,7 +428,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali * @param Contact|string|null $targetcontact Target contact object * @param int $usecontact Use contact instead of company * @param string $mode Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url) - * @param Object|null $object Object we want to build document for + * @param ?CommonObject $object Object we want to build document for * @return string|int String with full address or -1 if KO */ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source', $object = null) @@ -725,9 +723,9 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t /** * Show header of page for PDF generation * - * @param TCPDF $pdf Object PDF - * @param Translate $outputlangs Object lang for output - * @param int $page_height Height of page + * @param TCPDF $pdf Object PDF + * @param Translate $outputlangs Object lang for output + * @param int $page_height Height of page * @return void */ function pdf_pagehead(&$pdf, $outputlangs, $page_height) @@ -760,11 +758,11 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height) * Return array of possible substitutions for PDF content (without external module substitutions). * * @param Translate $outputlangs Output language - * @param array|null $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...) - * @param Object|null $object Object - * @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip) - * @param array|null $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) - * @return array Array of substitutions + * @param null|string[] $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...) + * @param ?Object $object Object + * @param int<0,2> $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip) + * @param null|string[] $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) + * @return array Array of substitutions */ function pdf_getSubstitutionArray($outputlangs, $exclude = null, $object = null, $onlykey = 0, $include = null) { @@ -797,6 +795,9 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) $k = 72 / 2.54; } elseif ($unit == 'in') { $k = 72; + } else { + $k = 1; + dol_print_error(null, 'Unexpected unit "'.$unit.'" for pdf_watermark'); } // Make substitution @@ -1011,8 +1012,8 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, * @param int $marge_basse Margin bottom we use for the autobreak * @param int $marge_gauche Margin left (no more used) * @param int $page_hauteur Page height - * @param Object $object Object shown in PDF - * @param int $showdetails Show company address details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both) + * @param CommonObject $object Object shown in PDF + * @param int<0,3> $showdetails Show company address details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both) * @param int $hidefreetext 1=Hide free text, 0=Show free text * @param int $page_largeur Page width * @param string $watermark Watermark text to print on page @@ -1210,6 +1211,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ // The start of the bottom of this page footer is positioned according to # of lines $freetextheight = 0; + $align = null; if ($line) { // Free text //$line="sample text
\nfdsfsdf
\nghfghg
"; if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { @@ -1226,7 +1228,8 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } } - // For customize footer + $posy = 0; + // For customized footer if (is_object($hookmanager)) { $parameters = array('line1' => $line1, 'line2' => $line2, 'line3' => $line3, 'line4' => $line4, 'outputlangs' => $outputlangs); $action = ''; @@ -1242,7 +1245,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ if (getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) { list($r, $g, $b) = sscanf($conf->global->PDF_FOOTER_BACKGROUND_COLOR, '%d, %d, %d'); $pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak - $pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', '', $fill_color = array($r, $g, $b)); + $pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', array(), $fill_color = array($r, $g, $b)); $pdf->SetAutoPageBreak(1, 0); // Restore pagebreak } @@ -1294,7 +1297,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ if (getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) { list($r, $g, $b) = sscanf($conf->global->PDF_FOOTER_BACKGROUND_COLOR, '%d, %d, %d'); $pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak - $pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', '', $fill_color = array($r, $g, $b)); + $pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', array(), $fill_color = array($r, $g, $b)); $pdf->SetAutoPageBreak(1, 0); // Restore pagebreak } @@ -1382,7 +1385,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ * Show linked objects for PDF generation * * @param TCPDF $pdf Object PDF - * @param Object $object Object + * @param CommonObject $object Object * @param Translate $outputlangs Object lang * @param int $posx X * @param int $posy Y @@ -1416,17 +1419,17 @@ function pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, * Output line description into PDF * * @param TCPDF $pdf PDF object - * @param Object $object Object + * @param CommonObject $object Object * @param int $i Current line number * @param Translate $outputlangs Object lang for output * @param int $w Width * @param int $h Height * @param int $posx Pos x * @param int $posy Pos y - * @param int $hideref Hide reference - * @param int $hidedesc Hide description - * @param int $issupplierline Is it a line for a supplier object ? - * @param string $align text alignment ('L', 'C', 'R', 'J' (default)) + * @param int<0,1> $hideref Hide reference + * @param int<0,1> $hidedesc Hide description + * @param int<0,1> $issupplierline Is it a line for a supplier object ? + * @param 'L'|'C'|'R'|'J' $align text alignment ('L', 'C', 'R', 'J' (default)) * @return string */ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref = 0, $hidedesc = 0, $issupplierline = 0, $align = 'J') @@ -1436,7 +1439,7 @@ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $pos $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -1476,7 +1479,7 @@ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $pos /** * Return line description translated in outputlangs and encoded into htmlentities and with
* - * @param Object $object Object + * @param CommonObject $object Object * @param int $i Current line number (0 = first line, 1 = second line, ...) * @param Translate $outputlangs Object langs for output * @param int $hideref Hide reference @@ -1503,7 +1506,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $prodser = new Product($db); - if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { + if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { include_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; } } @@ -1682,7 +1685,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, } else { $ref_prodserv = $prodser->ref; // Show local ref only - if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { + if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { $productCustomerPriceStatic = new ProductCustomerPrice($db); $filter = array('fk_product' => $idprod, 'fk_soc' => $object->socid); @@ -1821,7 +1824,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, /** * Return line num * - * @param Object $object Object + * @param CommonObject $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) @@ -1834,7 +1837,7 @@ function pdf_getlinenum($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -1854,7 +1857,7 @@ function pdf_getlinenum($object, $i, $outputlangs, $hidedetails = 0) /** * Return line product ref * - * @param Object $object Object + * @param CommonObject $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) @@ -1867,7 +1870,7 @@ function pdf_getlineref($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -1883,13 +1886,14 @@ function pdf_getlineref($object, $i, $outputlangs, $hidedetails = 0) return $result; } + /** * Return line ref_supplier * - * @param Object $object Object + * @param Contrat|CommandeFournisseur|FactureFournisseur|Facture|Product|Reception|SupplierProposal $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string */ function pdf_getlineref_supplier($object, $i, $outputlangs, $hidedetails = 0) @@ -1899,7 +1903,7 @@ function pdf_getlineref_supplier($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -1918,10 +1922,10 @@ function pdf_getlineref_supplier($object, $i, $outputlangs, $hidedetails = 0) /** * Return line vat rate * - * @param Object $object Object - * @param int $i Current line number - * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param SupplierProposal|CommandeFournisseur|FactureFournisseur|Propal|Facture|Commande|ExpenseReport|StockTransfer $object Object + * @param int $i Current line number + * @param Translate $outputlangs Object langs for output + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string */ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0) @@ -1956,7 +1960,7 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0) } else { $tmpresult = ''; } - $tmpresult .= vatrate(abs($object->lines[$i]->localtax1_tx), 0); + $tmpresult .= vatrate((string) abs($object->lines[$i]->localtax1_tx), 0); } } if (!getDolGlobalString('MAIN_PDF_MAIN_HIDE_THIRD_TAX')) { @@ -1966,7 +1970,7 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0) } else { $tmpresult = ''; } - $tmpresult .= vatrate(abs($object->lines[$i]->localtax2_tx), 0); + $tmpresult .= vatrate((string) abs($object->lines[$i]->localtax2_tx), 0); } } $tmpresult .= '%'; @@ -1980,10 +1984,10 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0) /** * Return line unit price excluding tax * - * @param Object $object Object + * @param SupplierProposal|CommandeFournisseur|Propal|Facture|FactureFournisseur|Commande|StockTransfer $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string */ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0) @@ -1998,7 +2002,7 @@ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0) $result = ''; $reshook = 0; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2023,10 +2027,10 @@ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0) /** * Return line unit price including tax * - * @param Object $object Object + * @param SupplierProposal|CommandeFournisseur|Propal|Facture|Commande $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines) + * @param int<0,2> $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines) * @return string */ function pdf_getlineupwithtax($object, $i, $outputlangs, $hidedetails = 0) @@ -2041,7 +2045,7 @@ function pdf_getlineupwithtax($object, $i, $outputlangs, $hidedetails = 0) $result = ''; $reshook = 0; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2065,10 +2069,10 @@ function pdf_getlineupwithtax($object, $i, $outputlangs, $hidedetails = 0) /** * Return line quantity * - * @param Object $object Object + * @param Delivery|Asset|Commande|Facture|CommandeFournisseur|FactureFournisseur|SupplierProposal|Propal|StockTransfer|MyObject $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string */ function pdf_getlineqty($object, $i, $outputlangs, $hidedetails = 0) @@ -2078,7 +2082,7 @@ function pdf_getlineqty($object, $i, $outputlangs, $hidedetails = 0) $result = ''; $reshook = 0; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2105,10 +2109,10 @@ function pdf_getlineqty($object, $i, $outputlangs, $hidedetails = 0) /** * Return line quantity asked * - * @param Object $object Object + * @param Delivery $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string */ function pdf_getlineqty_asked($object, $i, $outputlangs, $hidedetails = 0) @@ -2118,7 +2122,7 @@ function pdf_getlineqty_asked($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2145,10 +2149,10 @@ function pdf_getlineqty_asked($object, $i, $outputlangs, $hidedetails = 0) /** * Return line quantity shipped * - * @param Object $object Object + * @param Delivery $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string */ function pdf_getlineqty_shipped($object, $i, $outputlangs, $hidedetails = 0) @@ -2158,7 +2162,7 @@ function pdf_getlineqty_shipped($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2188,7 +2192,7 @@ function pdf_getlineqty_shipped($object, $i, $outputlangs, $hidedetails = 0) * @param Object $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string */ function pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails = 0) @@ -2198,7 +2202,7 @@ function pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2225,10 +2229,10 @@ function pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails = 0) /** * Return line unit * - * @param Object $object Object + * @param SupplierProposal|CommandeFournisseur|Propal|Facture|FactureFournisseur|Commande|StockTransfer $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string Value for unit cell */ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0) @@ -2238,7 +2242,7 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2268,10 +2272,10 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0) /** * Return line remise percent * - * @param Object $object Object + * @param SupplierProposal|CommandeFournisseur|Propal|Facture|FactureFournisseur|Commande|StockTransfer $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string */ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0) @@ -2283,7 +2287,7 @@ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2310,11 +2314,11 @@ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0) /** * Return line percent * - * @param Object $object Object - * @param int $i Current line number - * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @param HookManager|null $hookmanager Hook manager instance + * @param Facture $object Object + * @param int $i Current line number + * @param Translate $outputlangs Object langs for output + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param ?HookManager $hookmanager Hook manager instance * @return string */ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null) @@ -2327,7 +2331,7 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2362,10 +2366,10 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm /** * Return line total excluding tax * - * @param Object $object Object + * @param Commande|Facture|Propal|FactureFournisseur|CommandeFournisseur|SupplierProposal $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return string Return total of line excl tax */ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0) @@ -2380,7 +2384,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2418,10 +2422,10 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0) /** * Return line total including tax * - * @param Object $object Object + * @param Commande|Facture|Propal|FactureFournisseur|CommandeFournisseur|SupplierProposal $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines) + * @param int<0,2> $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines) * @return string Return total of line incl tax */ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0) @@ -2436,7 +2440,7 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0) $reshook = 0; $result = ''; //if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line) ) ) - if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduct this test in the pdf_xxx function if you don't want your hook to run + if (is_object($hookmanager)) { // Old code is commented on preceding line. Reproduce this test in the pdf_xxx function if you don't want your hook to run $special_code = empty($object->lines[$i]->special_code) ? '' : $object->lines[$i]->special_code; if (!empty($object->lines[$i]->fk_parent_line) && $object->lines[$i]->fk_parent_line > 0) { $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); @@ -2477,7 +2481,7 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0) * * @param CommonObject $object Object * @param Translate $outputlangs Object lang for output - * @return array Linked objects + * @return array> Linked objects */ function pdf_getLinkedObjects(&$object, $outputlangs) { @@ -2491,6 +2495,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs) if ($objecttype == 'facture') { // For invoice, we don't want to have a reference line on document. Image we are using recurring invoice, we will have a line longer than document width. } elseif ($objecttype == 'propal' || $objecttype == 'supplier_proposal') { + '@phan-var-force array $objects'; $outputlangs->load('propal'); foreach ($objects as $elementobject) { @@ -2500,6 +2505,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs); } } elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') { + '@phan-var-force array $objects'; $outputlangs->load('orders'); if (count($objects) == 1) { @@ -2510,6 +2516,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs); } } elseif ($objecttype == 'contrat') { + '@phan-var-force Contrat[] $objects'; $outputlangs->load('contracts'); foreach ($objects as $elementobject) { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract"); @@ -2518,6 +2525,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat, 'day', '', $outputlangs); } } elseif ($objecttype == 'fichinter') { + '@phan-var-force Fichinter[] $objects'; $outputlangs->load('interventions'); foreach ($objects as $elementobject) { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("InterRef"); @@ -2526,6 +2534,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->datec, 'day', '', $outputlangs); } } elseif ($objecttype == 'shipping') { + '@phan-var-force Expedition[] $objects'; $outputlangs->loadLangs(array("orders", "sendings")); if (count($objects) > 1) { @@ -2608,10 +2617,10 @@ function pdf_getLinkedObjects(&$object, $outputlangs) /** * Return dimensions to use for images onto PDF checking that width and height are not higher than - * maximum (16x32 by default). + * maximum (20x32 by default). * * @param string $realpath Full path to photo file to use - * @return array Height and width to use to output image (in pdf user unit, so mm) + * @return array{width:int,height:int} Height and width to use to output image (in pdf user unit, so mm) */ function pdf_getSizeForImage($realpath) { @@ -2638,10 +2647,10 @@ function pdf_getSizeForImage($realpath) /** * Return line total amount discount * - * @param CommonObject $object Object + * @param Facture $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return float|string Return total of line excl tax */ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0) diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php index 4f20d697c60..460697a2813 100644 --- a/htdocs/core/lib/prelevement.lib.php +++ b/htdocs/core/lib/prelevement.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010 Laurent Destailleur * Copyright (C) 2011 Regis Houssin + * 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 @@ -29,7 +30,7 @@ * Prepare array with list of tabs * * @param BonPrelevement $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function prelevement_prepare_head(BonPrelevement $object) { @@ -116,7 +117,7 @@ function prelevement_check_config($type = 'direct-debit') return 0; } - /** +/** * Return array head with list of tabs to view object information * * @param BonPrelevement $object Member diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 48c30219248..463427a131e 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -6,6 +6,7 @@ * Copyright (C) 2015-2016 Marcos García * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2024 Jean-Rémi TAPONIER + * 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,7 +33,7 @@ * Prepare array with list of tabs * * @param Product $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function product_prepare_head($object) { @@ -73,7 +74,7 @@ function product_prepare_head($object) // if (!empty($object->status_buy) || (isModEnabled('margin') && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase if ((isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'read') || $user->hasRight('supplier_invoice', 'read')) || (isModEnabled('margin') && $user->hasRight("margin", "liretous")) - ) { + ) { if ($usercancreadprice) { $head[$h][0] = DOL_URL_ROOT."/product/price_suppliers.php?id=".$object->id; $head[$h][1] = $langs->trans("BuyingPrices"); @@ -238,7 +239,7 @@ function product_prepare_head($object) * Prepare array with list of tabs * * @param ProductLot $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function productlot_prepare_head($object) { @@ -694,7 +695,7 @@ function show_stats_for_company($product, $socid) print ''; print ''; } - $parameters = array('socid'=>$socid); + $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('addMoreProductStat', $parameters, $product, $nblines); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -814,7 +815,7 @@ function show_stats_for_batch($batch, $socid) print ''; } - $parameters = array('socid'=>$socid); + $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('addMoreBatchProductStat', $parameters, $batch, $nblines); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 4dd48f7fcf0..6abf66876d8 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; * * @param Project $project Object related to tabs * @param string $moreparam More param on url - * @return array Array of tabs to show + * @return array Array of tabs to show */ function project_prepare_head(Project $project, $moreparam = '') { @@ -82,7 +82,7 @@ function project_prepare_head(Project $project, $moreparam = '') } else { require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $taskstatic = new Task($db); - $nbTasks = count($taskstatic->getTasksArray(0, 0, $project->id, 0, 0)); + $nbTasks = count($taskstatic->getTasksArray(null, null, $project->id, 0, 0)); dol_setcache($cachekey, $nbTasks, 120); // If setting cache fails, this is not a problem, so we do not test result. } $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : ''); @@ -369,8 +369,8 @@ function project_prepare_head(Project $project, $moreparam = '') /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @param CommonObject $object Object related to tabs + * @return array Array of tabs to show */ function task_prepare_head($object) { @@ -409,7 +409,7 @@ function task_prepare_head($object) dol_print_error($db); } - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.urlencode($object->id).(GETPOST('withproject') ? '&withproject=1' : ''); + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.urlencode((string) $object->id).(GETPOST('withproject') ? '&withproject=1' : ''); $head[$h][1] = $langs->trans("TimeSpent"); if ($nbTimeSpent > 0) { $head[$h][1] .= '...'; @@ -431,7 +431,7 @@ function task_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.urlencode($object->id).(GETPOST('withproject') ? '&withproject=1' : ''); + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.urlencode((string) $object->id).(GETPOST('withproject') ? '&withproject=1' : ''); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -477,7 +477,7 @@ function task_prepare_head($object) * * @param string $mode Mode * @param string $fuser Filter on user - * @return array Array of tabs to show + * @return array Array of tabs to show */ function project_timesheet_prepare_head($mode, $fuser = null) { @@ -523,7 +523,7 @@ function project_timesheet_prepare_head($mode, $fuser = null) /** * Prepare array with list of tabs * - * @return array Array of tabs to show + * @return array Array of tabs to show */ function project_admin_prepare_head() { @@ -585,16 +585,16 @@ function project_admin_prepare_head() * @param int $parent Id of parent task to show (0 to show all) * @param Task[] $lines Array of lines * @param int $level Level (start to 0, then increased/decrease by recursive call), or -1 to show all level in order of $lines without the recursive groupment feature. - * @param string $var Color + * @param string $var Not used * @param int $showproject Show project columns * @param int $taskrole Array of roles of user for each tasks - * @param string $projectsListId List of id of project allowed to user (string separated with comma) + * @param string $projectsListId List of id of projects allowed to user (string separated with comma) * @param int $addordertick Add a tick to move task * @param int $projectidfortotallink 0 or Id of project to use on total line (link to see all time consumed for project) * @param string $dummy Not used. * @param int $showbilltime Add the column 'TimeToBill' and 'TimeBilled' - * @param array $arrayfields Array with displayed column information - * @param array $arrayofselected Array with selected fields + * @param array $arrayfields Array with displayed column information + * @param string[] $arrayofselected Array with selected fields * @return int Nb of tasks shown */ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $dummy = '', $showbilltime = 0, $arrayfields = array(), $arrayofselected = array()) @@ -602,9 +602,18 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t global $user, $langs, $conf, $db, $hookmanager; global $projectstatic, $taskstatic, $extrafields; + ' + @phan-var-force Project $projectstatic + @phan-var-force Task $taskstatic + @phan-var-force ExtraFields $extrafields + '; + $lastprojectid = 0; - $projectsArrayId = explode(',', $projectsListId); + $projectsArrayId = array(); + if ($projectsListId) { + $projectsArrayId = explode(',', $projectsListId); + } $numlines = count($lines); @@ -666,7 +675,6 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($showline) { // Break on a new project if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid) { - $var = !$var; $lastprojectid = $lines[$i]->fk_project; } @@ -918,13 +926,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if (get_class($c) == 'User') { print $c->getNomUrl(-2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst')); } else { - print $c->getNomUrl(-2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst')); + print $c->getNomUrl(-2, '', 0, 0, -1, 0, ($ifisrt ? '' : 'notfirst')); } } else { if (get_class($c) == 'User') { print $c->getNomUrl(2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst')); } else { - print $c->getNomUrl(2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst')); + print $c->getNomUrl(2, '', 0, 0, -1, 0, ($ifisrt ? '' : 'notfirst')); } } $ifisrt = 0; @@ -979,7 +987,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($level >= 0) { // Call sublevels $level++; if ($lines[$i]->id) { - projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick, $projectidfortotallink, '', $showbilltime, $arrayfields); + projectLinesa($inc, $lines[$i]->id, $lines, $level, '', $showproject, $taskrole, $projectsListId, $addordertick, $projectidfortotallink, '', $showbilltime, $arrayfields); } $level--; } @@ -1040,6 +1048,10 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ''; } + $totalCalculatedProgress = 0; + $totalAverageDeclaredProgress = 0; + $badgeClass = ''; + $progressBarClass = ''; if ($total_projectlinesa_planned) { $totalAverageDeclaredProgress = round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2); $totalCalculatedProgress = round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2); @@ -1158,22 +1170,28 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t * * @param string $inc Line number (start to 0, then increased by recursive call) * @param int $parent Id of parent task to show (0 to show all) - * @param User|null $fuser Restrict list to user if defined + * @param ?User $fuser Restrict list to user if defined * @param Task[] $lines Array of lines * @param int $level Level (start to 0, then increased/decrease by recursive call) * @param string $projectsrole Array of roles user has on project * @param string $tasksrole Array of roles user has on task * @param string $mine Show only task lines I am assigned to - * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to + * @param int<0,1> $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @param int $preselectedday Preselected day - * @param array $isavailable Array with data that say if user is available for several days for morning and afternoon + * @param array,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon * @param int $oldprojectforbreak Old project id of last project break - * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks + * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks */ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0) { global $conf, $db, $user, $langs; global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic; + ' + @phan-var-force FormOther $formother + @phan-var-force Project $projectstatic + @phan-var-force Task $taskstatic + @phan-var-force Societe $thirdpartystatic + '; $lastprojectid = 0; $totalforeachline = array(); @@ -1331,6 +1349,9 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec print ''; $dayWorkLoad = $lines[$i]->timespent_duration; + if (!array_key_exists($preselectedday, $totalforeachline)) { + $totalforeachline[$preselectedday] = 0; + } $totalforeachline[$preselectedday] += $lines[$i]->timespent_duration; $alreadyspent = ''; @@ -1379,24 +1400,30 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec * * @param string $inc Line number (start to 0, then increased by recursive call) * @param int $parent Id of parent task to show (0 to show all) - * @param User|null $fuser Restrict list to user if defined + * @param ?User $fuser Restrict list to user if defined * @param Task[] $lines Array of lines * @param int $level Level (start to 0, then increased/decrease by recursive call) * @param string $projectsrole Array of roles user has on project * @param string $tasksrole Array of roles user has on task - * @param int $mine Show only task lines I am assigned to - * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others + * @param int<0,1> $mine Show only task lines I am assigned to + * @param int<0,2> $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others * @param int $preselectedday Preselected day - * @param array $isavailable Array with data that say if user is available for several days for morning and afternoon + * @param array,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon * @param int $oldprojectforbreak Old project id of last project break - * @param array $arrayfields Array of additional column + * @param string[] $arrayfields Array of additional column * @param Extrafields $extrafields Object extrafields - * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks + * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks */ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null) { global $conf, $db, $user, $langs; global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic; + ' + @phan-var-force FormOther $formother + @phan-var-force Project $projectstatic + @phan-var-force Task $taskstatic + @phan-var-force Societe $thirdpartystatic + '; $lastprojectid = 0; $totalforeachday = array(); @@ -1776,24 +1803,30 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr * * @param string $inc Line output identificator (start to 0, then increased by recursive call) * @param int $firstdaytoshow First day to show - * @param User|null $fuser Restrict list to user if defined + * @param ?User $fuser Restrict list to user if defined * @param int $parent Id of parent task to show (0 to show all) * @param Task[] $lines Array of lines (list of tasks but we will show only if we have a specific role on task) * @param int $level Level (start to 0, then increased/decrease by recursive call) * @param string $projectsrole Array of roles user has on project * @param string $tasksrole Array of roles user has on task - * @param int $mine Show only task lines I am assigned to - * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others - * @param array $isavailable Array with data that say if user is available for several days for morning and afternoon + * @param int<0,1> $mine Show only task lines I am assigned to + * @param int<0,2> $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others + * @param array,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon * @param int $oldprojectforbreak Old project id of last project break - * @param array $arrayfields Array of additional column + * @param string[] $arrayfields Array of additional column * @param Extrafields $extrafields Object extrafields - * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks + * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks */ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null) { global $conf, $db, $user, $langs; global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic; + ' + @phan-var-force FormOther $formother + @phan-var-force Project $projectstatic + @phan-var-force Task $taskstatic + @phan-var-force Societe $thirdpartystatic + '; $numlines = count($lines); @@ -2182,19 +2215,25 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ * @param int $level Level (start to 0, then increased/decrease by recursive call) * @param string $projectsrole Array of roles user has on project * @param string $tasksrole Array of roles user has on task - * @param int $mine Show only task lines I am assigned to - * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to - * @param array $isavailable Array with data that say if user is available for several days for morning and afternoon + * @param int<0,1> $mine Show only task lines I am assigned to + * @param int<0,1> $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to + * @param array,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon * @param int $oldprojectforbreak Old project id of last project break - * @param array $TWeek Array of week numbers - * @param array $arrayfields Array of additional column + * @param string[] $TWeek Array of week numbers ('02', ... + * @param string[] $arrayfields Array of additional column * @param Extrafields $extrafields Object extrafields - * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks + * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks (index is string, month is '01', ...) */ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $TWeek = array(), $arrayfields = array(), $extrafields = null) { global $conf, $db, $user, $langs; global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic; + ' + @phan-var-force FormOther $formother + @phan-var-force Project $projectstatic + @phan-var-force Task $taskstatic + @phan-var-force Societe $thirdpartystatic + '; $numlines = count($lines); @@ -2509,15 +2548,15 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) /** * Return HTML table with list of projects and number of opened tasks * - * @param DoliDB $db Database handler - * @param Form $form Object form - * @param int $socid Id thirdparty - * @param int $projectsListId Id of project I have permission on - * @param int $mytasks Limited to task I am contact to - * @param int $status -1=No filter on statut, 0 or 1 = Filter on status - * @param array $listofoppstatus List of opportunity status - * @param array $hiddenfields List of info to not show ('projectlabel', 'declaredprogress', '...', ) - * @param int $max Max nb of record to show in HTML list + * @param DoliDB $db Database handler + * @param Form $form Object form + * @param int $socid Id thirdparty + * @param int|string $projectsListId Id or ids of project I have permission on (separated with comma) + * @param int<0,1> $mytasks Limited to task I am contact to + * @param int<-1,1> $status -1=No filter on statut, 0 or 1 = Filter on status + * @param array $listofoppstatus List of opportunity status + * @param string[] $hiddenfields List of info to not show ('projectlabel', 'declaredprogress', '...', ) + * @param int<0,max> $max Max nb of record to show in HTML list * @return void */ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array(), $max = 0) @@ -2570,7 +2609,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet"; } $sql .= " WHERE p.entity IN (".getEntity('project').")"; - $sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; + $sql .= " AND p.rowid IN (".$db->sanitize((string) $projectsListId).")"; if ($socid) { $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } @@ -2598,6 +2637,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks // Get id of project we must show tasks $arrayidofprojects = array(); + $alttext = ''; $sql1 = "SELECT p.rowid as projectid"; $sql1 .= $sql; $resql = $db->query($sql1); diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 46cf91ce684..e0b5e000c33 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2012 Regis Houssin + * 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,7 @@ * Prepare array with list of tabs * * @param object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function propal_prepare_head($object) { @@ -111,7 +112,7 @@ function propal_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); - if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { + if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $nbEvent = 0; // Enable caching of thirdparty count actioncomm require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -212,7 +213,7 @@ function getCustomerProposalPieChart($socid = 0) { global $conf, $db, $langs, $user; - $result= ''; + $result = ''; if (!isModEnabled('propal') || !$user->hasRight('propal', 'lire')) { return ''; diff --git a/htdocs/core/lib/public.lib.php b/htdocs/core/lib/public.lib.php new file mode 100644 index 00000000000..ecc75de10da --- /dev/null +++ b/htdocs/core/lib/public.lib.php @@ -0,0 +1,75 @@ + + * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2019 Eric Seigne + * Copyright (C) 2021-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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/lib/public.lib.php + * \ingroup public + * \brief Library of public page functions + */ + +require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; + +/** + * Check if the object exceeded the number of posts for a specific ip + * @param object $object Object to check + * @param int $nb_post_max Number max of posts + * + * @return int return <0 if error, >0 if OK + */ +function checkNbPostsForASpeceificIp($object, $nb_post_max) +{ + global $db, $langs; + + $nb_post_ip = 0; + $now = dol_now(); + $minmonthpost = dol_time_plus_duree($now, -1, "m"); + + if (empty($object->ip)) { + $object->ip = getUserRemoteIP(); + } + + if ($nb_post_max > 0) { // Calculate only if there is a limit to check + $sql = "SELECT COUNT(".(!empty($object->table_rowid) ? $object->table_rowid : 'rowid').") as nb_posts"; + $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element; + $sql .= " WHERE ip = '".$db->escape($object->ip)."'"; + $sql .= " AND datec > '".$db->idate($minmonthpost)."'"; + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $i++; + $obj = $db->fetch_object($resql); + $nb_post_ip = $obj->nb_posts; + } + } else { + array_push($object->errors, $db->lasterror()); + return -1; + } + } + if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) { + array_push($object->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress")); + return -1; + } + return 1; +} diff --git a/htdocs/core/lib/reception.lib.php b/htdocs/core/lib/reception.lib.php index b5f5a0c7067..d39e8dc69bd 100644 --- a/htdocs/core/lib/reception.lib.php +++ b/htdocs/core/lib/reception.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2015 Claudio Aschieri + * 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,7 +31,7 @@ * Prepare array with list of tabs * * @param Reception $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function reception_prepare_head(Reception $object) { diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 11a4444902d..58b96ef6057 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -241,6 +241,10 @@ function dol_hash($chain, $type = '0', $nosalt = 0) { // No need to add salt for password_hash if (($type == '0' || $type == 'auto') && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_hash')) { + if (strpos($chain, "\0") !== false) { + // String contains a null character that can't be encoded. Return an error instead of fatal error. + return 'Invalid string to encrypt. Contains a null character.'; + } return password_hash($chain, PASSWORD_DEFAULT); } diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index e3e12176864..19fe34df945 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Regis Houssin + * 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,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function shipping_prepare_head($object) { @@ -128,7 +129,7 @@ function shipping_prepare_head($object) * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function delivery_prepare_head($object) { @@ -362,7 +363,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') // Add description in form if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { - print (!empty($objp->description) ? ((empty($objp->product) || $objp->description != $objp->product) ? '
'.dol_htmlentitiesbr($objp->description) : '') : ''); + print(!empty($objp->description) ? ((empty($objp->product) || $objp->description != $objp->product) ? '
'.dol_htmlentitiesbr($objp->description) : '') : ''); } print ''; diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index ee2ac8d39c5..76b464a508f 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -96,6 +96,10 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1, $o if ($type == 'proposal') { $securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN'); + if (strpos($securekeyseed, "\0") !== false) { + // String contains a null character that can't be encoded. Return an error to avoid fatal error later. + return 'Invalid parameter PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN. Contains a null character.'; + } $out = $urltouse.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '' : ''); if ($mode == 1) { @@ -136,6 +140,11 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1, $o }*/ } elseif ($type == 'contract') { $securekeyseed = getDolGlobalString('CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN'); + if (strpos($securekeyseed, "\0") !== false) { + // String contains a null character that can't be encoded. Return an error to avoid fatal error later. + return 'Invalid parameter CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN. Contains a null character.'; + } + $out = $urltouse.'/public/onlinesign/newonlinesign.php?source=contract&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'contract_ref'; @@ -151,6 +160,11 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1, $o } } elseif ($type == 'fichinter') { $securekeyseed = getDolGlobalString('FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN'); + if (strpos($securekeyseed, "\0") !== false) { + // String contains a null character that can't be encoded. Return an error to avoid fatal error later. + return 'Invalid parameter FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN. Contains a null character.'; + } + $out = $urltouse.'/public/onlinesign/newonlinesign.php?source=fichinter&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'fichinter_ref'; @@ -166,6 +180,11 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1, $o } } else { // For example $type = 'societe_rib' $securekeyseed = getDolGlobalString(dol_strtoupper($type).'_ONLINE_SIGNATURE_SECURITY_TOKEN'); + if (strpos($securekeyseed, "\0") !== false) { + // String contains a null character that can't be encoded. Return an error to avoid fatal error later. + return 'Invalid parameter '.dol_strtoupper($type).'_ONLINE_SIGNATURE_SECURITY_TOKEN. Contains a null character.'; + } + $out = $urltouse.'/public/onlinesign/newonlinesign.php?source='.$type.'&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= $type.'_ref'; diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index 9b790c39558..c8cb6c22892 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -1,5 +1,6 @@ + * 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 @@ -25,7 +26,7 @@ * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function stock_prepare_head($object) { diff --git a/htdocs/core/lib/supplier_proposal.lib.php b/htdocs/core/lib/supplier_proposal.lib.php index f1d0793e5cb..6540b0140f7 100644 --- a/htdocs/core/lib/supplier_proposal.lib.php +++ b/htdocs/core/lib/supplier_proposal.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2006-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2022 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 @@ -28,7 +29,7 @@ * Prepare array with list of tabs * * @param object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function supplier_proposal_prepare_head($object) { diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 98fb8dadb65..df17149afa6 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2021-2022 Open-Dsi * 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 @@ -34,7 +35,7 @@ * Prepare array with list of tabs * * @param ChargeSociales $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function tax_prepare_head(ChargeSociales $object) { diff --git a/htdocs/core/lib/trip.lib.php b/htdocs/core/lib/trip.lib.php index 31ed60ad716..0d6a023186b 100644 --- a/htdocs/core/lib/trip.lib.php +++ b/htdocs/core/lib/trip.lib.php @@ -1,5 +1,6 @@ + * 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 @@ -25,7 +26,7 @@ * Prepare array with list of tabs * * @param Deplacement $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function trip_prepare_head(Deplacement $object) { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 7e205b0394a..475d60da1c8 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -32,7 +32,7 @@ * Prepare array with list of tabs * * @param User $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function user_prepare_head(User $object) { @@ -231,7 +231,7 @@ function user_prepare_head(User $object) * Prepare array with list of tabs * * @param UserGroup $object Object group - * @return array Array of tabs + * @return array Array of tabs to show */ function group_prepare_head($object) { @@ -280,7 +280,7 @@ function group_prepare_head($object) /** * Prepare array with list of tabs * - * @return array Array of tabs to show + * @return array Array of tabs to show */ function user_admin_prepare_head() { diff --git a/htdocs/core/lib/vat.lib.php b/htdocs/core/lib/vat.lib.php index 19359c9321e..273b640408e 100644 --- a/htdocs/core/lib/vat.lib.php +++ b/htdocs/core/lib/vat.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2018 Philippe Grand * Copyright (C) 2021 Gauthier VERDOL + * 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 @@ -28,7 +29,7 @@ * Prepare array with list of tabs * * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @return array Array of tabs to show */ function vat_prepare_head($object) { diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 5a3e77f10d7..f78b707923a 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -844,7 +844,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } } - return $content; + return '
'.$content.'
'; } /** @@ -1290,7 +1290,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } } if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 4) == 'llx_') { - $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, '', 1); + $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, 0, 1); if ($result <= 0) { $error++; } @@ -1315,7 +1315,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } } if (preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 4) == 'llx_') { - $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, '', 1); + $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, 0, 1); if ($result <= 0) { $error++; } @@ -1340,7 +1340,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } } if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 9) == 'functions') { - $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, '', 1); + $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, 0, 1); if ($result <= 0) { $error++; } @@ -1365,7 +1365,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } } if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 4) == 'data') { - $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, '', 1); + $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, 0, 1); if ($result <= 0) { $error++; } @@ -1390,7 +1390,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } } if (preg_match('/\.sql$/i', $file) && !preg_match('/\.key\.sql$/i', $file) && substr($file, 0, 6) == 'update') { - $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, '', 1); + $result = run_sql($dir.$file, !getDolGlobalString('MAIN_DISPLAY_SQL_INSTALL_LOG') ? 1 : 0, 0, 1); if ($result <= 0) { $error++; } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 78b4b884bd1..8c711aea976 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -947,7 +947,7 @@ class pdf_einstein extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -983,7 +983,7 @@ class pdf_einstein extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1053,7 +1053,7 @@ class pdf_einstein extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1093,7 +1093,7 @@ class pdf_einstein extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 818731d1962..a881793cf03 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1153,7 +1153,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1189,7 +1189,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1257,7 +1257,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1295,7 +1295,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 15180f5ff26..0c5962c871e 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -152,7 +152,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport $fuser->fetch($object->fk_user_author); } - $numFinal = get_next_value($db, $mask, 'expensereport', 'ref', '', null, (string) $date, 'next', true, $fuser); + $numFinal = get_next_value($db, $mask, 'expensereport', 'ref', '', null, $date, 'next', true, $fuser); return $numFinal; } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index dbcc4b4efa7..26d7e600570 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -928,7 +928,6 @@ class pdf_crabe extends ModelePDFFactures protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs, $heightforfooter = 0) { // phpcs:enable - global $conf; $sign = 1; if ($object->type == 2 && getDolGlobalString('INVOICE_POSITIVE_CREDIT_NOTE')) { @@ -1426,7 +1425,7 @@ class pdf_crabe extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1463,7 +1462,7 @@ class pdf_crabe extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1530,7 +1529,7 @@ class pdf_crabe extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1565,7 +1564,7 @@ class pdf_crabe extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -2176,6 +2175,8 @@ class pdf_crabe extends ModelePDFFactures if (!empty($carac_client_shipping)) { $posy += $hautcadre; + $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box + // Show shipping frame $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); @@ -2193,7 +2194,8 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($posx + 2, $posy); $pdf->SetFont('', '', $default_font_size - 1); $pdf->MultiCell($widthrecbox - 2, 2, $carac_client_shipping, '', 'L'); - $top_shift += $hautcadre; + + $top_shift += $hautcadre + 10; } } } diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index 87b17a74a31..d5b62a27791 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -1638,7 +1638,7 @@ class pdf_octopus extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1675,7 +1675,7 @@ class pdf_octopus extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1759,7 +1759,7 @@ class pdf_octopus extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1797,7 +1797,7 @@ class pdf_octopus extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 1942da5cbc5..4268e3e1b5f 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1713,7 +1713,7 @@ class pdf_sponge extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1750,7 +1750,7 @@ class pdf_sponge extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1842,7 +1842,7 @@ class pdf_sponge extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1880,7 +1880,7 @@ class pdf_sponge extends ModelePDFFactures if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -2455,6 +2455,8 @@ class pdf_sponge extends ModelePDFFactures if (!empty($carac_client_shipping)) { $posy += $hautcadre; + $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box + // Show shipping frame $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); @@ -2472,7 +2474,8 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($posx + 2, $posy); $pdf->SetFont('', '', $default_font_size - 1); $pdf->MultiCell($widthrecbox - 2, 2, $carac_client_shipping, '', 'L'); - $shipp_shift += $hautcadre; + + $shipp_shift += $hautcadre + 10; } } } diff --git a/htdocs/core/modules/modAi.class.php b/htdocs/core/modules/modAi.class.php index 2bf7230a12d..e59b44d5de6 100644 --- a/htdocs/core/modules/modAi.class.php +++ b/htdocs/core/modules/modAi.class.php @@ -1,8 +1,8 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -387,7 +387,7 @@ class modAi extends DolibarrModules // if (file_exists($src) && !file_exists($dest)) { // require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // dol_mkdir($dirodt); - // $result = dol_copy($src, $dest, 0, 0); + // $result = dol_copy($src, $dest, '0', 0); // if ($result < 0) { // $langs->load("errors"); // $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index c08828442c9..30117285934 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Ferran Marcet * Copyright (C) 2024 MDW * Copyright (C) 2024 Rafael San José + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -485,7 +486,7 @@ class modBom extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 88fdc6d8abc..43ee332c399 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2020 Ahmad Jamaly Rabub * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -465,7 +466,7 @@ class modCommande extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index 8154c3f8902..87178b9a902 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2024 Frédéric France * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -236,7 +237,7 @@ class modContrat extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index e4be0d8b18f..ac44ce48249 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -1,6 +1,7 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -453,7 +454,7 @@ class modEventOrganization extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 0448e1a8f11..cfe141b56eb 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -349,7 +350,7 @@ class modExpedition extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index a9677cb980d..d80eb244a8d 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2021-2024 Alexandre Spangaro - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify @@ -786,7 +786,7 @@ class modFacture extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 5e7a31b3d77..107f99dd743 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -5,7 +5,8 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013-2015 Philippe Grand * Copyright (C) 2020 Ahmad Jamaly Rabib - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -978,7 +979,7 @@ class modFournisseur extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); @@ -999,7 +1000,7 @@ class modFournisseur extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index 92a1da8e8d0..5d43bee3077 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2021 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2021 SuperAdmin * Copyright (C) 2024 MDW * @@ -455,7 +455,7 @@ class modKnowledgeManagement extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index 955c2ed8d8d..862d069a794 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2019 Destailleur Laurent * Copyright (C) 2024 Charlene Benke * @@ -440,7 +440,7 @@ class modMrp extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index 099cce8a574..fabe977c849 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2021 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2021 Dorian Laurent * Copyright (C) 2021 NextGestion * Copyright (C) 2024 MDW @@ -471,7 +471,7 @@ class modPartnership extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 20137d7c905..77247881f2a 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Charles-Fr BENKE * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -383,7 +384,7 @@ class modProjet extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); @@ -399,7 +400,7 @@ class modProjet extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 2e99a82acde..4ddce5b6872 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2020 Ahmad Jamaly Rabib + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -495,7 +496,7 @@ class modPropale extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php index e424325734e..7c6b4f62cc2 100644 --- a/htdocs/core/modules/modReception.class.php +++ b/htdocs/core/modules/modReception.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -272,7 +273,7 @@ class modReception extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index 5bc9fe4516b..554a85b8179 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2021 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -425,7 +425,7 @@ class modRecruitment extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 9bc4a00a897..3af5d8edd79 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2012-2014 Juanjo Menent * Copyright (C) 2022 Ferran Marcet * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -107,13 +108,13 @@ class modSociete extends DolibarrModules $r++; /* - $this->const[$r][0] = "COMPANY_HIDE_INACTIVE_IN_COMBOBOX"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "0"; - $this->const[$r][3] = "hide thirdparty customer inative in combobox"; - $this->const[$r][4] = 1; - $r++; - */ + $this->const[$r][0] = "COMPANY_HIDE_INACTIVE_IN_COMBOBOX"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "0"; + $this->const[$r][3] = "hide thirdparty customer inative in combobox"; + $this->const[$r][4] = 1; + $r++; + */ $this->const[$r][0] = "SOCIETE_ADD_REF_IN_LIST"; $this->const[$r][1] = "yesno"; @@ -144,21 +145,21 @@ class modSociete extends DolibarrModules $this->rights[$r][4] = 'lire'; /*$r++; - $this->rights[$r][0] = 241; - $this->rights[$r][1] = 'Read thirdparties customers'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'thirdparty_customer_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on - $this->rights[$r][5] = 'read'; + $this->rights[$r][0] = 241; + $this->rights[$r][1] = 'Read thirdparties customers'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'thirdparty_customer_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on + $this->rights[$r][5] = 'read'; - $r++; - $this->rights[$r][0] = 242; - $this->rights[$r][1] = 'Read thirdparties suppliers'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on - $this->rights[$r][5] = 'read'; - */ + $r++; + $this->rights[$r][0] = 242; + $this->rights[$r][1] = 'Read thirdparties suppliers'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on + $this->rights[$r][5] = 'read'; + */ $r++; $this->rights[$r][0] = 122; // id de la permission @@ -168,21 +169,21 @@ class modSociete extends DolibarrModules $this->rights[$r][4] = 'creer'; /* $r++; - $this->rights[$r][0] = 251; - $this->rights[$r][1] = 'Create thirdparties customers'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'thirdparty_customer_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on - $this->rights[$r][5] = 'read'; + $this->rights[$r][0] = 251; + $this->rights[$r][1] = 'Create thirdparties customers'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'thirdparty_customer_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on + $this->rights[$r][5] = 'read'; - $r++; - $this->rights[$r][0] = 252; - $this->rights[$r][1] = 'Create thirdparties suppliers'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on - $this->rights[$r][5] = 'read'; - */ + $r++; + $this->rights[$r][0] = 252; + $this->rights[$r][1] = 'Create thirdparties suppliers'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on + $this->rights[$r][5] = 'read'; + */ $r++; $this->rights[$r][0] = 125; // id de la permission @@ -215,14 +216,14 @@ class modSociete extends DolibarrModules $this->rights[$r][5] = 'voir'; /* - $r++; - $this->rights[$r][0] = 263; - $this->rights[$r][1] = 'Read all third parties (without their objects) by internal users (otherwise only if commercial contact). Not effective for external users (limited to themselves).'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'client'; - $this->rights[$r][5] = 'readallthirdparties_advance'; - */ + $r++; + $this->rights[$r][0] = 263; + $this->rights[$r][1] = 'Read all third parties (without their objects) by internal users (otherwise only if commercial contact). Not effective for external users (limited to themselves).'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'client'; + $this->rights[$r][5] = 'readallthirdparties_advance'; + */ $r++; $this->rights[$r][0] = 281; // id de la permission @@ -411,6 +412,7 @@ class modSociete extends DolibarrModules 's.code_compta' => "company", 's.code_compta_fournisseur' => "company", 's.client' => "company", 's.fournisseur' => "company", 's.address' => "company", 's.zip' => "company", 's.town' => "company", 's.phone' => "company", 's.email' => "company", + 's.note_private' => 'company', 's.note_public' => "company", 't.code' => "company", 's.entity' => 'company', ); // We define here only fields that use another picto @@ -685,24 +687,24 @@ class modSociete extends DolibarrModules 'table_element' => 'c_stcomm' ), /* - 's.fk_prospectlevel' => array( - 'rule' => 'fetchidfromcodeid', - 'classfile' => '/core/class/cgenericdic.class.php', - 'class' => 'CGenericDic', - 'method' => 'fetch', - 'dict' => 'DictionaryProspectLevel', - 'element' => 'c_prospectlevel', - 'table_element' => 'c_prospectlevel' - ),*/ - // TODO - // 's.fk_incoterms' => array( - // 'rule' => 'fetchidfromcodeid', - // 'classfile' => '/core/class/cincoterm.class.php', - // 'class' => 'Cincoterm', - // 'method' => 'fetch', - // 'dict' => 'IncotermLabel' - // ) - ); + 's.fk_prospectlevel' => array( + 'rule' => 'fetchidfromcodeid', + 'classfile' => '/core/class/cgenericdic.class.php', + 'class' => 'CGenericDic', + 'method' => 'fetch', + 'dict' => 'DictionaryProspectLevel', + 'element' => 'c_prospectlevel', + 'table_element' => 'c_prospectlevel' + ),*/ + // TODO + // 's.fk_incoterms' => array( + // 'rule' => 'fetchidfromcodeid', + // 'classfile' => '/core/class/cincoterm.class.php', + // 'class' => 'Cincoterm', + // 'method' => 'fetch', + // 'dict' => 'IncotermLabel' + // ) + ); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); $this->import_regex_array[$r] = array(//field order as per structure of table llx_societe 's.status' => '^[0|1]', @@ -981,7 +983,7 @@ class modSociete extends DolibarrModules 'sr.datec' => 'date used for creating direct debit UMR formatted as '.dol_print_date( dol_now(), '%Y-%m-%d' - ), + ), 'sr.bank' => 'bank name eg: "ING-Direct"', 'sr.code_banque' => 'account sort code (GB)/Routing number (US) eg. "8456"', 'sr.code_guichet' => "bank code for office/branch", @@ -1008,8 +1010,8 @@ class modSociete extends DolibarrModules $this->import_fields_array[$r] = array('sr.fk_soc' => "ThirdPartyName*", 'sr.fk_user' => "User*"); $this->import_convertvalue_array[$r] = array( - 'sr.fk_soc' => array('rule' => 'fetchidfromref', 'classfile' => '/societe/class/societe.class.php', 'class' => 'Societe', 'method' => 'fetch', 'element' => 'ThirdParty'), - 'sr.fk_user' => array('rule' => 'fetchidfromref', 'classfile' => '/user/class/user.class.php', 'class' => 'User', 'method' => 'fetch', 'element' => 'User') + 'sr.fk_soc' => array('rule' => 'fetchidfromref', 'classfile' => '/societe/class/societe.class.php', 'class' => 'Societe', 'method' => 'fetch', 'element' => 'ThirdParty'), + 'sr.fk_user' => array('rule' => 'fetchidfromref', 'classfile' => '/user/class/user.class.php', 'class' => 'User', 'method' => 'fetch', 'element' => 'User') ); $this->import_examplevalues_array[$r] = array('sr.fk_soc' => "MyBigCompany", 'sr.fk_user' => "login"); } @@ -1038,7 +1040,7 @@ class modSociete extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 1399c1cd2fa..cdd52576a24 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -400,8 +400,8 @@ class modStock extends DolibarrModules $this->export_sql_end[$r] .= ' WHERE p.rowid = sm.fk_product AND sm.fk_entrepot = e.rowid'; $this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')'; - // Export inventory + // Export inventories $r++; $this->export_code[$r] = $this->rights_class.'_inventory'; $this->export_label[$r] = "Inventories"; // Translation key (used only if key ExportDataset_xxx_z not found) @@ -409,7 +409,7 @@ class modStock extends DolibarrModules $this->export_permission[$r] = array(array("stock", "lire")); $this->export_fields_array[$r] = array( 'i.rowid' => 'InventoryId', 'i.ref' => 'InventoryRef', 'i.date_inventory' => 'DateInventory', 'i.status' => 'InventoryStatus', 'i.title' => 'InventoryTitle', - 'id.rowid' => 'InventoryLineId', 'id.qty_view' => 'QtyViewed', 'id.qty_stock' => 'QtyStock', 'id.qty_regulated' => 'QtyRegulated', 'id.fk_warehouse' => 'InventoryEntrepot', + 'id.rowid' => 'InventoryLineId', 'id.qty_view' => 'QtyViewed', 'id.qty_stock' => 'QtyStock', 'id.qty_regulated' => 'QtyRegulated', 'id.batch' => 'Lotserial', 'e.rowid' => 'IdWarehouse', 'e.ref' => 'LocationSummary', 'e.description' => 'DescWareHouse', 'e.lieu' => 'LieuWareHouse', 'e.address' => 'Address', 'e.zip' => 'Zip', 'e.town' => 'Town', 'p.rowid' => "ProductId", 'p.ref' => "Ref", 'p.fk_product_type' => "Type", 'p.label' => "Label", 'p.description' => "Description", 'p.note' => "Note", @@ -431,14 +431,14 @@ class modStock extends DolibarrModules $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode' => 'Text')); } $this->export_entities_array[$r] = array( - 'e.rowid' => 'warehouse', 'e.ref' => 'warehouse', 'e.description' => 'warehouse', 'e.lieu' => 'warehouse', 'e.address' => 'warehouse', 'e.zip' => 'warehouse', 'e.town' => 'warehouse', + 'id.qty_view' => 'inventory_line', 'id.qty_stock' => 'inventory_line', 'id.batch' => 'inventory_line', 'id.qty_regulated' => 'inventory_line', 'id.fk_warehouse' => 'inventory_line', 'id.rowid' => 'inventory_line', 'e.rowid' => 'warehouse', 'e.ref' => 'warehouse', 'e.description' => 'warehouse', 'e.lieu' => 'warehouse', 'e.address' => 'warehouse', 'e.zip' => 'warehouse', 'e.town' => 'warehouse', 'p.rowid' => "product", 'p.ref' => "product", 'p.fk_product_type' => "product", 'p.label' => "product", 'p.description' => "product", 'p.note' => "product", 'p.barcode' => "product", 'p.price' => "product", 'p.tva_tx' => 'product', 'p.tosell' => "product", 'p.tobuy' => "product", 'p.duration' => "product", 'p.datec' => 'product', 'p.tms' => 'product' ); // We define here only fields that use another icon that the one defined into export_icon if (isModEnabled('productbatch')) { $this->export_fields_array[$r]['id.batch'] = 'Batch'; $this->export_TypeFields_array[$r]['id.batch'] = 'Text'; - $this->export_entities_array[$r]['id.batch'] = 'movement'; + $this->export_entities_array[$r]['id.batch'] = 'inventory_line'; } if (isModEnabled('barcode')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode' => 'product')); @@ -549,7 +549,7 @@ class modStock extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index d7c7941d08b..52d0dd1f546 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -169,7 +170,7 @@ class modSupplierProposal extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 90f63d269c1..c2ee9849387 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -115,7 +115,7 @@ class modTicket extends DolibarrModules 5 => array('TICKET_DELAY_BEFORE_FIRST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time before a first answer to a ticket (in hours). Display a warning in tickets list if not respected.', 0), 6 => array('TICKET_DELAY_SINCE_LAST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time between two answers on the same ticket (in hours). Display a warning in tickets list if not respected.', 0), 7 => array('TICKET_NOTIFY_AT_CLOSING', 'chaine', '0', 'Default notify contacts when closing a module', 0), - 8 => array('TICKET_PRODUCT_CATEGORY', 'chaine', 0, 'The category of product that is being used for ticket accounting', 0), + 8 => array('TICKET_PRODUCT_CATEGORY', 'chaine', 0, 'The category of product that is being used to find contract to link to created ticket', 0), 9 => array('TICKET_NOTIFICATION_EMAIL_FROM', 'chaine', getDolGlobalString('MAIN_MAIL_EMAIL_FROM'), 'Email to use by default as sender for messages sent from Dolibarr', 0), 10 => array('TICKET_MESSAGE_MAIL_INTRO', 'chaine', $langs->trans('TicketMessageMailIntroText'), 'Introduction text of ticket replies sent from Dolibarr', 0), 11 => array('TICKET_MESSAGE_MAIL_SIGNATURE', 'chaine', $default_footer, 'Signature to use by default for messages sent from Dolibarr', 0), @@ -420,7 +420,7 @@ class modTicket extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index 6fa992c9f6f..262a5bbcd38 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -207,7 +207,7 @@ class modWebsite extends DolibarrModules $src = $srcroot.'/'.$cursorfile['name']; $dest = $destroot.'/'.$cursorfile['name']; - $result = dol_copy($src, $dest, 0, 1); // For full zip templates, we overwrite old existing files + $result = dol_copy($src, $dest, '0', 1); // For full zip templates, we overwrite old existing files if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index 2f5a1846408..21580af1748 100644 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2021 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020 Gauthier VERDOL * Copyright (C) 2024 MDW * @@ -402,7 +402,7 @@ class modWorkstation extends DolibarrModules if (file_exists($src) && !file_exists($dest)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); + $result = dol_copy($src, $dest, '0', 0); if ($result < 0) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); diff --git a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php index 21045e9ec21..9e64261ba51 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php @@ -166,8 +166,8 @@ class pdf_standard_movementstock extends ModelePDFMovement $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'movementlist'; $idproduct = GETPOSTINT('idproduct'); - $year = GETPOST("year"); - $month = GETPOST("month"); + $year = GETPOSTINT("year"); + $month = GETPOSTINT("month"); $search_ref = GETPOST('search_ref', 'alpha'); $search_movement = GETPOST("search_movement"); $search_product_ref = trim(GETPOST("search_product_ref")); diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 08b00231c9d..e36d0ca0433 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -810,7 +810,7 @@ class pdf_vinci extends ModelePDFMo $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; - $totalvat .= vatrate(abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -840,7 +840,7 @@ class pdf_vinci extends ModelePDFMo $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; - $totalvat .= vatrate(abs((float) $tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index 1be7463ac42..381ed5e3635 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -282,7 +282,7 @@ if (!GETPOST('code')) { // Verify that email is a verified email /*if (empty($userinfo['email_verified'])) { - setEventMessages($langs->trans('Bad value for email, email lwas not verified by Google'), null, 'errors'); + setEventMessages($langs->trans('Bad value for email, email was not verified by Google'), null, 'errors'); $errorincheck++; }*/ diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 0fd734b845c..4f0d81dd64b 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -439,7 +439,7 @@ class pdf_beluga extends ModelePDFProjects } //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, null, null, $projectField); + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, 0, 0, $projectField); $num = count($elementarray); if ($num >= 0) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 39c4f86b2e1..80fe1b07e7a 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1132,7 +1132,7 @@ class pdf_azur extends ModelePDFPropales if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1168,7 +1168,7 @@ class pdf_azur extends ModelePDFPropales if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1235,7 +1235,7 @@ class pdf_azur extends ModelePDFPropales if (getDolGlobalString('PDF_LOCALTAX1_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1272,7 +1272,7 @@ class pdf_azur extends ModelePDFPropales if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') { $totalvat .= $tvacompl; } else { - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; } $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index cbfdab2ccb9..b7831b52696 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1235,7 +1235,7 @@ class pdf_cyan extends ModelePDFPropales } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : ''); $totalvat .= ' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); @@ -1268,7 +1268,7 @@ class pdf_cyan extends ModelePDFPropales } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : ''); $totalvat .= ' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); @@ -1326,7 +1326,7 @@ class pdf_cyan extends ModelePDFPropales $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : ''); $totalvat .= ' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); @@ -1361,7 +1361,7 @@ class pdf_cyan extends ModelePDFPropales $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : ''); $totalvat .= ' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index b6fd341fc6d..2d96b52c554 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -1501,6 +1501,8 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { global $conf, $hookmanager; + '@phan-var-force StockTransfer $object'; + /** @var StockTransfer $object */ // Default field style for content $this->defaultContentsFieldsStyle = array( diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 1ed55a909bc..20ac7bb948b 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -720,7 +720,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -745,7 +745,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index b9429ebe685..4c366ebb212 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1021,7 +1021,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -1051,7 +1051,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 657b9d05a59..af0b16d5ea6 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -897,7 +897,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -927,7 +927,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 5c4c64f7967..665441838f6 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -934,7 +934,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -966,7 +966,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -1019,7 +1019,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); @@ -1050,7 +1050,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index a1e702ce891..82e731a5b40 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -1018,7 +1018,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -1048,7 +1048,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; - $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; + $totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 375ad2c171f..90aa23c6879 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * This file is a modified version of datepicker.php from phpBSM to fix some * bugs, to add new features and to dramatically increase speed. @@ -174,7 +175,7 @@ if ($conf->dol_use_jmobile) { $ret .= ''; $ret .= ''; $ret .= '
'; - $ret .= img_picto('', 'url', '', false, 0, 0, '', 'paddingright width20'); + $ret .= img_picto('', 'url', '', 0, 0, 0, '', 'paddingright width20'); $ret .= 'trans("OrPasteAnURL")).'"'; diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index edc3ae45e88..e85e9871a13 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -22,6 +22,13 @@ if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } +// From controller using view +' +@phan-var-force FormAdvTargetEmailing $formadvtargetemaling +@phan-var-force AdvanceTargetingMailing $advTarget +@phan-var-force array $array_query +'; + print '