diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ccd276f8a97..26d49f0b1f4 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -131,7 +131,7 @@ jobs: ls -l ~/.cache/pre-commit/ - name: Convert Raw Log to Annotations - uses: mdeweerd/logToCheckStyle@v2024.3.5 + uses: mdeweerd/logToCheckStyle@v2025.1.1 if: ${{ failure() }} with: in: ${{ env.RAW_LOG }} diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index c15d2747125..2c34622bb70 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -165,7 +165,7 @@ jobs: for /f "tokens=2 delims==" %%A in ('doskey /m:err') do EXIT /B %%A - name: Convert Raw Log to Annotations - uses: mdeweerd/logToCheckStyle@v2024.3.5 + uses: mdeweerd/logToCheckStyle@v2025.1.1 if: ${{ failure() }} with: in: ${{ env.PHPUNIT_LOG }} diff --git a/.travis.yml b/.travis.yml index d3f1a32c067..80826abe00e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -511,6 +511,9 @@ script: php upgrade.php 20.0.0 21.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade20002100.log || cat $TRAVIS_BUILD_DIR/upgrade20002100.log php upgrade2.php 20.0.0 21.0.0 > $TRAVIS_BUILD_DIR/upgrade20002100-2.log || cat $TRAVIS_BUILD_DIR/upgrade20002100-2.log php step5.php 20.0.0 21.0.0 > $TRAVIS_BUILD_DIR/upgrade20002100-3.log || cat $TRAVIS_BUILD_DIR/upgrade20002100-3.log + php upgrade.php 21.0.0 22.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade21002200.log || cat $TRAVIS_BUILD_DIR/upgrade21002200.log + php upgrade2.php 21.0.0 22.0.0 > $TRAVIS_BUILD_DIR/upgrade21002200-2.log || cat $TRAVIS_BUILD_DIR/upgrade21002200-2.log + php step5.php 21.0.0 22.0.0 > $TRAVIS_BUILD_DIR/upgrade21002200-3.log || cat $TRAVIS_BUILD_DIR/upgrade21002200-3.log set +e echo diff --git a/ChangeLog b/ChangeLog index a150b81dd15..fe5dfbf8b82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ WARNING: The following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * The directory /build has been moved into /dev/build. +* The use of GETPOST function is not allowed inside extrafields conditions or any strings that contains dynamic code evaluated with dol_eval() @@ -1216,8 +1217,13 @@ NEW: updating for display Help title when try to delete Don (issue #25314) NEW: Upgrade in module builder in menu section NEW: use account address in sepa mandate (#23642) NEW: VAT rate - Add entity -NEW: Website: Support of js into the Dolibarr server preview NEW: When an user unset the batch management of products, transformation of each batch stock movement in global stock movement +NEW: PDF Generation for each Human Resource Evaluations. + +SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520) +SEC: Add action confirm_... as sensitive to need a CSRF token +SEC: Disable not used PHP streams +SEC: Add option MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY For developers or integrators: @@ -1311,7 +1317,7 @@ The following changes may create regressions for some external modules, but were * The delete() method of AdherentType, Contact, Delivery, MultiCurrency, CurrencyRate now need $user as first parameter. * A very high number of class properties (with old name in french) are now deprecated in favor of the property name in english. * The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases. - +* booking.class.php was removed, please have a look at calendar.class.php ***** ChangeLog for 18.0.6 compared to 18.0.5 ***** FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269) diff --git a/dev/build/docker-dev/Dockerfile b/dev/build/docker-dev/Dockerfile index 5cd4c60673b..f98726d4f8c 100644 --- a/dev/build/docker-dev/Dockerfile +++ b/dev/build/docker-dev/Dockerfile @@ -23,11 +23,12 @@ RUN apt-get update -y \ msmtp \ msmtp-mta \ mailutils \ + libpq-dev \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \ - && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ + && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql pgsql gd soap zip \ + && docker-php-ext-configure ldap \ && docker-php-ext-install -j$(nproc) ldap && \ mv ${PHP_INI_DIR}/php.ini-development ${PHP_INI_DIR}/php.ini diff --git a/dev/build/docker-dev/README.md b/dev/build/docker-dev/README.md index bb5c82391f1..22a1a671121 100644 --- a/dev/build/docker-dev/README.md +++ b/dev/build/docker-dev/README.md @@ -1,8 +1,9 @@ # How to use it ? -The docker-compose.yml file is a sample of a config file to use to build and run Dolibarr in the current workspace with Docker. -This docker image is intended for development usage. -For production usage you should consider other contributor reference like https://hub.docker.com/r/dolibarr/dolibarr +The docker-compose.yml file is a sample of a config file to use to build and run +Dolibarr in the current workspace with Docker. This docker image is intended for +**development usage**. For production usage you should consider other +contributor reference like https://hub.docker.com/r/dolibarr/dolibarr. Before build/run, define the variable HOST_USER_ID as following: @@ -12,11 +13,18 @@ Go in repository build/docker : cd dev/build/docker -And then, you can run : +And then, depending on whether you want to run with a MariaDB database or +PostgreSQL database, you can run: - docker-compose up + docker compose -f docker-compose.yml -f mariadb.yml up + +or + + docker compose -f docker-compose.yml -f postgres.yml up This will run 4 containers Docker : Dolibarr, MariaDB, PhpMyAdmin and MailDev. +In the case of PostgreSQL, only Dolibarr, MailDev and the PostgreSQL database +will be running. The URL to go to the Dolibarr is : @@ -26,9 +34,35 @@ The URL to go to PhpMyAdmin is (login/password is root/root) : http://0.0.0.0:8080 -In Dolibarr configuration Email let PHP mail function, To see all mail send by Dolibarr go to maildev +In Dolibarr configuration Email let PHP mail function, To see all mail send by +Dolibarr go to maildev http://0.0.0.0:8081 -Setup the database connection during the installation process, please use mariadb (name of the database container) as database host. -Setup documents folder, during the installation process, to /var/documents +Setup the database connection during the installation process, please use +mariadb or postgres (name of the database container) as database host. + +## Setup your custom modules + +You can setup your own modules from your development folder by using volume +mounts and docker compose override. For instance for your module "yourmodule" +located in `/path/to/your/module_folder`, you can edit `yourmodule.yml` and +write: + + --- + services: + web: + volumes: + - /path/to/your/module_folder:/var/www/html/custom/yourmodule/ + +This will add your module at runtime inside the dolibarr custom plugins and it +will automatically be synced with your development environment. + +Then, you can start by extending one of the commands above, for instance for +mariadb: + + docker compose \ + -f docker-compose.yml \ + -f postgres.yml \ + -f yourmodule.yml \ + up diff --git a/dev/build/docker-dev/docker-compose.yml b/dev/build/docker-dev/docker-compose.yml index cc2988a67d1..84a48d00f48 100644 --- a/dev/build/docker-dev/docker-compose.yml +++ b/dev/build/docker-dev/docker-compose.yml @@ -1,5 +1,4 @@ -version: '3' - +--- networks: internal-pod: internal: true @@ -17,19 +16,6 @@ services: networks: - internal-pod - external-pod - - phpmyadmin: - image: phpmyadmin/phpmyadmin - environment: - PMA_HOST: mariadb - depends_on: - - mariadb - ports: - - "8080:80" - networks: - - internal-pod - - external-pod - web: build: . environment: @@ -37,13 +23,12 @@ services: PHP_INI_DATE_TIMEZONE: $PHP_INI_DATE_TIMEZONE PHP_INI_MEMORY_LIMIT: $PHP_INI_MEMORY_LIMIT volumes: - - ../../htdocs:/var/www/html/ - - ../../documents:/var/documents + - ../../../htdocs:/var/www/html/ + - ../../../documents:/var/www/documents ports: - "80:80" - "9000:9000" depends_on: - - mariadb - mail networks: - internal-pod diff --git a/dev/build/docker-dev/docker-run.sh b/dev/build/docker-dev/docker-run.sh index 07bc35947cf..a3a1123c1f2 100755 --- a/dev/build/docker-dev/docker-run.sh +++ b/dev/build/docker-dev/docker-run.sh @@ -1,24 +1,21 @@ #!/bin/bash # Script used by the Dockerfile. # See README.md to know how to create a Dolibarr env with docker +set -ex + +if [ "${HOST_USER_ID}" == "" ]; then + echo "Define HOST_USER_ID to your user ID before starting" + exit 1 +fi usermod -u "${HOST_USER_ID}" www-data groupmod -g "${HOST_USER_ID}" www-data -chgrp -hR www-data /var/www/html -chmod g+rwx /var/www/html/conf - -if [ ! -d /var/documents ]; then - echo "[docker-run] => create volume directory /var/documents ..." - mkdir -p /var/documents -fi -echo "[docker-run] => Set Permission to www-data for /var/documents" -chown -R www-data:www-data /var/documents - echo "[docker-run] => update '${PHP_INI_DIR}/conf.d/dolibarr-php.ini'" cat < "${PHP_INI_DIR}/conf.d/dolibarr-php.ini" date.timezone = ${PHP_INI_DATE_TIMEZONE:-UTC} memory_limit = ${PHP_INI_MEMORY_LIMIT:-256M} +display_errors = Off EOF exec apache2-foreground diff --git a/dev/build/docker-dev/mariadb.yml b/dev/build/docker-dev/mariadb.yml new file mode 100644 index 00000000000..c9b2e78ac18 --- /dev/null +++ b/dev/build/docker-dev/mariadb.yml @@ -0,0 +1,34 @@ +--- +networks: + internal-pod: + internal: true + external-pod: + internal: false + +services: + mariadb: + image: mariadb:latest + environment: + MYSQL_ROOT_PASSWORD: rootpassfordev + MYSQL_DATABASE: dolibarr + ports: + - "3306:3306" + networks: + - internal-pod + - external-pod + web: + depends_on: + - mariadb + phpmyadmin: + image: phpmyadmin/phpmyadmin + environment: + PMA_HOST: mariadb + depends_on: + - mariadb + ports: + - "8080:80" + networks: + - internal-pod + - external-pod + + diff --git a/dev/build/docker-dev/postgres.yml b/dev/build/docker-dev/postgres.yml new file mode 100644 index 00000000000..ab740658894 --- /dev/null +++ b/dev/build/docker-dev/postgres.yml @@ -0,0 +1,18 @@ +--- +networks: + internal-pod: + internal: true + external-pod: + internal: false + +services: + postgres: + image: postgres:latest + environment: + POSTGRES_PASSWORD: rootpassfordev + networks: + - internal-pod + - external-pod + web: + depends_on: + - postgres diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 01c75984c0d..98a307425c1 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -942,12 +942,6 @@ parameters: count: 5 path: ../../../htdocs/adherents/class/adherent.class.php - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/adherents/class/adherent.class.php - - message: '#^Property Adherent\:\:\$last_subscription_amount \(int\|string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -2556,12 +2550,6 @@ parameters: count: 1 path: ../../../htdocs/blockedlog/ajax/block-add.php - - - message: '#^Call to function is_object\(\) with Don\|Facture\|FactureFournisseur\|PaymentVarious will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../../htdocs/blockedlog/class/blockedlog.class.php - - message: '#^Dead catch \- Exception is never thrown in the try block\.$#' identifier: catch.neverThrown @@ -5124,30 +5112,12 @@ parameters: count: 1 path: ../../../htdocs/compta/bank/various_payment/card.php - - - message: '#^Variable \$accountline might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/compta/bank/various_payment/card.php - - - - message: '#^Variable \$ref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/compta/bank/various_payment/card.php - - message: '#^Right side of && is always false\.$#' identifier: booleanAnd.rightAlwaysFalse count: 1 path: ../../../htdocs/compta/bank/various_payment/document.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/compta/bank/various_payment/document.php - - message: '#^Variable \$maxlength might not be defined\.$#' identifier: variable.undefined @@ -5166,12 +5136,6 @@ parameters: count: 1 path: ../../../htdocs/compta/bank/various_payment/info.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/compta/bank/various_payment/info.php - - message: '#^Variable \$maxlength might not be defined\.$#' identifier: variable.undefined @@ -5568,24 +5532,12 @@ parameters: count: 3 path: ../../../htdocs/compta/facture/class/facture.class.php - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/compta/facture/class/facture.class.php - - message: '#^Parameter \#12 \$localtaxes_array of function calcul_price_total expects array\{string, int\|string, string, int\|string, string, string\}\|array\{string, int\|string, string, string\}, array\{\} given\.$#' identifier: argument.type count: 2 path: ../../../htdocs/compta/facture/class/facture.class.php - - - message: '#^Parameter \#4 \$txtva of method Facture\:\:addline\(\) expects float, string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/compta/facture/class/facture.class.php - - message: '#^Property CommonInvoice\:\:\$close_code \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -7620,12 +7572,6 @@ parameters: count: 1 path: ../../../htdocs/contrat/list.php - - - message: '#^Parameter \#2 \$array of static method Form\:\:multiselectarray\(\) expects array\, non\-empty\-array\\|non\-empty\-string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/contrat/list.php - - message: '#^Unable to resolve the template type T in call to function dol_sort_array$#' identifier: argument.templateType @@ -7902,12 +7848,6 @@ parameters: count: 3 path: ../../../htdocs/core/actions_massactions.inc.php - - - message: '#^Variable \$obj might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/core/actions_massactions.inc.php - - message: '#^Variable \$permissiontoadd might not be defined\.$#' identifier: variable.undefined @@ -8034,12 +7974,6 @@ parameters: count: 1 path: ../../../htdocs/core/ajax/ajaxdirpreview.php - - - message: '#^Variable \$module might not be defined\.$#' - identifier: variable.undefined - count: 34 - path: ../../../htdocs/core/ajax/ajaxdirpreview.php - - message: '#^Variable \$section might not be defined\.$#' identifier: variable.undefined @@ -8544,24 +8478,12 @@ parameters: count: 1 path: ../../../htdocs/core/boxes/box_produits.php - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: bool, module\: ''product\|service''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/boxes/box_produits.php - - message: '#^Constructor of class box_produits_alerte_stock has an unused parameter \$param\.$#' identifier: constructor.unusedParameter count: 1 path: ../../../htdocs/core/boxes/box_produits_alerte_stock.php - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: mixed, module\: ''product\|service…''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/boxes/box_produits_alerte_stock.php - - message: '#^Constructor of class box_project has an unused parameter \$param\.$#' identifier: constructor.unusedParameter @@ -8862,18 +8784,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/comment.class.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, CommonObject given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/class/commondocgenerator.class.php - - - - message: '#^Parameter \#2 \$array_to_fill of method CommonDocGenerator\:\:fill_substitutionarray_with_extrafields\(\) expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/class/commondocgenerator.class.php - - message: '#^Property CommonObject\:\:\$element \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -9687,13 +9597,7 @@ parameters: - message: '#^Parameter \#1 \$array of function dol_sort_array contains unresolvable type\.$#' identifier: argument.unresolvableType - count: 4 - path: ../../../htdocs/core/class/html.form.class.php - - - - message: '#^Parameter \#1 \$selected of method Form\:\:getSelectConditionsPaiements\(\) expects int, string given\.$#' - identifier: argument.type - count: 1 + count: 3 path: ../../../htdocs/core/class/html.form.class.php - @@ -9702,12 +9606,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.form.class.php - - - message: '#^Parameter \#2 \$array of method Form\:\:multiselectarray\(\) expects array\, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/class/html.form.class.php - - message: '#^Parameter \#3 \$optJson of method Form\:\:constructProjectListOption\(\) expects array\{key\: string, value\: string, type\: string\}, array\{\} given\.$#' identifier: argument.type @@ -9732,12 +9630,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.form.class.php - - - message: '#^Property Form\:\:\$cache_availability has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/class/html.form.class.php - - message: '#^Property Form\:\:\$cache_conditions_paiements has no type specified\.$#' identifier: missingType.property @@ -9783,7 +9675,7 @@ parameters: - message: '#^Return type of call to function dol_sort_array contains unresolvable type\.$#' identifier: function.unresolvableReturnType - count: 4 + count: 3 path: ../../../htdocs/core/class/html.form.class.php - @@ -9828,24 +9720,12 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.formcategory.class.php - - - message: '#^Parameter \#2 \$array of static method Form\:\:multiselectarray\(\) expects array\, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/class/html.formcategory.class.php - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 path: ../../../htdocs/core/class/html.formcompany.class.php - - - message: '#^Call to function is_numeric\(\) with float\|int\\|int\<1, max\>\|\(non\-falsy\-string&numeric\-string\) will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../../htdocs/core/class/html.formcompany.class.php - - message: '#^Parameter \#1 \$array of function dol_sort_array contains unresolvable type\.$#' identifier: argument.unresolvableType @@ -9936,24 +9816,12 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.formmail.class.php - - - message: '#^Parameter \#2 \$array of static method Form\:\:multiselectarray\(\) expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/class/html.formmail.class.php - - message: '#^Property FormMail\:\:\$ckeditortoolbar \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property count: 1 path: ../../../htdocs/core/class/html.formmail.class.php - - - message: '#^Parameter \#2 \$array of static method Form\:\:multiselectarray\(\) expects array\, non\-empty\-array\<\-1\|0\|1\|2\|3, string\> given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/class/html.formorder.class.php - - message: '#^Parameter \#3 \$zone of static method InfoBox\:\:listBoxes\(\) expects int, string given\.$#' identifier: argument.type @@ -9978,12 +9846,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.formprojet.class.php - - - message: '#^Parameter \#2 \$array of static method Form\:\:multiselectarray\(\) expects array\, non\-empty\-array\<0\|1\|2, string\> given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/class/html.formprojet.class.php - - message: '#^Variable \$labeltoshow might not be defined\.$#' identifier: variable.undefined @@ -10857,7 +10719,7 @@ parameters: - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue - count: 1 + count: 2 path: ../../../htdocs/core/lib/company.lib.php - @@ -11598,84 +11460,6 @@ parameters: count: 2 path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: 0\|1, perms\: 0\|1, module\: ''projet''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: 0\|1, perms\: bool, module\: ''facture\|supplier…''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: 0\|1, perms\: bool, module\: ''propal\|commande…''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: 1, perms\: 1, module\: ''''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: bool, module\: ''banque\|prelevement…''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: bool, module\: ''bom\|mrp''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: bool, module\: ''comptabilite…''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: bool, module\: ''hrm\|holiday…''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: bool, module\: ''product\|service''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: bool, module\: ''societe\|fournisseur''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: bool, module\: ''ticket…''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: bool, perms\: mixed, module\: ''adherent''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - - - message: '#^Parameter \#2 \$menuentry of function isVisibleToUserType expects array\{enabled\: int\<0, 1\>, module\: string, perms\: string\}, array\{enabled\: true, perms\: mixed, module\: ''projet''\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/menus/standard/eldy.lib.php - - message: '#^Parameter \#8 \$menuval of function print_text_menu_entry expects array\{\}\|array\{rowid\: string, fk_menu\: string, langs\: string, enabled\: int\<0, 2\>, type\: string, fk_mainmenu\: string, fk_leftmenu\: string, url\: string, \.\.\.\}, array\{url\: string, titre\: string, enabled\: int\<0, 2\>, target\: string, mainmenu\: string, leftmenu\: string, position\: int, level\?\: int, \.\.\.\} given\.$#' identifier: argument.type @@ -11814,30 +11598,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/action/doc/pdf_standard_actions.class.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Asset given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php - - message: '#^Property CommonObject\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -11970,30 +11730,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, BOM given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php - - message: '#^Property CommonObject\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -12006,30 +11742,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/cheque/doc/pdf_blochet.class.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Commande given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php - - message: '#^Property Commande\:\:\$availability \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -12162,24 +11874,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Contrat given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -12264,12 +11958,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php - - message: '#^Parameter \#4 \$columnText of method CommonDocGenerator\:\:printStdColumnContent\(\) expects string, float given\.$#' identifier: argument.type @@ -12372,30 +12060,6 @@ parameters: count: 6 path: ../../../htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Facture given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php - - message: '#^Variable \$array_propal_object in isset\(\) always exists and is not nullable\.$#' identifier: isset.variable @@ -13584,30 +13248,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Mo given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php - - message: '#^Property Mo\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -13620,12 +13260,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/mrp/doc/pdf_vinci.modules.php - - - message: '#^Parameter \#4 \$columnText of method CommonDocGenerator\:\:printStdColumnContent\(\) expects string, float given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/mrp/doc/pdf_vinci.modules.php - - message: '#^Property CommonDocGenerator\:\:\$cols \(array\\) does not accept non\-empty\-array\\.$#' identifier: assign.propertyType @@ -13734,30 +13368,6 @@ parameters: count: 2 path: ../../../htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Product given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php - - - - message: '#^Property Product\:\:\$weight_units \(int\|string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/core/modules/product/doc/pdf_standard.modules.php - - message: '#^Method ModeleProductCode\:\:liste_modeles\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -13770,30 +13380,6 @@ parameters: count: 2 path: ../../../htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Project given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method doc_generic_project_odt\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php - - - - message: '#^Parameter \#2 \$array_to_fill of method CommonDocGenerator\:\:fill_substitutionarray_with_extrafields\(\) expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php - - message: '#^Variable \$objectdetail might not be defined\.$#' identifier: variable.undefined @@ -13806,12 +13392,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/project/doc/pdf_baleine.modules.php - - - message: '#^Comparison operation "\>\=" between int\<0, max\> and 0 is always true\.$#' - identifier: greaterOrEqual.alwaysTrue - count: 1 - path: ../../../htdocs/core/modules/project/doc/pdf_beluga.modules.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -13842,60 +13422,12 @@ parameters: count: 2 path: ../../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Project\|Task given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: '#^Parameter \#1 \$task of method doc_generic_task_odt\:\:get_substitutionarray_tasks\(\) expects Task, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: '#^Parameter \#2 \$array_to_fill of method CommonDocGenerator\:\:fill_substitutionarray_with_extrafields\(\) expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - message: '#^Variable \$listlines might not be defined\.$#' identifier: variable.undefined count: 3 path: ../../../htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Propal given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php - - message: '#^Property CommonObject\:\:\$multicurrency_tx \(array\\|float\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -14022,30 +13554,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/rapport/pdf_paiement.class.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Reception given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php - - message: '#^Property Reception\:\:\$trueWeight \(float\|int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -14070,24 +13578,6 @@ parameters: count: 3 path: ../../../htdocs/core/modules/societe/doc/doc_generic_odt.modules.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Entrepot given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php - - message: '#^Property CommonDocGenerator\:\:\$cols \(array\\) does not accept non\-empty\-array\\.$#' identifier: assign.propertyType @@ -14160,30 +13650,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, FactureFournisseur given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php - - message: '#^Property CommonObject\:\:\$multicurrency_tx \(array\\|float\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -14202,30 +13668,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, CommandeFournisseur given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php - - message: '#^Left side of \|\| is always false\.$#' identifier: booleanOr.leftAlwaysFalse @@ -14364,18 +13806,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php - - - message: '#^Parameter \#1 \$line of method CommonDocGenerator\:\:get_substitutionarray_lines\(\) expects CommonObjectLine, CommonObject\|stdClass given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue @@ -14502,30 +13932,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php - - - message: '#^Call to function is_array\(\) with string will always evaluate to false\.$#' - identifier: function.impossibleType - count: 1 - path: ../../../htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, UserGroup given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php - - message: '#^Variable \$contactobject might not be defined\.$#' identifier: variable.undefined @@ -14634,42 +14040,12 @@ parameters: count: 1 path: ../../../htdocs/core/tpl/bloc_showhide.tpl.php - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/card_presend.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: ../../../htdocs/core/tpl/card_presend.tpl.php - - message: '#^Variable \$hidedetails might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/core/tpl/card_presend.tpl.php - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/card_presend.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../../htdocs/core/tpl/card_presend.tpl.php - - - - message: '#^Variable \$modelmail might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/card_presend.tpl.php - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -14682,18 +14058,6 @@ parameters: count: 2 path: ../../../htdocs/core/tpl/card_presend.tpl.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/commonfields_edit.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/commonfields_view.tpl.php - - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -14706,30 +14070,12 @@ parameters: count: 1 path: ../../../htdocs/core/tpl/contacts.tpl.php - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/contacts.tpl.php - - message: '#^Variable \$conf might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/core/tpl/contacts.tpl.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/core/tpl/contacts.tpl.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/contacts.tpl.php - - message: '#^Variable \$action might not be defined\.$#' identifier: variable.undefined @@ -14814,12 +14160,6 @@ parameters: count: 2 path: ../../../htdocs/core/tpl/extrafields_list_print_fields.tpl.php - - - message: '#^Variable \$object might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/extrafields_list_search_input.tpl.php - - message: '#^Variable \$extrafields might not be defined\.$#' identifier: variable.undefined @@ -14832,12 +14172,6 @@ parameters: count: 2 path: ../../../htdocs/core/tpl/extrafields_list_search_param.tpl.php - - - message: '#^Variable \$object might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/extrafields_list_search_param.tpl.php - - message: '#^Variable \$param might not be defined\.$#' identifier: variable.undefined @@ -14856,48 +14190,18 @@ parameters: count: 1 path: ../../../htdocs/core/tpl/extrafields_list_search_sql.tpl.php - - - message: '#^Variable \$object might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/extrafields_list_search_sql.tpl.php - - message: '#^Variable \$sql might not be defined\.$#' identifier: variable.undefined count: 7 path: ../../../htdocs/core/tpl/extrafields_list_search_sql.tpl.php - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/extrafields_list_search_title.tpl.php - - - - message: '#^Variable \$object might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/extrafields_list_search_title.tpl.php - - message: '#^Variable \$param might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/core/tpl/extrafields_list_search_title.tpl.php - - - message: '#^Variable \$sortfield might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/extrafields_list_search_title.tpl.php - - - - message: '#^Variable \$sortorder might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/extrafields_list_search_title.tpl.php - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue @@ -14970,12 +14274,6 @@ parameters: count: 2 path: ../../../htdocs/core/tpl/formlayoutai.tpl.php - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/list_print_subtotal.tpl.php - - message: '#^Variable \$limit might not be defined\.$#' identifier: variable.undefined @@ -15063,7 +14361,7 @@ parameters: - message: '#^Variable \$conf might not be defined\.$#' identifier: variable.undefined - count: 5 + count: 4 path: ../../../htdocs/core/tpl/objectline_create.tpl.php - @@ -15690,12 +14988,6 @@ parameters: count: 1 path: ../../../htdocs/don/list.php - - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../../htdocs/don/list.php - - message: '#^Variable \$projectstatic might not be defined\.$#' identifier: variable.undefined @@ -17766,12 +17058,6 @@ parameters: count: 2 path: ../../../htdocs/fourn/class/fournisseur.facture-rec.class.php - - - message: '#^Parameter \#8 \$remise_percent of method FactureFournisseurRec\:\:addline\(\) expects int, float given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/fourn/class/fournisseur.facture-rec.class.php - - message: '#^Property CommonInvoice\:\:\$subtype \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -17832,12 +17118,6 @@ parameters: count: 2 path: ../../../htdocs/fourn/class/fournisseur.facture.class.php - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/fourn/class/fournisseur.facture.class.php - - message: '#^Parameter \#15 \$pu_devise of function calcul_price_total expects float, string given\.$#' identifier: argument.type @@ -18162,24 +17442,12 @@ parameters: count: 2 path: ../../../htdocs/fourn/commande/card.php - - - message: '#^Variable \$array_option might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/commande/card.php - - message: '#^Variable \$classname might not be defined\.$#' identifier: variable.undefined count: 2 path: ../../../htdocs/fourn/commande/card.php - - - message: '#^Variable \$fk_account might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/commande/card.php - - message: '#^Variable \$line might not be defined\.$#' identifier: variable.undefined @@ -18204,36 +17472,12 @@ parameters: count: 1 path: ../../../htdocs/fourn/commande/contact.php - - - message: '#^Variable \$caneditproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/commande/contact.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse count: 1 path: ../../../htdocs/fourn/commande/dispatch.php - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/fourn/commande/dispatch.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/fourn/commande/dispatch.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/fourn/commande/dispatch.php - - message: '#^Right side of && is always false\.$#' identifier: booleanAnd.rightAlwaysFalse @@ -18264,24 +17508,12 @@ parameters: count: 1 path: ../../../htdocs/fourn/commande/document.php - - - message: '#^Variable \$caneditproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/commande/document.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse count: 1 path: ../../../htdocs/fourn/commande/info.php - - - message: '#^Variable \$caneditproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/commande/info.php - - message: '#^Call to function method_exists\(\) with CommandeFournisseur and ''fetch_lines'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -18300,12 +17532,6 @@ parameters: count: 1 path: ../../../htdocs/fourn/commande/list.php - - - message: '#^Variable \$billed might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/commande/list.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -18324,24 +17550,12 @@ parameters: count: 1 path: ../../../htdocs/fourn/commande/note.php - - - message: '#^Variable \$caneditproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/commande/note.php - - message: '#^Variable \$object might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php - - - message: '#^Variable \$begin might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/fourn/contact.php - - message: '#^Variable \$socid might not be defined\.$#' identifier: variable.undefined @@ -18354,48 +17568,6 @@ parameters: count: 1 path: ../../../htdocs/fourn/facture/agenda.php - - - message: '#^Parameter \#1 \$hour of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 3 - path: ../../../htdocs/fourn/facture/card-rec.php - - - - message: '#^Parameter \#2 \$minute of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 3 - path: ../../../htdocs/fourn/facture/card-rec.php - - - - message: '#^Parameter \#3 \$second of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/fourn/facture/card-rec.php - - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/fourn/facture/card-rec.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/fourn/facture/card-rec.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/fourn/facture/card-rec.php - - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/facture/card-rec.php - - message: '#^Variable \$label might not be defined\.$#' identifier: variable.undefined @@ -18414,24 +17586,6 @@ parameters: count: 2 path: ../../../htdocs/fourn/facture/card-rec.php - - - message: '#^Variable \$predef might not be defined\.$#' - identifier: variable.undefined - count: 20 - path: ../../../htdocs/fourn/facture/card-rec.php - - - - message: '#^Variable \$price_min might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/facture/card-rec.php - - - - message: '#^Variable \$ref_fournisseur might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/facture/card-rec.php - - message: '#^Comparison operation "\>" between 0 and 0 is always false\.$#' identifier: greater.alwaysFalse @@ -18444,60 +17598,12 @@ parameters: count: 2 path: ../../../htdocs/fourn/facture/card.php - - - message: '#^Parameter \#1 \$hour of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 6 - path: ../../../htdocs/fourn/facture/card.php - - - - message: '#^Parameter \#2 \$minute of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 6 - path: ../../../htdocs/fourn/facture/card.php - - - - message: '#^Parameter \#3 \$second of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/fourn/facture/card.php - - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 6 - path: ../../../htdocs/fourn/facture/card.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 6 - path: ../../../htdocs/fourn/facture/card.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 6 - path: ../../../htdocs/fourn/facture/card.php - - - - message: '#^Property CommonObject\:\:\$cond_reglement_id \(int\) does not accept array\\|string\.$#' - identifier: assign.propertyType - count: 2 - path: ../../../htdocs/fourn/facture/card.php - - message: '#^Property CommonObject\:\:\$fk_project \(int\) does not accept null\.$#' identifier: assign.propertyType count: 1 path: ../../../htdocs/fourn/facture/card.php - - - message: '#^Property CommonObject\:\:\$mode_reglement_id \(int\) does not accept array\\|string\.$#' - identifier: assign.propertyType - count: 2 - path: ../../../htdocs/fourn/facture/card.php - - message: '#^Variable \$backtopageforcancel in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -18522,12 +17628,6 @@ parameters: count: 2 path: ../../../htdocs/fourn/facture/card.php - - - message: '#^Variable \$vat_reverse_charge might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/facture/card.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -18600,18 +17700,6 @@ parameters: count: 1 path: ../../../htdocs/fourn/facture/list.php - - - message: '#^Variable \$numprlv might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/facture/list.php - - - - message: '#^Variable \$soc might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/facture/list.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -18666,12 +17754,6 @@ parameters: count: 1 path: ../../../htdocs/fourn/paiement/card.php - - - message: '#^Variable \$title_button might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/fourn/paiement/card.php - - message: '#^Variable \$object might not be defined\.$#' identifier: variable.undefined @@ -18702,36 +17784,6 @@ parameters: count: 1 path: ../../../htdocs/fourn/product/list.php - - - message: '#^Variable \$result2 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/ftp/admin/ftpclient.php - - - - message: '#^Variable \$result3 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/ftp/admin/ftpclient.php - - - - message: '#^Variable \$result4 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/ftp/admin/ftpclient.php - - - - message: '#^Variable \$result5 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/ftp/admin/ftpclient.php - - - - message: '#^Variable \$result6 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/ftp/admin/ftpclient.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -18762,12 +17814,6 @@ parameters: count: 3 path: ../../../htdocs/ftp/index.php - - - message: '#^Variable \$newsectioniso might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/ftp/index.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -18780,24 +17826,6 @@ parameters: count: 1 path: ../../../htdocs/holiday/card_group.php - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/holiday/card_group.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/holiday/card_group.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/holiday/card_group.php - - message: '#^Variable \$errors might not be defined\.$#' identifier: variable.undefined @@ -18840,12 +17868,6 @@ parameters: count: 3 path: ../../../htdocs/holiday/class/holiday.class.php - - - message: '#^Parameter \#4 \$new_solde of method Holiday\:\:addLogCP\(\) expects int, float given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/holiday/class/holiday.class.php - - message: '#^Property Holiday\:\:\$events has no type specified\.$#' identifier: missingType.property @@ -18894,12 +17916,6 @@ parameters: count: 1 path: ../../../htdocs/holiday/define_holiday.php - - - message: '#^Variable \$arraydata might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/holiday/list.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -19554,12 +18570,6 @@ parameters: count: 1 path: ../../../htdocs/hrm/index.php - - - message: '#^Variable \$newcardbutton might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/hrm/job_agenda.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -19986,696 +18996,6 @@ parameters: count: 1 path: ../../../htdocs/index.php - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 2 - path: ../../../htdocs/install/check.php - - - - message: '#^Offset 2 on array\{string, non\-falsy\-string, non\-falsy\-string\} in empty\(\) always exists and is not falsy\.$#' - identifier: empty.offset - count: 1 - path: ../../../htdocs/install/check.php - - - - message: '#^Path in include_once\(\) "\./install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/check.php - - - - message: '#^Path in include_once\(\) "/etc/dolibarr/install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/check.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/check.php - - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../../htdocs/install/fileconf.php - - - - message: '#^Path in include_once\(\) "\./install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/fileconf.php - - - - message: '#^Path in include_once\(\) "/etc/dolibarr/install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/fileconf.php - - - - message: '#^Strict comparison using \!\=\= between mixed and null will always evaluate to true\.$#' - identifier: notIdentical.alwaysTrue - count: 8 - path: ../../../htdocs/install/fileconf.php - - - - message: '#^Variable \$testclass might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/fileconf.php - - - - message: '#^Variable \$testfunction might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/fileconf.php - - - - message: '#^Instanceof between mod_syslog_file and LogHandler will always evaluate to true\.$#' - identifier: instanceof.alwaysTrue - count: 2 - path: ../../../htdocs/install/inc.php - - - - message: '#^Variable \$dolibarr_main_db_prefix in isset\(\) always exists and is not nullable\.$#' - identifier: isset.variable - count: 1 - path: ../../../htdocs/install/inc.php - - - - message: '#^Variable \$dolibarr_main_db_type in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../../htdocs/install/inc.php - - - - message: '#^Variable \$dolibarr_main_url_root in isset\(\) always exists and is not nullable\.$#' - identifier: isset.variable - count: 1 - path: ../../../htdocs/install/inc.php - - - - message: '#^Loose comparison using \=\= between 0 and 0 will always evaluate to true\.$#' - identifier: equal.alwaysTrue - count: 1 - path: ../../../htdocs/install/index.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/index.php - - - - message: '#^PHPDoc tag @var with type string is not subtype of native type null\.$#' - identifier: varTag.nativeType - count: 1 - path: ../../../htdocs/install/install.forced.docker.php - - - - message: '#^PHPDoc tag @var with type string is not subtype of native type null\.$#' - identifier: varTag.nativeType - count: 1 - path: ../../../htdocs/install/install.forced.sample.php - - - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../../htdocs/install/repair.php - - - - message: '#^Variable \$actiondone in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../../htdocs/install/repair.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/repair.php - - - - message: '#^Variable \$dolibarr_main_data_root might not be defined\.$#' - identifier: variable.undefined - count: 16 - path: ../../../htdocs/install/repair.php - - - - message: '#^Variable \$dolibarr_main_db_character_set might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/repair.php - - - - message: '#^Variable \$dolibarr_main_db_encrypted_pass might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/repair.php - - - - message: '#^Variable \$dolibarr_main_db_type might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/install/repair.php - - - - message: '#^Variable \$methodtofix might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/repair.php - - - - message: '#^Variable \$object_instance might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/install/repair.php - - - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Path in include_once\(\) "\./install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Path in include_once\(\) "/etc/dolibarr/install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 35 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$conffiletoshow might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$db_create_database in isset\(\) always exists and is not nullable\.$#' - identifier: isset.variable - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$db_create_user in isset\(\) always exists and is not nullable\.$#' - identifier: isset.variable - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$dolibarr_main_db_character_set might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$dolibarr_main_db_collation might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$dolibarr_main_db_host might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$dolibarr_main_db_name might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$dolibarr_main_db_user might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$dolibarr_main_document_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$force_dolibarr_lib_TCPDI_PATH in empty\(\) is never defined\.$#' - identifier: empty.variable - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Variable \$force_install_noedit might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step1.php - - - - message: '#^Call to preg_quote\(\) is missing delimiter / to be effective\.$#' - identifier: argument.invalidPregQuote - count: 1 - path: ../../../htdocs/install/step2.php - - - - message: '#^Loose comparison using \=\= between 0 and 0 will always evaluate to true\.$#' - identifier: equal.alwaysTrue - count: 1 - path: ../../../htdocs/install/step2.php - - - - message: '#^Path in include_once\(\) "\./install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/step2.php - - - - message: '#^Path in include_once\(\) "/etc/dolibarr/install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/step2.php - - - - message: '#^Variable \$buffer might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step2.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 15 - path: ../../../htdocs/install/step2.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/step2.php - - - - message: '#^Variable \$conffiletoshow might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step2.php - - - - message: '#^Variable \$dir might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/install/step2.php - - - - message: '#^Variable \$dolibarr_main_db_prefix might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../../htdocs/install/step2.php - - - - message: '#^Variable \$dolibarr_main_db_type might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: ../../../htdocs/install/step2.php - - - - message: '#^Variable \$dolibarr_main_document_root might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/install/step2.php - - - - message: '#^Variable \$versionarray might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/install/step2.php - - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../../htdocs/install/step4.php - - - - message: '#^Left side of && is always false\.$#' - identifier: booleanAnd.leftAlwaysFalse - count: 1 - path: ../../../htdocs/install/step4.php - - - - message: '#^Path in include_once\(\) "\./install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/step4.php - - - - message: '#^Path in include_once\(\) "/etc/dolibarr/install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/step4.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../../htdocs/install/step4.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/step4.php - - - - message: '#^Variable \$conffiletoshow might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step4.php - - - - message: '#^Variable \$dolibarr_main_document_root might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/step4.php - - - - message: '#^Variable \$force_install_dolibarrlogin might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step4.php - - - - message: '#^Variable \$force_install_noedit might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step4.php - - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Left side of && is always false\.$#' - identifier: booleanAnd.leftAlwaysFalse - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Path in include_once\(\) "\./install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Path in include_once\(\) "/etc/dolibarr/install\.forced\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 29 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$conffiletoshow might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$dolibarr_main_db_encrypted_pass might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$dolibarr_main_db_host might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$dolibarr_main_db_name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$dolibarr_main_db_pass might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$dolibarr_main_db_port might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$dolibarr_main_db_type might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$dolibarr_main_db_user might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$dolibarr_main_document_root might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$force_install_noedit might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$login in isset\(\) always exists and is not nullable\.$#' - identifier: isset.variable - count: 5 - path: ../../../htdocs/install/step5.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$dolibarr_main_db_encrypted_pass might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$dolibarr_main_db_host might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$dolibarr_main_db_name might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$dolibarr_main_db_pass might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$dolibarr_main_db_port might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$dolibarr_main_db_type might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$dolibarr_main_db_user might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$dolibarr_main_document_root might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Variable \$versionarray might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/upgrade.php - - - - message: '#^Call to function is_array\(\) with array\, array\{mixed, mixed, mixed\}\> will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Parameter \#4 \$listofmodule of function migrate_reload_modules expects array\, array\{MAIN_MODULE_ACCOUNTING\: ''newboxdefonly'', MAIN_MODULE_AGENDA\: ''newboxdefonly'', MAIN_MODULE_BOM\: ''menuonly'', MAIN_MODULE_BANQUE\: ''menuonly'', MAIN_MODULE_BARCODE\: ''newboxdefonly'', MAIN_MODULE_CRON\: ''newboxdefonly'', MAIN_MODULE_COMMANDE\: ''newboxdefonly'', MAIN_MODULE_BLOCKEDLOG\: ''noboxes'', \.\.\.\} given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$dolibarr_main_db_encrypted_pass might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$dolibarr_main_db_host might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$dolibarr_main_db_name might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$dolibarr_main_db_pass might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$dolibarr_main_db_port might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$dolibarr_main_db_type might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$dolibarr_main_db_user might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/install/upgrade2.php - - - - message: '#^Variable \$dolibarr_main_document_root might not be defined\.$#' - identifier: variable.undefined - count: 9 - path: ../../../htdocs/install/upgrade2.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -20730,12 +19050,6 @@ parameters: count: 1 path: ../../../htdocs/intracommreport/class/intracommreport.class.php - - - message: '#^Parameter \#3 \$period_reference of method IntracommReport\:\:addItemsFact\(\) expects int, string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/intracommreport/class/intracommreport.class.php - - message: '#^Variable \$url in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -21078,12 +19392,6 @@ parameters: count: 1 path: ../../../htdocs/loan/payment/payment.php - - - message: '#^Variable \$sumpaid might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/loan/payment/payment.php - - message: '#^Variable \$result might not be defined\.$#' identifier: variable.undefined @@ -21144,18 +19452,6 @@ parameters: count: 1 path: ../../../htdocs/main.inc.php - - - message: '#^Parameter \#1 \$var of function analyseVarsForSqlAndScriptsInjection expects array\\|string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/main.inc.php - - - - message: '#^Parameter \#1 \$var of function analyseVarsForSqlAndScriptsInjection expects array\\|string, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/main.inc.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -21210,24 +19506,12 @@ parameters: count: 2 path: ../../../htdocs/margin/customerMargins.php - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/margin/customerMargins.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse count: 1 path: ../../../htdocs/margin/customerMargins.php - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/margin/productMargins.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -21312,12 +19596,6 @@ parameters: count: 1 path: ../../../htdocs/modulebuilder/index.php - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../../htdocs/modulebuilder/index.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -21360,12 +19638,6 @@ parameters: count: 1 path: ../../../htdocs/modulebuilder/index.php - - - message: '#^Variable \$content might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/modulebuilder/index.php - - message: '#^Variable \$field might not be defined\.$#' identifier: variable.undefined @@ -21399,7 +19671,7 @@ parameters: - message: '#^Variable \$outputfilezip might not be defined\.$#' identifier: variable.undefined - count: 3 + count: 1 path: ../../../htdocs/modulebuilder/index.php - @@ -21498,12 +19770,6 @@ parameters: count: 3 path: ../../../htdocs/modulebuilder/template/class/api_mymodule.class.php - - - message: '#^Parameter \#1 \$data of method MyModuleApi\:\:_validateMyObject\(\) expects array\, list\\|null given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/modulebuilder/template/class/api_mymodule.class.php - - message: '#^Result of && is always false\.$#' identifier: booleanAnd.alwaysFalse @@ -21606,12 +19872,6 @@ parameters: count: 1 path: ../../../htdocs/modulebuilder/template/class/myobject.class.php - - - message: '#^Parameter \#1 \$params of method MyObject\:\:getTooltipContentArray\(\) expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/modulebuilder/template/class/myobject.class.php - - message: '#^Property CommonObject\:\:\$isextrafieldmanaged \(int\<0, 1\>\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -21642,30 +19902,6 @@ parameters: count: 1 path: ../../../htdocs/modulebuilder/template/core/modules/modMyModule.class.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, MyObject given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php - - message: '#^Property MyObject\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -21954,54 +20190,6 @@ parameters: count: 3 path: ../../../htdocs/mrp/class/api_mos.class.php - - - message: '#^Method Mos\:\:_validate\(\) has parameter \$data with no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../../htdocs/mrp/class/api_mos.class.php - - - - message: '#^Method Mos\:\:_validate\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../../htdocs/mrp/class/api_mos.class.php - - - - message: '#^Method Mos\:\:delete\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../../htdocs/mrp/class/api_mos.class.php - - - - message: '#^Method Mos\:\:index\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../../htdocs/mrp/class/api_mos.class.php - - - - message: '#^Method Mos\:\:post\(\) has parameter \$request_data with no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../../htdocs/mrp/class/api_mos.class.php - - - - message: '#^Method Mos\:\:produceAndConsume\(\) has parameter \$request_data with no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../../htdocs/mrp/class/api_mos.class.php - - - - message: '#^Method Mos\:\:produceAndConsumeAll\(\) has parameter \$request_data with no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../../htdocs/mrp/class/api_mos.class.php - - - - message: '#^Method Mos\:\:put\(\) has parameter \$request_data with no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../../htdocs/mrp/class/api_mos.class.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -22176,12 +20364,6 @@ parameters: count: 1 path: ../../../htdocs/mrp/mo_card.php - - - message: '#^Variable \$titlelist might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/mrp/mo_card.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -22212,12 +20394,6 @@ parameters: count: 1 path: ../../../htdocs/mrp/mo_movements.php - - - message: '#^Variable \$movement might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/mrp/mo_movements.php - - message: '#^Variable \$text might not be defined\.$#' identifier: variable.undefined @@ -22350,36 +20526,12 @@ parameters: count: 1 path: ../../../htdocs/opcachepreload.php - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/opensurvey/card.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/opensurvey/card.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/opensurvey/card.php - - message: '#^Variable \$id might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/opensurvey/card.php - - - message: '#^Variable \$userstatic might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/opensurvey/card.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -22393,14 +20545,14 @@ parameters: path: ../../../htdocs/opensurvey/class/opensurveysondage.class.php - - message: '#^Method Opensurveysondage\:\:fetchAll\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue + message: '#^Negated boolean expression is always true\.$#' + identifier: booleanNot.alwaysTrue count: 1 path: ../../../htdocs/opensurvey/class/opensurveysondage.class.php - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue + message: '#^PHPDoc type array\\> of property Opensurveysondage\:\:\$lines is not covariant with PHPDoc type array\ of overridden property CommonObject\:\:\$lines\.$#' + identifier: property.phpDocType count: 1 path: ../../../htdocs/opensurvey/class/opensurveysondage.class.php @@ -22464,12 +20616,6 @@ parameters: count: 1 path: ../../../htdocs/opensurvey/results.php - - - message: '#^Variable \$cleinsertion might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/opensurvey/results.php - - message: '#^Variable \$erreur_ajout_date in isset\(\) always exists and is not nullable\.$#' identifier: isset.variable @@ -22482,42 +20628,6 @@ parameters: count: 1 path: ../../../htdocs/opensurvey/results.php - - - message: '#^Variable \$meilleurecolonne might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/opensurvey/results.php - - - - message: '#^Variable \$modifier might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/opensurvey/results.php - - - - message: '#^Variable \$userstatic might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/opensurvey/results.php - - - - message: '#^Variable \$allow_comments might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/opensurvey/wizard/create_survey.php - - - - message: '#^Variable \$allow_spy might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/opensurvey/wizard/create_survey.php - - - - message: '#^Variable \$champdatefin might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/opensurvey/wizard/create_survey.php - - message: '#^Left side of && is always false\.$#' identifier: booleanAnd.leftAlwaysFalse @@ -22806,12 +20916,6 @@ parameters: count: 2 path: ../../../htdocs/product/admin/product.php - - - message: '#^Variable \$mc might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/admin/product.php - - message: '#^Variable \$obj might not be defined\.$#' identifier: variable.undefined @@ -22872,12 +20976,6 @@ parameters: count: 1 path: ../../../htdocs/product/card.php - - - message: '#^Variable \$prod might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/card.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -23406,18 +21504,6 @@ parameters: count: 1 path: ../../../htdocs/product/document.php - - - message: '#^Variable \$upload_dir might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/document.php - - - - message: '#^Variable \$upload_dirold might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/document.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -23496,12 +21582,6 @@ parameters: count: 1 path: ../../../htdocs/product/inventory/card.php - - - message: '#^Variable \$text might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/inventory/card.php - - message: '#^Call to function method_exists\(\) with \$this\(Inventory\) and ''getLibStatut'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -23526,18 +21606,6 @@ parameters: count: 2 path: ../../../htdocs/product/list.php - - - message: '#^Variable \$perm might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/list.php - - - - message: '#^Variable \$workstation_static might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/product/list.php - - message: '#^Loose comparison using \=\= between ''add_customer_price'' and ''add_customer_price'' will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -23562,12 +21630,6 @@ parameters: count: 2 path: ../../../htdocs/product/price.php - - - message: '#^Parameter \#4 \$txtva of function calcul_price_total expects float, string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/product/price.php - - message: '#^Result of && is always false\.$#' identifier: booleanAnd.alwaysFalse @@ -23598,24 +21660,12 @@ parameters: count: 1 path: ../../../htdocs/product/price.php - - - message: '#^Variable \$ii might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/price.php - - message: '#^Variable \$lineid might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/product/price.php - - - message: '#^Variable \$maxpricesupplier might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/price.php - - message: '#^Variable \$obj might not be defined\.$#' identifier: variable.undefined @@ -23634,12 +21684,6 @@ parameters: count: 2 path: ../../../htdocs/product/price.php - - - message: '#^Variable \$soc might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/price.php - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue @@ -23850,24 +21894,6 @@ parameters: count: 1 path: ../../../htdocs/product/stats/supplier_proposal.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/card.php - - - - message: '#^Variable \$lastmovementdate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/card.php - - - - message: '#^Variable \$pricemin might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/card.php - - message: '#^Method StockMovements\:\:index\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -24054,12 +22080,6 @@ parameters: count: 2 path: ../../../htdocs/product/stock/info.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/info.php - - message: '#^Variable \$socid might not be defined\.$#' identifier: variable.undefined @@ -24102,12 +22122,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/list.php - - - message: '#^Variable \$totalnboflines might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/list.php - - message: '#^Comparison operation "\<" between 0 and 0 is always false\.$#' identifier: smaller.alwaysFalse @@ -24180,12 +22194,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/movement_card.php - - - message: '#^Variable \$batch might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/movement_card.php - - message: '#^Variable \$comref might not be defined\.$#' identifier: variable.undefined @@ -24210,18 +22218,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/movement_card.php - - - message: '#^Variable \$eatby might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/movement_card.php - - - - message: '#^Variable \$lastmovementdate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/movement_card.php - - message: '#^Variable \$massaction might not be defined\.$#' identifier: variable.undefined @@ -24234,36 +22230,12 @@ parameters: count: 3 path: ../../../htdocs/product/stock/movement_card.php - - - message: '#^Variable \$result1 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/movement_card.php - - - - message: '#^Variable \$result2 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/movement_card.php - - message: '#^Variable \$sall might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/product/stock/movement_card.php - - - message: '#^Variable \$sellby might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/movement_card.php - - - - message: '#^Variable \$srcwarehouseid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/movement_card.php - - message: '#^Variable \$toselect might not be defined\.$#' identifier: variable.undefined @@ -24378,42 +22350,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/product.php - - - message: '#^Variable \$batch might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$eatby might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$lastmovementdate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$result1 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$result2 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$sellby might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/product.php - - message: '#^Variable \$sortfield might not be defined\.$#' identifier: variable.undefined @@ -24426,18 +22362,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/product.php - - - message: '#^Variable \$srcwarehouseid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$variants might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/product/stock/product.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -24462,36 +22386,18 @@ parameters: count: 1 path: ../../../htdocs/product/stock/replenish.php - - - message: '#^Variable \$lastWarehouseID might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/replenish.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 1 path: ../../../htdocs/product/stock/replenishorders.php - - - message: '#^Variable \$nbofmovement might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/stockatdate.php - - message: '#^Variable \$resql might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/product/stock/stockatdate.php - - - message: '#^Variable \$virtualstock might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/product/stock/stockatdate.php - - message: '#^Call to function property_exists\(\) with \$this\(StockTransfer\) and ''socid'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -24624,24 +22530,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/tpl/extrafields_add.tpl.php - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/product/stock/tpl/stockcorrection.tpl.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -24678,42 +22566,6 @@ parameters: count: 1 path: ../../../htdocs/projet/activity/perday.php - - - message: '#^Parameter \#11 \$isavailable of function projectLinesPerDay expects array\, afternoon\: int\<0, 1\>\}\>, non\-empty\-array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#6 \$projectsrole of function projectLinesPerDay expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#7 \$tasksrole of function projectLinesPerDay expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perday.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -24750,18 +22602,6 @@ parameters: count: 1 path: ../../../htdocs/projet/activity/permonth.php - - - message: '#^Parameter \#7 \$projectsrole of function projectLinesPerMonth expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/permonth.php - - - - message: '#^Parameter \#8 \$tasksrole of function projectLinesPerMonth expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/permonth.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -24798,24 +22638,6 @@ parameters: count: 1 path: ../../../htdocs/projet/activity/perweek.php - - - message: '#^Parameter \#11 \$isavailable of function projectLinesPerWeek expects array\, afternoon\: int\<0, 1\>\}\>, non\-empty\-array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perweek.php - - - - message: '#^Parameter \#7 \$projectsrole of function projectLinesPerWeek expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perweek.php - - - - message: '#^Parameter \#8 \$tasksrole of function projectLinesPerWeek expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perweek.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -25146,12 +22968,6 @@ parameters: count: 1 path: ../../../htdocs/projet/contact.php - - - message: '#^Variable \$formconfirmtoaddtasks might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/projet/contact.php - - message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -25170,30 +22986,6 @@ parameters: count: 1 path: ../../../htdocs/projet/element.php - - - message: '#^PHPDoc tag @var has invalid value \(\$loanSchedule LoanSchedule\)\: Unexpected token "\$loanSchedule", expected type at offset 20 on line 2$#' - identifier: phpDoc.parseError - count: 1 - path: ../../../htdocs/projet/element.php - - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/projet/element.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/projet/element.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/projet/element.php - - message: '#^Variable \$margin in isset\(\) always exists and is not nullable\.$#' identifier: isset.variable @@ -25248,12 +23040,6 @@ parameters: count: 1 path: ../../../htdocs/projet/ganttview.php - - - message: '#^Variable \$userWrite might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/projet/ganttview.php - - message: '#^Variable \$colorseries might not be defined\.$#' identifier: variable.undefined @@ -25392,18 +23178,6 @@ parameters: count: 1 path: ../../../htdocs/projet/note.php - - - message: '#^Variable \$px2 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/projet/stats/index.php - - - - message: '#^Variable \$px3 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/projet/stats/index.php - - message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -25440,12 +23214,6 @@ parameters: count: 1 path: ../../../htdocs/projet/tasks.php - - - message: '#^Variable \$userWrite might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/projet/tasks.php - - message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -25734,12 +23502,6 @@ parameters: count: 1 path: ../../../htdocs/projet/tasks/time.php - - - message: '#^Variable \$allprojectforuser might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/projet/tasks/time.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -25752,12 +23514,6 @@ parameters: count: 1 path: ../../../htdocs/projet/tasks/time.php - - - message: '#^Variable \$valtoshow might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/projet/tasks/time.php - - message: '#^Unable to resolve the template type T in call to function dol_sort_array$#' identifier: argument.templateType @@ -25980,18 +23736,6 @@ parameters: count: 1 path: ../../../htdocs/public/members/public_card.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: ../../../htdocs/public/members/public_card.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 17 - path: ../../../htdocs/public/members/public_card.php - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -26007,7 +23751,7 @@ parameters: - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue - count: 2 + count: 1 path: ../../../htdocs/public/onlinesign/newonlinesign.php - @@ -26040,12 +23784,6 @@ parameters: count: 2 path: ../../../htdocs/public/onlinesign/newonlinesign.php - - - message: '#^Variable \$source in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 2 - path: ../../../htdocs/public/onlinesign/newonlinesign.php - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue @@ -26058,12 +23796,6 @@ parameters: count: 1 path: ../../../htdocs/public/opensurvey/index.php - - - message: '#^Variable \$modifier might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/public/opensurvey/studs.php - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -26088,12 +23820,6 @@ parameters: count: 1 path: ../../../htdocs/public/payment/newpayment.php - - - message: '#^Parameter \#1 \$paymentAmount of function print_paypal_redirect expects float, string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/public/payment/newpayment.php - - message: '#^Variable \$attendee might not be defined\.$#' identifier: variable.undefined @@ -26154,12 +23880,6 @@ parameters: count: 1 path: ../../../htdocs/public/payment/paymentko.php - - - message: '#^Variable \$FinalPaymentAmt might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/public/payment/paymentko.php - - message: '#^Variable \$user might not be defined\.$#' identifier: variable.undefined @@ -26190,24 +23910,6 @@ parameters: count: 1 path: ../../../htdocs/public/payment/paymentok.php - - - message: '#^Variable \$autocreatethirdparty might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/public/payment/paymentok.php - - - - message: '#^Variable \$crowid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/public/payment/paymentok.php - - - - message: '#^Variable \$paymentTypeId might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/public/payment/paymentok.php - - message: '#^Variable \$service might not be defined\.$#' identifier: variable.undefined @@ -26406,12 +24108,6 @@ parameters: count: 1 path: ../../../htdocs/public/project/viewandvote.php - - - message: '#^Variable \$votestatus might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/public/project/viewandvote.php - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue @@ -26502,12 +24198,6 @@ parameters: count: 2 path: ../../../htdocs/public/stripe/ipn.php - - - message: '#^Variable \$directdebitorcreditransfer_id might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/public/stripe/ipn.php - - message: '#^Variable \$error in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -26520,12 +24210,6 @@ parameters: count: 1 path: ../../../htdocs/public/stripe/ipn.php - - - message: '#^Variable \$pdid might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/public/stripe/ipn.php - - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue @@ -26622,24 +24306,6 @@ parameters: count: 2 path: ../../../htdocs/public/ticket/create_ticket.php - - - message: '#^Parameter \#1 \$filenb of function dol_remove_file_process expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/public/ticket/create_ticket.php - - - - message: '#^Variable \$cid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/public/ticket/create_ticket.php - - - - message: '#^Variable \$old_MAIN_MAIL_AUTOCOPY_TO might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/public/ticket/create_ticket.php - - message: '#^Variable \$user might not be defined\.$#' identifier: variable.undefined @@ -26688,12 +24354,6 @@ parameters: count: 2 path: ../../../htdocs/public/ticket/view.php - - - message: '#^Variable \$display_ticket might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/public/ticket/view.php - - message: '#^Variable \$user might not be defined\.$#' identifier: variable.undefined @@ -26880,12 +24540,6 @@ parameters: count: 1 path: ../../../htdocs/reception/card.php - - - message: '#^Variable \$editColspan might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/reception/card.php - - message: '#^Variable \$extrafields in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -26916,12 +24570,6 @@ parameters: count: 1 path: ../../../htdocs/reception/card.php - - - message: '#^Variable \$outputlangs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/reception/card.php - - message: '#^Variable \$reception might not be defined\.$#' identifier: variable.undefined @@ -26934,24 +24582,6 @@ parameters: count: 1 path: ../../../htdocs/reception/card.php - - - message: '#^Variable \$rowEnd might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/reception/card.php - - - - message: '#^Variable \$rowExtrafieldsView might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/reception/card.php - - - - message: '#^Variable \$typeobject might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../../htdocs/reception/card.php - - message: '#^Call to function method_exists\(\) with \$this\(Reception\) and ''getLibStatut'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -27144,60 +24774,18 @@ parameters: count: 6 path: ../../../htdocs/reception/contact.php - - - message: '#^Variable \$origin might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../../htdocs/reception/contact.php - - message: '#^Variable \$result might not be defined\.$#' identifier: variable.undefined count: 2 path: ../../../htdocs/reception/contact.php - - - message: '#^Variable \$typeobject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/reception/contact.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse count: 1 path: ../../../htdocs/reception/dispatch.php - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/reception/dispatch.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/reception/dispatch.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/reception/dispatch.php - - - - message: '#^Variable \$modebatch might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/reception/dispatch.php - - - - message: '#^Variable \$nbproduct might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/reception/dispatch.php - - message: '#^Variable \$objectsrc might not be defined\.$#' identifier: variable.undefined @@ -27210,18 +24798,6 @@ parameters: count: 1 path: ../../../htdocs/reception/dispatch.php - - - message: '#^Variable \$saveprice might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/reception/dispatch.php - - - - message: '#^Variable \$typeobject might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/reception/dispatch.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -27258,18 +24834,6 @@ parameters: count: 1 path: ../../../htdocs/reception/list.php - - - message: '#^Variable \$show_files might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/reception/list.php - - - - message: '#^Variable \$soc might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/reception/list.php - - message: '#^Variable \$type might not be defined\.$#' identifier: variable.undefined @@ -27282,18 +24846,6 @@ parameters: count: 1 path: ../../../htdocs/reception/note.php - - - message: '#^Variable \$morejs might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/reception/note.php - - - - message: '#^Variable \$origin might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../../htdocs/reception/note.php - - message: '#^Unable to resolve the template type T in call to function dol_sort_array$#' identifier: argument.templateType @@ -27516,12 +25068,6 @@ parameters: count: 1 path: ../../../htdocs/recruitment/class/recruitmentjobposition.class.php - - - message: '#^Method RecruitmentJobPosition\:\:getLinesArray\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../../htdocs/recruitment/class/recruitmentjobposition.class.php - - message: '#^Property CommonObject\:\:\$ismultientitymanaged \(int\<0, 1\>\|string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -27534,30 +25080,6 @@ parameters: count: 1 path: ../../../htdocs/recruitment/class/recruitmentjobposition.class.php - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, RecruitmentJobPosition given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php - - - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_object\(\) expects CommonObject, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php - - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php - - - - message: '#^Parameter \#3 \$object of function complete_substitutions_array expects CommonObject\|null, array\ given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php - - message: '#^Property RecruitmentJobPosition\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -27636,12 +25158,6 @@ parameters: count: 1 path: ../../../htdocs/recruitment/recruitmentcandidature_card.php - - - message: '#^Variable \$formquestion might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/recruitment/recruitmentcandidature_card.php - - message: '#^Variable \$text might not be defined\.$#' identifier: variable.undefined @@ -27660,12 +25176,6 @@ parameters: count: 1 path: ../../../htdocs/recruitment/recruitmentcandidature_list.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/recruitment/recruitmentcandidature_list.php - - message: '#^Variable \$maxlength might not be defined\.$#' identifier: variable.undefined @@ -27678,12 +25188,6 @@ parameters: count: 1 path: ../../../htdocs/recruitment/recruitmentcandidature_list.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/recruitment/recruitmentjobposition_agenda.php - - message: '#^Property RecruitmentJobPosition\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -27738,12 +25242,6 @@ parameters: count: 1 path: ../../../htdocs/recruitment/recruitmentjobposition_card.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/recruitment/recruitmentjobposition_document.php - - message: '#^Variable \$maxlength might not be defined\.$#' identifier: variable.undefined @@ -27762,12 +25260,6 @@ parameters: count: 1 path: ../../../htdocs/recruitment/recruitmentjobposition_list.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/recruitment/recruitmentjobposition_note.php - - message: '#^Variable \$maxlength might not be defined\.$#' identifier: variable.undefined @@ -28164,18 +25656,6 @@ parameters: count: 2 path: ../../../htdocs/salaries/list.php - - - message: '#^Variable \$aBill might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/salaries/list.php - - - - message: '#^Variable \$numprlv might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/salaries/list.php - - message: '#^Variable \$selected might not be defined\.$#' identifier: variable.undefined @@ -28236,12 +25716,6 @@ parameters: count: 1 path: ../../../htdocs/salaries/virement_request.php - - - message: '#^Variable \$numOfBp might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/salaries/virement_request.php - - message: '#^Variable \$mc might not be defined\.$#' identifier: variable.undefined @@ -28272,12 +25746,6 @@ parameters: count: 1 path: ../../../htdocs/societe/ajax/company.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/societe/canvas/company/tpl/card_view.tpl.php - - message: '#^Variable \$formfile might not be defined\.$#' identifier: variable.undefined @@ -30114,18 +27582,6 @@ parameters: count: 7 path: ../../../htdocs/user/card.php - - - message: '#^Variable \$dolibarr_main_authentication might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: ../../../htdocs/user/card.php - - - - message: '#^Variable \$formproduct might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/user/card.php - - message: '#^Variable \$mc might not be defined\.$#' identifier: variable.undefined @@ -31332,12 +28788,6 @@ parameters: count: 2 path: ../../../htdocs/workstation/workstation_card.php - - - message: '#^Variable \$formquestion might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/workstation/workstation_card.php - - message: '#^Variable \$upload_dir might not be defined\.$#' identifier: variable.undefined diff --git a/dev/setup/pre-commit/README.md b/dev/setup/pre-commit/README.md index f256cbf26e8..71318703b91 100644 --- a/dev/setup/pre-commit/README.md +++ b/dev/setup/pre-commit/README.md @@ -32,8 +32,13 @@ the project: `pre-commit-config.yaml`. Then you can install pre-commit tool:\ `python3 -m pip install pre-commit` + or + `python3 -m pip install pre-commit --break-system-packages` -2. In your local git clone of the project, run `pre-commit install` to add the hooks + Then install phpcbf and phpcs:\ + `sudo apt install php-codesniffer` + +3. In your local git clone of the project, run `pre-commit install` to add the hooks or copy the file *dev/setup/git/hooks/pre-commit* manually into *.git/hooks/pre-commit* (recommended because this file may differ from the file installed with the pre-commit install). The good file redirects output to the error channel so your IDE will be able to catch the error. diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index f69251c12c0..e4bac1868cc 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,35 +9,34 @@ */ return [ // # Issue statistics: - // PhanUndeclaredProperty : 540+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 210+ occurrences - // PhanUndeclaredGlobalVariable : 210+ occurrences - // PhanPluginUnknownArrayMethodReturnType : 180+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 160+ occurrences - // PhanTypeMismatchProperty : 140+ occurrences - // PhanPluginUnknownArrayMethodParamType : 120+ occurrences - // PhanRedefineFunction : 45+ occurrences - // PhanPluginUndeclaredVariableIsset : 40+ occurrences + // PhanTypeMismatchArgument : 1690+ occurrences + // PhanUndeclaredProperty : 500+ occurrences + // PhanTypeMismatchArgumentNullable : 350+ occurrences + // PhanPluginUnknownArrayMethodReturnType : 170+ occurrences + // PhanUndeclaredGlobalVariable : 160+ occurrences + // PhanTypeMismatchProperty : 120+ occurrences + // PhanPluginUnknownArrayMethodParamType : 110+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 75+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 65+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences // PhanTypeInvalidDimOffset : 25+ occurrences - // PhanTypeMismatchDimFetch : 25+ occurrences - // PhanTypeMismatchArgumentNullableInternal : 20+ occurrences + // PhanTypeMismatchDimFetch : 20+ occurrences + // PhanPluginUndeclaredVariableIsset : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences - // PhanTypeComparisonFromArray : 10+ occurrences + // PhanTypeMismatchArgumentNullableInternal : 10+ occurrences // PhanUndeclaredMethod : 10+ occurrences - // PhanPluginUnknownObjectMethodCall : 8 occurrences - // PhanEmptyForeach : 7 occurrences - // PhanPluginEmptyStatementIf : 7 occurrences - // PhanPluginSuspiciousParamPosition : 7 occurrences + // PhanTypeComparisonFromArray : 8 occurrences // PhanPluginDuplicateExpressionBinaryOp : 6 occurrences // PhanTypeArraySuspiciousNull : 6 occurrences // PhanParamTooMany : 5 occurrences - // PhanPluginBothLiteralsBinaryOp : 4 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences + // PhanPluginSuspiciousParamPosition : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanInvalidFQSENInClasslike : 3 occurrences + // PhanPluginBothLiteralsBinaryOp : 3 occurrences + // PhanPluginEmptyStatementIf : 2 occurrences + // PhanRedefineFunction : 2 occurrences // PhanTypeMismatchDimAssignment : 2 occurrences - // PhanTypeMismatchDimFetchNullable : 2 occurrences // PhanTypeSuspiciousStringExpression : 2 occurrences // PhanAccessMethodProtected : 1 occurrence // PhanPluginDuplicateExpressionAssignmentOperation : 1 occurrence @@ -47,154 +46,436 @@ return [ // Currently, file_suppressions and directory_suppressions are the only supported suppressions 'file_suppressions' => [ - 'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/adherents/type.php' => ['PhanTypeMismatchProperty'], + 'htdocs/accountancy/admin/account.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/admin/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/admin/categories.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/admin/categories_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/admin/fiscalyear_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/admin/journals_list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/admin/report_list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/admin/subaccount.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/bookkeeping/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/bookkeeping/export.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/bookkeeping/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/bookkeeping/listbyaccount.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/accountancy/class/accountingjournal.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/class/bookkeeping.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/class/lettering.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/closure/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/customer/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/customer/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/expensereport/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/expensereport/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/journal/bankjournal.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/journal/expensereportsjournal.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/journal/purchasesjournal.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/journal/sellsjournal.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/journal/variousjournal.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/supplier/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/accountancy/supplier/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/accountancy/tpl/export_journal.tpl.php' => ['PhanTypeMismatchArgument'], + 'htdocs/adherents/admin/member.php' => ['PhanTypeMismatchArgument'], + 'htdocs/adherents/admin/website.php' => ['PhanTypeMismatchArgument'], + 'htdocs/adherents/canvas/actions_adherentcard_common.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/adherents/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/adherents/class/adherent.class.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/adherents/class/adherent_type.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/adherents/class/api_members.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/adherents/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/adherents/stats/geo.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/adherents/subscription.php' => ['PhanTypeMismatchArgument'], + 'htdocs/adherents/type.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], + 'htdocs/adherents/vcard.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/agenda_other.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/admin/agenda_reminder.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/admin/barcode.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/bom.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/company.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/defaultvalues.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/admin/dict.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/emailcollector_card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/emailcollector_list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/eventorganization.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/expensereport_rules.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/external_rss.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/hrm.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/knowledgemanagement.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/mails.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/mails_emailing.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/admin/mails_passwordreset.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/admin/mails_senderprofile_list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/mails_templates.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/admin/mails_ticket.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/admin/menus/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/multicurrency.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/paymentbybanktransfer.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/pdf_other.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/prelevement.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/receiptprinter.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/remotestore/class/PSWebServiceLibrary.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/admin/remotestore/class/dolistore.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/system/filecheck.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/system/modules.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/taxes.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/admin/ticket.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/tools/export.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/webhook.php' => ['PhanTypeMismatchArgument'], + 'htdocs/admin/website.php' => ['PhanTypeMismatchArgument'], 'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'], - 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/api/class/api_setup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], + 'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], + 'htdocs/api/class/api_setup.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], 'htdocs/api/class/api_status.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset'], + 'htdocs/asset/admin/setup.php' => ['PhanTypeMismatchArgument'], + 'htdocs/asset/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/asset/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/asset/model/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/asterisk/wrapper.php' => ['PhanRedefineFunction'], - 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/bom/bom_card.php' => ['PhanUndeclaredProperty'], + 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/bom/bom_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/bom/class/api_boms.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'], + 'htdocs/bom/class/bom.class.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/bom/tpl/linkedobjectblock.tpl.php' => ['PhanTypeMismatchArgument'], + 'htdocs/bom/tpl/objectline_create.tpl.php' => ['PhanTypeMismatchArgument'], + 'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/bookcal/availabilities_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/bookcal/availabilities_list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/bookcal/booking_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/bookcal/calendar_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/bookcal/calendar_document.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/bookcal/calendar_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/bookmarks/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected', 'PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'], + 'htdocs/categories/class/categorie.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/categories/photos.php' => ['PhanTypeMismatchArgument'], + 'htdocs/categories/viewcat.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/collab/index.php' => ['PhanParamTooMany', 'PhanUndeclaredProperty'], - 'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp'], + 'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchArgument'], + 'htdocs/comm/action/class/actioncomm.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/comm/action/class/api_agendaevents.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchProperty'], 'htdocs/comm/action/class/cactioncomm.class.php' => ['PhanPluginUnknownArrayPropertyType'], - 'htdocs/comm/action/index.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'], - 'htdocs/comm/action/info.php' => ['PhanUndeclaredProperty'], - 'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchDimFetch'], - 'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray'], - 'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/comm/mailing/cibles.php' => ['PhanUndeclaredProperty'], + 'htdocs/comm/action/document.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'], + 'htdocs/comm/action/info.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/comm/action/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch'], + 'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchArgument'], + 'htdocs/comm/action/rapport/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/comm/mailing/cibles.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/comm/mailing/class/advtargetemailing.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'], - 'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'], + 'htdocs/comm/multiprix.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/propal/agenda.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/propal/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'], 'htdocs/comm/propal/class/api_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/comm/propal/list.php' => ['PhanUndeclaredProperty'], + 'htdocs/comm/propal/class/propal.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/comm/propal/class/propaleligne.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/propal/contact.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/propal/document.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/propal/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/comm/propal/note.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/propal/stats/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/comm/remise.php' => ['PhanTypeMismatchArgument'], + 'htdocs/comm/remx.php' => ['PhanTypeMismatchArgument'], + 'htdocs/commande/agenda.php' => ['PhanTypeMismatchArgument'], + 'htdocs/commande/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], + 'htdocs/commande/class/commande.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/commande/class/orderline.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/commande/contact.php' => ['PhanTypeMismatchArgument'], 'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/commande/list.php' => ['PhanUndeclaredProperty'], - 'htdocs/commande/list_det.php' => ['PhanTypeInvalidDimOffset'], + 'htdocs/commande/document.php' => ['PhanTypeMismatchArgument'], + 'htdocs/commande/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/commande/list_det.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/commande/note.php' => ['PhanTypeMismatchArgument'], + 'htdocs/commande/stats/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], + 'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/compta/bank/class/account.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/bank/class/api_bankaccounts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/compta/bank/annuel.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/bank/bankentries_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/bank/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/bank/categ.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/bank/class/account.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/compta/bank/class/api_bankaccounts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/compta/bank/class/paymentvarious.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/bank/graph.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/bank/line.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/compta/bank/various_payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/compta/bank/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/bank/releve.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/bank/transfer.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/bank/treso.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/bank/various_payment/card.php' => ['PhanUndeclaredProperty'], + 'htdocs/compta/bank/various_payment/document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/compta/bank/various_payment/info.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchProperty'], - 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/facture/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], + 'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/deplacement/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/deplacement/class/deplacement.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/deplacement/class/deplacementstats.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/deplacement/stats/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/agenda-rec.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/agenda.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/facture/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/compta/facture/class/facture.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/compta/facture/class/factureligne.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/class/paymentterm.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/contact.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/document.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/invoicetemplate_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/facture/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/facture/messaging.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/note.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/prelevement.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/facture/stats/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/facture/tpl/linkedobjectblock.tpl.php' => ['PhanEmptyFQSENInClasslike', 'PhanInvalidFQSENInClasslike', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/localtax/card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/compta/localtax/clients.php' => ['PhanTypeExpectedObjectPropAccess'], + 'htdocs/compta/localtax/clients.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument'], + 'htdocs/compta/localtax/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/compta/paiement.php' => ['PhanTypeMismatchDimFetch'], - 'htdocs/compta/paiement/card.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/sociales/card.php' => ['PhanUndeclaredProperty'], + 'htdocs/compta/paiement.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch'], + 'htdocs/compta/paiement/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/compta/paiement/cheque/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/paiement/cheque/class/remisecheque.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/paiement/class/paiement.class.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/paiement/rapport.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/prelevement/class/rejetprelevement.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/prelevement/create.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/prelevement/demandes.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/prelevement/line.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/resultat/clientfourn.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/resultat/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/resultat/projects.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/resultat/result.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/sociales/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/compta/sociales/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/sociales/payments.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/stats/cabyprodserv.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/stats/supplier_turnover_by_prodserv.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/compta/stats/supplier_turnover_by_thirdparty.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/tva/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'], - 'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'], - 'htdocs/contrat/agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/contrat/card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/compta/tva/class/tva.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], + 'htdocs/compta/tva/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/tva/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], + 'htdocs/contact/ajax/contact.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/contact/canvas/actions_contactcard_common.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contact/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contact/class/contact.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/contact/consumption.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contact/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/contrat/agenda.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/contrat/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], + 'htdocs/contrat/class/contrat.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contrat/class/contratligne.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contrat/contact.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contrat/document.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contrat/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contrat/messaging.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contrat/note.php' => ['PhanTypeMismatchArgument'], + 'htdocs/contrat/services_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], - 'htdocs/core/actions_massactions.inc.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/actions_printing.inc.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/actions_extrafields.inc.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/actions_lineupdown.inc.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/actions_massactions.inc.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/ajax/ajaxdirpreview.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/ajax/ajaxstatusprospect.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/ajax/contacts.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/ajax/editinline.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/ajax/loadinplace.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/ajax/saveinplace.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/ajax/selectobject.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/core/class/CMailFile.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'], - 'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/ccountry.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/core/class/commondocgenerator.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/commoninvoice.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/commonsocialnetworks.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/commonstickergenerator.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/conf.class.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'], + 'htdocs/core/class/cregion.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/cstate.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/ctypent.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/ctyperesource.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/cunits.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/doleditor.class.php' => ['PhanPluginDuplicateExpressionAssignmentOperation'], 'htdocs/core/class/dolgraph.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/dolreceiptprinter.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/emailsenderprofile.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/evalmath.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/extrafields.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/fileupload.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/fiscalyear.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/hookmanager.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/html.formcompany.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/html.formfile.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/html.formmail.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/html.form.class.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/core/class/html.formcompany.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/class/html.formfile.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/html.formmail.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/class/html.formother.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/html.formsetup.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/class/link.class.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/core/class/menubase.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/openid.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/rssparser.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/timespent.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/core/customreports.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/lib/admin.lib.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/lib/files.lib.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/lib/agenda.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/ajax.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/barcode.lib.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/core/lib/company.lib.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/lib/date.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/expedition.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/files.lib.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/lib/functions.lib.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/lib/functions2.lib.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/lib/pdf.lib.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/lib/xcal.lib.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/lib/functionsnumtoword.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/images.lib.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/core/lib/invoice.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/loan.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/modulebuilder.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/pdf.lib.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/lib/product.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/project.lib.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/lib/security.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/sendings.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/website.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/lib/xcal.lib.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/login/functions_dolibarr.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/login/functions_ldap.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/commande/mod_commande_saphir.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/expensereport/mod_expensereport_jade.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/facture/modules_facture.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/fichinter/mod_arctic.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'], + 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'], + 'htdocs/core/modules/member/doc/pdf_standard_member.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/member/modules_cards.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modAdherent.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modCommande.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modContrat.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modDon.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modExpedition.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modExpenseReport.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modFacture.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modFicheinter.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modFournisseur.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modHRM.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modMrp.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modPrelevement.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modProjet.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modPropale.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modReceiptPrinter.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modReception.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modStock.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modSupplierProposal.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/modTicket.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/societe/doc/doc_generic_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchProperty'], - 'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'], + 'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'], + 'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/tpl/extrafields_view.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/multicompany_page.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/search_page.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/tpl/extrafields_list_array_fields.tpl.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/tpl/extrafields_list_print_fields.tpl.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/core/tpl/extrafields_view.tpl.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/core/tpl/notes.tpl.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/core/tpl/object_discounts.tpl.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/tpl/objectline_edit.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/tpl/objectlinked_lineimport.tpl.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/resource_view.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/dav/dav.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/debugbar/class/TraceableDB.php' => ['PhanTypeMismatchArgument'], 'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'], 'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'], 'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -203,48 +484,73 @@ return [ 'htdocs/don/info.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/don/list.php' => ['PhanTypeMismatchProperty'], 'htdocs/don/note.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ecm/class/ecmfiles.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ecm/dir_add_card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ecm/file_card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ecm/file_note.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ecm/search.php' => ['PhanTypeMismatchArgument'], + 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanTypeMismatchArgument'], + 'htdocs/eventorganization/conferenceorbooth_document.php' => ['PhanTypeMismatchArgument'], + 'htdocs/eventorganization/conferenceorbooth_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/eventorganization/conferenceorboothattendee_card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanUndeclaredProperty'], - 'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/expedition/ajax/searchfrombarcode.php' => ['PhanTypeMismatchArgument'], + 'htdocs/expedition/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/expedition/class/api_shipments.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/expensereport/card.php' => ['PhanUndeclaredProperty'], + 'htdocs/expedition/class/expedition.class.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/expedition/class/expeditionlinebatch.class.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/expedition/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/expedition/stats/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/expensereport/ajax/ajaxik.php' => ['PhanTypeMismatchArgument'], + 'htdocs/expensereport/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/expensereport/class/api_expensereports.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/expensereport/class/expensereportline.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/expensereport/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/expensereport/payment/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/payment/info.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/expensereport/payment/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], + 'htdocs/exports/class/export.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/exports/export.php' => ['PhanTypeMismatchArgument'], 'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/fichinter/agenda.php' => ['PhanTypeMismatchArgument'], 'htdocs/fichinter/card-rec.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/fichinter/class/fichinter.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/fichinter/contact.php' => ['PhanTypeMismatchArgument'], + 'htdocs/fichinter/document.php' => ['PhanTypeMismatchArgument'], + 'htdocs/fichinter/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/fichinter/note.php' => ['PhanTypeMismatchArgument'], + 'htdocs/fichinter/stats/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/filefunc.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], 'htdocs/fourn/class/api_supplier_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/fourn/class/fournisseur.commande.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/fourn/commande/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimAssignment', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'], - 'htdocs/fourn/commande/contact.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/commande/document.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/commande/info.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/commande/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/fourn/commande/note.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/contact.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fourn/facture/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/fourn/facture/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], - 'htdocs/fourn/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/fourn/class/fournisseur.commande.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/fourn/class/fournisseur.facture-rec.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/fourn/class/fournisseur.facture-rec.ligne.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/fourn/class/fournisseur.facture.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/fourn/class/fournisseur.facture.ligne.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/fourn/class/fournisseur.orderline.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/fourn/class/fournisseur.product.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/fourn/commande/card.php' => ['PhanTypeMismatchDimAssignment', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'], + 'htdocs/fourn/commande/dispatch.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/fourn/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/fourn/facture/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], 'htdocs/fourn/facture/paiement.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/fourn/facture/rapport.php' => ['PhanTypeMismatchArgument'], 'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/fourn/paiement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/ftp/admin/ftpclient.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/holiday/card_group.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], - 'htdocs/holiday/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/holiday/view_log.php' => ['PhanTypeMismatchDimFetch'], - 'htdocs/hrm/admin/admin_hrm.php' => ['PhanEmptyForeach'], + 'htdocs/holiday/card_group.php' => ['PhanTypeMismatchArgument'], + 'htdocs/holiday/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/hrm/class/evaluation.class.php' => ['PhanUndeclaredProperty'], 'htdocs/hrm/class/evaluationdet.class.php' => ['PhanUndeclaredProperty'], 'htdocs/hrm/class/job.class.php' => ['PhanUndeclaredProperty'], @@ -252,196 +558,127 @@ return [ 'htdocs/hrm/class/skill.class.php' => ['PhanUndeclaredProperty'], 'htdocs/hrm/class/skilldet.class.php' => ['PhanUndeclaredProperty'], 'htdocs/hrm/class/skillrank.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/hrm/core/tpl/objectline_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/hrm/evaluation_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/hrm/job_agenda.php' => ['PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/hrm/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'], + 'htdocs/hrm/evaluation_card.php' => ['PhanTypeMismatchArgument'], 'htdocs/hrm/job_card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/hrm/job_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/hrm/position_list.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/hrm/skill_card.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/hrm/skill_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/imports/emptyexample.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/imports/import.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/install/check.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/install/fileconf.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/install/inc.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/install/index.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/install/repair.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/install/step2.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/install/step5.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/imports/import.php' => ['PhanTypeMismatchArgument'], 'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], 'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/loan/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/loan/document.php' => ['PhanUndeclaredProperty'], 'htdocs/loan/note.php' => ['PhanUndeclaredProperty'], - 'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/margin/customerMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/margin/productMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/master.inc.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/mrp/class/api_mos.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/loan/payment/payment.php' => ['PhanUndeclaredProperty'], 'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchProperty'], - 'htdocs/mrp/mo_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/mrp/mo_movements.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], + 'htdocs/mrp/mo_movements.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/mrp/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/mrp/tpl/originproductline.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], 'htdocs/multicurrency/class/multicurrency.class.php' => ['PhanTypeExpectedObjectPropAccess'], - 'htdocs/opcachepreload.php' => ['PhanEmptyForeach'], - 'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanTypeMismatchProperty'], - 'htdocs/opensurvey/list.php' => ['PhanPluginUndeclaredVariableIsset'], - '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/multicurrency/multicurrency_rate.php' => ['PhanTypeMismatchArgument'], + 'htdocs/opensurvey/results.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/partnership/class/api_partnerships.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], 'htdocs/partnership/class/partnership.class.php' => ['PhanUndeclaredProperty'], 'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/partnership/partnership_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'], - 'htdocs/printing/index.php' => ['PhanUndeclaredProperty'], - 'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/ajax/products.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], + 'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'], 'htdocs/product/class/productfournisseurprice.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], - 'htdocs/product/document.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/product/index.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/inventory/class/inventory.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/product/inventory/inventory.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/inventory/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/product/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/product/price.php' => ['PhanUndeclaredProperty'], 'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'], - 'htdocs/product/stats/card.php' => ['PhanTypeComparisonFromArray'], - 'htdocs/product/stock/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], - 'htdocs/product/stock/class/api_stockmovements.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], + 'htdocs/product/stock/class/api_stockmovements.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], 'htdocs/product/stock/class/api_warehouses.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/product/stock/class/entrepot.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/product/stock/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/movement_list.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/product.php' => ['PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/product/stock/info.php' => ['PhanUndeclaredProperty'], + 'htdocs/product/stock/list.php' => ['PhanUndeclaredProperty'], + 'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/product/stock/movement_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], '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' => ['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'], 'htdocs/product/stock/stocktransfer/class/stocktransferline.class.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/stocktransfer/stocktransfer_card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/product/stock/stocktransfer/stocktransfer_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/stock/tpl/stockcorrection.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/ajax/projects.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/projet/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/element.php' => ['PhanUndeclaredProperty'], - 'htdocs/projet/ganttchart.inc.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/projet/ganttview.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/graph_opportunities.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], - 'htdocs/projet/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/projet/tasks.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/comment.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/task.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/time.php' => ['PhanEmptyForeach', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/projet/card.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], + 'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/public/agenda/agendaexport.php' => ['PhanRedefineFunction'], - 'htdocs/public/bookcal/index.php' => ['PhanRedefineFunction'], - 'htdocs/public/company/new.php' => ['PhanRedefineFunction'], - 'htdocs/public/cron/cron_run_jobs_by_url.php' => ['PhanUndeclaredProperty'], - 'htdocs/public/demo/index.php' => ['PhanRedefineFunction'], - 'htdocs/public/donations/donateurs_code.php' => ['PhanRedefineFunction'], - 'htdocs/public/emailing/mailing-read.php' => ['PhanRedefineFunction'], - 'htdocs/public/eventorganization/attendee_new.php' => ['PhanRedefineFunction'], - 'htdocs/public/eventorganization/subscriptionok.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/members/new.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/members/public_card.php' => ['PhanRedefineFunction'], - 'htdocs/public/members/public_list.php' => ['PhanRedefineFunction'], - 'htdocs/public/onlinesign/newonlinesign.php' => ['PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/public/opensurvey/studs.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/public/partnership/new.php' => ['PhanRedefineFunction'], + 'htdocs/public/company/new.php' => ['PhanTypeMismatchArgument'], + 'htdocs/public/eventorganization/subscriptionok.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/public/members/new.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/public/payment/newpayment.php' => ['PhanUndeclaredProperty'], - 'htdocs/public/payment/paymentko.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/project/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/project/new.php' => ['PhanRedefineFunction'], - 'htdocs/public/project/suggestbooth.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/public/project/suggestconference.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'], - 'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/public/payment/paymentok.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/public/project/index.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/public/project/suggestbooth.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/public/project/suggestconference.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/public/project/viewandvote.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/public/recruitment/view.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/public/webportal/webportal.main.inc.php' => ['PhanRedefineFunction'], - 'htdocs/public/website/index.php' => ['PhanRedefineFunction'], - 'htdocs/public/website/javascript.js.php' => ['PhanRedefineFunction'], - 'htdocs/public/website/styles.css.php' => ['PhanRedefineFunction'], - 'htdocs/reception/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/reception/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/reception/class/api_receptions.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/reception/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/reception/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/reception/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/reception/note.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/recruitment/admin/setup.php' => ['PhanEmptyForeach'], - 'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach'], + 'htdocs/reception/list.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/recruitment/index.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/recruitment/recruitmentcandidature_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/recruitment/recruitmentcandidature_list.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/recruitment/recruitmentjobposition_agenda.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], + 'htdocs/recruitment/recruitmentcandidature_card.php' => ['PhanUndeclaredProperty'], + 'htdocs/recruitment/recruitmentcandidature_list.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/recruitment/recruitmentjobposition_agenda.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/recruitmentjobposition_applications.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/recruitment/recruitmentjobposition_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/recruitment/recruitmentjobposition_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/salaries/admin/salaries.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/resource/class/dolresource.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/salaries/paiement_salary.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], - 'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/salaries/paiement_salary.php' => ['PhanUndeclaredProperty'], + 'htdocs/salaries/virement_request.php' => ['PhanUndeclaredProperty'], + 'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], + 'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/societe/canvas/actions_card_common.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/societe/canvas/company/actions_card_company.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/societe/card.php' => ['PhanTypeMismatchArgument'], 'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], - 'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'], - 'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], - 'htdocs/societe/price.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], + 'htdocs/societe/class/companybankaccount.class.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'], + 'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/societe/contact.php' => ['PhanTypeMismatchArgument'], + 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/societe/price.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition'], + 'htdocs/societe/website.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/stripe/admin/stripe.php' => ['PhanTypeMismatchArgument'], + 'htdocs/stripe/charge.php' => ['PhanTypeMismatchArgument'], + 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanTypeMismatchArgument'], 'htdocs/stripe/class/stripe.class.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty'], - 'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/stripe/lib/stripe.lib.php' => ['PhanTypeMismatchArgument'], + 'htdocs/supplier_proposal/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], - 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/supplier_proposal/contact.php' => ['PhanTypeMismatchArgument'], + 'htdocs/supplier_proposal/document.php' => ['PhanTypeMismatchArgument'], + 'htdocs/supplier_proposal/info.php' => ['PhanTypeMismatchArgument'], + 'htdocs/supplier_proposal/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/supplier_proposal/note.php' => ['PhanTypeMismatchArgument'], + 'htdocs/takepos/admin/bar.php' => ['PhanTypeMismatchArgument'], + 'htdocs/takepos/admin/terminal.php' => ['PhanTypeMismatchArgument'], + 'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgument', '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'], - 'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgument'], + 'htdocs/takepos/invoice.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/takepos/phone.php' => ['PhanTypeMismatchArgument'], + 'htdocs/takepos/send.php' => ['PhanTypeMismatchArgument'], 'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/theme/eldy/badges.inc.php' => ['PhanRedefineFunction'], 'htdocs/theme/eldy/btn.inc.php' => ['PhanUndeclaredGlobalVariable'], @@ -454,48 +691,69 @@ return [ 'htdocs/theme/md/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/md/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/md/progress.inc.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'], - 'htdocs/ticket/class/actions_ticket.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/ticket/agenda.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ticket/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/ticket/class/actions_ticket.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/ticket/class/ticket.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/user/card.php' => ['PhanTypeMismatchProperty'], - 'htdocs/user/class/api_users.class.php' => ['PhanTypeMismatchProperty'], - 'htdocs/user/class/user.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/ticket/class/ticket.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/ticket/class/ticketstats.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ticket/contact.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ticket/document.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/ticket/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ticket/messaging.php' => ['PhanTypeMismatchArgument'], + 'htdocs/ticket/stats/index.php' => ['PhanTypeMismatchArgument'], + 'htdocs/user/bank.php' => ['PhanTypeMismatchArgument'], + 'htdocs/user/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'], + 'htdocs/user/class/api_users.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], + 'htdocs/user/class/user.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/user/class/userbankaccount.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/user/class/usergroup.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/user/document.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/user/group/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/user/list.php' => ['PhanTypeMismatchArgument'], + 'htdocs/user/param_ihm.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/user/virtualcard.php' => ['PhanTypeMismatchArgument'], 'htdocs/variants/ajax/get_attribute_values.php' => ['PhanTypeComparisonFromArray'], - 'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], + 'htdocs/variants/card.php' => ['PhanTypeMismatchArgument'], + 'htdocs/variants/class/ProductAttribute.class.php' => ['PhanTypeMismatchArgumentNullable'], + 'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeMismatchArgument'], + 'htdocs/variants/combinations.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], + 'htdocs/variants/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/viewimage.php' => ['PhanRedefineFunction', 'PhanUndeclaredMethod'], + 'htdocs/viewimage.php' => ['PhanUndeclaredMethod'], 'htdocs/webhook/class/api_webhook.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/webhook/class/target.class.php' => ['PhanUndeclaredMethod'], 'htdocs/webhook/target_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/webhook/target_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/webportal/class/html.formcardwebportal.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanTypeInvalidDimOffset', 'PhanUndeclaredProperty'], + 'htdocs/webhook/target_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/webportal/admin/setup.php' => ['PhanTypeMismatchArgument'], + 'htdocs/webportal/class/html.formcardwebportal.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/webportal/class/html.formwebportal.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/webservices/server_actioncomm.php' => ['PhanUndeclaredProperty'], - 'htdocs/webservices/server_category.php' => ['PhanUndeclaredProperty'], - 'htdocs/webservices/server_contact.php' => ['PhanUndeclaredProperty'], - 'htdocs/webservices/server_invoice.php' => ['PhanUndeclaredProperty'], - 'htdocs/webservices/server_order.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidDimOffset', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'], - 'htdocs/webservices/server_payment.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredProperty'], - 'htdocs/webservices/server_productorservice.php' => ['PhanUndeclaredProperty'], + 'htdocs/webportal/controllers/membercard.controller.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/webportal/controllers/partnershipcard.controller.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/webservices/server_actioncomm.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/webservices/server_category.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/webservices/server_contact.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/webservices/server_invoice.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/webservices/server_order.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'], + 'htdocs/webservices/server_payment.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/webservices/server_productorservice.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_project.php' => ['PhanUndeclaredProperty'], 'htdocs/webservices/server_supplier_invoice.php' => ['PhanUndeclaredProperty'], - 'htdocs/webservices/server_thirdparty.php' => ['PhanUndeclaredProperty'], - 'htdocs/webservices/server_user.php' => ['PhanUndeclaredProperty'], - 'htdocs/website/class/website.class.php' => ['PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/website/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/website/samples/wrapper.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/webservices/server_thirdparty.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/webservices/server_user.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/website/class/website.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/website/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/website/samples/wrapper.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/website/websiteaccount_card.php' => ['PhanUndeclaredProperty'], 'htdocs/workstation/class/api_workstations.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/workstation/class/workstation.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/workstation/workstation_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/workstation/workstation_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/workstation/workstation_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/workstation/workstation_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/zapier/class/api_zapier.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/zapier/class/hook.class.php' => ['PhanUndeclaredProperty'], 'internal' => ['PhanUndeclaredConstant'], diff --git a/dev/tools/phan/baseline_extended.txt b/dev/tools/phan/baseline_extended.txt index 9ba71871a6d..b795a03f1c6 100644 --- a/dev/tools/phan/baseline_extended.txt +++ b/dev/tools/phan/baseline_extended.txt @@ -15,7 +15,6 @@ return [ // Currently, file_suppressions and directory_suppressions are the only supported suppressions 'file_suppressions' => [ - 'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgumentNullableInternal'], // false positive 'internal' => ['PhanUndeclaredConstant'], ], 'directory_suppressions' => [ diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index b13c4c1e769..9c89cda3e88 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -228,12 +228,17 @@ return [ 'actioncode' => 'string', 'badgeStatus0' => 'string', 'badgeStatus1' => 'string', - 'badgeStatus11' => 'string', 'badgeStatus3' => 'string', 'badgeStatus4' => 'string', + 'badgeStatus5' => 'string', 'badgeStatus6' => 'string', + 'badgeStatus7' => 'string', 'badgeStatus8' => 'string', 'badgeStatus9' => 'string', + 'badgeStatus10' => 'string', + 'badgeStatus11' => 'string', + 'badgeStatus4b' => 'string', + 'badgeStatus8b' => 'string', 'classname' => 'string', 'conf' => '\Conf', 'conffile' => 'string', @@ -267,7 +272,7 @@ return [ 'linkedObjectBlock' => '\CommonObject[]', // See htdocs/core/class/html.form.class.php 'mainmenu' => 'string', 'menumanager' => '\MenuManager', - 'mysoc' => '?\Societe', + 'mysoc' => '\Societe', 'nblines' => '\int', 'objectoffield' => '\CommonObject', 'objsoc' => '\Societe', @@ -440,7 +445,7 @@ return [ 'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences 'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences - 'PhanTypeMismatchArgument', // Also reported by phpstan < lvl6 - 12300+ occurrences + // 'PhanTypeMismatchArgument', // Can detect missing array keys, invalid types, objects being passed when scalar expected - Not all reported by phpstan - <=3800 cases (was: 12300+ before) 'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences 'PhanPluginDuplicateAdjacentStatement', diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index 38cd62d20f6..380493bbdd9 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -85,7 +85,7 @@ $config['suppress_issue_types'] = [ 'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences 'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences - 'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences + 'PhanTypeMismatchArgument', // Not showing in cti.dolibarr until low count - Can detect missing array keys, invalid types, objects being passed when scalar expected - Not all reported by phpstan - <=3800 cases (was: 12300+ before) 'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences 'PhanPluginDuplicateAdjacentStatement', diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index b290e5ef5c7..521cbcbedbf 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France */ @@ -9,30 +9,42 @@ $config = include __DIR__.DIRECTORY_SEPARATOR."config.php"; +// Note: When more than one fixer is attached to the same Notice, only the last fix is applied. //require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php'; //require_once __DIR__.'/plugins/PriceFormFixer.php'; //require_once __DIR__.'/plugins/UrlEncodeStringifyFixer.php'; -require_once __DIR__.'/plugins/SelectDateFixer.php'; +//require_once __DIR__.'/plugins/SelectDateFixer.php'; +//require_once __DIR__.'/plugins/setPageOrientationFixer.php'; +//require_once __DIR__.'/plugins/textwithpictoFixer.php'; +require_once __DIR__.'/plugins/ifsqlFixer.php'; +//require_once __DIR__.'/plugins/MultiCellFixer.php'; +//require_once __DIR__.'/plugins/setAutoPageBreakFixer.php'; +//require_once __DIR__.'/plugins/CellFixer.php'; //$deprecatedModuleNameRegex = '/^(?!(?:'.implode('|', array_keys($DEPRECATED_MODULE_MAPPING)).')$).*/'; -require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php'; +//require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php'; $config['exclude_file_regex'] = '@^(' // @phpstan-ignore-line .'dummy' // @phpstan-ignore-line + //.'|(?!htdocs/modulebuilderrtemplate/core/modules/mymodule/doc/pdf_standard_myobject.modules.php).*' // Only this file for test @php-stan-ignore-line + .'|htdocs/custom/.*' // Ignore all custom modules @phpstan-ignore-line .'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line .'|htdocs/admin/tools/ui/.*' // @phpstan-ignore-line //.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line + // Included as stub (better analysis) + .'|htdocs/includes/nusoap/.*' // @phpstan-ignore-line // Included as stub (old version + incompatible typing hints) .'|htdocs/includes/restler/.*' // @phpstan-ignore-line - // Included as stub (did not seem properly analysed by phan without it) + // Included as stub (did not seem properly analyzed by phan without it) .'|htdocs/includes/stripe/.*' // @phpstan-ignore-line .'|htdocs/conf/conf.php' // @phpstan-ignore-line - //.'|htdocs/[^c][^o][^r][^e][^/].*' // For testing @phpstan-ignore-line - //.'|htdocs/[^h].*' // For testing on restricted set @phpstan-ignore-line + //.'|htdocs/[^mi](?!.*(pdf_|tcpdf)).*\.php' // @phpstan-ignore-line + //.'|htdocs/(?!.*modules.*(pdf_|pdf.lib)).*\.php' // @phpstan-ignore-line .')@'; // @phpstan-ignore-line // $config['plugins'][] = __DIR__.'/plugins/ParamMatchRegexPlugin.php'; +$config['plugins'] = []; $config['plugins'][] = 'DeprecateAliasPlugin'; // $config['plugins'][] = __DIR__.'/plugins/GetPostFixerPlugin.php'; // $config['plugins'][] = 'PHPDocToRealTypesPlugin'; diff --git a/dev/tools/phan/plugins/CellFixer.php b/dev/tools/phan/plugins/CellFixer.php new file mode 100644 index 00000000000..bb49d415b47 --- /dev/null +++ b/dev/tools/phan/plugins/CellFixer.php @@ -0,0 +1,185 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\TCPDI::Cell()"; + $expected_functionlike2 = "\\TCPDF::Cell()"; + $expected_name = "Cell"; + if ($functionlike !== $expected_functionlike + && $functionlike !== $expected_functionlike2) { + print "$functionlike != '$expected_functionlike'|'$expected_functionlike2".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "false","1" => "true"); + // Check if we fix any of this + if ( + ($argument_name === 'fill' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + // print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + // && $arg->expression instanceof StringLiteral + && $arg->expression instanceof NumericLiteral + ) { + // Get the value of the NumericLiteral + $fieldValue = (string) $arg->expression; + print "Number is '$fieldValue'".PHP_EOL; + /* + // Get the string value of the StringLiteral + $fieldValue = $arg->expression->getStringContentsText(); + print "String is '$fieldValue'".PHP_EOL; + */ + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + print "Not replacing $argument_name which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/MultiCellFixer.php b/dev/tools/phan/plugins/MultiCellFixer.php new file mode 100644 index 00000000000..e126d0c622e --- /dev/null +++ b/dev/tools/phan/plugins/MultiCellFixer.php @@ -0,0 +1,185 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\TCPDI::MultiCell()"; + $expected_functionlike2 = "\\TCPDF::MultiCell()"; + $expected_name = "MultiCell"; + if ($functionlike !== $expected_functionlike + && $functionlike !== $expected_functionlike2) { + print "$functionlike != '$expected_functionlike'|'$expected_functionlike2".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "false","1" => "true"); + // Check if we fix any of this + if ( + ($argument_name === 'fill' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + // print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + // && $arg->expression instanceof StringLiteral + && $arg->expression instanceof NumericLiteral + ) { + // Get the value of the NumericLiteral + $fieldValue = (string) $arg->expression; + print "Number is '$fieldValue'".PHP_EOL; + /* + // Get the string value of the StringLiteral + $fieldValue = $arg->expression->getStringContentsText(); + print "String is '$fieldValue'".PHP_EOL; + */ + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + print "Not replacing $argument_name which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/ifsqlFixer.php b/dev/tools/phan/plugins/ifsqlFixer.php new file mode 100644 index 00000000000..ba97b719c24 --- /dev/null +++ b/dev/tools/phan/plugins/ifsqlFixer.php @@ -0,0 +1,177 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\DoliDB::ifsql()"; + $expected_name = "ifsql"; + if ($functionlike !== $expected_functionlike) { + //print "$functionlike != '$expected_functionlike'".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "'0'","1" => "'1'","-1" => "'-1'"); + // Check if we fix any of this + if ( + (in_array($argument_name, ['resok','resko']) && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + // print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + // print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + // print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + // print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + && $arg->expression instanceof NumericLiteral + ) { + // Get the string value of the NumericLiteral + $fieldValue = (string) $arg->expression; + //print "Field is '$fieldValue'".PHP_EOL; + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + // print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + // print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/setAutoPageBreakFixer.php b/dev/tools/phan/plugins/setAutoPageBreakFixer.php new file mode 100644 index 00000000000..2d0c0ba11a7 --- /dev/null +++ b/dev/tools/phan/plugins/setAutoPageBreakFixer.php @@ -0,0 +1,185 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\TCPDI::setAutoPageBreak()"; + $expected_functionlike2 = "\\TCPDF::setAutoPageBreak()"; + $expected_name = "setAutoPageBreak"; + if ($functionlike !== $expected_functionlike + && $functionlike !== $expected_functionlike2) { + //print "$functionlike != '$expected_functionlike'|'$expected_functionlike2".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "false","1" => "true"); + // Check if we fix any of this + if ( + ($argument_name === 'auto' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + //print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + // print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + //print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + //print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + //print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + //print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + // && $arg->expression instanceof StringLiteral + && $arg->expression instanceof NumericLiteral + ) { + // Get the value of the NumericLiteral + $fieldValue = (string) $arg->expression; + print "Number is '$fieldValue'".PHP_EOL; + /* + // Get the string value of the StringLiteral + $fieldValue = $arg->expression->getStringContentsText(); + print "String is '$fieldValue'".PHP_EOL; + */ + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/setPageOrientationFixer.php b/dev/tools/phan/plugins/setPageOrientationFixer.php new file mode 100644 index 00000000000..09658fe6d23 --- /dev/null +++ b/dev/tools/phan/plugins/setPageOrientationFixer.php @@ -0,0 +1,177 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\TCPDF::setPageOrientation()"; + $expected_name = "setPageOrientation"; + if ($functionlike !== $expected_functionlike) { + //print "$functionlike != '$expected_functionlike'".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "false","1" => "true"); + // Check if we fix any of this + if ( + ($argument_name === 'autopagebreak' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + // print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + // print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + // print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + // print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + && $arg->expression instanceof NumericLiteral + ) { + // Get the string value of the NumericLiteral + $fieldValue = (string) $arg->expression; + //print "Field is '$fieldValue'".PHP_EOL; + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + // print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + // print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/textwithpictoFixer.php b/dev/tools/phan/plugins/textwithpictoFixer.php new file mode 100644 index 00000000000..484b02cf675 --- /dev/null +++ b/dev/tools/phan/plugins/textwithpictoFixer.php @@ -0,0 +1,177 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\Form::textwithpicto()"; + $expected_name = "textwithpicto"; + if ($functionlike !== $expected_functionlike) { + //print "$functionlike != '$expected_functionlike'".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "'info'","1" => "'help'"); + // Check if we fix any of this + if ( + ($argument_name === 'type' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + // print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + // print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + // print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + // print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + && $arg->expression instanceof NumericLiteral + ) { + // Get the string value of the NumericLiteral + $fieldValue = (string) $arg->expression; + //print "Field is '$fieldValue'".PHP_EOL; + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + // print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + // print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index 9a34c97bc3f..ae2bf3581d6 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -123,10 +123,8 @@ AmountOfTicketsByMonthHT AmountOfinterventions AmountOfinterventionsByMonthHT AnObjectWithThisClassNameAlreadyExists -Anciennete AnnualByAccountDueDebtMode AnnualByAccountInputOutputMode -Anonymous AnotherField Applications Articles @@ -136,8 +134,6 @@ AuthorityDidntReconizeFingerprintConformity AuthorityReconizeFingerprintConformity Auto AutoGenerateDoc -AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation -Automatic AvailabilityType BAN BI @@ -178,7 +174,6 @@ CalcModeLT CalculatedFromProductsToConsume CancelReception Candidatures -CantBeNullOrPositive CantConvertToReducAnInvoiceOfThisType CardFichinter CardProduct @@ -201,7 +196,6 @@ CloneProgression CloneTimes Close Done Close2 -CloseShipment CodeTooltipHelp Column Combination @@ -216,7 +210,6 @@ ConfirmActionMyObject ConfirmActionTarget ConfirmCloneMyObject ConfirmCloneTask -ConfirmCloseShipment ConfirmCreateAdherent ConfirmDeleteAdherent ConfirmDeleteIndividual @@ -418,18 +411,12 @@ FailedToExecutCommandJob FailedToGetCostPrice FailedToOpenFile FailedToReadFile -FailedToSetPaid -FailedToSetToCancel FailedToUncompressFile FailedToUpdatePrice FailedtoSetToApprove FailedtoSetToDeny FeatureNotAvailableWithThisDatabaseDriver FieldNotFoundInObject -FieldsEdit -FieldsInsert -FieldsLinked -FieldsView File encoding FileDidAlreadyExist FileIsNotCorrect @@ -568,7 +555,6 @@ NbOfOrder NbOfSendingsByMonth NbOfTicket NeedRefresh -NetMeasure Network NewAdherent NewAdherentAddress @@ -589,7 +575,6 @@ NoOperations NoPasswordGenerationRuleConfigured NoReader NoRecordedUnpaidInvoices -NoRecordfound NoRecords NoRecordsToDisplay NoSenderEmailDefined @@ -1099,7 +1084,6 @@ PDF/A-1b PDF/A-3b PartnershipSentByEMail PdfTitle -Privileges ProcessingError PurchaseOrder PurchaseOrders diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index b937d9c89bd..45bb66e8d23 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -99,7 +99,7 @@ $tablib[32] = "DictionaryAccountancyCategory"; // Requests to extract data $tabsql = array(); -$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; +$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid AND c.active=1 AND a.entity IN (".getEntity('c_accounting_category').")"; // Criteria to sort dictionaries $tabsqlsort = array(); @@ -111,11 +111,11 @@ $tabfield[32] = "code,label,range_account,category_type,formula,position,country // Name of editing fields for record modification $tabfieldvalue = array(); -$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id"; +$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id,entity"; // Name of the fields in the table for inserting a record $tabfieldinsert = array(); -$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country"; +$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country,entity"; // Name of the rowid if the field is not of type autoincrement // Example: "" if id field is "rowid" and has autoincrement on diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 4983485ea3e..525e02edd37 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -153,7 +153,7 @@ if ($result) { $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; if (empty($reshook)) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->hasRight('accounting', 'fiscalyear', 'write')); + $newcardbutton .= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?action=create', '', $user->hasRight('accounting', 'fiscalyear', 'write')); } $title = $langs->trans('AccountingPeriods'); diff --git a/htdocs/accountancy/class/accountancyimport.class.php b/htdocs/accountancy/class/accountancyimport.class.php index a35235e0218..4394a0eac2a 100644 --- a/htdocs/accountancy/class/accountancyimport.class.php +++ b/htdocs/accountancy/class/accountancyimport.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2017 André Schild * Copyright (C) 2020 Guillaume Alexandre - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -109,7 +109,7 @@ class AccountancyImport $amount = (float) price2num($arrayrecord[$credit_index]['val']); } - return "'" . $this->db->escape(abs($amount)) . "'"; + return "'" . $this->db->escape((string) abs($amount)) . "'"; } return "''"; @@ -117,12 +117,12 @@ class AccountancyImport /** - * Compute direction + * Compute direction * * @param array}> $arrayrecord Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]... * @param array $listfields Fields list to add * @param int $record_key Record key - * @return string Value + * @return string Value D or C or "" */ public function computeDirection(&$arrayrecord, $listfields, $record_key) { @@ -139,7 +139,7 @@ class AccountancyImport return $sens; } - return "''"; + return ""; } /** diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index e1934a31b0e..d2217e62654 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -5,6 +5,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 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 @@ -429,10 +430,10 @@ 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[2*$i - 2]); + print ''; + print price($row[2 * $i - 2]); // Add link to make binding - if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { + 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 ''; @@ -672,7 +673,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa " (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent ! " (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))" ).")", - 0 + '0' ).") AS month".str_pad((string) $j, 2, '0', STR_PAD_LEFT).","; } $sql .= " SUM(".$db->ifsql( @@ -694,7 +695,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa " (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty)))", " (fd.total_ht - (fd.buy_price_ht * fd.qty))" ).")", - 0 + '0' ).") AS month".str_pad((string) $j, 2, '0', STR_PAD_LEFT).","; } $sql .= " SUM(".$db->ifsql( diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 8bd3a2013ea..31a1597eeed 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -10,7 +10,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2020-2024 Frédéric France * Copyright (C) 2023 Waël Almoman - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -461,7 +461,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 3e9335a30d1..82cf1ba1d43 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2015-2024 Alexandre Spangaro * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Waël Almoman - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -1563,14 +1563,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $fullname = $object->getFullName($langs); if ($object->morphy == 'mor') { - $companyname = $object->company; + $companyname = (string) $object->company; if (!empty($fullname)) { - $companyalias = $fullname; + $companyalias = (string) $fullname; } } else { $companyname = $fullname; if (!empty($object->company)) { - $companyalias = $object->company; + $companyalias = (string) $object->company; } } diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 8329014dfad..34ef215eb13 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -96,13 +96,12 @@ class Adherent extends CommonObject /** * @var string - * @deprecated Use $civility_code - * @see $civility_code + * @deprecated Use $civility_code */ public $civility_id; /** - * @var string The civility code, not an integer (ex: 'MR', 'MME', 'MLE', etc.) + * @var string The civility code, not an integer (ex: 'MR', 'MME', 'MLE', 'DR', etc.) */ public $civility_code; @@ -317,38 +316,76 @@ class Adherent extends CommonObject /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * 'type' field format: + * 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', + * 'select' (list of values are in 'options'. for integer list of values are in 'arrayofkeyval'), + * 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:CategoryIdType[:CategoryIdList[:SortField]]]]]]', + * 'chkbxlst:...', + * 'varchar(x)', + * 'text', 'text:none', 'html', + * 'double(24,8)', 'real', 'price', 'stock', + * 'date', 'datetime', 'timestamp', 'duration', + * 'boolean', 'checkbox', 'radio', 'array', + * 'mail', 'phone', 'url', 'password', 'ip' + * Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)" + * 'length' the length of field. Example: 255, '24,8' + * 'label' the translation key. + * 'alias' the alias used into some old hard coded SQL requests + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt("MY_SETUP_PARAM")' or 'isModEnabled("multicurrency")' ...) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0') + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'placeholder' to set the placeholder of a varchar field. + * 'help' and 'helplist' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code like the constructor of the class. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'validate' is 1 if you need to validate the field with $this->validateField(). Need MAIN_ACTIVATE_VALIDATION_RESULT. + * 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), 'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'default' => '1', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 12, 'index' => 1), - 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 15, 'index' => 1), 'ref_ext' => array('type' => 'varchar(128)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 20), 'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25), 'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'showoncombobox' => 1), 'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'showoncombobox' => 1), 'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => 1, 'position' => 40), - 'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45), - 'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50), + 'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => 3, 'position' => 45), + 'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => 3, 'position' => 50), 'morphy' => array('type' => 'varchar(3)', 'label' => 'MemberNature', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 55), - 'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60), + 'fk_adherent_type' => array('type' => 'integer', 'label' => 'MemberType', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60), 'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => 1, 'position' => 65, 'showoncombobox' => 2), 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 70), 'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75), 'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80), 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85), - 'state_id' => array('type' => 'integer', 'label' => 'State id', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'state_id' => array('type' => 'integer', 'label' => 'State', 'enabled' => 1, 'visible' => -1, 'position' => 90), 'country' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => 1, 'position' => 95), 'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 115), 'phone_perso' => array('type' => 'varchar(30)', 'label' => 'Phone perso', 'enabled' => 1, 'visible' => -1, 'position' => 120), 'phone_mobile' => array('type' => 'varchar(30)', 'label' => 'Phone mobile', 'enabled' => 1, 'visible' => -1, 'position' => 125), 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => 1, 'position' => 126), 'url' => array('type' => 'varchar(255)', 'label' => 'Url', 'enabled' => 1, 'visible' => -1, 'position' => 127), - 'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 128), + 'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => 3, 'position' => 128), 'birth' => array('type' => 'date', 'label' => 'DateOfBirth', 'enabled' => 1, 'visible' => -1, 'position' => 130), 'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 132), 'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => -1, 'position' => 135), - 'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145), + 'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 145), 'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => 1, 'position' => 150), 'default_lang' => array('type' => 'varchar(6)', 'label' => 'Default lang', 'enabled' => 1, 'visible' => -1, 'position' => 153), 'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155), @@ -356,13 +393,13 @@ class Adherent extends CommonObject 'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175), - 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 180), - 'fk_user_mod' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user mod', 'enabled' => 1, 'visible' => -1, 'position' => 185), - 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 190), - 'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => -1, 'position' => 195), - 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 500, 'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => 3, 'position' => 180), + 'fk_user_mod' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModification', 'enabled' => 1, 'visible' => 3, 'position' => 185), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => 3, 'position' => 190), + 'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => 0, 'position' => 195), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 800), - 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805) + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805), + 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 1000, 'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')) ); /** @@ -3306,7 +3343,7 @@ class Adherent extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 1af9ebd608d..846a05b04e3 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2018-2019 Thibault Foucart * Copyright (C) 2021 Waël Almoman * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -51,6 +51,78 @@ class AdherentType extends CommonObject */ public $picto = 'members'; + /** + * @var int<0,1>|string 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + */ + public $ismultientitymanaged = 1; + + /** + * @var int<0,1> Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + + //TODO : rename BDD field libelle into label before being able to use arrayfields. + + /** + * 'type' field format: + * 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', + * 'select' (list of values are in 'options'), + * 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:CategoryIdType[:CategoryIdList[:SortField]]]]]]', + * 'chkbxlst:...', + * 'varchar(x)', + * 'text', 'text:none', 'html', + * 'double(24,8)', 'real', 'price', + * 'date', 'datetime', 'timestamp', 'duration', + * 'boolean', 'checkbox', 'radio', 'array', + * 'mail', 'phone', 'url', 'password', 'ip' + * Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt("MY_SETUP_PARAM")' or 'isModEnabled("multicurrency")' ...) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0') + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' and 'helplist' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'validate' is 1 if need to validate with $this->validateField() + * 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + + // BEGIN MODULEBUILDER PROPERTIES + /** + * @inheritdoc + * Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + "rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "-1",), + "tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 20, 'notnull' => 1, "visible" => "-1",), + "statut" => array("type" => "smallint(6)", "label" => "Statut", "enabled" => "1", 'position' => 500, 'notnull' => 1, "visible" => "-1",), + "libelle" => array("type" => "varchar(50)", "label" => "Label", "enabled" => "1", 'position' => 30, 'notnull' => 1, "visible" => "-1",), + "subscription" => array("type" => "varchar(3)", "label" => "Subscription", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "-1",), + "amount" => array("type" => "double(24,8)", "label" => "Amount", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1",), + "caneditamount" => array("type" => "integer", "label" => "Caneditamount", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1",), + "vote" => array("type" => "varchar(3)", "label" => "Vote", "enabled" => "1", 'position' => 50, 'notnull' => 1, "visible" => "-1",), + "note" => array("type" => "longtext", "label" => "Note", "enabled" => "1", 'position' => 55, 'notnull' => 0, "visible" => "-1",), + "mail_valid" => array("type" => "longtext", "label" => "Mailvalid", "enabled" => "1", 'position' => 60, 'notnull' => 0, "visible" => "-1",), + "morphy" => array("type" => "varchar(3)", "label" => "Morphy", "enabled" => "1", 'position' => 65, 'notnull' => 0, "visible" => "-1",), + "duration" => array("type" => "varchar(6)", "label" => "Duration", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1",), + ); + // END MODULEBUILDER PROPERTIES + /** * @var string * @deprecated Use label @@ -143,39 +215,43 @@ class AdherentType extends CommonObject public $multilangs = array(); - // BEGIN MODULEBUILDER PROPERTIES - /** - * @inheritdoc - * Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. - */ - public $fields = array( - "rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "-1",), - "tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 20, 'notnull' => 1, "visible" => "-1",), - "statut" => array("type" => "smallint(6)", "label" => "Statut", "enabled" => "1", 'position' => 500, 'notnull' => 1, "visible" => "-1",), - "libelle" => array("type" => "varchar(50)", "label" => "Label", "enabled" => "1", 'position' => 30, 'notnull' => 1, "visible" => "-1",), - "subscription" => array("type" => "varchar(3)", "label" => "Subscription", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "-1",), - "amount" => array("type" => "double(24,8)", "label" => "Amount", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1",), - "caneditamount" => array("type" => "integer", "label" => "Caneditamount", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1",), - "vote" => array("type" => "varchar(3)", "label" => "Vote", "enabled" => "1", 'position' => 50, 'notnull' => 1, "visible" => "-1",), - "note" => array("type" => "longtext", "label" => "Note", "enabled" => "1", 'position' => 55, 'notnull' => 0, "visible" => "-1",), - "mail_valid" => array("type" => "longtext", "label" => "Mailvalid", "enabled" => "1", 'position' => 60, 'notnull' => 0, "visible" => "-1",), - "morphy" => array("type" => "varchar(3)", "label" => "Morphy", "enabled" => "1", 'position' => 65, 'notnull' => 0, "visible" => "-1",), - "duration" => array("type" => "varchar(6)", "label" => "Duration", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1",), - ); - // END MODULEBUILDER PROPERTIES - - /** * Constructor * * @param DoliDB $db Database handler */ - public function __construct($db) + public function __construct(DoliDB $db) { + global $langs; $this->db = $db; $this->ismultientitymanaged = 1; $this->status = 1; + + if (!getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid']) && !empty($this->fields['ref'])) { + $this->fields['rowid']['visible'] = 0; + } + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { + $this->fields['entity']['enabled'] = 0; + } + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } } /** @@ -299,12 +375,12 @@ class AdherentType extends CommonObject } /** - * Delete a language for this member type - * - * @param string $langtodelete Language code to delete - * @param User $user Object user making delete - * @return int Return integer <0 if KO, >0 if OK - */ + * Delete a language for this member type + * + * @param string $langtodelete Language code to delete + * @param User $user Object user making delete + * @return int Return integer <0 if KO, >0 if OK + */ public function delMultiLangs($langtodelete, $user) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang"; @@ -1001,7 +1077,7 @@ class AdherentType extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 8fa636ca903..c021e335604 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2006-2015 Laurent Destailleur - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -98,7 +98,7 @@ class Subscription extends CommonObject public $fk_bank; /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -166,7 +166,7 @@ class Subscription extends CommonObject } $sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note, fk_user_creat)"; - $sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape($type)."', '".$this->db->idate($now)."',"; + $sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape((string) $type)."', '".$this->db->idate($now)."',"; $sql .= " '".$this->db->idate($this->dateh)."',"; $sql .= " '".$this->db->idate($this->datef)."',"; $sql .= " ".((float) $this->amount).","; @@ -543,9 +543,9 @@ class Subscription extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{selected:?int,member:?Adherent,bank:?Account} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array{selected?:int|bool,adherent_type?:AdherentType,member?:Adherent,bank?:Account} $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 21f24487c24..5c18a3688d1 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -174,7 +174,7 @@ $arrayfields = array( 'd.company' => array('label' => "Company", 'checked' => 1, 'position' => 70), 'd.login' => array('label' => "Login", 'checked' => 1), 'd.morphy' => array('label' => "MemberNature", 'checked' => 1), - 't.libelle' => array('label' => "Type", 'checked' => 1, 'position' => 55), + 't.libelle' => array('label' => "MemberType", 'checked' => 1, 'position' => 55), 'd.address' => array('label' => "Address", 'checked' => 0), 'd.zip' => array('label' => "Zip", 'checked' => 0), 'd.town' => array('label' => "Town", 'checked' => 0), @@ -199,6 +199,10 @@ $tableprefix = 'd'; foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { + // Special case already added + if (in_array($key, array('fk_adherent_type', 'state_id', 'country'))) { // Already managed by another field key in arrayfields + continue; + } $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], @@ -222,7 +226,6 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); // Security check $result = restrictedArea($user, 'adherent'); - /* * Actions */ diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index c34a84824cc..a038e3b11f8 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2023 Laurent Destailleur * Copyright (C) 2024 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -102,20 +102,20 @@ $fieldstosearchall = array( 'c.note' => "Label", ); $arrayfields = array( - 'd.ref' => array('label' => "Ref", 'checked' => 1), - 'd.fk_type' => array('label' => "Type", 'checked' => 1), - 'd.lastname' => array('label' => "Lastname", 'checked' => 1), - 'd.firstname' => array('label' => "Firstname", 'checked' => 1), - 'd.login' => array('label' => "Login", 'checked' => 1), - 'c.note' => array('label' => "Label", 'checked' => 1), - 'd.bank' => array('label' => "BankAccount", 'checked' => 1, 'enabled' => (isModEnabled('bank'))), + 'd.ref' => array('label' => "Ref", 'checked' => '1'), + 'd.fk_type' => array('label' => "Type", 'checked' => '1'), + 'd.lastname' => array('label' => "Lastname", 'checked' => '1'), + 'd.firstname' => array('label' => "Firstname", 'checked' => '1'), + 'd.login' => array('label' => "Login", 'checked' => '1'), + 'c.note' => array('label' => "Label", 'checked' => '1'), + 'd.bank' => array('label' => "BankAccount", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled('bank'))), /*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0), 'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/ - 'c.dateadh' => array('label' => "DateSubscription", 'checked' => 1, 'position' => 100), - 'c.datef' => array('label' => "EndSubscription", 'checked' => 1, 'position' => 101), - 'd.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 102), - 'c.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500), - 'c.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500), + 'c.dateadh' => array('label' => "DateSubscription", 'checked' => '1', 'position' => 100), + 'c.datef' => array('label' => "EndSubscription", 'checked' => '1', 'position' => 101), + 'd.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 102), + 'c.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 500), + 'c.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 500), // 'd.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) ); @@ -223,7 +223,7 @@ if ($search_ref) { } } if ($search_type > 0) { - $sql .= natural_search(array('c.fk_type'), $search_type); + $sql .= natural_search(array('c.fk_type'), (string) $search_type); } if ($search_lastname) { $sql .= natural_search(array('d.lastname', 'd.societe'), $search_lastname); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 7db9917b1d2..ab9e2462cc2 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -534,7 +534,7 @@ if ($action == 'create') { print ''; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 5f50050e53c..fddb1cf8566 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Charlie Benke * Copyright (C) 2017 Open-DSI - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -320,7 +320,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print '
'; print ''; // Preview diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 1c4f0b4377a..de147fc81d3 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -283,7 +283,7 @@ foreach ($dirmodels as $reldir) { } print ''; print "\n"; @@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir) { print ''; // Preview diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 07f6779fd90..11955d4ae4f 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2022 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -471,7 +471,7 @@ print ''; print '
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("Status").''; print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100'); @@ -566,7 +566,7 @@ if ($action == 'create') { print '
'.$langs->trans("Duration").''; - print ' '; + print ' '; print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOSTISSET("duration_unit") ? GETPOST('duration_unit', 'aZ09') : 'y', 0, 1); print '
'; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''.img_object($langs->trans("Preview"), 'pdf').''; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 2e1afa189cc..a01086727f0 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -3,7 +3,7 @@ * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -413,7 +413,7 @@ foreach ($dirmodels as $reldir) { //$htmltooltip .= '
' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1); print '
'; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print '
'; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print '
'; print ''; -print $form->buttonsSaveCancel("Save", '', array(), 0, 'reposition'); +print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition'); print ''; print "\n".''."\n"; diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index a26f0f33af2..75b0e216b27 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -3,7 +3,7 @@ * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -226,7 +226,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); if (getDolGlobalString('CHEQUERECEIPTS_ADDON').'.php' == $file) { // If module is the one used, we show existing errors if (!empty($module->error)) { diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index ae676a142fd..d9bd0289527 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -1,7 +1,7 @@ * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -316,7 +316,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -456,7 +456,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index fa05a39c472..95ef16efbad 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -8,7 +8,7 @@ * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -328,7 +328,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -456,7 +456,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) { $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d96d7ce0e4f..cd052b7dde0 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2540,7 +2540,7 @@ if ($id > 0) { } elseif ($value == 'block_if_negative') { $valuetoshow = yn($obj->{$value}); } elseif ($value == 'icon') { - $valuetoshow = $obj->{$value}." ".img_picto("", $obj->{$value}); + $valuetoshow = $obj->{$value}." ".img_picto("", preg_replace('/^fa-/', '', $obj->{$value})); } elseif ($value == 'type_duration') { $TDurationTypes = array('y' => $langs->trans('Years'), 'm' => $langs->trans('Month'), 'w' => $langs->trans('Weeks'), 'd' => $langs->trans('Days'), 'h' => $langs->trans('Hours'), 'i' => $langs->trans('Minutes')); if (!empty($obj->{$value}) && array_key_exists($obj->{$value}, $TDurationTypes)) { @@ -2561,7 +2561,7 @@ if ($id > 0) { if (in_array($value, array('nbjour', 'decalage', 'pos', 'position', 'deposit_percent'))) { $class .= ' right'; } - if (in_array($value, array('type_vat', 'localtax1_type', 'localtax2_type'))) { + if (in_array($value, array('icon', 'type_vat', 'localtax1_type', 'localtax2_type'))) { $class .= ' nowraponall'; } if (in_array($value, array('use_default', 'fk_parent', 'sortorder'))) { diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 5ad30fc921f..1f03a708917 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -272,7 +272,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -408,7 +408,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 31087976ffc..e9d5c01acd8 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -7,7 +7,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2022 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -298,7 +298,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -427,7 +427,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, -1, 0); + print $form->textwithpicto('', $htmltooltip, -1, 'info'); print ''; // Preview diff --git a/htdocs/admin/fediverse.php b/htdocs/admin/fediverse.php index e10baa10207..d2848b905ec 100644 --- a/htdocs/admin/fediverse.php +++ b/htdocs/admin/fediverse.php @@ -25,9 +25,9 @@ */ /** - * \file htdocs/admin/faitdivers.php - * \ingroup faitdivers - * \brief Page to setupe module Socialnetworks + * \file htdocs/admin/fediverse.php + * \ingroup fedivers + * \brief Page to setup fedivers in module Socialnetworks */ //load Dolibarr environment diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index edcd0469c1a..18c72b62051 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -7,7 +7,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -364,7 +364,7 @@ foreach ($dirmodels as $reldir) { } } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -503,7 +503,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, -1, 0); + print $form->textwithpicto('', $htmltooltip, -1, 'info'); print ''; // Preview diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index b6fc587032d..4eb9e2f5dbd 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -3,7 +3,7 @@ * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2018 Charlene Benke * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -419,7 +419,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index e80962f6d25..de8dfabaa18 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -4,7 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -331,7 +331,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -471,7 +471,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 1ec7c21252f..41ba080ff85 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -400,7 +400,7 @@ if ($mode == 'other') { print ''; print $langs->trans("Language"); - print ''; + print ''; print ''; // Default language @@ -435,7 +435,7 @@ if ($mode == 'other') { print ''; print $langs->trans("Miscellaneous"); print ''; - print ''; + print ''; print ''; if (!empty($conf->use_javascript_ajax)) { diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php index e9dc88c9b96..1beac2929ee 100644 --- a/htdocs/admin/invoice.php +++ b/htdocs/admin/invoice.php @@ -7,7 +7,7 @@ * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2022 Anthony Berton - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Alexandre Spangaro * @@ -451,7 +451,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); if (getDolGlobalString('FACTURE_ADDON') . '.php' == $file) { // If module is the one used, we show existing errors if (!empty($module->error)) { @@ -608,7 +608,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index 7c7458a6901..953f7958bd7 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -450,7 +450,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -589,7 +589,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index afda0e31733..b32c64b8b35 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -382,6 +382,7 @@ if ($action == 'edit') { clearstatcache(); + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -613,11 +614,11 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameters").'
'; - + print '
'; print '
'; - + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -664,6 +665,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("OtherOptions").'
'; + print '
'; print dol_get_fiche_end(); @@ -868,7 +870,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) { if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); } @@ -892,7 +894,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) { if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); } @@ -910,7 +912,7 @@ if ($action == 'edit') { if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) { print img_warning($langs->trans("Mandatory")); } elseif (!isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))); } print ''; @@ -958,7 +960,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; print ''.(getDolGlobalString('MAIN_MAIL_ERRORS_TO')); if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail(getDolGlobalString('MAIN_MAIL_ERRORS_TO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_ERRORS_TO'))); } print ''; diff --git a/htdocs/admin/mails_passwordreset.php b/htdocs/admin/mails_passwordreset.php index 5f3b07ce7ee..6433b63486c 100644 --- a/htdocs/admin/mails_passwordreset.php +++ b/htdocs/admin/mails_passwordreset.php @@ -104,6 +104,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET")) { + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + } + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -349,6 +353,7 @@ if ($action == 'edit') { clearstatcache(); + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -553,6 +558,26 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameters").'
'; + print '
'; + + print '
'; + + + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + print ''; + print ''; + + // From + $help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; + print ''; + + print '
'.$langs->trans("OtherOptions").'
'; + print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); + print ' '.$help; + print '
'; + print '
'; print dol_get_fiche_end(); @@ -685,6 +710,36 @@ if ($action == 'edit') { print ''; print ''; + + print '
'; + + + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + print ''; + print ''; + + // From + $help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; + print ''; + + print '
'.$langs->trans("OtherOptions").'
'; + print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); + print ' '.$help; + print ''; + if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) { + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').''; + } else { + print getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'); + } + if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && !getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) { + print img_warning($langs->trans("Mandatory")); + } elseif (getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET') && !isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))) { + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))); + } + print '
'; + print '
'; + print dol_get_fiche_end(); diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 0b343459e3d..9f75b7efa18 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -30,12 +30,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php'; require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; /** * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager - * @var Societe $mysoc * @var Translate $langs * @var User $user */ @@ -263,13 +263,15 @@ foreach ($dirmodels as $reldir) { $mrp = new Mo($db); $mrp->initAsSpecimen(); + $product = new Product($db); + $product->initAsSpecimen(); // Info $htmltooltip = ''; $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
'; $mrp->type = 0; - $nextval = $module->getNextValue($mysoc, $mrp); - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $nextval = $module->getNextValue($product, $mrp); + if ((string) $nextval != $langs->trans("NotAvailable")) { $htmltooltip .= ''.$langs->trans("NextValue").': '; if ($nextval) { if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { @@ -282,7 +284,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -396,7 +398,7 @@ foreach ($dirmodels as $reldir) { // Default print ''; - if ($conf->global->MRP_MO_ADDON_PDF == $name) { + if (getDolGlobalString("MRP_MO_ADDON_PDF") == $name) { print img_picto($langs->trans("Default"), 'on'); } else { print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; @@ -417,7 +419,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index c44caecb710..1df42a44853 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -139,9 +139,9 @@ if ($action == 'add_currency') { } } elseif ($action == 'setapilayer') { if (GETPOSTISSET('modify_apilayer')) { - dolibarr_set_const($db, 'MULTICURRENCY_APP_ID', GETPOST('MULTICURRENCY_APP_ID', 'alpha')); - dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha')); - //dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha')); + dolibarr_set_const($db, 'MULTICURRENCY_APP_ID', GETPOST('MULTICURRENCY_APP_ID', 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha'), 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha'), 'chaine', 0, '', $conf->entity); } else { $multiurrency = new MultiCurrency($db); $result = $multiurrency->syncRates(getDolGlobalString('MULTICURRENCY_APP_ID')); diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php index 38b4dd721cf..27e6f623a62 100644 --- a/htdocs/admin/order.php +++ b/htdocs/admin/order.php @@ -10,7 +10,7 @@ * Copyright (C) 2011-2016 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -368,7 +368,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -509,7 +509,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/order_pdf.php b/htdocs/admin/order_pdf.php new file mode 100644 index 00000000000..ab7786efaa3 --- /dev/null +++ b/htdocs/admin/order_pdf.php @@ -0,0 +1,213 @@ + + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2024-2025 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 + * 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/admin/order_pdf.php + * \ingroup order + * \brief Setup page for order module + */ + +// Load Dolibarr environment +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Societe $mysoc + * @var Translate $langs + * @var User $user + */ + +// Load translation files required by the page +$langs->loadLangs(array("admin", "other", "errors", "orders")); + +if (!$user->admin) { + accessforbidden(); +} + +$action = GETPOST('action', 'aZ09'); +$value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); +$type = 'order'; +$dirforterms = $conf->order->dir_output; +if (!empty($conf->order->multidir_output[$conf->entity])) { + $dirforterms = $conf->order->multidir_output[$conf->entity].'/'; +} + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + +$error = 0; +if ($action == "update") { + if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) { + dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_ORDER", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_ORDER", 'int'), 'chaine', 0, '', $conf->entity); + } + if (GETPOSTISSET('SALES_ORDER_SHOW_SHIPPING_ADDRESS')) { + dolibarr_set_const($db, "SALES_ORDER_SHOW_SHIPPING_ADDRESS", GETPOSTINT("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity); + dolibarr_del_const($db, "SALES_ORDER_SHOW_SHIPPING_ADDRESS", $conf->entity); + } + + // Terms of sale + if ($_FILES['termsofsale']["name"]) { + if (!preg_match('/(\.pdf)$/i', $_FILES['termsofsale']["name"])) { // Document can be used on a lot of different places. Only pdf can be supported. + $langs->load("errors"); + setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors'); + } else { + $original_file = $_FILES['termsofsale']["name"]; + $result = dol_move_uploaded_file($_FILES['termsofsale']["tmp_name"], $dirforterms.$original_file, 1, 0, $_FILES['termsofsale']['error']); + if ($result) { + dolibarr_set_const($db, 'MAIN_INFO_ORDER_TERMSOFSALE', $original_file, 'chaine', 0, '', $conf->entity); + } + } + } + + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + exit; +} + +// Terms of sale +if ($action == 'removetermsofsale') { + $filename = getDolGlobalString('MAIN_INFO_ORDER_TERMSOFSALE'); + $file = $dirforterms.'/'.$filename; + + if ($filename != '') { + dol_delete_file($file); + } + dolibarr_del_const($db, 'MAIN_INFO_ORDER_TERMSOFSALE', $conf->entity); +} + +/* + * View + */ + +$form = new Form($db); +$formfile = new FormFile($db); + +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); + +llxHeader('', $langs->trans("OrdersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-order'); + +//if ($mesg) print $mesg; + +$linkback = ''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup'); + +$head = order_admin_prepare_head(); + +print dol_get_fiche_head($head, 'pdf', $langs->trans("Orders"), -1, 'order'); + +print '
'; +print ''; +print ''; + +print '
'; +print ''; +print ''; + +print ''; + +print ''; + +print '
'.$langs->trans("Parameter").'
'; +print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp")); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER); +} +print '
'; +print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore")); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SALES_ORDER_SHOW_SHIPPING_ADDRESS'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->SALES_ORDER_SHOW_SHIPPING_ADDRESS); +} +print '
'; +print '
'; + +print load_fiche_titre($langs->trans("Files"), '', 'file'); +print '
'; +print ''; +print ''; + +// Terms of sale +$tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf'; +$maxfilesizearray = getMaxFileSizeArray(); +$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '
'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : ''; +$documenturl = DOL_URL_ROOT.'/document.php'; +if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) { + $documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP; +} +$modulepart = 'order'; + +print ''; +print '
'.$langs->trans("Parameters").'
'; +print '
'; +print ''; + +if (getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE")) { + $termofsale = getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE"); + if (file_exists($dirforterms.'/'.$termofsale)) { + $file = dol_dir_list($dirforterms, 'files', 0, $termofsale); + print '
'.$termofsale.''.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, ''); + print ''; + } +} +print '
'; +print '
'; +print '
'; + + +print '
'; + +print '
'; + + +print '

'; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index f60bed8f0c9..f40c357e13e 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -1,7 +1,7 @@ * Copyright (C) 2020 Maxime DEMAREST - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -230,7 +230,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); if (getDolGlobalString('PAYMENT_ADDON') . '.php' == $file) { // If module is the one used, we show existing errors if (!empty($module->error)) { diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 73b4d52596c..8e5bbe44ae5 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -224,11 +224,33 @@ if (isModEnabled('propal')) { print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING); + print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')); } print ''; */ + print ''; + print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_PROPAL_SHOW_PRICE_INCL_TAX'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_PROPAL_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX')); + } + print ''; + + print ''; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')); + } + print ''; + print ''; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -236,18 +258,7 @@ if (isModEnabled('propal')) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL); - } - print ''; - - print ''; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')); } print ''; @@ -261,7 +272,31 @@ if (isModEnabled('order')) { print '
'; print ''; + print ''; + + print ''; + + print ''; + print ''; - print ''; @@ -289,74 +324,6 @@ if (isModEnabled('order')) { } -if (isModEnabled('supplier_proposal')) { - $langs->load("supplier_proposal"); - print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal'); - - print '
'; - print '
'.$langs->trans("Parameters").'
'; + print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_ORDER_SHOW_PRICE_INCL_TAX'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_ORDER_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_ORDER_SHOW_PRICE_INCL_TAX')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_ORDERS_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_ORDERS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_ORDERS_WITH_PICTURE')); + } + print '
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -269,18 +304,18 @@ if (isModEnabled('order')) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_ORDER')); } print '
'; + print '
'; print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('SALES_ORDER_SHOW_SHIPPING_ADDRESS'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->SALES_ORDER_SHOW_SHIPPING_ADDRESS); + print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('SALES_ORDER_SHOW_SHIPPING_ADDRESS')); } print '
'; - print ''; - - print ''; - - print ''; - - print '
'.$langs->trans("Parameter").'
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE); - } - print '
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN); - } - print '
'; - print '
'; -} - - -if (isModEnabled('supplier_order')) { - $langs->load("supplier_order"); - print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal'); - - print '
'; - print ''; - print ''; - - print ''; - - print ''; - - print '
'.$langs->trans("Parameter").'
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE); - } - print '
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN); - } - print '
'; - print '
'; -} if (isModEnabled('invoice')) { print load_fiche_titre($langs->trans("Invoices"), '', 'bill'); @@ -365,6 +332,28 @@ if (isModEnabled('invoice')) { print ''; print ''; + print ''; + + print ''; + print ''; + print ''; @@ -466,7 +456,77 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('INVOICE_HIDE_LINKED_OBJECT'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, $conf->global->INVOICE_HIDE_LINKED_OBJECT); + print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, getDolGlobalString('INVOICE_HIDE_LINKED_OBJECT')); + } + print ''; + + print '
'.$langs->trans("Parameters").'
'; + print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_INVOICE_SHOW_PRICE_INCL_TAX'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_INVOICE_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_INVOICE_SHOW_PRICE_INCL_TAX')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_INVOICES_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_INVOICES_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_INVOICES_WITH_PICTURE')); + } + print '
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -372,9 +361,10 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_INVOICE); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')); } print '
'; print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore")); print ''; @@ -430,7 +420,7 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('INVOICE_SHOW_SHIPPING_ADDRESS'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->INVOICE_SHOW_SHIPPING_ADDRESS); + print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('INVOICE_SHOW_SHIPPING_ADDRESS')); } print '
'; + print ''; +} + + +if (isModEnabled('supplier_proposal')) { + $langs->load("supplier_proposal"); + print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal'); + + print '
'; + print ''; + print ''; + + print ''; + + print ''; + + print '
'.$langs->trans("Parameter").'
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN')); + } + print '
'; + print '
'; +} + + +if (isModEnabled('supplier_order')) { + $langs->load("supplier_order"); + print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal'); + + print '
'; + print ''; + print ''; + + print ''; + + print ''; @@ -495,7 +555,6 @@ if (isModEnabled('shipping')) { print ''; } - if (isModEnabled('reception')) { print load_fiche_titre($langs->trans("Receptions"), '', 'reception'); @@ -572,7 +631,7 @@ $maxfilesizearray = getMaxFileSizeArray(); $tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '
'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : ''; $documenturl = DOL_URL_ROOT.'/document.php'; if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) { - $documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP; + $documenturl = getDolGlobalString('DOL_URL_ROOT_DOCUMENT_PHP'); } $modulepart = 'mycompany'; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 49ca75ee0a1..f9c26ab8616 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -346,7 +346,7 @@ foreach ($dirmodels as $reldir) { } print ''; print "\n"; @@ -486,7 +486,7 @@ foreach ($dirmodels as $reldir) { print ''; // Preview diff --git a/htdocs/admin/propal_pdf.php b/htdocs/admin/propal_pdf.php new file mode 100644 index 00000000000..5dc4e5064e4 --- /dev/null +++ b/htdocs/admin/propal_pdf.php @@ -0,0 +1,209 @@ + + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2024-2025 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 + * 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/admin/propal.php + * \ingroup propale + * \brief Setup page for commercial proposal module + */ + +// Load Dolibarr environment +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Societe $mysoc + * @var Translate $langs + * @var User $user + */ + +// Load translation files required by the page +$langs->loadLangs(array("admin", "other", "errors", "propal")); + +if (!$user->admin) { + accessforbidden(); +} + +$action = GETPOST('action', 'aZ09'); +$value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); +$type = 'propal'; + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + +$error = 0; +if ($action == "update") { + if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')) { + dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_PROPAL", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", 'int'), 'chaine', 0, '', $conf->entity); + } + if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) { + dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity); + } + + // Terms of sale + if ($_FILES['termsofsale']["name"]) { + if (!preg_match('/(\.pdf)$/i', $_FILES['termsofsale']["name"])) { // Document can be used on a lot of different places. Only pdf can be supported. + $langs->load("errors"); + setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors'); + } else { + $dirforterms = $conf->propal->dir_output.'/'; + $original_file = $_FILES['termsofsale']["name"]; + $result = dol_move_uploaded_file($_FILES['termsofsale']["tmp_name"], $dirforterms.$original_file, 1, 0, $_FILES['termsofsale']['error']); + if ($result) { + dolibarr_set_const($db, 'MAIN_INFO_PROPAL_TERMSOFSALE', $original_file, 'chaine', 0, '', $conf->entity); + } + } + } + + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + exit; +} + +// Terms of sale +if ($action == 'removetermsofsale') { + $filename = getDolGlobalString('MAIN_INFO_PROPAL_TERMSOFSALE'); + $file = $conf->propal->dir_output.'/'.$filename; + + if ($filename != '') { + dol_delete_file($file); + } + dolibarr_del_const($db, 'MAIN_INFO_PROPAL_TERMSOFSALE', $conf->entity); +} + +/* + * View + */ + +$form = new Form($db); +$formfile = new FormFile($db); + +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); + +llxHeader('', $langs->trans("PropalSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-propal'); + +//if ($mesg) print $mesg; + +$linkback = ''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("PropalSetup"), $linkback, 'title_setup'); + +$head = propal_admin_prepare_head(); + +print dol_get_fiche_head($head, 'pdf', $langs->trans("Proposals"), -1, 'propal'); + +print '
'; +print ''; +print ''; + +print '
'; +print '
'.$langs->trans("Parameter").'
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN')); } print '
'; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print '
'; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print '
'; +print ''; + +print ''; + +print ''; + +print '
'.$langs->trans("Parameter").'
'; +print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp")); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL); +} +print '
'; +print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); +} +print '
'; +print '
'; + +print load_fiche_titre($langs->trans("Files"), '', 'file'); +print '
'; +print ''; +print ''; + +// Terms of sale +$tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf'; +$maxfilesizearray = getMaxFileSizeArray(); +$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '
'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : ''; +$documenturl = DOL_URL_ROOT.'/document.php'; +if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) { + $documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP; +} +$modulepart = 'propal'; + +print ''; +print '
'.$langs->trans("Parameters").'
'; +print '
'; +print ''; + +if (getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE")) { + $termofsale = getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE"); + if (file_exists($conf->propal->dir_output.'/'.$termofsale)) { + $file = dol_dir_list($conf->propal->dir_output, 'files', 0, $termofsale); + print '
'.$termofsale.''.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, ''); + print ''; + } +} +print '
'; +print '
'; +print '
'; + + +print '
'; + +print ''; + + +print '

'; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 7c1c855dc0a..b783d9e07df 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -279,7 +279,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -421,7 +421,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 952bccf2074..10df54ee44d 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -5,7 +5,7 @@ * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2013 Florian Henry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -656,7 +656,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/stocktransfer.php b/htdocs/admin/stocktransfer.php index 6a14e25c466..8dc65bc920e 100644 --- a/htdocs/admin/stocktransfer.php +++ b/htdocs/admin/stocktransfer.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2021 SuperAdmin - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -337,7 +337,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -473,7 +473,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 8dab80b8157..b0c05b8bbea 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -303,7 +303,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -441,7 +441,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; print ''.img_object($langs->trans("Preview"), 'pdf').''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index ba4886573f3..c10d59f2939 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -320,7 +320,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; @@ -446,7 +446,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; print ''.img_object($langs->trans("Preview"), 'pdf').''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 3419f734977..20d89893d8e 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Juanjo Menent * Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2020 Maxime DEMAREST - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -307,7 +307,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); if (getDolGlobalString("PAYMENT_ADDON").'.php' == $file) { // If module is the one used, we show existing errors if (!empty($module->error)) { @@ -421,7 +421,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print ''; print ''.img_object($langs->trans("Preview"), 'pdf').''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 4c3fc9ee12c..c642ff20383 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -8,7 +8,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -336,7 +336,7 @@ foreach ($dirmodels as $reldir) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -475,7 +475,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index ed039b164b7..2d20ee0fff0 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -94,7 +94,7 @@ print ''.$langs->trans("Password").''.$langs->trans("DBStoringCharset").''.$db->getDefaultCharacterSetDatabase(); if ($db->type == 'mysqli') { $tooltipexample = "
SHOW VARIABLES LIKE 'character_set_database' (cached)
You can avoid cache effect with:
SELECT DEFAULT_CHARACTER_SET_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = '".$db->escape($conf->db->name)."'"; - print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetValue", $tooltipexample.'
'.$langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "
SHOW CHARSET"))); + print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetValue", $tooltipexample.'
'.$langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "
SHOW CHARSET")."

Example to change value: ALTER DATABASE ".$conf->db->name." CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;")); // We can use $db->getDefaultCharacterSetDatabase(), $db->getListOfCharacterSet(), } print ''."\n"; @@ -107,7 +107,7 @@ if ($db->type == 'mysqli') { print img_warning('The database default value of collation '.$defaultcollation.' differs from conf setup '.$conf->db->dolibarr_main_db_collation); } $tooltipexample = "
SHOW VARIABLES LIKE 'collation_database' (cached)
You can avoid cache effect with:
SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = '".$db->escape($conf->db->name)."'"; - print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetValue", $tooltipexample.'
'.$langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "
SHOW COLLATION"))); + print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetValue", $tooltipexample.'
'.$langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "
SHOW COLLATION")."

Example to change value: ALTER DATABASE ".$conf->db->name." CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;")); // We can use $db->getDefaultCollationDatabase(), $db->getListOfCollation(); print '       '.$langs->trans("ConvertInto"); diff --git a/htdocs/admin/tools/ui/class/documentation.class.php b/htdocs/admin/tools/ui/class/documentation.class.php index 642b07121da..3c2c0180cc8 100644 --- a/htdocs/admin/tools/ui/class/documentation.class.php +++ b/htdocs/admin/tools/ui/class/documentation.class.php @@ -155,6 +155,15 @@ class Documentation 'DocSetEventMessageContextualVariations' => '#seteventmessagesection-contextvariations', ) ), + 'Inputs' => array( + 'url' => dol_buildpath($baseUrl.'/components/inputs.php', 1), + 'icon' => 'fas fa-comments pictofixedwidth', + 'submenu' => array(), + 'summary' => array( + 'DocBasicUsage' => '#setinputssection-basicusage', + 'DocHelperFunctionsInputUsage' => '#setinputssection-helperfunctions', + ) + ), ), 'summary' => array( 'keySum' => '#keySum' diff --git a/htdocs/admin/tools/ui/components/inputs.php b/htdocs/admin/tools/ui/components/inputs.php new file mode 100644 index 00000000000..3f8c7edda78 --- /dev/null +++ b/htdocs/admin/tools/ui/components/inputs.php @@ -0,0 +1,308 @@ + + * + * This program and files/directory inner it is free software: you can + * redistribute it and/or modify it under the terms of the + * GNU Affero General Public License (AGPL) 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 AGPL for more details. + * + * You should have received a copy of the GNU AGPL + * along with this program. If not, see . + */ + +// Load Dolibarr environment +require '../../../../main.inc.php'; + +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ + +// Protection if external user +if ($user->socid > 0) : accessforbidden(); +endif; + +// Includes +dol_include_once('admin/tools/ui/class/documentation.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + +// Load documentation translations +$langs->load('uxdocumentation'); + +$action = GETPOST('action', 'alpha'); + +// +$documentation = new Documentation($db); + +// Output html head + body - Param is Title +$documentation->docHeader('Inputs'); + +// Set view for menu and breadcrumb +// Menu must be set in constructor of documentation class +$documentation->view = array('Components','Inputs'); + +// Output sidebar +$documentation->showSidebar(); ?> + +
+ + showBreadCrumb(); ?> + +
+ +

trans('DocInputsTitle'); ?>

+

trans('DocInputsMainDescription'); ?>

+ + + showSummary(); ?> + + +
+

trans('DocBasicUsage'); ?>

+ +

trans('DocClassicInputsDescription'); ?>

+
+ Available Input + +

+ Disabled Input + +
+ Available Input', + '', + '', + 'Disabled Input', + '', + ); + echo $documentation->showCode($lines); ?> + + +

trans('DocCheckboxInputsDescription'); ?>

+
+ + + +
+ ', + '', + '', + ); + echo $documentation->showCode($lines); ?> + + +

trans('DocRadioInputsDescription'); ?>

+
+ Radio Input +
+ Radio Input' + ); + echo $documentation->showCode($lines); ?> +
+ + +
+

trans('DocHelperFunctionsInputUsage'); ?>

+

trans('DocSelectInputsDescription'); ?>

+
+ Select with empty value + 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->selectarray('htmlnameselectwithemptyvalue', $values, 'idselectwithemptyvalue', 1, 0, 0, '', 0, 0, 0, '', 'minwidth200'); + ?> +

+ Select within empty value + 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->selectarray('htmlnameselectwithinemptyvalue', $values, 'idnameselectwithinemptyvalue', 0, 0, 0, '', 0, 0, 0, '', 'minwidth200'); + ?> +
+ value) or array(key=>array(\'label\'=>..., \'data-...\'=>..., \'disabled\'=>..., \'css\'=>...)),', + ' * @param string|string[]|int $id Preselected key or array of preselected keys for multiselect. Use \'ifone\' to autoselect record if there is only one record.,', + ' * @param int<0,1>|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is \'\' or " ", If \'Placeholder string\': key is -1 and value is the string), <0 to add an empty value with key that is this value.,', + ' * @param int<0,1> $key_in_label 1 to show key into label with format "[key] value",', + ' * @param int<0,1> $value_as_key 1 to use value as key,', + ' * @param string $moreparam Add more parameters onto the select tag. For example "style=\"width: 95%\"" to avoid select2 component to go over parent container,', + ' * @param int<0,1> $translate 1=Translate and encode value,', + ' * @param int $maxlen Length maximum for labels,', + ' * @param int<0,1> $disabled Html select box is disabled,', + ' * @param string $sort \'ASC\' or \'DESC\' = Sort on label, \'\' or \'NONE\' or \'POS\' = Do not sort, we keep original order,', + ' * @param string $morecss Add more class to css styles,', + ' * @param int $addjscombo Add js combo,', + ' * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set,', + ' * @param int $disablebademail 1=Check if a not valid email, 2=Check string \'---\', and if found into value, disable and colorize entry,', + ' * @param int $nohtmlescape No html escaping (not recommended, use \'data-html\' if you need to use label with HTML content).,', + ' * @return string HTML select string.,', + ' */', + '', + 'Select with empty value', + 'print $form->selectarray(\'htmlnameselectwithemptyvalue\', $values, \'idselectwithemptyvalue\', 1, 0, 0, \'\', 0, 0, 0, \'\', \'minwidth200\');', + '', + 'Select within empty value', + 'print $form->selectarray(\'htmlnameselectwithinemptyvalue\', $values, \'idnameselectwithinemptyvalue\', 0,0, 0, \'\', 0, 0, 0, \'\', \'minwidth200\');', + + ); + echo $documentation->showCode($lines); ?> + + +

trans('DocMultiSelectInputsDescription'); ?>

+
+ Multiselect + 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->multiselectarray('categories', $values, GETPOST('categories', 'array'), 0, 0, 'minwidth200', 0, 0); + ?> +
+ $array Array(key=>value) or Array(key=>array(\'id\'=>key, \'label\'=>value, \'color\'=> , \'picto\'=> , \'labelhtml\'=> ))', + ' * @param string[] $selected Array of keys preselected', + ' * @param int<0,1> $key_in_label 1 to show key like in "[key] value"', + ' * @param int<0,1> $value_as_key 1 to use value as key', + ' * @param string $morecss Add more css style', + ' * @param int<0,1> $translate Translate and encode value', + ' * @param int|string $width Force width of select box. May be used only when using jquery couch. Example: 250, \'95%\'', + ' * @param string $moreattrib Add more options on select component. Example: \'disabled\'', + ' * @param string $elemtype Type of element we show (\'category\', ...). Will execute a formatting function on it. To use in readonly mode if js component support HTML formatting.', + ' * @param string $placeholder String to use as placeholder', + ' * @param int<-1,1> $addjscombo Add js combo', + ' * @return string HTML multiselect string', + ' * @see selectarray(), selectArrayAjax(), selectArrayFilter()', + ' */', + '', + 'Multiselect', + 'print $form->multiselectarray(\'categories\', $values, GETPOST(\'categories\', \'array\'), 0, 0, \'minwidth200\', 0, 0);' + ); + echo $documentation->showCode($lines); ?> + + +

trans('DocDateSelectInputsDescription'); ?>

+
+ Date Select + 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->selectDate(); + ?> +

+ Date Select with hours + 'value 1', '2' => 'value 2', '3' => 'value 3']; + $form = new Form($db); + print $form->selectDate('', 're2', 1, 1, 1); + ?> +
+ $d 1=Show days, month, years,', + ' * @param int<0,2> $addnowlink Add a link "Now", 1 with server time, 2 with local computer time,', + ' * @param int<0,1> $disabled Disable input fields,', + ' * @param int|string $fullday When a checkbox with id #fullday is checked, hours are set with 00:00 (if value if \'fulldaystart\') or 23:59 (if value is \'fulldayend\'),', + ' * @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field.,', + ' * @param int|string|array $adddateof Add a link "Date of ..." using the following date. Must be array(array(\'adddateof\' => ..., \'labeladddateof\' => ...)),', + ' * @param string $openinghours Specify hour start and hour end for the select ex 8,20,', + ' * @param int $stepminutes Specify step for minutes between 1 and 30,', + ' * @param string $labeladddateof Label to use for the $adddateof parameter. Deprecated. Used only when $adddateof is not an array.,', + ' * @param string $placeholder Placeholder,', + ' * @param \'auto\'|\'gmt\'|\'tzserver\'|\'tzuserrel\' $gm \'auto\' (for backward compatibility, avoid this), \'gmt\' or \'tzserver\' or \'tzuserrel\',', + ' * @param string $calendarpicto URL of the icon/image used to display the calendar,', + ' * @return string Html for selectDate,', + ' * @see form_date(), select_month(), select_year(), select_dayofweek(),', + ' */', + '', + 'Date Select', + 'print $form->selectDate();', + '', + 'Date Select with hours', + 'print $form->selectDate(\'\', \'re2\', 1, 1, 1);' + ); + echo $documentation->showCode($lines); ?> + + + +

trans('DocEditorInputsDescription'); ?>

+
+ Create(); + ?> +
+ $readonly 0=Read/Edit, 1=Read only', + ' * @param array{x?:string,y?:string,find?:string} $poscursor Array for initial cursor position array(\'x\'=>x, \'y\'=>y).', + ' * array(\'find\'=> \'word\') can be used to go to line were the word has been found', + ' */', + '', + '$doleditor = new DolEditor(\'desc\', GETPOST(\'desc\', \'restricthtml\'), \'\', 160, \'dolibarr_details\', \'\', false, true, getDolGlobalString(\'FCKEDITOR_ENABLE_DETAILS\'), ROWS_4, \'90%\');', + 'print $form->multiselectarray(\'categories\', $values, GETPOST(\'categories\', \'array\'), 0, 0, \'minwidth200\', 0, 0);' + ); + echo $documentation->showCode($lines); ?> +
+
+ +
+ +docFooter(); + +?> diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 045c32ef64a..78679cc16e5 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -59,6 +59,11 @@ if ($mode == 'searchkey') { $transvalue = GETPOST('transvalue', 'restricthtml'); } +$entity = $conf->entity; +if (isModEnabled('multicompany') && !$user->entity) { + $entity = GETPOST('entity', 'int'); +} + // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -128,10 +133,19 @@ if ($action == 'update') { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NewTranslationStringToShow")), null, 'errors'); $error++; } + if ($entity == '') { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Entity")), null, 'errors'); + $error++; + } if (!$error) { $db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".(GETPOSTINT('rowid')); + $sql = "UPDATE " . MAIN_DB_PREFIX . "overwrite_trans set transkey = '" . $db->escape( + $transkey + ) . "', transvalue = '" . $db->escape($transvalue) . "', entity = '" . $db->escape( + $entity + ) . "' WHERE rowid = " . ((int) GETPOST('rowid', 'int')); + $result = $db->query($sql); if ($result) { $db->commit(); @@ -368,7 +382,9 @@ if ($mode == 'overwrite') { print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("TranslationKey", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("NewTranslationStringToShow", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); - //if (isModEnabled('multicompany') && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder); + if (isModEnabled('multicompany') && !$user->entity) { + print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'Entity', '', $param, '', $sortfield, $sortorder); + } print ''; print "\n"; @@ -376,21 +392,36 @@ if ($mode == 'overwrite') { // Line to add new record print "\n"; - print ''; + print ''; + + // Lang + print ''; print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, array(), 1, 0, $disablededit ? 1 : 0, 'maxwidth250', 1); print ''."\n"; + + // Trans key print ''; print ''; - print ''; + print ''; + + // Value + print ''; print ''; print ''; + + // Multi company + if (isModEnabled('multicompany') && !$user->entity) { + print ''; + print ''; + print ''; + } + print ''; print ''; print ''; print "\n"; print ''; - // Show constants $sql = "SELECT rowid, entity, lang, transkey, transvalue"; $sql .= " FROM ".MAIN_DB_PREFIX."overwrite_trans"; @@ -411,7 +442,10 @@ if ($mode == 'overwrite') { print ''; + // Lang print ''.dol_escape_htmltag($obj->lang).''."\n"; + + // Trans key print ''; if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; @@ -441,6 +475,19 @@ if ($mode == 'overwrite') { } print ''; + // Entity limit to superadmin + if (isModEnabled('multicompany') && empty($user->entity)) { + print ''; + if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { + print ''; + } else { + print dol_escape_htmltag($obj->entity); + } + print ''; + } else { + print ''; + } + print ''; if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 0c957617ce1..8055e5fdcde 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2020-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -317,7 +317,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index fbaa912385a..15939c806c2 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -236,7 +236,7 @@ foreach ($dirmodels as $reldir) { print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index dc6017c33ed..b93b8e0bb0c 100644 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -1,7 +1,7 @@ * Copyright (C) 2020 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -281,7 +281,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -415,7 +415,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 22e36b47bda..4930864aa71 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2024 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -301,7 +301,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; print "\n"; @@ -439,7 +439,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; // Preview diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index e90672c6d76..44eb8af5724 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018-2024 Alexandre Spangaro * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Jose MARTINEZ * * This program is free software; you can redistribute it and/or modify @@ -84,23 +84,23 @@ class Asset extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), - 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'noteditable' => 0, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "Reference of object"), - 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,), - 'fk_asset_model' => array('type' => 'integer:AssetModel:asset/class/assetmodel.class.php:1:((status:=:1) and (entity:IN:__SHARED_ENTITIES__))', 'label' => 'AssetModel', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => 1,), + 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'noteditable' => 0, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "Reference of object", "css" => "maxwidth150"), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax125', 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,), + 'fk_asset_model' => array('type' => 'integer:AssetModel:asset/class/assetmodel.class.php:1:((status:=:1) and (entity:IN:__SHARED_ENTITIES__))', 'label' => 'AssetModel', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => 1, 'csslist' => 'tdoverflowmax75', 'css' => 'maxwidth300'), 'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 0, 'default' => '1', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'validate' => 1,), - 'acquisition_type' => array('type' => 'smallint', 'label' => 'AssetAcquisitionType', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetAcquisitionTypeNew', 1 => 'AssetAcquisitionTypeOccasion'), 'validate' => 1,), - 'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetTypeIntangible', 1 => 'AssetTypeTangible', 2 => 'AssetTypeInProgress', 3 => 'AssetTypeFinancial'), 'validate' => 1,), - 'not_depreciated' => array('type' => 'boolean', 'label' => 'AssetNotDepreciated', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1,), + 'acquisition_type' => array('type' => 'smallint', 'label' => 'AssetAcquisitionType', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetAcquisitionTypeNew', 1 => 'AssetAcquisitionTypeOccasion'), 'validate' => 1, 'csslist' => 'tdoverflowmax75'), + 'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetTypeIntangible', 1 => 'AssetTypeTangible', 2 => 'AssetTypeInProgress', 3 => 'AssetTypeFinancial'), 'validate' => 1, 'csslist' => 'tdoverflowmax75'), + 'not_depreciated' => array('type' => 'boolean', 'label' => 'AssetNotDepreciated', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1, 'csslist' => 'maxwidth50 tdoverflowmax50', 'css' => 'maxwidth50imp'), 'date_acquisition' => array('type' => 'date', 'label' => 'AssetDateAcquisition', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => 1,), 'date_start' => array('type' => 'date', 'label' => 'AssetDateStart', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => -1,), 'acquisition_value_ht' => array('type' => 'price', 'label' => 'AssetAcquisitionValueHT', 'enabled' => 1, 'position' => 110, 'notnull' => 1, 'visible' => 1, 'isameasure' => 1, 'validate' => 1,), 'recovered_vat' => array('type' => 'price', 'label' => 'AssetRecoveredVAT', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'isameasure' => 1, 'validate' => 1,), 'reversal_date' => array('type' => 'date', 'label' => 'AssetReversalDate', 'enabled' => 1, 'position' => 130, 'notnull' => 0, 'visible' => 1,), - 'reversal_amount_ht' => array('type' => 'price', 'label' => 'AssetReversalAmountHT', 'enabled' => 1, 'position' => 140, 'notnull' => 0, 'visible' => 1, 'isameasure' => 1, 'validate' => 1,), + 'reversal_amount_ht' => array('type' => 'price', 'label' => 'AssetReversalAmountHT', 'enabled' => 1, 'position' => 140, 'notnull' => 0, 'visible' => 1, 'isameasure' => 1, 'validate' => 1, 'csslist' => 'maxwidth50'), 'disposal_date' => array('type' => 'date', 'label' => 'AssetDisposalDate', 'enabled' => 1, 'position' => 200, 'notnull' => 0, 'visible' => -2,), 'disposal_amount_ht' => array('type' => 'price', 'label' => 'AssetDisposalAmount', 'enabled' => 1, 'position' => 210, 'notnull' => 0, 'visible' => -2, 'default' => '0', 'isameasure' => 1, 'validate' => 1,), 'fk_disposal_type' => array('type' => 'sellist:c_asset_disposal_type:label:rowid::active=1', 'label' => 'AssetDisposalType', 'enabled' => 1, 'position' => 220, 'notnull' => 0, 'visible' => -2, 'index' => 1, 'validate' => 1,), @@ -713,7 +713,7 @@ class Asset extends CommonObject */ $sql = "SELECT ad.rowid, ad.depreciation_mode, ad.ref, ad.depreciation_date, ad.depreciation_ht, ad.cumulative_depreciation_ht"; - $sql .= ", " . $this->db->ifsql('iab.fk_docdet IS NOT NULL', 1, 0) . " AS bookkeeping"; + $sql .= ", " . $this->db->ifsql('iab.fk_docdet IS NOT NULL', '1', '0') . " AS bookkeeping"; $sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation AS ad"; $sql .= " LEFT JOIN (SELECT DISTINCT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset') AS iab ON iab.fk_docdet = ad.rowid"; $sql .= " WHERE ad.fk_asset = " . (int) $this->id; diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index ecd6d276726..16db99fcd02 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -66,7 +66,7 @@ class AssetDepreciationOptions extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index fcb463504e4..f985497ed4d 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -89,7 +89,7 @@ class AssetModel extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 649f436b2e0..30ceb45988b 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -53,26 +53,29 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'assetlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$mode = GETPOST('mode', 'alpha'); // mode view (kanban or common) +$mode = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...) +$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut' + $id = GETPOSTINT('id'); // 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 < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { +$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 or if we click on clear filters or if we select empty mass action +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize a technical objects +// Initialize technical objects $object = new Asset($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -90,7 +93,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml'); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { @@ -111,12 +114,13 @@ foreach ($object->fields as $key => $val) { } // Definition of array of fields for columns +$tableprefix = 't'; $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { $visible = (int) dol_eval((string) $val['visible'], 1); - $arrayfields['t.'.$key] = array( + $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), @@ -171,7 +175,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array(); +$parameters = array('arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -190,6 +194,7 @@ if (empty($reshook)) { $search[$key.'_dtend'] = ''; } } + $search_all = ''; $toselect = array(); $search_array_options = array(); } @@ -202,6 +207,8 @@ if (empty($reshook)) { $objectclass = 'Asset'; $objectlabel = 'Asset'; $uploaddir = $conf->asset->dir_output; + + global $error; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -223,17 +230,17 @@ $morecss = array(); // Build and execute select // -------------------------------------------------------------------- -$sql = 'SELECT '; -$sql .= $object->getFieldList('t'); +$sql = "SELECT"; +$sql .= " ".$object->getFieldList('t'); // 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 : ""); } } // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); @@ -245,10 +252,10 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array } // Add table from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } @@ -264,18 +271,24 @@ foreach ($search as $key => $val) { } $mode_search = 2; } - if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + if (empty($object->fields[$key]['searchmulti'])) { + if (!is_array($search[$key]) && $search[$key] != '') { + $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (is_array($search[$key]) && !empty($search[$key])) { + $sql .= natural_search("t.".$db->escape($key), implode(',', $search[$key]), (($key == 'status') ? 2 : $mode_search)); + } } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; + $sql .= " AND t.".$db->sanitize($columnName)." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$db->sanitize($columnName)." <= '".$db->idate($search[$key])."'"; } } } @@ -289,13 +302,13 @@ if ($search_all) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; /* If a group by is required $sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= "t.".$key.", "; + $sql .= "t.".$db->sanitize($key).", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -303,9 +316,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } } -// Add where from hooks +// Add groupby from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); */ @@ -313,8 +326,8 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Add HAVING from hooks /* $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook -$sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 " . $hookmanager->resPrint) : ""; +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint; */ // Count total nb of records @@ -331,7 +344,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -354,10 +367,10 @@ $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.'/asset/card.php?id='.$id); + header("Location: ".DOL_URL_ROOT.'/asset/card.php?id='.((int) $id)); exit; } @@ -365,36 +378,46 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-asset page-list'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-asset page-list bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +if ($groupby != '') { + $param .= '&groupby='.urlencode($groupby); +} foreach ($search as $key => $val) { - if (is_array($search[$key]) && count($search[$key])) { + if (is_array($search[$key])) { foreach ($search[$key] as $skey) { if ($skey != '') { $param .= '&search_'.$key.'[]='.urlencode($skey); } } + } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { + $param .= '&search_'.$key.'month='.GETPOSTINT('search_'.$key.'month'); + $param .= '&search_'.$key.'day='.GETPOSTINT('search_'.$key.'day'); + $param .= '&search_'.$key.'year='.GETPOSTINT('search_'.$key.'year'); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } } -if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); -} // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks $parameters = array('param' => &$param); -$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $param .= $hookmanager->resPrint; // List of mass actions available @@ -404,7 +427,7 @@ $arrayofmassactions = array( //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); -if ($permissiontodelete) { +if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { @@ -423,6 +446,9 @@ print ''; print ''; print ''; print ''; +print ''; +print ''; + $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/asset/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); @@ -437,10 +463,14 @@ $trackid = 'asset'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($search_all) { + $setupstring = ''; + // @phan-suppress-next-line PhanEmptyForeach foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); + $setupstring .= $key."=".$val.";"; } - print '
'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'
'; + print ''."\n"; + print '
'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'
'."\n"; } $moreforfilter = ''; @@ -455,6 +485,9 @@ if (empty($reshook)) { } else { $moreforfilter = $hookmanager->resPrint; } +$parameters = array( + 'arrayfields' => &$arrayfields, +); if (!empty($moreforfilter)) { print '
'; @@ -463,7 +496,8 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column ? 'left' : ''); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table @@ -472,8 +506,16 @@ print ''; +print ''; +// Action column +if ($conf->main_checkbox_left_column) { + print ''; +} foreach ($object->fields as $key => $val) { + //$searchkey = empty($search[$key]) ? '' : $search[$key]; $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -481,15 +523,19 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; } @@ -512,19 +558,28 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters = array('arrayfields' => $arrayfields); -$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; +if (!$conf->main_checkbox_left_column) { + print ''; +} print ''."\n"; +$totalarray = array(); +$totalarray['nbfield'] = 0; // Fields title label // -------------------------------------------------------------------- print ''; +// Action column +if ($conf->main_checkbox_left_column) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { @@ -533,21 +588,26 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label if (!empty($arrayfields['t.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; + $totalarray['nbfield']++; } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +if (!$conf->main_checkbox_left_column) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} print ''."\n"; @@ -565,9 +625,11 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar // Loop on record // -------------------------------------------------------------------- $i = 0; +$savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; -while ($i < ($limit ? min($num, $limit) : $num)) { +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); if (empty($obj)) { break; // Should not happen @@ -576,8 +638,26 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Store properties in $object $object->setVarsFromFetchObj($obj); - // Show here line of result - print ''; + // Show line of result + $j = 0; + print ''; + + // Action column + if ($conf->main_checkbox_left_column) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Fields foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { @@ -587,18 +667,22 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; } elseif ($key == 'ref') { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; + print '$key) && !in_array($key, array('ref'))) { + print ' title="'.dol_escape_htmltag($object->$key).'"'; + } + print '>'; if ($key == 'status') { print $object->getLibStatut(5); } elseif ($key == 'rowid') { @@ -628,20 +712,22 @@ while ($i < ($limit ? min($num, $limit) : $num)) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column - print ''; + if (!$i) { + $totalarray['nbfield']++; } - print ''; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; } print ''."\n"; @@ -667,7 +753,7 @@ if ($num == 0) { $db->free($resql); $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ''."\n"; diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 952dec310b6..5fa452e781f 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -51,6 +51,8 @@ if (!defined('NOREQUIREAJAX')) { /** * Empty header * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page @@ -68,7 +70,7 @@ if (!defined('NOREQUIREAJAX')) { * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction { print ''."\n"; print ''."\n"; @@ -79,12 +81,14 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab /** * Empty footer * + * Note: also called by functions.lib:recordNotFound + * * @param string $comment A text to add as HTML comment into HTML generated page * @param string $zone 'private' (for private pages) or 'public' (for public pages) * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction { print "\n".''."\n"; } diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 01cb2c58f1c..35f7934add0 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 ATM Consulting * Copyright (C) 2017-2018 Laurent Destailleur * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -353,7 +353,7 @@ $help_url = "EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Ina llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-blockedlog page-admin_blockedlog_list'); -$blocks = $block_static->getLog('all', $search_id, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code); +$blocks = $block_static->getLog('all', (int) $search_id, $MAXLINES, $sortfield, $sortorder, (int) $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code); if (!is_array($blocks)) { if ($blocks == -2) { setEventMessages($langs->trans("TooManyRecordToScanRestrictFilters", $MAXLINES), null, 'errors'); @@ -440,7 +440,7 @@ print ''; print '
'; print $langs->trans("RestrictYearToExport").': '; // Month -print $formother->select_month(GETPOSTINT('monthtoexport'), 'monthtoexport', 1, 0, 'minwidth50 maxwidth75imp valignmiddle', true); +print $formother->select_month((string) GETPOSTINT('monthtoexport'), 'monthtoexport', 1, 0, 'minwidth50 maxwidth75imp valignmiddle', true); print ''; print ''; print ''; @@ -491,7 +491,7 @@ print ''; // User print ''; -print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth150'); +print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth150'); print ''; // Actions code diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index c959800cef7..afe6549c03d 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 ATM Consulting * Copyright (C) 2017-2020 Laurent Destailleur * Copyright (C) 2022 charlene benke - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -102,12 +102,12 @@ class BlockedLog public $fk_user = 0; /** - * @var int|string date_creation + * @var int|string */ public $date_creation; /** - * @var int|string $date_modification; + * @var int|string */ public $date_modification; @@ -395,11 +395,11 @@ class BlockedLog /** * Populate properties of log from object data * - * @param CommonObject $object object to store - * @param string $action action - * @param float|int $amounts amounts - * @param ?User $fuser User object (forced) - * @return int<-1,-1>|int<1,1> >0 if OK, <0 if KO + * @param CommonObject|stdClass $object object to store + * @param string $action action + * @param float|int $amounts amounts + * @param ?User $fuser User object (forced) + * @return int<-1,-1>|int<1,1> >0 if OK, <0 if KO */ public function setObjectData(&$object, $action, $amounts, $fuser = null) { @@ -1115,7 +1115,7 @@ class BlockedLog if (empty($previoussignature)) { $sql = "SELECT rowid, signature FROM ".MAIN_DB_PREFIX."blockedlog"; if ($beforeid) { - $sql.= $this->db->hintindex('entity_rowid', 1); + $sql .= $this->db->hintindex('entity_rowid', 1); } $sql .= " WHERE entity = ".((int) $conf->entity); if ($beforeid) { diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index ed592c8ff91..1663a64d1bf 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -1,6 +1,7 @@ * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2025 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 @@ -135,7 +136,7 @@ $form = new Form($db); $formfile = new FormFile($db); $title = $langs->trans('BOM'); -$help_url ='EN:Module_BOM'; +$help_url = 'EN:Module_BOM'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-bom page-net_needs'); @@ -330,7 +331,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($useunit) { require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; $unit = new CUnits($db); - $unit->fetch($elem['fk_unit']); + $unit->fetch((int) $elem['fk_unit']); print(isset($unit->label) ? " ".$langs->trans(ucwords($unit->label))." " : ''); } print ''; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index d779f11f4d7..49ebde095d7 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -98,7 +98,7 @@ class BOM extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/bom/class/bomline.class.php b/htdocs/bom/class/bomline.class.php index 67b879078df..a26f0c2a9f2 100644 --- a/htdocs/bom/class/bomline.class.php +++ b/htdocs/bom/class/bomline.class.php @@ -80,7 +80,7 @@ class BOMLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'LineID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index def20558866..1ce3201aa9c 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -6,7 +6,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Juanjo Menent - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -153,7 +153,7 @@ print ''; if ($filtertype != 1) { // Product if (getDolGlobalInt('PRODUCT_USE_UNITS')) { // For product, unit is shown only if option PRODUCT_USE_UNITS is on print ''; - $label = measuringUnitString($line->fk_unit, '', '', 1); + $label = measuringUnitString((int) $line->fk_unit, '', null, 1); if ($label !== '') { print $langs->trans($label); } @@ -359,7 +359,7 @@ if ($resql) { $total_cost += $sub_bom->total_cost * $sub_bom_line->qty * (float) $line->qty; } elseif ($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) { //Convert qty to hour - $unit = measuringUnitString($sub_bom_line->fk_unit, '', '', 1); + $unit = measuringUnitString($sub_bom_line->fk_unit, '', null, 1); $qty = convertDurationtoHour($sub_bom_line->qty, $unit); $workstation = new Workstation($this->db); $res = $workstation->fetch($sub_bom_product->fk_default_workstation); diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 8906b147c82..ce329cc9620 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2022 Alice Adminson * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -101,7 +101,7 @@ class Availabilities extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 2, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), @@ -831,7 +831,7 @@ class Availabilities extends CommonObject * Return a thumb for kanban views * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index db5eff037cd..a6f76aafb1d 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2023 Alice Adminson - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -101,7 +101,7 @@ class Calendar extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'right', 'comment' => "Id"), @@ -816,8 +816,8 @@ class Calendar extends CommonObject /** * Return a thumb for kanban views * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index ec038b7a129..10e327a0420 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -322,7 +322,7 @@ class Categorie extends CommonObject 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => '1', 'notnull' => 1, 'index' => 1, 'position' => 5), 'fk_parent' => array('type' => 'integer', 'label' => 'Fkparent', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx',), - 'label' => array('type' => 'varchar(180)', 'label' => 'Label', 'enabled' => 1, 'position' => 25, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150',), + 'label' => array('type' => 'varchar(180)', 'label' => 'Label', 'enabled' => 1, 'position' => 25, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150', 'showoncombobox' => 1), 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 0, 'alwayseditable' => 1,), 'type' => array('type' => 'integer', 'label' => 'Type', 'enabled' => 1, 'position' => 35, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,), 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), @@ -1504,7 +1504,7 @@ class Categorie extends CommonObject $forced_color = 'colortoreplace'; if ($i == count($way)) { // Last category in hierarchy // Check contrast with background and correct text color - $forced_color = 'categtextwhite'; + $forced_color = 'categtextwhite'; // We want color white because the getNomUrl of a tag is always called inside a dark background like '' to show it as a tag. TODO Add this in param to force when called outside of span. if ($cat->color) { if (colorIsLight($cat->color)) { $forced_color = 'categtextblack'; @@ -1514,7 +1514,7 @@ class Categorie extends CommonObject } if ($url == '') { - $link = ''; + $link = ''; $linkend = ''; $w[] = $link.(($addpicto && $i == 1) ? img_object('', 'category', 'class="paddingright"') : '').$cat->label.$linkend; } elseif ($url == 'none') { @@ -1833,7 +1833,7 @@ class Categorie extends CommonObject } // Check contrast with background and correct text color - $forced_color = 'categtextwhite'; // We want color white because the background is dark (grey or other) + $forced_color = 'categtextwhite'; // We want color white because the getNomUrl of a tag is always called inside a dark background like '' to show it as a tag. TODO Add this in param to force when called outside of span. if ($this->color) { if (colorIsLight($this->color)) { // If color is light, we force color to dark $forced_color = 'categtextblack'; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 84992cc45bc..fa40a1860b6 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -124,6 +124,8 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $permissiontoadd) if ($forcelangprod == $current_lang) { $object->label = $libelle; $object->description = dol_htmlcleanlastbr($desc); + + $object->update($user); } else { $object->multilangs[$forcelangprod]["label"] = $libelle; $object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr($desc); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 725e43717cd..fcef409cc55 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -298,9 +298,9 @@ dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'la // Confirmation of deletion if ($action == 'delete') { if ($backtopage) { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&backtopage='.urlencode($backtopage), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 2); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.urlencode($type).'&backtopage='.urlencode($backtopage), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 2); } else { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.urlencode($type), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1); } } @@ -349,11 +349,11 @@ if ($reshook < 0) { if (empty($reshook)) { if ($user->hasRight('categorie', 'creer')) { $socid = ($object->socid ? "&socid=".$object->socid : ""); - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; } if ($user->hasRight('categorie', 'supprimer')) { - print 'id.'&type='.$type.'&backtolist='.urlencode($backtolist).'">'.$langs->trans("Delete").''; + print 'id.'&type='.urlencode($type).'&backtolist='.urlencode($backtolist).'">'.$langs->trans("Delete").''; } } @@ -363,8 +363,8 @@ $newcardbutton = ''; if ($user->hasRight('categorie', 'creer')) { $link = DOL_URL_ROOT.'/categories/card.php'; $link .= '?action=create'; - $link .= '&type='.$type; - $link .= '&catorigin='.$object->id; + $link .= '&type='.urlencode($type); + $link .= '&catorigin='.((int) $object->id); $link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id); $newcardbutton = '
'; @@ -462,13 +462,13 @@ if ($cats < 0) { $entry .= $counter; $entry .= ''; - $entry .= ''.img_view().''; + $entry .= ''.img_view().''; $entry .= ''; $entry .= ''; - $entry .= ''.img_edit().''; + $entry .= ''.img_edit().''; $entry .= ''; $entry .= ''; - $entry .= ''.img_delete().''; + $entry .= ''.img_delete().''; $entry .= ''; $entry .= ''; @@ -517,7 +517,7 @@ $arrayofmassactions = array( ); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -$typeid = $type; +$typeid = $type; // warning, typeid can be a string // List of products or services (type is type of category) @@ -579,7 +579,7 @@ if ($type == Categorie::TYPE_PRODUCT) { // Link to delete from category print ''; if ($permission) { - print 'id.'">'; + print 'id).($limit ? '&limit='.$limit : '').'">'; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -659,7 +659,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -740,7 +740,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { // Link to delete from category print ''; if ($permission) { - print 'id.($limit ? '&limit='.$limit : '').'">'; + print 'id).($limit ? '&limit='.$limit : '').'">'; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -825,7 +825,7 @@ if ($type == Categorie::TYPE_MEMBER) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -911,7 +911,7 @@ if ($type == Categorie::TYPE_CONTACT) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -994,7 +994,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1076,7 +1076,7 @@ if ($type == Categorie::TYPE_PROJECT) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1154,7 +1154,7 @@ if ($type == Categorie::TYPE_USER) { // Link to delete from category print ''; if ($user->hasRight('user', 'user', 'creer')) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1225,7 +1225,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1305,7 +1305,7 @@ if ($type == Categorie::TYPE_TICKET) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1391,7 +1391,7 @@ if ($type == Categorie::TYPE_FICHINTER) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 6af0cf4aca6..9ebc4408438 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -1682,7 +1682,7 @@ if ($action == 'create') { print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx maxwidth500'); + print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx maxwidth500'); print ' '; print ''; @@ -1708,14 +1708,14 @@ if ($action == 'create') { // Task print ''.$langs->trans("Task").''; print img_picto('', 'projecttask', 'class="paddingrightonly"'); - $projectsListId = false; + $projectsListId = ''; if (!empty($projectid)) { $projectsListId = $projectid; } $tid = GETPOSTISSET("projecttaskid") ? GETPOSTINT("projecttaskid") : (GETPOSTISSET("taskid") ? GETPOSTINT("taskid") : ''); - $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', $projectsListId); + $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId); print ''; } @@ -2144,8 +2144,8 @@ if ($id > 0) { 'type' => 'user', //'transparency'=>$object->userassigned[$user->id]['transparency'], 'transparency' => $object->transparency, // Force transparency on ownerfrom event - 'answer_status' => (isset($object->userassigned[$object->userownerid]['answer_status']) ? $object->userassigned[$object->userownerid]['answer_status']: null), - 'mandatory' => (isset($object->userassigned[$object->userownerid]['mandatory']) ? $object->userassigned[$object->userownerid]['mandatory']:null) + 'answer_status' => (isset($object->userassigned[$object->userownerid]['answer_status']) ? $object->userassigned[$object->userownerid]['answer_status'] : null), + 'mandatory' => (isset($object->userassigned[$object->userownerid]['mandatory']) ? $object->userassigned[$object->userownerid]['mandatory'] : null) ); } if (!empty($object->userassigned)) { // Now concat assigned users @@ -2255,7 +2255,7 @@ if ($id > 0) { print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - $numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500 widthcentpercentminusxx'); + $numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), (string) $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500 widthcentpercentminusxx'); if ($numprojet == 0) { print '   '; } @@ -2294,7 +2294,7 @@ if ($id > 0) { })'; print ''."\n"; - $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, 0, 1, 0, 0, 'maxwidth500', $object->fk_project); + $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, '', 1, 0, 0, 'maxwidth500', (string) $object->fk_project); print ''; print ''; diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index a1d248df806..f7894822fb3 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -71,7 +71,7 @@ class ActionCommReminder extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index da003149657..648f96aba4d 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -4,7 +4,8 @@ * Copyright (C) 2013-2014 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Vincent de Grandpré * * 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 @@ -96,7 +97,16 @@ class ICal $file_text = ''; //$tmpresult = getURLContent($file, 'GET', '', 1, [], ['http', 'https'], 2, 0); // To test with any URL - $tmpresult = getURLContent($file, 'GET'); + $localip = 0; + $sslverify = -1; + if (getDolGlobalString('AGENDA_EXT_CALENDAR_IP_MODE')) { + $localip = intval(getDolGlobalString('AGENDA_EXT_CALENDAR_IP_MODE')); + } + if (getDolGlobalString('AGENDA_EXT_CALENDAR_SSLVERIFY_MODE')) { + $sslverify = intval(getDolGlobalString('AGENDA_EXT_CALENDAR_SSLVERIFY_MODE')); + } + // See documentation of getURLContent function for $localip and $sslverify possible values + $tmpresult = getURLContent($file, 'GET', '', 1, [], ['http', 'https'], $localip, $sslverify); if ($tmpresult['http_code'] != 200) { $file_text = null; $this->error = 'Error: '.$tmpresult['http_code'].' '.$tmpresult['content']; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 0f46efb5a85..a1d8b1605c9 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -477,7 +477,7 @@ if ($mode == 'show_day') { $picto = 'calendarday'; } if (empty($conf->dol_optimize_smallscreen)) { - $nav .= '   '.$langs->trans("Today").' '; + $nav .= ' '.$langs->trans("Today").' '; } $nav .= '
'; @@ -581,7 +581,6 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda' // Define the legend/list of calendard to show $s = ''; -$link = ''; $showextcals = $listofextcals; @@ -726,14 +725,14 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on if (!preg_match('/showbirthday=/i', $newparam)) { $newparam .= '&showbirthday=1'; } - $link = ''; + $s = ''; if (empty($showbirthday)) { - $link .= $langs->trans("AgendaShowBirthdayEvents"); + $s .= $langs->trans("AgendaShowBirthdayEvents"); } else { - $link .= $langs->trans("AgendaHideBirthdayEvents"); + $s .= $langs->trans("AgendaHideBirthdayEvents"); } - $link .= ''; + $s .= ''; } diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index b15f1f714ef..47debff0fd2 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -469,6 +469,12 @@ if ($filtert > 0 || $usergroup > 0) { if ($usergroup > 0) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; // Condition on actioncode if (!empty($actioncode)) { diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index cbde1cfc1ee..e35ee927044 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -433,7 +433,7 @@ $nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $first_mo $nav .= " \n"; $nav .= "   trans("Next"))."\">\n"; if (empty($conf->dol_optimize_smallscreen)) { - $nav .= '   '.$langs->trans("Today").' '; + $nav .= ' '.$langs->trans("Today").' '; } $nav .= '
'; $nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index ed5e64a5a39..cc3e8e07d70 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -803,7 +803,7 @@ if ($object->fetch($id) >= 0) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column ? 'left' : ''); // This also change content of $arrayfields with user setup $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f2ca321604a..c0a0d240fa7 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -17,7 +17,7 @@ * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 Lenin Rivas * Copyright (C) 2023 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -238,7 +238,7 @@ if (empty($reshook)) { } } - $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOSTINT('update_prices') ? true : false), (GETPOSTINT('update_desc') ? true : false)); + $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOST('update_prices') == 'on'), (GETPOST('update_desc') == 'on')); if ($result > 0) { $warningMsgLineList = array(); // check all product lines are to sell otherwise add a warning message for each product line is not to sell @@ -2164,7 +2164,7 @@ if ($action == 'create') { $sday = date("d", $tmpdte); print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop"); } else { - $tmp_date_delivery = GETPOST('date_delivery') ? : -1; + $tmp_date_delivery = GETPOST('date_delivery') ?: -1; print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1); } print ''; @@ -2174,7 +2174,7 @@ if ($action == 'create') { $langs->load("projects"); print ''; print ''.$langs->trans("Project").''; - print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); print ' id).'">'; print ''; print ''; @@ -2387,7 +2387,7 @@ if ($action == 'create') { $formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date); } // Incomplete payment. We ask if reason = discount or other - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600); } if ($action == 'closeas') { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 4031c5e5361..07bdd50e7a5 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -19,7 +19,7 @@ * Copyright (C) 2022 OpenDSI * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 William Mead - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2025 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 @@ -356,7 +356,7 @@ class Propal extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -827,17 +827,22 @@ class Propal extends CommonObject $result = $this->line->insert(); if ($result > 0) { - // Reorder if child line - if (!empty($fk_parent_line)) { - $this->line_order(true, 'DESC'); - } elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines - $linecount = count($this->lines); - for ($ii = $ranktouse; $ii <= $linecount; $ii++) { - $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); + if (!isset($this->context['createfromclone'])) { + if (!empty($fk_parent_line)) { + // Always reorder if child line + $this->line_order(true, 'DESC'); + } elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { + // Update all rank of all other lines starting from the same $ranktouse + $linecount = count($this->lines); + for ($ii = $ranktouse; $ii <= $linecount; $ii++) { + $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); + } } + + $this->lines[] = $this->line; } - // Mise a jour information denormalisees au niveau de la propale meme + // Update denormalized fields at the order level if (empty($noupdateafterinsertline)) { $result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. } @@ -3771,7 +3776,7 @@ class Propal extends CommonObject if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { $res = $this->fetchProject(); if ($res > 0 && $this->project instanceof Project) { - $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1); + $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, '1'); } } } @@ -4014,7 +4019,7 @@ class Propal extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index e60536c9bcb..8ae504de154 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -15,7 +15,8 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023-2024 Benjamin Falière - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Lenin Rivas * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,6 +104,9 @@ $origin = GETPOST('origin', 'alpha'); $originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility $rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1; +// Type Contact default +$type_contact_code = (getDolGlobalString('ORDER_TYPE_CONTACT_DEFAULT') ? getDolGlobalString('ORDER_TYPE_CONTACT_DEFAULT') : 'CUSTOMER'); + // PDF $hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); $hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); @@ -218,10 +222,10 @@ if (empty($reshook)) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('IdThirdParty')), null, 'errors'); } else { if ($object->id > 0) { - // Because createFromClone modifies the object, we must clone it so that we can restore it later - $orig = clone $object; + // We clone object to avoid to denaturate loaded object when setting some properties for clone or if createFromClone modifies the object. + $objectutil = dol_clone($object, 1); - $result = $object->createFromClone($user, $socid); + $result = $objectutil->createFromClone($user, $socid); if ($result > 0) { $warningMsgLineList = array(); // check all product lines are to sell otherwise add a warning message for each product line is not to sell @@ -243,7 +247,6 @@ if (empty($reshook)) { exit; } else { setEventMessages($object->error, $object->errors, 'errors'); - $object = $orig; $action = ''; } } @@ -549,7 +552,8 @@ if (empty($reshook)) { // Insert default contacts if defined if ($object_id > 0) { if (GETPOSTINT('contactid')) { - $result = $object->add_contact(GETPOSTINT('contactid'), 'CUSTOMER', 'external'); + // $result = $object->add_contact(GETPOSTINT('contactid'), 'CUSTOMER', 'external'); + $result = $object->add_contact(GETPOSTINT('contactid'), $type_contact_code, 'external'); if ($result < 0) { setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors'); $error++; @@ -1995,7 +1999,10 @@ if ($action == 'create' && $usercancreate) { // Contact of order if ($socid > 0) { // Contacts (ask contact only if thirdparty already defined). - print "".$langs->trans("DefaultContact").''; + // print "".$langs->trans("DefaultContact").''; + print ""; + print $form->textwithpicto($langs->trans("DefaultContact"), $langs->trans("TypeContact_commande_external_".$type_contact_code)); + print ''; print img_picto('', 'contact', 'class="pictofixedwidth"'); //print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, empty($srccontactslist) ? "" : $srccontactslist, '', 1, 'maxwidth300 widthcentpercentminusx'); print $form->select_contact($soc->id, $contactid, 'contactid', 1, empty($srccontactslist) ? "" : $srccontactslist, '', 1, 'maxwidth300 widthcentpercentminusx', true); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7a68bc13620..aada73c641f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -113,9 +113,16 @@ class Commande extends CommonOrder /** * Status of the order * @var int + * @deprecated Use status */ public $statut; + /** + * Status of the order + * @var int + */ + public $status; + /** * @var int Status Billed or not */ @@ -304,7 +311,7 @@ class Commande extends CommonOrder // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -793,12 +800,10 @@ class Commande extends CommonOrder * * @param User $user Object user that close * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers - * @return int Return integer <0 if KO, >0 if OK + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK */ public function cloture($user, $notrigger = 0) { - global $conf; - $error = 0; $usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'creer')) @@ -1098,6 +1103,7 @@ class Commande extends CommonOrder $line->ref_ext, 1 ); + if ($result < 0) { if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER) { $this->error = $this->db->lasterror(); @@ -1541,7 +1547,7 @@ class Commande extends CommonOrder $logtext = "::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent"; $logtext .= ", info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start"; - $logtext .= ", date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit, origin=$origin, origin_id=$origin_id, pu_ht_devise=$pu_ht_devise, ref_ext=$ref_ext"; + $logtext .= ", date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit, origin=$origin, origin_id=$origin_id, pu_ht_devise=$pu_ht_devise, ref_ext=$ref_ext rang=$rang"; dol_syslog(get_class($this).$logtext, LOG_DEBUG); if ($this->statut == self::STATUS_DRAFT) { @@ -1681,6 +1687,7 @@ class Commande extends CommonOrder // Rang to use $ranktouse = $rang; + if ($ranktouse == -1) { $rangmax = $this->line_max($fk_parent_line); $ranktouse = $rangmax + 1; @@ -1753,24 +1760,28 @@ class Commande extends CommonOrder $result = $this->line->insert($user); if ($result > 0) { - // Reorder if child line - if (!empty($fk_parent_line)) { - $this->line_order(true, 'DESC'); - } elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines - $linecount = count($this->lines); - for ($ii = $ranktouse; $ii <= $linecount; $ii++) { - $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); - } - } - - // Mise a jour information denormalisees au niveau de la commande meme + // Update denormalized fields at the order level if (empty($noupdateafterinsertline)) { $result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. } if ($result > 0) { + if (!isset($this->context['createfromclone'])) { + if (!empty($fk_parent_line)) { + // Always reorder if child line + $this->line_order(true, 'DESC'); + } elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { + // Update all rank of all other lines starting from the same $ranktouse + $linecount = count($this->lines); + for ($ii = $ranktouse; $ii <= $linecount; $ii++) { + $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); + } + } + + $this->lines[] = $this->line; + } + $this->db->commit(); - $this->lines[] = $this->line; return $this->line->id; } else { $this->db->rollback(); @@ -1899,7 +1910,7 @@ class Commande extends CommonOrder return -1; } - $sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_user_modif, c.fk_statut'; + $sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_user_modif, c.fk_statut as status'; $sql .= ', c.amount_ht, c.total_ht, c.total_ttc, c.total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.deposit_percent, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason'; $sql .= ', c.fk_account'; $sql .= ', c.date_commande, c.date_valid, c.tms'; @@ -1955,8 +1966,8 @@ class Commande extends CommonOrder $this->fk_project = $obj->fk_project; $this->project = null; // Clear if another value was already set by fetch_projet - $this->statut = $obj->fk_statut; - $this->status = $obj->fk_statut; + $this->statut = $obj->status; + $this->status = $obj->status; $this->user_author_id = $obj->fk_user_author; $this->user_creation_id = $obj->fk_user_author; @@ -2120,8 +2131,6 @@ class Commande extends CommonOrder public function fetch_lines($only_product = 0, $loadalsotranslation = 0) { // phpcs:enable - global $langs, $conf; - $this->lines = array(); $sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.product_type, l.fk_commande, l.label as custom_label, l.description, l.price, l.qty, l.vat_src_code, l.tva_tx, l.ref_ext,'; @@ -3730,7 +3739,7 @@ class Commande extends CommonOrder if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { $res = $this->fetchProject(); if ($res > 0 && $this->project instanceof Project) { - $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1); + $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, '1'); } } } @@ -4073,7 +4082,7 @@ class Commande extends CommonOrder */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { - global $conf, $langs; + global $langs; $langs->load("orders"); $outputlangs->load("products"); diff --git a/htdocs/commande/class/orderline.class.php b/htdocs/commande/class/orderline.class.php index ec78db8e44d..618bbcccf74 100644 --- a/htdocs/commande/class/orderline.class.php +++ b/htdocs/commande/class/orderline.class.php @@ -341,7 +341,7 @@ class OrderLine extends CommonOrderLine } /** - * Insert line into database + * Insert line into database. This also set $this->id. * * @param User $user User that modify * @param int $notrigger 1 = disable triggers @@ -487,7 +487,7 @@ class OrderLine extends CommonOrderLine if (!$error) { $this->db->commit(); - return 1; + return $this->id; } foreach ($this->errors as $errmsg) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 59148913edd..9e9ba12eda0 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -151,7 +151,7 @@ $search_deliveryyear = ''; $search_import_key = trim(GETPOST("search_import_key", "alpha")); -$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->order->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; @@ -376,7 +376,7 @@ if (empty($reshook)) { $permissiontocancel = $user->hasRight("commande", "creer"); $permissiontosendbymail = $user->hasRight("commande", "creer"); } - $uploaddir = $conf->commande->multidir_output[$conf->entity]; + $uploaddir = $conf->order->multidir_output[$conf->entity]; $triggersendname = 'ORDER_SENTBYMAIL'; $year = ""; $month = ""; @@ -766,14 +766,16 @@ if (empty($reshook)) { } } } + if ($action == 'validate' && $permissiontoadd && $objectclass !== null) { if (GETPOST('confirm') == 'yes') { + /** @var Commande $objecttmp */ $objecttmp = new $objectclass($db); $db->begin(); $error = 0; foreach ($toselect as $checked) { if ($objecttmp->fetch($checked)) { - if ($objecttmp->statut == 0) { + if ($objecttmp->status == $objecttmp::STATUS_DRAFT) { if (!empty($objecttmp->fk_warehouse)) { $idwarehouse = $objecttmp->fk_warehouse; } else { @@ -804,21 +806,23 @@ if ($action == 'validate' && $permissiontoadd && $objectclass !== null) { } if ($action == 'shipped' && $permissiontoadd && $objectclass !== null) { if (GETPOST('confirm') == 'yes') { + /** @var Commande $objecttmp */ $objecttmp = new $objectclass($db); $db->begin(); $error = 0; foreach ($toselect as $checked) { if ($objecttmp->fetch($checked)) { - if ($objecttmp->statut == 1 || $objecttmp->statut == 2) { - if ($objecttmp->cloture($user)) { + if ($objecttmp->status == $objecttmp::STATUS_VALIDATED || $objecttmp->status == $objecttmp::STATUS_SHIPMENTONPROCESS || $objecttmp->status == $objecttmp::STATUS_CLOSED) { + $result = $objecttmp->cloture($user); + if ($result > 0) { setEventMessages($langs->trans('StatusOrderDelivered', $objecttmp->ref), null, 'mesgs'); - } else { + } elseif ($result < 0) { setEventMessages($langs->trans('ErrorOrderStatusCantBeSetToDelivered'), null, 'errors'); $error++; } } else { $langs->load("errors"); - setEventMessages($langs->trans('ErrorIsNotADraft', $objecttmp->ref), null, 'errors'); + setEventMessages($langs->trans('ErrorObjectHasWrongStatus', $objecttmp->ref), null, 'errors'); $error++; } } else { @@ -997,7 +1001,7 @@ if ($search_status != '') { } } if ($search_option == 'late') { - $sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->commande->client->warning_delay)."'"; + $sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'"; } if ($search_datecloture_start) { $sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'"; @@ -2294,7 +2298,7 @@ while ($i < $imaxinloop) { print $generic_commande->getNomUrl(1, $getNomUrlOption, 0, 0, 0, 1, 1); $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref); + $filedir = $conf->order->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref); $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); @@ -2882,8 +2886,10 @@ while ($i < $imaxinloop) { } } - if ($nbprod) { + if ($nbprod) { // If there is at least one product to ship, we show the shippable icon + print ''; print $form->textwithtooltip('', $text_info, 2, 1, $text_icon, '', 2); + print ''; } if ($warning) { // Always false in default mode print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders').'
'.$text_warning, 2, 1, img_picto('', 'error'), '', 2); diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 5ccd1ffa2d8..94bd781bcdd 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -5,7 +5,7 @@ * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2022-2025 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -673,7 +673,7 @@ if (isModEnabled('project')) { $formproject = new FormProjets($db); $langs->load('projects'); print ''.$langs->trans('Project').":"; - print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, ''); + print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), (string) $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, ''); print ''; print '
'; } diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 31f7fc7ca20..451802d6c84 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -799,7 +799,7 @@ if ($action == 'create') { if ($object->type == Account::TYPE_SAVINGS || $object->type == Account::TYPE_CURRENT) { print ''; - print ''; + print ''; print ''; $ibankey = FormBank::getIBANLabel($object); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 45a30fdef82..050e4267f95 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2019 JC Prieto * Copyright (C) 2022-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -348,7 +348,7 @@ class Account extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -2016,7 +2016,7 @@ class Account extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 7f38dab7af2..f6e8fd6ce24 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -198,7 +198,7 @@ class PaymentVarious extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( // TODO: fill this array @@ -295,7 +295,7 @@ class PaymentVarious extends CommonObject * Load object in memory from database * * @param int $id id object - * @param User $user User that load + * @param ?User $user User that load * @return int Return integer <0 if KO, >0 if OK */ public function fetch($id, $user = null) @@ -825,7 +825,7 @@ class PaymentVarious extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 8dc01195026..634971a30ba 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -1,9 +1,9 @@ - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2023 Laurent Destailleur * Copyright (C) 2023 Joachim Kueter - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -105,8 +105,8 @@ if (empty($reshook)) { header("Location: ".$urltogo); exit; } - if ($id > 0 || !empty($ref)) { - $ret = $object->fetch($id, $ref); + if ($id > 0) { + $ret = $object->fetch($id); } $action = ''; } @@ -221,14 +221,13 @@ if (empty($reshook)) { $ret = $object->delete($user); if ($ret > 0) { + $accountline = null; if ($object->fk_bank) { $accountline = new AccountLine($db); $result = $accountline->fetch($object->fk_bank); if ($result > 0) { $result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) } - } else { - $account_line = null; } if ($result >= 0) { @@ -514,7 +513,7 @@ if ($action == 'create') { print ''; } @@ -597,7 +596,7 @@ if ($id) { array('type' => 'date', 'name' => 'clone_date_value', 'label' => $langs->trans("DateValue"), 'value' => -1), array('type' => 'other', 'tdclass' => 'fieldrequired', 'name' => 'clone_accountid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes($object->fk_account, "accountid", 0, '', 1, '', 0, 'minwidth200', 1)), array('type' => 'text', 'name' => 'clone_amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount)), - array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens").' '.$set_value_help, 'values' => $sensarray, 'default' => $object->sens), + array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens").' '.$set_value_help, 'values' => $sensarray, 'default' => (string) $object->sens), ); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 350); @@ -626,11 +625,11 @@ if ($id) { $morehtmlref .= ''; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + $morehtmlref .= $formproject->select_projects(-1, (string) $object->fk_project, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (property_exists($object, 'socid') ? $object->socid : 0), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (property_exists($object, 'socid') ? $object->socid : 0), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } } else { if (!empty($object->fk_project)) { @@ -685,7 +684,7 @@ if ($id) { if (isModEnabled('accounting')) { /** @var FormAccounting $formaccounting */ print ''; print ''; diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index d5d7c6c954e..2bff92f4218 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -75,7 +75,7 @@ if (!$sortfield) { $object = new PaymentVarious($db); -$object->fetch($id, $ref); +$object->fetch($id); $upload_dir = $conf->bank->dir_output.'/'.dol_sanitizeFileName((string) $object->id); $modulepart = 'banque'; @@ -109,6 +109,7 @@ if ($object->id) { $morehtmlref = '
'; // Project if (isModEnabled('project')) { + $formproject = new FormProjets($db); $langs->load("projects"); if ($user->hasRight('banque', 'modifier') && 0) { if ($action != 'classify') { @@ -119,11 +120,11 @@ if ($object->id) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(0, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index d4f99f934de..80f4681e507 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -78,6 +78,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans("VariousPayment"), -1, $ob $morehtmlref = '
'; // Project if (isModEnabled('project')) { + $formproject = new FormProjets($db); $langs->load("projects"); if ($user->hasRight('banque', 'modifier') && 0) { if ($action != 'classify') { @@ -88,11 +89,11 @@ if (isModEnabled('project')) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(0, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 96e5af1cef5..a1b349a7867 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -169,22 +169,22 @@ $fieldstosearchall = array( // Definition of fields for lists $arrayfields = array( - 'ref' => array('label' => "Ref", 'checked' => 1, 'position' => 100), - 'label' => array('label' => "Label", 'checked' => 1, 'position' => 110), - 'datep' => array('label' => "DatePayment", 'checked' => 1, 'position' => 120), - 'datev' => array('label' => "DateValue", 'checked' => -1, 'position' => 130), - 'type' => array('label' => "PaymentMode", 'checked' => 1, 'position' => 140), - 'project' => array('label' => "Project", 'checked' => -1, 'position' => 200, "enabled" => isModEnabled('project')), - 'bank' => array('label' => "BankAccount", 'checked' => 1, 'position' => 300, "enabled" => isModEnabled("bank")), - 'entry' => array('label' => "BankTransactionLine", 'checked' => 1, 'position' => 310, "enabled" => isModEnabled("bank")), - 'account' => array('label' => "AccountAccountingShort", 'checked' => 1, 'position' => 400, "enabled" => isModEnabled('accounting')), - 'subledger' => array('label' => "SubledgerAccount", 'checked' => 1, 'position' => 410, "enabled" => isModEnabled('accounting')), - 'debit' => array('label' => "Debit", 'checked' => 1, 'position' => 500), - 'credit' => array('label' => "Credit", 'checked' => 1, 'position' => 510), + 'ref' => array('label' => "Ref", 'checked' => '1', 'position' => 100), + 'label' => array('label' => "Label", 'checked' => '1', 'position' => 110), + 'datep' => array('label' => "DatePayment", 'checked' => '1', 'position' => 120), + 'datev' => array('label' => "DateValue", 'checked' => '-1', 'position' => 130), + 'type' => array('label' => "PaymentMode", 'checked' => '1', 'position' => 140), + 'project' => array('label' => "Project", 'checked' => '-1', 'position' => 200, "enabled" => (string) (int) isModEnabled('project')), + 'bank' => array('label' => "BankAccount", 'checked' => '1', 'position' => 300, "enabled" => (string) (int) isModEnabled("bank")), + 'entry' => array('label' => "BankTransactionLine", 'checked' => '1', 'position' => 310, "enabled" => (string) (int) isModEnabled("bank")), + 'account' => array('label' => "AccountAccountingShort", 'checked' => '1', 'position' => 400, "enabled" => (string) (int) isModEnabled('accounting')), + 'subledger' => array('label' => "SubledgerAccount", 'checked' => '1', 'position' => 410, "enabled" => (string) (int) isModEnabled('accounting')), + 'debit' => array('label' => "Debit", 'checked' => '1', 'position' => 500), + 'credit' => array('label' => "Credit", 'checked' => '1', 'position' => 510), ); $arrayfields = dol_sort_array($arrayfields, 'position'); -'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan +// '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Security check $socid = GETPOSTINT("socid"); diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 755c2f711eb..1449d27ffa6 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2009 Regis Houssin * Copyright (C) 2016 Marcos García * Copyright (C) 2018 Andreu Bisquerra - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ class CashControl extends CommonObject public $fk_user_creat; /** - * @var int|'' $date_valid + * @var int|'' */ public $date_valid; @@ -502,7 +502,7 @@ class CashControl extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index d4d1d6d758f..4b9d33c32af 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -226,6 +226,7 @@ if ($resql) { $totalqty = 0; $totalvat = 0; $totalvatperrate = array(); + $totalhtperrate = array(); $totallocaltax1 = 0; $totallocaltax2 = 0; $cachebankaccount = array(); @@ -257,8 +258,10 @@ if ($resql) { if ($line->tva_tx) { if (empty($totalvatperrate[$line->tva_tx])) { $totalvatperrate[$line->tva_tx] = 0; + $totalhtperrate[$line->tva_tx] = 0; } $totalvatperrate[$line->tva_tx] += $line->total_tva; + $totalhtperrate[$line->tva_tx] += $line->total_ht; } $totallocaltax1 += $line->total_localtax1; $totallocaltax2 += $line->total_localtax2; @@ -448,9 +451,9 @@ if ($resql) { } if (!empty($totalvatperrate) && is_array($totalvatperrate)) { - print '

'.$langs->trans("VATRate").'
'; + print '

'.$langs->trans("TotalHT").'
'.$langs->trans("TotalVAT").'
'; foreach ($totalvatperrate as $keyrate => $valuerate) { - print '
'.$langs->trans("VATRate").' '.vatrate($keyrate, true).' :
'.price($valuerate).'
'; + print '
'.$langs->trans("VATRate").' '.vatrate($keyrate, true).' :
'.price($totalhtperrate[$keyrate] ?? 0).'
'.price($valuerate).'
'; } } diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 5e67c50fb15..619e4e5a8ae 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -268,7 +268,7 @@ if (empty($reshook)) { $error++; } - // Get first contract linked to invoice used to generate template (facid is id of source invoice) + // Get first contract linked to invoice (or order or proposal) used to generate template (facid is id of source invoice) if (GETPOSTINT('facid') > 0) { $srcObject = new Facture($db); $srcObject->fetch(GETPOSTINT('facid')); @@ -278,9 +278,17 @@ if (empty($reshook)) { if (!empty($srcObject->linkedObjectsIds['contrat'])) { $contractidid = reset($srcObject->linkedObjectsIds['contrat']); - $object->origin = 'contrat'; + $object->origin_type = 'contrat'; $object->origin_id = $contractidid; - $object->linked_objects[$object->origin] = $object->origin_id; + $object->linked_objects[$object->origin_type] = $object->origin_id; + } elseif (!empty($srcObject->linkedObjectsIds['commande'])) { + $orderid = reset($srcObject->linkedObjectsIds['commande']); + + $object->linked_objects['commande'] = $orderid; + } elseif (!empty($srcObject->linkedObjectsIds['propal'])) { + $proposalid = reset($srcObject->linkedObjectsIds['propal']); + + $object->linked_objects['commande'] = $proposalid; } } @@ -1289,6 +1297,8 @@ if ($action == 'create') { } print "
'.$langs->trans("BankName").'
'.$langs->trans("BankName").''.$object->bank.'
'.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); + print $formproject->select_projects(-1, (string) $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); print '
'; - print $form->editfieldkey('AccountAccounting', 'accountancy_code', $object->accountancy_code, $object, (!$alreadyaccounted && $permissiontoadd), 'string', '', 0); + print $form->editfieldkey('AccountAccounting', 'accountancy_code', $object->accountancy_code, $object, (int) (!$alreadyaccounted && $permissiontoadd), 'string', '', 0); print ''; if ($action == 'editaccountancy_code' && (!$alreadyaccounted && $permissiontoadd)) { //print $form->editfieldval('AccountAccounting', 'accountancy_code', $object->accountancy_code, $object, (!$alreadyaccounted && $user->hasRight('banque', 'modifier')), 'string', '', 0); @@ -707,7 +706,7 @@ if ($id) { // Subledger account print '
'; - print $form->editfieldkey('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $permissiontoadd), 'string', '', 0); + print $form->editfieldkey('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (int) (!$alreadyaccounted && $permissiontoadd), 'string', '', 0); print ''; if ($action == 'editsubledger_account' && (!$alreadyaccounted && $permissiontoadd)) { if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { @@ -739,7 +738,7 @@ if ($id) { } else { $bankaccountnotfound = 1; - print ''.$langs->trans("NoRecordfound").''; + print ''.$langs->trans("NoRecordFound").''; } print '
\n"; + print '
'; + print $form->buttonsSaveCancel("Create"); print "\n"; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 6120fcc9fa4..e374e52450e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -17,7 +17,7 @@ * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 Nick Fragoulis - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -892,27 +892,27 @@ if (empty($reshook)) { $keyforvatrate = $line->tva_tx.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''); if (!isset($amount_ht[$keyforvatrate])) { - $amount_ht[$keyforvatrate]=0; + $amount_ht[$keyforvatrate] = 0; } $amount_ht[$keyforvatrate] += $line->total_ht; if (!isset($amount_tva[$keyforvatrate])) { - $amount_tva[$keyforvatrate]=0; + $amount_tva[$keyforvatrate] = 0; } $amount_tva[$keyforvatrate] += $line->total_tva; if (!isset($amount_ttc[$keyforvatrate])) { - $amount_ttc[$keyforvatrate]=0; + $amount_ttc[$keyforvatrate] = 0; } $amount_ttc[$keyforvatrate] += $line->total_ttc; if (!isset($multicurrency_amount_ht[$keyforvatrate])) { - $multicurrency_amount_ht[$keyforvatrate]=0; + $multicurrency_amount_ht[$keyforvatrate] = 0; } $multicurrency_amount_ht[$keyforvatrate] += $line->multicurrency_total_ht; if (!isset($multicurrency_amount_tva[$keyforvatrate])) { - $multicurrency_amount_tva[$keyforvatrate]=0; + $multicurrency_amount_tva[$keyforvatrate] = 0; } $multicurrency_amount_tva[$keyforvatrate] += $line->multicurrency_total_tva; if (!isset($multicurrency_amount_ttc[$keyforvatrate])) { - $multicurrency_amount_ttc[$keyforvatrate]=0; + $multicurrency_amount_ttc[$keyforvatrate] = 0; } $multicurrency_amount_ttc[$keyforvatrate] += $line->multicurrency_total_ttc; $i++; @@ -3528,7 +3528,12 @@ if ($action == 'create') { // Overwrite some values if creation of invoice is from a predefined invoice if (empty($origin) && empty($originid) && GETPOSTINT('fac_rec') > 0) { - $invoice_predefined->fetch(GETPOSTINT('fac_rec')); + //$invoice_predefined->fetch(GETPOSTINT('fac_rec')); + foreach ($invoice_predefined->array_options as $key => $option) { + if (!isset($object->array_options[$key])) { + $object->array_options[$key] = $invoice_predefined->array_options[$key]; + } + } $dateinvoice = $invoice_predefined->date_when; // To use next gen date by default later if (empty($projectid)) { @@ -3692,7 +3697,8 @@ if ($action == 'create') { print $form->selectarray('typedeposit', $arraylist, $typedeposit, 0, 0, 0, '', 1); print ''; print ''; - print ''.$langs->trans("AmountOrPercent").''; + print ''.$langs->trans("AmountOrPercent").''; + print ''; print ''; } print ''; @@ -4064,7 +4070,7 @@ if ($action == 'create') { $langs->load('projects'); print ''.$langs->trans('Project').''; print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + print $formproject->select_projects(($socid > 0 ? $socid : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'; print ''; } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index cdc391e1ee8..7e45aaa7faf 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -148,7 +148,7 @@ class FactureRec extends CommonInvoice public $user_author; /** - * @var int Frequency + * @var ?int Frequency */ public $frequency; @@ -235,7 +235,7 @@ class FactureRec extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -1945,10 +1945,10 @@ class FactureRec extends CommonInvoice /** * Update frequency and unit * - * @param int $frequency value of frequency - * @param string $unit unit of frequency (d, m, y) - * @param int $notrigger Disable the trigger - * @return int Return integer <0 if KO, >0 if OK + * @param ?int $frequency value of frequency + * @param string $unit unit of frequency (d, m, y) + * @param int<0,1> $notrigger Disable the trigger + * @return int Return integer <0 if KO, >0 if OK */ public function setFrequencyAndUnit($frequency, $unit, $notrigger = 0) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5d22fb3f0fe..12cd7d8bbaf 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -14,7 +14,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Cedric Gross * Copyright (C) 2013 Florian Henry - * Copyright (C) 2016-2022 Ferran Marcet + * Copyright (C) 2016-2025 Ferran Marcet * Copyright (C) 2018-2024 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2022 Sylvain Legrand @@ -104,7 +104,7 @@ class Facture extends CommonInvoice protected $table_ref_field = 'ref'; /** - * @var int ID + * @var int|null ID * @deprecated Use $user_creation_id */ public $fk_user_author; @@ -321,7 +321,7 @@ class Facture extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 1), @@ -2554,9 +2554,12 @@ class Facture extends CommonInvoice if (isset($this->retained_warranty)) { $this->retained_warranty = (float) $this->retained_warranty; } - - // Check parameters - // Put here code to add control on parameters values + if (!isset($this->user_creation_id) && isset($this->fk_user_author) ) { + $this->user_creation_id = $this->fk_user_author; + } + if (!isset($this->user_validation_id) && isset($this->fk_user_valid) ) { + $this->user_validation_id = $this->fk_user_valid; + } // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET"; @@ -2581,7 +2584,8 @@ class Facture extends CommonInvoice $sql .= " total_ttc=".(isset($this->total_ttc) ? (float) $this->total_ttc : "null").","; $sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (float) $this->revenuestamp : "null").","; $sql .= " fk_statut=".(isset($this->status) ? (int) $this->status : "null").","; - $sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? (int) $this->fk_user_valid : "null").","; + $sql .= " fk_user_author=".(isset($this->user_creation_id) ? ((int) $this->user_creation_id) : "null").","; + $sql .= " fk_user_valid=".(isset($this->user_validation_id) ? (int) $this->user_validation_id : "null").","; $sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? (int) $this->fk_facture_source : "null").","; $sql .= " fk_projet=".(isset($this->fk_project) ? (int) $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? (int) $this->cond_reglement_id : "null").","; @@ -3324,10 +3328,17 @@ class Facture extends CommonInvoice } } if ($key == 'TVA_INTRA') { - // Check for mandatory - if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') && ($this->thirdparty->tva_assuj) && empty($this->thirdparty->tva_intra)) { + // Check for mandatory vat number + if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') == 'eeconly') { + if (($this->thirdparty->tva_assuj) && empty($this->thirdparty->tva_intra) && $this->thirdparty->isInEEC()) { + $langs->load("errors"); + $this->error = $langs->trans('ErrorProdIdIsMandatoryForEuThirdparties', $langs->transnoentitiesnoconv('VATIntra')).' ('.$langs->transnoentitiesnoconv("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; + dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); + return -1; + } + } elseif (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') && ($this->thirdparty->tva_assuj) && empty($this->thirdparty->tva_intra)) { $langs->load("errors"); - $this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->trans('VATIntra')).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; + $this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->transnoentitiesnoconv('VATIntra')).' ('.$langs->transnoentitiesnoconv("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); return -1; } @@ -3835,13 +3846,13 @@ class Facture extends CommonInvoice * @param string $desc Description of line * @param float $pu_ht Unit price without tax (> 0 even for credit note) * @param float $qty Quantity - * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) * @param int $fk_product Id of predefined product/service * @param float $remise_percent Percent of discount on line - * @param int|string $date_start Date start of service - * @param int|string $date_end Date end of service + * @param int|'' $date_start Date start of service + * @param int|'' $date_end Date end of service * @param int $fk_code_ventilation Code of dispatching into accountancy * @param int $info_bits Bits of type of lines * @param int $fk_remise_except Id discount used @@ -3854,7 +3865,7 @@ class Facture extends CommonInvoice * @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id * @param int $fk_parent_line Id of parent line * @param int $fk_fournprice Supplier price id (to calculate margin) or '' - * @param int $pa_ht Buying price of line (to calculate margin) or '' + * @param float|'' $pa_ht Buying price of line (to calculate margin) or '' * @param string $label Label of the line (deprecated, do not use) * @param array $array_options extrafields array * @param int $situation_percent Situation advance percentage @@ -3942,7 +3953,7 @@ class Facture extends CommonInvoice if (empty($fk_prev_id)) { $fk_prev_id = 'null'; } - if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') { + if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '' || $situation_percent == null) { $situation_percent = 100; } if (empty($ref_ext)) { @@ -4110,21 +4121,26 @@ class Facture extends CommonInvoice $result = $this->line->insert(); if ($result > 0) { - // Reorder if child line - if (!empty($fk_parent_line)) { - $this->line_order(true, 'DESC'); - } elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines - $linecount = count($this->lines); - for ($ii = $ranktouse; $ii <= $linecount; $ii++) { - $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); - } - } - - // Mise a jour information denormalisees au niveau de la facture meme + // Update denormalized fields at the order level if (empty($noupdateafterinsertline)) { $result = $this->update_price(1, 'auto', 0, $mysoc); // The addline method is designed to add line from user input so total calculation with update_price must be done using 'auto' mode. } + if (!isset($this->context['createfromclone'])) { + if (!empty($fk_parent_line)) { + // Always reorder if child line + $this->line_order(true, 'DESC'); + } elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { + // Update all rank of all other lines starting from the same $ranktouse + $linecount = count($this->lines); + for ($ii = $ranktouse; $ii <= $linecount; $ii++) { + $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); + } + } + + $this->lines[] = $this->line; + } + if ($result > 0) { $this->db->commit(); return $this->line->id; @@ -4220,7 +4236,7 @@ class Facture extends CommonInvoice if (empty($special_code) || $special_code == 3) { $special_code = 0; } - if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') { + if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '' || $situation_percent == null) { $situation_percent = 100; } if (empty($ref_ext)) { @@ -5165,11 +5181,12 @@ class Facture extends CommonInvoice //Avoid php warning Warning: mt_rand(): max(0) is smaller than min(1) when no product exists if (empty($num_prods)) { $num_prods = 1; + $prodids[$num_prods] = 1; } // Initialize parameters $this->id = 0; - $this->entity = 1; + $this->entity = $conf->entity; $this->ref = 'SPECIMEN'; $this->specimen = 1; $this->socid = 1; @@ -5208,7 +5225,9 @@ class Facture extends CommonInvoice $line->remise_percent = 0; if ($xnbp == 1) { // Qty is negative (product line) $prodid = mt_rand(1, $num_prods); - $line->fk_product = $prodids[$prodid]; + if (isset($prodids[$prodid])) { + $line->fk_product = $prodids[$prodid]; + } $line->qty = -1; $line->total_ht = -100; $line->total_ttc = -119.6; @@ -5227,7 +5246,9 @@ class Facture extends CommonInvoice $line->multicurrency_total_tva = -39.2; } elseif ($xnbp == 3) { // Discount is 50% (product line) $prodid = mt_rand(1, $num_prods); - $line->fk_product = $prodids[$prodid]; + if (isset($prodids[$prodid])) { + $line->fk_product = $prodids[$prodid]; + } $line->total_ht = 50; $line->total_ttc = 59.8; $line->total_tva = 9.8; @@ -5237,7 +5258,9 @@ class Facture extends CommonInvoice $line->remise_percent = 50; } else { // (product line) $prodid = mt_rand(1, $num_prods); - $line->fk_product = $prodids[$prodid]; + if (isset($prodids[$prodid])) { + $line->fk_product = $prodids[$prodid]; + } $line->total_ht = 100; $line->total_ttc = 119.6; $line->total_tva = 19.6; @@ -5278,7 +5301,9 @@ class Facture extends CommonInvoice $line->multicurrency_total_ttc = 0; $line->multicurrency_total_tva = 0; $prodid = mt_rand(1, $num_prods); - $line->fk_product = $prodids[$prodid]; + if (isset($prodids[$prodid])) { + $line->fk_product = $prodids[$prodid]; + } $this->lines[$xnbp] = $line; $xnbp++; @@ -6109,7 +6134,7 @@ class Facture extends CommonInvoice * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/facture/class/factureligne.class.php b/htdocs/compta/facture/class/factureligne.class.php index c0b69cb14d3..da644fff225 100644 --- a/htdocs/compta/facture/class/factureligne.class.php +++ b/htdocs/compta/facture/class/factureligne.class.php @@ -209,6 +209,7 @@ class FactureLigne extends CommonInvoiceLine $sql .= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,'; $sql .= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,'; $sql .= ' fd.fk_code_ventilation,'; + $sql .= ' fd.batch, fd.fk_warehouse,'; $sql .= ' fd.fk_unit, fd.fk_user_author, fd.fk_user_modif,'; $sql .= ' fd.situation_percent, fd.fk_prev_id,'; $sql .= ' fd.multicurrency_subprice,'; @@ -258,6 +259,8 @@ class FactureLigne extends CommonInvoiceLine $this->total_localtax2 = $objp->total_localtax2; $this->total_ttc = $objp->total_ttc; $this->fk_code_ventilation = $objp->fk_code_ventilation; + $this->batch = $objp->batch; + $this->fk_warehouse = $objp->fk_warehouse; $this->rang = $objp->rang; $this->fk_fournprice = $objp->fk_fournprice; $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 1ba1f950242..31c98fef78c 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -1,17 +1,17 @@ - * Copyright (C) 2004-2022 Laurent Destailleur - * Copyright (C) 2005-2015 Regis Houssin - * Copyright (C) 2015-2020 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2016 Marcos García - * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2024 Rafael San José - * Copyright (C) 2024 MDW +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2022 Laurent Destailleur + * Copyright (C) 2005-2015 Regis Houssin + * Copyright (C) 2015-2020 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2016 Marcos García + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2021-2025 Frédéric France + * Copyright (C) 2024 Rafael San José + * 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 @@ -433,7 +433,7 @@ if (isModEnabled('don') && $user->hasRight('don', 'lire')) { $langs->load("boxes"); $donationstatic = new Don($db); - $sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status"; + $sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status, d.fk_soc as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."don as d"; $sql .= " WHERE d.entity IN (".getEntity('donation').")"; // Add where from hooks @@ -484,9 +484,18 @@ if (isModEnabled('don') && $user->hasRight('don', 'lire')) { $donationstatic->statut = $obj->status; $donationstatic->status = $obj->status; - $label = $donationstatic->getFullName($langs); - if ($obj->societe) { - $label .= ($label ? ' - ' : '').$obj->societe; + $label = ''; + if (!empty($obj->socid)) { + $companystatic = new Societe($db); + $ret = $companystatic->fetch($obj->socid); + if ($ret > 0) { + $label = $companystatic->getNomUrl(1); + } + } else { + $label = $donationstatic->getFullName($langs); + if ($obj->societe) { + $label .= ($label ? ' - ' : '').$obj->societe; + } } print ''; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 398c7f443cc..b7725e4f736 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -671,7 +671,7 @@ class Localtax extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index ddce090b667..33a10159f33 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2016 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -1031,7 +1031,7 @@ class RemiseCheque extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 777973ca035..95f3968d84b 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2022 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -88,7 +88,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('tax', ' } /*if ($action == 'setdatep' && GETPOST('datepday') && $user->hasRight('tax', 'charges', 'creer')) { - $datepaye = dol_mktime(GETPOST('datephour', 'int'), GETPOST('datepmin', 'int'), GETPOST('datepsec', 'int'), GETPOST('datepmonth', 'int'), GETPOST('datepday', 'int'), GETPOST('datepyear', 'int')); + $datepaye = dol_mktime(GETPOSTINT('datephour'), GETPOSTINT('datepmin'), GETPOSTINT('datepsec'), GETPOSTINT('datepmonth'), GETPOSTINT('datepday'), GETPOSTINT('datepyear')); $res = $object->update_date($datepaye); if ($res === 0) { setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs'); @@ -257,7 +257,7 @@ if (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION')) { if ($user->socid == 0 && $object->statut == 0 && $action == '') { if ($user->hasRight('facture', 'paiement')){ - print ''.$langs->trans('Valid').''; + print ''.$langs->trans('Valid').''; } } } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 376a958ee6a..861948151d6 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2014-2016 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 JC Prieto - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -194,7 +194,7 @@ class BonPrelevement extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 0,), @@ -252,7 +252,7 @@ class BonPrelevement extends CommonObject */ public $date_trans; /** - * @var int Current transport method, index to $methodes_trans + * @var int Current transport method, index to `$methodes_trans` */ public $method_trans; /** @@ -2912,7 +2912,7 @@ class BonPrelevement extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param ?array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 4bda1228b91..9c37b76e37b 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2016-2024 Frédéric France * Copyright (C) 2017-2024 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -431,7 +431,7 @@ if ($action == 'create') { print ''.$langs->trans("Project").''; - print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); + print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, (string) $fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); print ''; } diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 97ac741e52e..35a1535e232 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2016-2024 Frédéric France * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -62,7 +62,7 @@ class ChargeSociales extends CommonObject protected $table_ref_field = 'ref'; /** - * @var int|string $date_ech + * @var int|string */ public $date_ech; @@ -820,7 +820,7 @@ class ChargeSociales extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 1222d7c1472..3079b6225de 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2018 Philippe Grand * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -935,7 +935,7 @@ class Tva extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e785fc0a520..2dbc8c53381 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -2248,7 +2248,7 @@ class Contact extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index c7f1bc8f41a..e2e5496e0c8 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2015-2018 Ferran Marcet * Copyright (C) 2024 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -263,7 +263,7 @@ class Contrat extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -2068,7 +2068,7 @@ class Contrat extends CommonObject if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { $res = $this->fetchProject(); if ($res > 0 && $this->project instanceof Project) { - $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1); + $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, '1'); } } } @@ -2921,7 +2921,7 @@ class Contrat extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/contrat/class/contratligne.class.php b/htdocs/contrat/class/contratligne.class.php index 9b2184c8b03..09c42a1a632 100644 --- a/htdocs/contrat/class/contratligne.class.php +++ b/htdocs/contrat/class/contratligne.class.php @@ -299,7 +299,7 @@ class ContratLigne extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index be2f81dc20f..1906560455c 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 2024 Frédéric France * @@ -328,11 +328,11 @@ print '
'; // Last modified contracts $sql = 'SELECT '; -$sql .= " sum(".$db->ifsql("cd.statut=0", 1, 0).') as nb_initial,'; -$sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", 1, 0).') as nb_running,'; -$sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')", 1, 0).') as nb_expired,'; -$sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')", 1, 0).') as nb_late,'; -$sql .= " sum(".$db->ifsql("cd.statut=5", 1, 0).') as nb_closed,'; +$sql .= " sum(".$db->ifsql("cd.statut=0", '1', '0').') as nb_initial,'; +$sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", '1', '0').') as nb_running,'; +$sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')", '1', '0').') as nb_expired,'; +$sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')", '1', '0').') as nb_late,'; +$sql .= " sum(".$db->ifsql("cd.statut=5", '1', '0').') as nb_closed,'; $sql .= " c.rowid as cid, c.ref, c.datec, c.tms, c.statut,"; $sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,"; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 5dc7e793af9..52557b35668 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -9,7 +9,7 @@ * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2019 Nicolas Zabouri * Copyright (C) 2021-2024 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Benjamin Falière * @@ -325,11 +325,11 @@ $sql .= " state.code_departement as state_code, state.nom as state_name,"; // TODO Add a denormalized field "denormalized_lower_planned_end_date" so we can remove the HAVING and then, // remove completely the SUM and GROUP BY (faster). Status of each service can be read into the loop that build the list. $sql .= " MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") as lower_planned_end_date,"; // lowest expiration date among open service lines -$sql .= " SUM(".$db->ifsql("cd.statut=0", 1, 0).') as nb_initial,'; -$sql .= " SUM(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", 1, 0).') as nb_running,'; -$sql .= " SUM(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')", 1, 0).') as nb_expired,'; -$sql .= " SUM(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')", 1, 0).') as nb_late,'; -$sql .= " SUM(".$db->ifsql("cd.statut=5", 1, 0).') as nb_closed'; +$sql .= " SUM(".$db->ifsql("cd.statut=0", '1', '0').') as nb_initial,'; +$sql .= " SUM(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", '1', '0').') as nb_running,'; +$sql .= " SUM(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')", '1', '0').') as nb_expired,'; +$sql .= " SUM(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')", '1', '0').') as nb_late,'; +$sql .= " SUM(".$db->ifsql("cd.statut=5", '1', '0').') as nb_closed'; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 72fe0e4e0a7..1f2c59b5ee4 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -414,10 +414,6 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= $db->order($sortfield, $sortorder); - -//print $sql; - // Count total nb of records $nbtotalofrecords = ''; if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { @@ -429,7 +425,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { } } -// Complete request and execute it with limit +// Complete request and execute it with order and limit $sql .= $db->order($sortfield, $sortorder); if ($limit) { $sql .= $db->plimit($limit + 1, $offset); diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index a9a51bf849a..78ca677f9fa 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -334,9 +334,17 @@ if ($action == 'update' && !empty($permissiontoadd)) { } $object->$key = $value; - if (!empty($val['notnull']) && $val['notnull'] > 0 && $object->$key == '' && (!isset($val['default']) || is_null($val['default']))) { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors'); + + if ($key == 'pass_crypted' && property_exists($object, 'pass')) { + if (GETPOST("pass", "password")) { // If not provided, we do not change it. We never erase a password with empty. + $object->pass = GETPOST("pass", "password"); + } + // TODO Manadatory for password not yet managed + } else { + if (!empty($val['notnull']) && $val['notnull'] > 0 && $object->$key == '' && (!isset($val['default']) || is_null($val['default']))) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors'); + } } // Validation of fields values diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e5a191b8135..35a67a4c272 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -962,10 +962,10 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto $filename .= '_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); } } - if ($year) { + if (!empty($year)) { $filename .= '_'.$year; } - if ($month) { + if (!empty($month)) { $filename .= '_'.$month; } if ($pagecount) { @@ -1358,18 +1358,36 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa $result = $object->fetch($toselectid); //var_dump($contcats);exit; if ($result > 0) { - if ($obj->price_base_type == 'TTC') { - $newprice = $object->price_ttc * (100 + $pricepercentage) / 100; - $minprice = $object->price_min_ttc; - } else { - $newprice = $object->price * (100 + $pricepercentage) / 100; - $minprice = $object->price_min; - } - $res = $object->updatePrice($newprice, $obj->price_base_type, $user, $object->tva_tx, $minprice, 0, $object->tva_npr, 0, 0, array(), $object->default_vat_code); - if ($res > 0) { - $nbok++; - } else { - setEventMessages($object->error, $object->errors, 'errors'); + if (getDolGlobalString('PRODUCT_PRICE_UNIQ') + || getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { + if ($object->price_base_type == 'TTC') { + $newprice = $object->price_ttc * (100 + $pricepercentage) / 100; + $minprice = $object->price_min_ttc; + } else { + $newprice = $object->price * (100 + $pricepercentage) / 100; + $minprice = $object->price_min; + } + $res = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, 0, $object->tva_npr, 0, 0, array(), $object->default_vat_code); + if ($res > 0) { + $nbok++; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } elseif (getDolGlobalString('PRODUIT_MULTIPRICES')) { + $maxlevel = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); + for ($level = 1; $level <= $maxlevel; $level++) { + if ($object->price_base_type == 'TTC') { + $newprice = $object->multiprices_ttc[$level] * (100 + $pricepercentage) / 100; + $minprice = $object->multiprices_min_ttc[$level]; + } else { + $newprice = $object->multiprices[$level] * (100 + $pricepercentage) / 100; + $minprice = $object->multiprices_min[$level]; + } + $res = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, $level, $object->tva_npr, 0, 0, array(), $object->default_vat_code); + if ($res > 0) { + $nbok++; + } + } } } else { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 51f053c9eda..d89834e3d49 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005 Simon Tosser - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Pierre Morin - * Copyright (C) 2013 Marcos García - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2004-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005 Simon Tosser + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010 Pierre Morin + * Copyright (C) 2013 Marcos García + * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -48,6 +48,9 @@ if (!defined('NOREQUIREAJAX')) { * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string $module + * @var string $mode */ if (!isset($mode) || $mode != 'noajax') { // For ajax call @@ -96,11 +99,15 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call } } else { // When no an ajax call (include from other file) + /** + * @var string $module + */ ' @phan-var-force int $section @phan-var-force string $module @phan-var-force string $showonrightsize '; + $rootdirfordoc = $conf->ecm->dir_output; $ecmdir = new EcmDirectory($db); @@ -233,6 +240,7 @@ if ($type == 'directory') { 'holiday', 'recruitment-recruitmentcandidature', 'banque', + 'bank-statement', 'chequereceipt', 'mrp-mo' ); @@ -286,6 +294,8 @@ if ($type == 'directory') { $upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature'; } elseif ($module == 'banque') { $upload_dir = $conf->bank->dir_output; + } elseif ($module == 'bank-statement') { + $upload_dir = $conf->bank->dir_output.'/*/statement'; } elseif ($module == 'chequereceipt') { $upload_dir = $conf->bank->dir_output.'/checkdeposits'; } elseif ($module == 'mrp-mo') { @@ -300,7 +310,7 @@ if ($type == 'directory') { // Automatic list if (in_array($module, $automodules)) { - $param .= '&module='.$module; + $param .= '&module='.urlencode($module); if (isset($search_doc_ref) && $search_doc_ref != '') { $param .= '&search_doc_ref='.urlencode($search_doc_ref); } @@ -309,6 +319,7 @@ if ($type == 'directory') { $filter = preg_quote((string) $search_doc_ref, '/'); $filearray = dol_dir_list($upload_dir, "files", 1, $filter, $excludefiles, $sortfield, $sorting, 1); + //var_dump($filearray); // To allow external users,we must restrict $filearray to entries the user is a thirdparty. // This can be done by filtering on entries found into llx_ecm diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index db7710e960b..5e622fd0792 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015-2023 Frederic France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -52,7 +52,7 @@ class box_produits extends ModeleBoxes $this->db = $db; $listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); - $tmpentry = array('enabled' => (isModEnabled("product") || isModEnabled("service")), 'perms' => ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')), 'module' => 'product|service'); + $tmpentry = array('enabled' => (int) (isModEnabled("product") || isModEnabled("service")), 'perms' => (string) (int) ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')), 'module' => 'product|service'); $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $this->hidden = ($showmode != 1); $this->urltoaddentry = DOL_URL_ROOT.'/product/card.php?action=create'; @@ -167,7 +167,7 @@ class box_produits extends ModeleBoxes $price = ($objp->price_base_type == 'HT') ? price($objp->price) : $price = price($objp->price_ttc); } else { //Parse the dynamic price - $productstatic->fetch($objp->rowid, '', '', 1); + $productstatic->fetch($objp->rowid, '', '', '1'); require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; $priceparser = new PriceParser($this->db); diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index f2a18d04ccc..fc5448fed47 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Maxime Kohlhaas * Copyright (C) 2015-2021 Frédéric France * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ class box_produits_alerte_stock extends ModeleBoxes $this->db = $db; $listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); - $tmpentry = array('enabled' => ((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms' => $user->hasRight('stock', 'lire'), 'module' => 'product|service|stock'); + $tmpentry = array('enabled' => (int) ((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms' => (string) (int) $user->hasRight('stock', 'lire'), 'module' => 'product|service|stock'); $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $this->hidden = ($showmode != 1); $this->urltoaddentry = DOL_URL_ROOT.'/product/card.php?action=create'; @@ -163,7 +163,7 @@ class box_produits_alerte_stock extends ModeleBoxes $price_base_type = $langs->trans($objp->price_base_type); $price = ($objp->price_base_type == 'HT') ? price($objp->price) : $price = price($objp->price_ttc); } else { //Parse the dynamic price - $productstatic->fetch($objp->rowid, '', '', 1); + $productstatic->fetch($objp->rowid, '', '', '1'); require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; $priceparser = new PriceParser($this->db); diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index 81be08a78b8..171100943fc 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -63,7 +63,7 @@ class Ccountry extends CommonDict /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> */ public $fields = array( 'label' => array('type' => 'varchar(250)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 15, 'notnull' => -1, 'showoncombobox' => 1) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index f37bfc34085..4bb9a8fbb08 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -5,9 +5,9 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Marcos García * Copyright (C) 2016-2023 Charlene Benke - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Mélina Joum * Copyright (C) 2024 Nick Fragoulis * @@ -933,8 +933,10 @@ abstract class CommonDocGenerator array('line_date_end_rfc', 'date_end', 'dayrfc', 'auto', null) ); foreach ($date_specs as $date_spec) { - if (property_exists($line, $date_spec[1])) { - $resarray[$date_spec[0]] = dol_print_date($line->${$date_spec[1]}, $date_spec[2], $date_spec[3], $date_spec[4]); + $propertyname = $date_spec[1]; + if (property_exists($line, $propertyname)) { + // @phan-suppress-next-line PhanUndeclaredProperty + $resarray[$date_spec[0]] = dol_print_date($line->$propertyname, $date_spec[2], $date_spec[3], $date_spec[4]); } } @@ -1053,7 +1055,7 @@ abstract class CommonDocGenerator $array_key.'_tracking_number' => $object->tracking_number, $array_key.'_tracking_url' => $object->tracking_url, $array_key.'_shipping_method' => $object->listmeths[0]['libelle'], - $array_key.'_weight' => $object->trueWeight.' '.measuringUnitString(0, 'weight', (string) $object->weight_units), + $array_key.'_weight' => $object->trueWeight.' '.measuringUnitString(0, 'weight', $object->weight_units), $array_key.'_width' => $object->trueWidth.' '.measuringUnitString(0, 'size', $object->width_units), $array_key.'_height' => $object->trueHeight.' '.measuringUnitString(0, 'size', $object->height_units), $array_key.'_depth' => $object->trueDepth.' '.measuringUnitString(0, 'size', $object->depth_units), @@ -1090,31 +1092,31 @@ abstract class CommonDocGenerator // Set trueVolume and volume_units not currently stored into database if ($object->trueWidth && $object->trueHeight && $object->trueDepth) { - $object->trueVolume = $object->trueWidth * $object->trueHeight * $object->trueDepth; - $object->volume_units = $object->size_units * 3; + $object->trueVolume = $object->trueWidth * $object->trueHeight * $object->trueDepth; + $object->volume_units = $object->size_units * 3; } $array_shipment[$array_key.'_total_ordered'] = (string) $totalOrdered; $array_shipment[$array_key.'_total_toship'] = (string) $totalToShip; if ($object->trueWeight) { - $array_shipment[$array_key.'_total_weight'] = (empty($totalWeight)) ? '' : showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); + $array_shipment[$array_key.'_total_weight'] = (empty($totalWeight)) ? '' : showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); } elseif (!empty($totalWeight)) { - $array_shipment[$array_key.'_total_weight'] = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1); + $array_shipment[$array_key.'_total_weight'] = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1); } else { - $array_shipment[$array_key.'_total_weight'] = ""; + $array_shipment[$array_key.'_total_weight'] = ""; } if (!empty($object->trueVolume)) { if ($object->volume_units < 50) { - $array_shipment[$array_key.'_total_volume'] = (empty($totalVolume)) ? '' : showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs); + $array_shipment[$array_key.'_total_volume'] = (empty($totalVolume)) ? '' : showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs); } else { - $array_shipment[$array_key.'_total_volume'] = (empty($totalVolume)) ? '' : price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units); + $array_shipment[$array_key.'_total_volume'] = (empty($totalVolume)) ? '' : price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units); } } elseif (!empty($totalVolume)) { - $array_shipment[$array_key.'_total_volume'] = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1); + $array_shipment[$array_key.'_total_volume'] = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1); } else { - $array_shipment[$array_key.'_total_volume'] = ""; + $array_shipment[$array_key.'_total_volume'] = ""; } return $array_shipment; @@ -1125,16 +1127,18 @@ abstract class CommonDocGenerator /** * Define array with couple substitution key => substitution value * - * @param array $object Dolibarr Object - * @param Translate $outputlangs Language object for output - * @param boolean|int $recursive Want to fetch child array or child object. - * @return array Array of substitution key->code + * @param array|CommonObject $object Dolibarr Object + * @param Translate $outputlangs Language object for output + * @param boolean|int $recursive Want to fetch child array or child object. + * @return array Array of substitution key->code */ public function get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive = 1) { // phpcs:enable $array_other = array(); - if (is_array($object) && count($object)) { + + if ((is_array($object) && count($object)) || is_object($object)) { + // Loop on each entry of array or on each property of object foreach ($object as $key => $value) { if (in_array($key, array('db', 'fields', 'lines', 'modelpdf', 'model_pdf'))) { // discard some properties continue; @@ -1171,11 +1175,11 @@ abstract class CommonDocGenerator * Note that vars into substitutions array are formatted. * * @param CommonObject $object Object with extrafields (must have $object->array_options filled) - * @param array $array_to_fill Substitution array + * @param array $array_to_fill Substitution array * @param Extrafields $extrafields Extrafields object * @param string $array_key Prefix for name of the keys into returned array * @param Translate $outputlangs Lang object to use for output - * @return array Substitution array + * @return array Substitution array */ public function fill_substitutionarray_with_extrafields($object, $array_to_fill, $extrafields, $array_key, $outputlangs) { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index bc0cd86198c..d22f304ca0d 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024-2025 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -1984,7 +1984,7 @@ abstract class CommonInvoice extends CommonObject $s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";*/ } else { $s .= "S\n"; - $s .= dol_trunc($mysoc->name, 70, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc((string) $mysoc->name, 70, 'right', 'UTF-8', 1)."\n"; $addresslinearray = explode("\n", $mysoc->address); $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 @@ -2005,7 +2005,7 @@ abstract class CommonInvoice extends CommonObject $s .= ($this->multicurrency_code ? $this->multicurrency_code : $conf->currency)."\n"; // Buyer $s .= "S\n"; - $s .= dol_trunc($this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc((string) $this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n"; $addresslinearray = explode("\n", $this->thirdparty->address); $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 18dfa4645f5..a4f954cbaff 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -17,7 +17,7 @@ * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2021 Grégory Blémand * Copyright (C) 2023 Lenin Rivas - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify @@ -140,7 +140,7 @@ abstract class CommonObject /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); @@ -152,7 +152,7 @@ abstract class CommonObject public $array_languages = null; // Value is array() when load already tried /** - * @var array To store result of ->liste_contact() + * @var array To store result of ->liste_contact() */ public $contacts_ids; @@ -270,13 +270,13 @@ abstract class CommonObject public $user; /** - * @var string The type of originating object. Combined with $origin_id, it allows to reload $origin_object + * @var string The type of originating object. Combined with `$origin_type`, it allows to reload `$origin_object` * @see fetch_origin() */ public $origin_type; /** - * @var int The id of originating object. Combined with $origin_type, it allows to reload $origin_object + * @var int The id of originating object. Combined with `$origin_type`, it allows to reload `$origin_object` * @see fetch_origin() */ public $origin_id; @@ -653,9 +653,15 @@ abstract class CommonObject /** * @var string The civility code, not an integer + * @deprecated Use $civlity_code */ public $civility_id; + /** + * @var string The civility code, not an integer + */ + public $civility_code; + // Dates /** * @var integer|''|null Object creation date @@ -704,7 +710,7 @@ abstract class CommonObject public $user_creation; /** - * @var int User id author/creation + * @var int|null User id author/creation */ public $user_creation_id; @@ -1489,7 +1495,7 @@ abstract class CommonObject * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) * @param int $status Status of user or company * @param int[] $arrayoftcids Array with ID of type of contacts. If we provide this, we can filter on ec.fk_c_type_contact IN ($arrayoftcids) to avoid a link on c_type_contact table (faster). - * @return array|int<-1,-1> Array of contacts, -1 if error + * @return array|int<-1,-1> Array of contacts, -1 if error */ public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1, $arrayoftcids = array()) { @@ -1580,7 +1586,7 @@ abstract class CommonObject 'rowid' => $obj->rowid, 'code' => $obj->code, 'libelle' => $libelle_type, - 'status' => $obj->statuslink, + 'status' => (int) $obj->statuslink, 'fk_c_type_contact' => $obj->fk_c_type_contact ); } else { @@ -4558,10 +4564,11 @@ abstract class CommonObject $deletetarget = true; } + $element = $this->getElementType(); $sourceid = (!empty($sourceid) ? $sourceid : $this->id); - $sourcetype = (!empty($sourcetype) ? $sourcetype : $this->element); + $sourcetype = (!empty($sourcetype) ? $sourcetype : $element); $targetid = (!empty($targetid) ? $targetid : $this->id); - $targettype = (!empty($targettype) ? $targettype : $this->element); + $targettype = (!empty($targettype) ? $targettype : $element); $this->db->begin(); $error = 0; @@ -4587,14 +4594,14 @@ abstract class CommonObject } else { if ($deletesource) { $sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'"; - $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'"; + $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "'"; } elseif ($deletetarget) { $sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'"; - $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'"; + $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "'"; } else { - $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')"; + $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "')"; $sql .= " OR"; - $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')"; + $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "')"; } } @@ -5386,7 +5393,7 @@ abstract class CommonObject // Define output language and label if (getDolGlobalInt('MAIN_MULTILANGS')) { - if (property_exists($this, 'socid') && !is_object($this->thirdparty)) { + if (property_exists($this, 'socid') && !empty($this->socid) && !is_object($this->thirdparty)) { dol_print_error(null, 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before'); return; } @@ -5801,7 +5808,7 @@ abstract class CommonObject */ protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams = null) { - global $conf, $langs, $user, $hookmanager, $action; + global $conf, $langs, $hookmanager, $action; $srctemplatepath = ''; @@ -6543,8 +6550,8 @@ abstract class CommonObject } } else { /** - We are in a situation where the current object has no values in its extra fields. - We want to initialize all the values to null so that the array_option is accessible in other contexts (especially in document generation). + * We are in a situation where the current object has no values in its extra fields. + * We want to initialize all the values to null so that the array_option is accessible in other contexts (especially in document generation). **/ if (is_array($extrafields->attributes[$this->table_element]['label'])) { foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { @@ -6986,7 +6993,7 @@ abstract class CommonObject */ public function insertExtraLanguages($trigger = '', $userused = null) { - global $conf, $langs, $user; + global $langs, $user; if (empty($userused)) { $userused = $user; @@ -7104,7 +7111,7 @@ abstract class CommonObject */ public function updateExtraField($key, $trigger = null, $userused = null) { - global $conf, $langs, $user, $hookmanager; + global $langs, $user, $hookmanager; if (getDolGlobalString('MAIN_EXTRAFIELDS_DISABLED')) { return 0; @@ -7437,13 +7444,13 @@ abstract class CommonObject */ public function updateExtraLanguages($key, $trigger = null, $userused = null) { - global $conf, $langs, $user; + global $user; if (empty($userused)) { $userused = $user; } - $error = 0; + //$error = 0; if (getDolGlobalString('MAIN_EXTRALANGUAGES_DISABLED')) { return 0; // For avoid conflicts if trigger used @@ -10497,7 +10504,7 @@ abstract class CommonObject } // Create lines - if (!empty($this->table_element_line) && !empty($this->fk_element)) { + if (!empty($this->table_element_line) && !empty($this->fk_element) && !empty($this->lines)) { foreach ($this->lines as $line) { $keyforparent = $this->fk_element; $line->$keyforparent = $this->id; @@ -10702,6 +10709,14 @@ abstract class CommonObject if (array_key_exists('user_modification_id', $fieldvalues) && !($fieldvalues['user_modification_id'] > 0)) { $fieldvalues['user_modification_id'] = $user->id; } + if (array_key_exists('pass_crypted', $fieldvalues) && property_exists($this, 'pass') && !empty($this->pass)) { + // @phan-suppress-next-line PhanUndeclaredProperty + $tmparray = dol_hash($this->pass, '0', 0, 1); + $fieldvalues['pass_crypted'] = $tmparray['pass_encrypted']; + if (array_key_exists('pass_encoding', $fieldvalues) && property_exists($this, 'pass_encoding')) { + $fieldvalues['pass_encoding'] = $tmparray['pass_encoding']; + } + } if (array_key_exists('ref', $fieldvalues)) { $fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data } diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 5fbf92c7446..9ab9401c570 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -39,7 +39,7 @@ abstract class CommonOrder extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/core/class/commonpeople.class.php b/htdocs/core/class/commonpeople.class.php index 9d80dbdd518..a4e9096b067 100644 --- a/htdocs/core/class/commonpeople.class.php +++ b/htdocs/core/class/commonpeople.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -99,8 +99,8 @@ trait CommonPeople * Return full name (civility+' '+name+' '+lastname) * * @param Translate $langs Language object for translation of civility (used only if option is 1) - * @param int $option 0=No option, 1=Add civility - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname + * @param int<0,1> $option 0=No option, 1=Add civility + * @param int<-1,5> $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname * @param int $maxlen Maximum length * @return string String with full name */ diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 0d28daa0958..c92697a4a9f 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -76,7 +76,7 @@ class DefaultValues extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 3a695df5e97..5cd03e46f74 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -339,7 +339,7 @@ class DiscountAbsolute extends CommonObject include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $tmpinvoice = new Facture($this->db); $tmpinvoice->fetch($this->fk_facture_source); - $userid = $tmpinvoice->fk_user_author; // We use the author of invoice + $userid = $tmpinvoice->user_creation_id; // We use the author of invoice } // Insert request @@ -347,13 +347,15 @@ class DiscountAbsolute extends CommonObject $sql .= " (entity, datec, fk_soc, discount_type, fk_user, description,"; $sql .= " amount_ht, amount_tva, amount_ttc, tva_tx, vat_src_code,"; $sql .= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,"; - $sql .= " fk_facture_source, fk_invoice_supplier_source"; + $sql .= " fk_facture_source, fk_invoice_supplier_source, multicurrency_code, multicurrency_tx"; $sql .= ")"; $sql .= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec != '' ? $this->datec : dol_now())."', ".((int) $this->socid).", ".(empty($this->discount_type) ? 0 : intval($this->discount_type)).", ".((int) $userid).", '".$this->db->escape($this->description)."',"; $sql .= " ".price2num($this->amount_ht).", ".price2num($this->amount_tva).", ".price2num($this->amount_ttc).", ".price2num($this->tva_tx).", '".$this->db->escape($this->vat_src_code)."',"; $sql .= " ".price2num($this->multicurrency_amount_ht).", ".price2num($this->multicurrency_amount_tva).", ".price2num($this->multicurrency_amount_ttc).", "; $sql .= " ".($this->fk_facture_source ? ((int) $this->fk_facture_source) : "null").","; - $sql .= " ".($this->fk_invoice_supplier_source ? ((int) $this->fk_invoice_supplier_source) : "null"); + $sql .= " ".($this->fk_invoice_supplier_source ? ((int) $this->fk_invoice_supplier_source) : "null").","; + $sql .= " ".($this->multicurrency_code ? "'".$this->db->escape($this->multicurrency_code)."'" : "null").","; + $sql .= " ".($this->multicurrency_tx ? price2num($this->multicurrency_tx) : "null"); $sql .= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index fb2f9a289e4..bd1034abe3d 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -87,7 +87,7 @@ class EmailSenderProfile extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index d1f80baadb2..1a581c464e6 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -127,7 +127,7 @@ class Events // extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f03f3dfe15d..9954624538e 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2065,7 +2065,7 @@ class ExtraFields } elseif ($type == 'price') { //$value = price($value, 0, $langs, 0, 0, -1, $conf->currency); if ($value || $value == '0') { - $value = price($value, 0, $outputlangs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).' '.$outputlangs->getCurrencySymbol($conf->currency); + $value = price($value, 0, $outputlangs, 0, getDolGlobalInt('MAIN_MAX_DECIMALS_TOT'), -1).' '.$outputlangs->getCurrencySymbol($conf->currency); } } elseif ($type == 'pricecy') { $currency = $conf->currency; @@ -2076,7 +2076,7 @@ class ExtraFields $value = $pricetmp[0]; } if ($value || $value == '0') { - $value = price($value, 0, $outputlangs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1, $currency); + $value = price($value, 0, $outputlangs, 0, getDolGlobalInt('MAIN_MAX_DECIMALS_TOT'), -1, $currency); } } elseif ($type == 'select') { $valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : ''); @@ -2313,7 +2313,17 @@ class ExtraFields $tmpobject = new $classname($this->db); '@phan-var-force CommonObject $tmpobject'; $tmpobject->fetch($value); - $value = $tmpobject->getNomUrl(3); + + if (get_class($tmpobject) == 'Categorie') { + // For category object, rendering must use the same method than the one deinfed into showCategories() + $color = $tmpobject->color; + $sfortag = ''; + $sfortag .= $tmpobject->getNomUrl(3); + $sfortag .= ''; + $value = $sfortag; + } else { + $value = $tmpobject->getNomUrl(3); + } } } else { dol_syslog('Error bad setup of extrafield', LOG_WARNING); @@ -2428,8 +2438,22 @@ class ExtraFields * @param string $key Key of attribute * @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data * @return string Formatted value + * @deprecated Use getCSSClass() */ public function getAlignFlag($key, $extrafieldsobjectkey = '') + { + return $this->getCSSClass($key, $extrafieldsobjectkey); + } + + /** + * Return the CSS to use for this extrafield into list + * + * @param string $key Key of attribute + * @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data + * @param string $mode 'csslist' (used on td into table list), 'css' (used on create/update), 'cssview' (used on view) + * @return string Formatted value + */ + public function getCSSClass($key, $extrafieldsobjectkey = '', $mode = 'csslist') { $type = 'varchar'; if (!empty($extrafieldsobjectkey)) { @@ -2438,19 +2462,27 @@ class ExtraFields $cssstring = ''; - if (in_array($type, array('date', 'datetime', 'datetimegmt',))) { - $cssstring = "center"; - } elseif (in_array($type, array('int', 'price', 'double', 'duration'))) { - $cssstring = "right"; - } elseif (in_array($type, array('boolean', 'radio', 'checkbox', 'ip', 'icon'))) { - $cssstring = "center"; + if ($mode == 'csslist') { + if (in_array($type, array('date', 'datetime', 'datetimegmt',))) { + $cssstring = "center"; + } elseif (in_array($type, array('int', 'price', 'double', 'duration'))) { + $cssstring = "right"; + } elseif (in_array($type, array('boolean', 'radio', 'checkbox', 'ip', 'icon'))) { + $cssstring = "center"; + } + + if (!empty($this->attributes[$extrafieldsobjectkey][$mode][$key])) { + $cssstring .= ($cssstring ? ' ' : '').$this->attributes[$extrafieldsobjectkey][$mode][$key]; + } else { + if (in_array($type, array('ip'))) { + $cssstring .= ($cssstring ? ' ' : '').'tdoverflowmax150'; + } + } } - if (!empty($this->attributes[$extrafieldsobjectkey]['csslist'][$key])) { - $cssstring .= ($cssstring ? ' ' : '').$this->attributes[$extrafieldsobjectkey]['csslist'][$key]; - } else { - if (in_array($type, array('ip'))) { - $cssstring .= ($cssstring ? ' ' : '').'tdoverflowmax150'; + if ($mode == 'css' || $mode == 'cssview') { + if (!empty($this->attributes[$extrafieldsobjectkey][$mode][$key])) { + $cssstring = ($cssstring ? ' ' : '').$this->attributes[$extrafieldsobjectkey][$mode][$key]; } } diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 571b2b1fda3..9bc2935b2a2 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2025 Alexandre Spangaro * Copyright (C) 2020 OScss-Shop * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2024 MDW @@ -406,11 +406,11 @@ class Fiscalyear extends CommonObject // phpcs:enable if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - //$langs->load("mymodule@mymodule"); - $this->labelStatus[self::STATUS_OPEN] = $langs->transnoentitiesnoconv('Draft'); - $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Enabled'); - $this->labelStatusShort[self::STATUS_OPEN] = $langs->transnoentitiesnoconv('Enabled'); - $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Disabled'); + + $this->labelStatus[self::STATUS_OPEN] = $langs->transnoentitiesnoconv('FiscalYearOpened'); + $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('FiscalYearClosed'); + $this->labelStatusShort[self::STATUS_OPEN] = $langs->transnoentitiesnoconv('FiscalYearOpenedShort'); + $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('FiscalYearClosedShort'); } $statusType = 'status4'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5dee9316b1e..dee4f0b3b71 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -81,6 +81,7 @@ class Form public $cache_types_paiements = array(); public $cache_conditions_paiements = array(); public $cache_transport_mode = array(); + /** @var array */ public $cache_availability = array(); public $cache_demand_reason = array(); public $cache_types_fees = array(); @@ -204,7 +205,7 @@ class Form * @param string $text Text of label (not used in this function) * @param string $htmlname Name of select field * @param string|int $value Value to show/edit - * @param CommonObject $object Object (that we want to show) + * @param CommonObject|ActionsCardProduct|ActionsCardService $object Object (that we want to show) * @param bool|int<0,1> $perm Permission to allow button to edit parameter * @param string $typeofdata Type of data ('string' by default, 'checkbox', 'email', 'phone', 'amount:99', 'numeric:99', * 'text' or 'textarea:rows:cols%', 'safehtmlstring', 'restricthtml', @@ -874,7 +875,7 @@ class Form console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); - if (atleastoneselected || ' . $alwaysvisible . ') + if (atleastoneselected || ' . ((int) $alwaysvisible) . ') { jQuery("."+name).show(); ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' @@ -1407,11 +1408,11 @@ class Form * @param int<0,3>|string $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list * @param string $exclude List of contacts id to exclude * @param string $limitto Not used - * @param integer $showfunction Add function into label + * @param int<0,1> $showfunction Add function into label * @param string $morecss Add more class to class style * @param bool $nokeyifsocid When 1, we force the option "Press a key to show list" to 0 if there is a value for $socid * @param integer $showsoc Add company into label - * @param int $forcecombo 1=Force to use combo box (so no ajax beautify effect) + * @param int<0,1> $forcecombo 1=Force to use combo box (so no ajax beautify effect) * @param array}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @param string $htmlid Html id to use instead of htmlname @@ -2563,7 +2564,7 @@ class Form * * @param string $action Value for $action * @param string $htmlname Field name in form - * @param int $show_empty 0=list without the empty value, 1=add empty value + * @param int<0,1> $show_empty 0=list without the empty value, 1=add empty value * @param int[] $exclude Array list of users id to exclude * @param int<0,1> $disabled If select list must be disabled * @param int[]|string $include Array list of users id to include or 'hierarchy' to have only supervised users @@ -2572,7 +2573,7 @@ class Form * @param int $maxlength Maximum length of string into list (0=no limit) * @param int<-1,1> $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status * @param string $morefilter Add more filters into sql request - * @param int $showproperties Show properties of each attendees + * @param int<0,1> $showproperties Show properties of each attendees * @param array}> $listofresourceid Array with properties of each resource * @return string HTML select string */ @@ -2658,17 +2659,17 @@ class Form * * @param int $selected Preselected products * @param string $htmlname Name of HTML select field (must be unique in page). - * @param int|string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param int|'' $filtertype Filter on product type (''=nofilter, 0=product, 1=service) * @param int $limit Limit on number of returned lines * @param int $price_level Level of price to show - * @param int $status Sell status: -1=No filter on sell status, 0=Products not on sell, 1=Products on sell - * @param int $finished 2=all, 1=finished, 0=raw material + * @param int<-1,1> $status Sell status: -1=No filter on sell status, 0=Products not on sell, 1=Products on sell + * @param int<0,2> $finished 2=all, 1=finished, 0=raw material * @param string $selected_input_value Value of preselected input text (for use with ajax) - * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param int<0,3> $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) * @param array $ajaxoptions Options for ajax_autocompleter * @param int $socid Thirdparty Id (to get also price dedicated to this customer) - * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. - * @param int $forcecombo Force to use combo box. + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int<0,1> $forcecombo Force to use combo box. * @param string $morecss Add more css on select * @param int<0,1> $hidepriceinlabel 1=Hide prices in label * @param string $warehouseStatus Warehouse status filter to count the quantity in stock. Following comma separated filter options can be used @@ -2726,8 +2727,6 @@ class Form $urloption .= '&warehouseid=' . (int) $warehouseId; } - $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); - if (isModEnabled('variants') && is_array($selected_combinations)) { // Code to automatically insert with javascript the select of attributes under the select of product // when a parent of variant has been selected. @@ -2817,6 +2816,8 @@ class Form if ($hidelabel == 3) { $out .= img_picto($langs->trans("Search"), 'search'); } + + $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); } else { $out .= $this->select_produits_list($selected, $htmlname, $filtertype, $limit, $price_level, '', $status, $finished, 0, $socid, $showempty, $forcecombo, $morecss, $hidepriceinlabel, $warehouseStatus, $status_purchase, $warehouseId); } @@ -2968,7 +2969,7 @@ class Form if (count($warehouseStatusArray)) { $selectFieldsGrouped = ", sum(" . $this->db->ifsql("e.statut IS NULL", "0", "ps.reel") . ") as stock"; // e.statut is null if there is no record in stock } else { - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; + $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", '0', "p.stock") . " AS stock"; } $sql = "SELECT "; @@ -3262,7 +3263,7 @@ class Form } else { if (isModEnabled('dynamicprices') && !empty($objp->fk_price_expression)) { $price_product = new Product($this->db); - $price_product->fetch($objp->rowid, '', '', 1); + $price_product->fetch($objp->rowid, '', '', '1'); require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; $priceparser = new PriceParser($this->db); @@ -3341,7 +3342,7 @@ class Form $outtva_tx = ''; $outdefault_vat_code = ''; $outqty = 1; - $outdiscount = 0; + $outdiscount = '0'; $maxlengtharticle = (!getDolGlobalString('PRODUCT_MAX_LENGTH_COMBO') ? 48 : $conf->global->PRODUCT_MAX_LENGTH_COMBO); @@ -3711,7 +3712,7 @@ class Form if ($selected > 0) { require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; $producttmpselect = new Product($this->db); - $producttmpselect->fetch($selected); + $producttmpselect->fetch((int) $selected); $selected_input_value = $producttmpselect->ref; unset($producttmpselect); } @@ -3734,7 +3735,7 @@ class Form * @param int $socid Id of supplier thirdparty (0 = no filter) * @param string $selected Product price preselected (must be 'id' in product_fournisseur_price or 'idprod_IDPROD') * @param string $htmlname Name of HTML select - * @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param ''|int<0,1> $filtertype Filter on product type (''=nofilter, 0=product, 1=service) * @param string $filtre Generic filter. Data must not come from user input. * @param string $filterkey Filter of produdts * @param int $statut -1=Return all products, 0=Products not on buy, 1=Products on buy @@ -4077,7 +4078,7 @@ class Form $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; // the price with numeric international format $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; // the price formatted in user language - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; + $optstart .= ' data-discount="' . dol_escape_htmltag((string) $outdiscount) . '"'; $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; // the rate with numeric international format $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; // the rate formatted in user language $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; @@ -4304,7 +4305,7 @@ class Form public function load_cache_conditions_paiements() { // phpcs:enable - global $langs; + global $langs, $hookmanager; $num = count($this->cache_conditions_paiements); if ($num > 0) { @@ -4313,7 +4314,9 @@ class Form dol_syslog(__METHOD__, LOG_DEBUG); - $sql = "SELECT rowid, code, libelle as label, deposit_percent"; + $this->cache_conditions_paiements = array(); + + $sql = "SELECT rowid, code, libelle as label, deposit_percent, entity"; $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; $sql .= " AND active > 0"; @@ -4328,12 +4331,23 @@ class Form // Si traduction existe, on l'utilise, sinon on prend le libelle par default $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); - $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; - $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; - $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; + $this->cache_conditions_paiements[$obj->rowid]['code'] = (string) $obj->code; + $this->cache_conditions_paiements[$obj->rowid]['label'] = (string) $label; + $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = (string) $obj->deposit_percent; + $this->cache_conditions_paiements[$obj->rowid]['entity'] = (int) $obj->entity; $i++; } + $parameters = array('context' => 'paymentterm'); + $reshook = $hookmanager->executeHooks('loadDictionaryCache', $parameters, $this); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + if (is_array($hookmanager->resArray) && count($hookmanager->resArray)) { + $this->cache_conditions_paiements = array_merge($this->cache_conditions_paiements, $hookmanager->resArray); + } + } else { + $this->cache_conditions_paiements = $hookmanager->resArray; + } + //$this->cache_conditions_paiements=dol_sort_array($this->cache_conditions_paiements, 'label', 'asc', 0, 0, 1); // We use the field sortorder of table return $num; @@ -4362,6 +4376,8 @@ class Form dol_syslog(__METHOD__, LOG_DEBUG); + $this->cache_availability = array(); + $langs->load('propal'); $sql = "SELECT rowid, code, label, position"; @@ -4377,9 +4393,9 @@ class Form // Si traduction existe, on l'utilise, sinon on prend le libelle par default $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); - $this->cache_availability[$obj->rowid]['code'] = $obj->code; - $this->cache_availability[$obj->rowid]['label'] = $label; - $this->cache_availability[$obj->rowid]['position'] = $obj->position; + $this->cache_availability[$obj->rowid]['code'] = (string) $obj->code; + $this->cache_availability[$obj->rowid]['label'] = (string) $label; + $this->cache_availability[$obj->rowid]['position'] = (int) $obj->position; $i++; } @@ -4395,11 +4411,11 @@ class Form /** * Return the list of type of delay available. * - * @param string $selected Id du type de delais pre-selectionne - * @param string $htmlname Nom de la zone select - * @param string $filtertype To add a filter - * @param int $addempty Add empty entry - * @param string $morecss More CSS + * @param ''|int $selected Id du type de delais pre-selectionne + * @param string $htmlname Nom de la zone select + * @param string|int<0,1> $filtertype To add a filter + * @param int<0,1> $addempty Add empty entry + * @param string $morecss More CSS * @return void */ public function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0, $morecss = '') @@ -4534,7 +4550,7 @@ class Form public function load_cache_types_paiements() { // phpcs:enable - global $langs; + global $langs, $hookmanager; $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements if ($num > 0) { @@ -4545,7 +4561,7 @@ class Form $this->cache_types_paiements = array(); - $sql = "SELECT id, code, libelle as label, type, active"; + $sql = "SELECT id, code, libelle as label, type, entity, active"; $sql .= " FROM " . $this->db->prefix() . "c_paiement"; $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; @@ -4558,14 +4574,25 @@ class Form // Si traduction existe, on l'utilise, sinon on prend le libelle par default $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); - $this->cache_types_paiements[$obj->id]['id'] = $obj->id; - $this->cache_types_paiements[$obj->id]['code'] = $obj->code; - $this->cache_types_paiements[$obj->id]['label'] = $label; - $this->cache_types_paiements[$obj->id]['type'] = $obj->type; - $this->cache_types_paiements[$obj->id]['active'] = $obj->active; + $this->cache_types_paiements[$obj->id]['id'] = (int) $obj->id; + $this->cache_types_paiements[$obj->id]['code'] = (string) $obj->code; + $this->cache_types_paiements[$obj->id]['label'] = (string) $label; + $this->cache_types_paiements[$obj->id]['type'] = (int) $obj->type; + $this->cache_types_paiements[$obj->id]['entity'] = (int) $obj->entity; + $this->cache_types_paiements[$obj->id]['active'] = (int) $obj->active; $i++; } + $parameters = array('context' => 'paymenttype'); + $reshook = $hookmanager->executeHooks('loadDictionaryCache', $parameters, $this); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + if (is_array($hookmanager->resArray) && count($hookmanager->resArray)) { + $this->cache_types_paiements = array_merge($this->cache_types_paiements, $hookmanager->resArray); + } + } else { + $this->cache_types_paiements = $hookmanager->resArray; + } + $this->cache_types_paiements = dol_sort_array($this->cache_types_paiements, 'label', 'asc', 0, 0, 1); return $num; @@ -5172,14 +5199,14 @@ class Form * * @param int|'' $selected Id account preselected * @param string $htmlname Name of select zone - * @param int $status Status of searched accounts (0=open, 1=closed, 2=both) + * @param int<0,2> $status Status of searched accounts (0=open, 1=closed, 2=both) * @param string $filtre To filter the list. This parameter must not come from input of users - * @param int|string $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param int<0,2>|string $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @param string $moreattrib To add more attribute on select - * @param int $showcurrency Show currency in label + * @param int<0,1> $showcurrency Show currency in label * @param string $morecss More CSS * @param int<0,1> $nooutput 1=Return string, do not send to output - * @return int|string If noouput=0: Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...), If nooutput=1: Return a HTML select string. + * @return int|string If nooutput=0: Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...), If nooutput=1: Return a HTML select string. */ public function select_comptes($selected = '', $htmlname = 'accountid', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '', $nooutput = 0) { @@ -5274,7 +5301,7 @@ class Form * @param int $showibanbic Show iban/bic in label * @param string $morecss More CSS * @param int<0,1> $nooutput 1=Return string, do not send to output - * @return int|string If noouput=0: Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...), If nooutput=1: Return a HTML select string. + * @return int|string If nooutput=0: Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...), If nooutput=1: Return a HTML select string. */ public function selectRib($selected = '', $htmlname = 'ribcompanyid', $filtre = '', $useempty = 0, $moreattrib = '', $showibanbic = 0, $morecss = '', $nooutput = 0) { @@ -5418,7 +5445,7 @@ class Form * @param string $page Page * @param string $selected Id of bank account * @param string $htmlname Name of select html field - * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param int<0,2> $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @return void */ public function formSelectAccount($page, $selected = '', $htmlname = 'fk_account', $addempty = 0) @@ -5440,7 +5467,7 @@ class Form if ($selected) { require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; $bankstatic = new Account($this->db); - $result = $bankstatic->fetch($selected); + $result = $bankstatic->fetch((int) $selected); if ($result) { print $bankstatic->getNomUrl(1); } @@ -5479,7 +5506,7 @@ class Form if ($selected) { require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; $bankstatic = new CompanyBankAccount($this->db); - $result = $bankstatic->fetch($selected); + $result = $bankstatic->fetch((int) $selected); if ($result) { print $bankstatic->label; if ($showibanbic) { @@ -5498,7 +5525,7 @@ class Form * Return list of categories having chosen type * * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. - * @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element). Not used if $outputmode = 1. + * @param int|'auto'|'' $selected Id of category preselected or 'auto' (autoselect category if there is only one element). Not used if $outputmode = 1. * @param string $htmlname HTML field name * @param int $maxlength Maximum length for labels * @param int|string|int[] $fromid Keep only or Exclude (depending on $include parameter) all categories (including the leaf $fromid) into the tree after this id $fromid. @@ -5615,11 +5642,11 @@ class Form * @param string $title Title * @param string $question Question * @param string $action Action - * @param array}>|string|null $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...')) - * 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'datetime', 'select', 'multiselect', 'morecss', - * 'other', 'onecolumn' or 'hidden'... + * @param array}>|string|null $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...')) + * 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'datetime', 'select', 'multiselect', 'morecss', + * 'other', 'onecolumn' or 'hidden'... * @param string $selectedchoice "" or "no" or "yes" - * @param int|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx + * @param int<0,2>|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box * @param int $width Force width of box * @return void @@ -5648,9 +5675,9 @@ class Form * @param string $title Title * @param string $question Question * @param string $action Action - * @param array}>|string|null $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...')) - * 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'datetime', 'select', 'multiselect', 'morecss', - * 'other', 'onecolumn' or 'hidden'... + * @param null|string|array,tdclass?:string}>|array{text:string,0?:array{name:string,value?:string|float|bool,values?:string[],default?:string,label?:string,type:string,size?:int|string,morecss?:string,moreattr?:string,style?:string,inputko?:int<0,1>,tdclass?:string},1?:array{name:string,value?:string|float|bool,values?:string[],default?:string,label?:string,type:string,size?:int|string,morecss?:string,moreattr?:string,style?:string,inputko?:int<0,1>,tdclass?:string}} $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...')) + * 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'datetime', 'select', 'multiselect', 'morecss', + * 'other', 'onecolumn' or 'hidden'... * @param int<0,1>|''|'no'|'yes'|'1'|'0' $selectedchoice '' or 'no', or 'yes' or '1', 1, '0' or 0 * @param int<0,2>|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int|string $height Force height of box (0 = auto) @@ -6100,7 +6127,7 @@ class Form $out .= ''; if ($selected) { $projet = new Project($this->db); - $projet->fetch($selected); + $projet->fetch((int) $selected); $out .= $projet->getNomUrl(0, '', 1); } else { $out .= '' . $textifnoproject . ''; @@ -6123,8 +6150,8 @@ class Form * @param string $page Page * @param string $selected Id condition pre-selectionne * @param string $htmlname Name of select html field - * @param int $addempty Add empty entry - * @param string $type Type ('direct-debit' or 'bank-transfer') + * @param int<0,1> $addempty Add empty entry + * @param ''|'direct-debit'|'bank-transfer' $type Type ('direct-debit' or 'bank-transfer') * @param int $filtertype If > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates) * @param int $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) * 0 : use default deposit percentage from entry @@ -6146,7 +6173,7 @@ class Form if ($type) { $out .= ''; } - $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); + $out .= $this->getSelectConditionsPaiements((int) $selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); $out .= ''; $out .= ''; } else { @@ -6184,7 +6211,7 @@ class Form * @param string $page Page * @param string $selected Id condition pre-selectionne * @param string $htmlname Name of select html field - * @param int $addempty Add an empty entry + * @param int<0,1> $addempty Add an empty entry * @return void */ public function form_availability($page, $selected = '', $htmlname = 'availability', $addempty = 0) @@ -6322,7 +6349,7 @@ class Form if ($selected) { require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; $theuser = new User($this->db); - $theuser->fetch($selected); + $theuser->fetch((int) $selected); print $theuser->getNomUrl(1); } else { print " "; @@ -6340,8 +6367,8 @@ class Form * @param string $selected Id mode pre-selectionne * @param string $htmlname Name of select html field * @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz)) - * @param int $active Active or not, -1 = all - * @param int $addempty 1=Add empty entry + * @param int<-1,1> $active Active or not, -1 = all + * @param int<0,1> $addempty 1=Add empty entry * @param string $type Type ('direct-debit' or 'bank-transfer') * @param int<0,1> $nooutput 1=Return string, no output * @return string HTML output or '' @@ -6613,7 +6640,7 @@ class Form if ($selected) { require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; $contact = new Contact($this->db); - $contact->fetch($selected); + $contact->fetch((int) $selected); print $contact->getFullName($langs); } else { print " "; @@ -6656,7 +6683,7 @@ class Form if ($selected) { require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; $soc = new Societe($this->db); - $soc->fetch($selected); + $soc->fetch((int) $selected); $out .= $soc->getNomUrl(0, ''); } else { $out .= '' . $textifnothirdparty . ''; @@ -6982,7 +7009,7 @@ class Form // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); - if (isInEEC($societe_vendeuse) && isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()) { + if (is_object($societe_vendeuse) && isInEEC($societe_vendeuse) && isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()) { // We also add the buyer country code if (is_numeric($type)) { if ($type == 1) { // We know product is a service @@ -7020,7 +7047,7 @@ class Form // Keep only the VAT qualified for $type_vat $arrayofvatrates = array(); foreach ($this->cache_vatrates as $cachevalue) { - if (empty($cachevalue['type_vat']) || $cachevalue['type_vat'] != $type_vat) { + if (empty($cachevalue['type_vat']) || $cachevalue['type_vat'] == $type_vat) { $arrayofvatrates[] = $cachevalue; } } @@ -7029,7 +7056,7 @@ class Form if ($num > 0) { // Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '') - if ($defaulttx < 0 || dol_strlen($defaulttx) == 0) { + if (($defaulttx < 0 || dol_strlen($defaulttx) == 0) && is_object($societe_vendeuse)) { $tmpthirdparty = new Societe($this->db); $defaulttx = get_default_tva($societe_vendeuse, (is_object($societe_acheteuse) ? $societe_acheteuse : $tmpthirdparty), $idprod); @@ -7222,7 +7249,7 @@ class Form * @param int<0,1> $disabled Disable input fields * @param int|string $fullday When a checkbox with id #fullday is checked, hours are set with 00:00 (if value if 'fulldaystart') or 23:59 (if value is 'fulldayend') * @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field. - * @param int|string|array $adddateof Add a link "Date of ..." using the following date. Must be array(array('adddateof' => ..., 'labeladddateof' => ...)) + * @param int|string|array $adddateof Add a link "Date of ..." using the following date. Must be array(array('adddateof' => ..., 'labeladddateof' => ...)) * @param string $openinghours Specify hour start and hour end for the select ex 8,20 * @param int $stepminutes Specify step for minutes between 1 and 30 * @param string $labeladddateof Label to use for the $adddateof parameter. Deprecated. Used only when $adddateof is not an array. @@ -7835,7 +7862,7 @@ class Form if ($selected && empty($selected_input_value)) { require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; $tickettmpselect = new Ticket($this->db); - $tickettmpselect->fetch($selected); + $tickettmpselect->fetch((int) $selected); $selected_input_value = $tickettmpselect->ref; unset($tickettmpselect); } @@ -8031,7 +8058,7 @@ class Form * @param string $selected Preselected tickets * @param string $htmlname Name of HTML select field (must be unique in page). * @param string $filtertype To add a filter - * @param int $limit Limit on number of returned lines + * @param int<0,max> $limit Limit on number of returned lines * @param int $status Not used * @param string $selected_input_value Value of preselected input text (for use with ajax) * @param int<0,3> $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) @@ -8061,7 +8088,7 @@ class Form if ($selected && empty($selected_input_value)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; $projecttmpselect = new Project($this->db); - $projecttmpselect->fetch($selected); + $projecttmpselect->fetch((int) $selected); $selected_input_value = $projecttmpselect->ref; unset($projecttmpselect); } @@ -8222,7 +8249,9 @@ class Form * * @param stdClass $objp Result set of fetch * @param string $opt Option (var used for returned value in string option format) - * @param array{key:string,value:string,type:string} $optJson Option (var used for returned value in json format) + * @param array{} $optJson Option (var used for returned value in json format) @phan-output-reference + * @phan-param array{key:string,value:string,type:string} $optJson Option (var used for returned value in json format) @phan-output-reference + * @phpstan-param-out array{key:string,value:string,type:string} $optJson * @param string $selected Preselected value * @param string $filterkey Filter key to highlight * @return void @@ -8290,7 +8319,7 @@ class Form if ($selected && empty($selected_input_value)) { require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; $adherenttmpselect = new Adherent($this->db); - $adherenttmpselect->fetch($selected); + $adherenttmpselect->fetch((int) $selected); $selected_input_value = $adherenttmpselect->ref; unset($adherenttmpselect); } @@ -8396,7 +8425,7 @@ class Form if (!$forcecombo) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); + $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT')); } $out .= ''; + $listoffieldsforselection .= '
  • '; + $listoffieldsforselection .= '
  • '; $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); } } @@ -9584,7 +9614,11 @@ class Form foreach ($categories as $c) { $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text foreach ($ways as $way) { - $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; + $color = $c->color; + $sfortag = '
  • '; + $sfortag .= $way; + $sfortag .= '
  • '; + $toprint[] = $sfortag; } } if (empty($toprint)) { @@ -10078,11 +10112,11 @@ class Form * Return an html string with a select combo box to choose yes or no * * @param string $htmlname Name of html select field - * @param string|int $value Pre-selected value - * @param int $option 0 return yes/no, 1 return 1/0 - * @param bool $disabled true or false - * @param int $useempty 1=Add empty line - * @param int $addjscombo 1=Add js beautifier on combo box + * @param string|int $value Pre-selected value + * @param int<0,1> $option 0 return yes/no, 1 return 1/0 + * @param bool|int<0,1> $disabled true or false + * @param int<0,1> $useempty 1=Add empty line + * @param int<0,1> $addjscombo 1=Add js beautifier on combo box * @param string $morecss More CSS * @param string $labelyes Label for Yes * @param string $labelno Label for No @@ -10313,7 +10347,7 @@ class Form // For thirdparty, contact, user, member, the ref is the id, so we show something else if ($object->element == 'societe') { - $ret .= dol_htmlentities($object->name); + $ret .= dol_htmlentities((string) $object->name); // List of extra languages $arrayoflangcode = array(); @@ -10350,14 +10384,14 @@ class Form $ret .= $object->ref . '
    '; $fullname = $object->getFullName($langs); if ($object->morphy == 'mor' && $object->societe) { - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); + $ret .= dol_htmlentities((string) $object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); } else { - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); + $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities((string) $object->societe) . ')' : ''); } } elseif (in_array($object->element, array('contact', 'user'))) { $ret .= ''.dol_htmlentities($object->getFullName($langs)).''.$addgendertxt; } elseif ($object->element == 'usergroup') { - $ret .= dol_htmlentities($object->name); + $ret .= dol_htmlentities((string) $object->name); } elseif (in_array($object->element, array('action', 'agenda'))) { '@phan-var-force ActionComm $object'; $ret .= $object->ref . '
    ' . $object->label; @@ -10432,7 +10466,7 @@ class Form * @param string $imagesize 'mini', 'small' or '' (original) * @param int<0,1> $addlinktofullsize Add link to fullsize image * @param int<0,1> $cache 1=Accept to use image in cache - * @param string $forcecapture '', 'user' or 'environment'. Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''. + * @param ''|'user'|'environment' $forcecapture '', 'user' or 'environment'. Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''. * @param int<0,1> $noexternsourceoverwrite No overwrite image with extern source (like 'gravatar' or other module) * @return string HTML code to output photo * @see getImagePublicURLOfObject() diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 948907ff469..800913719ee 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2017 Rui Strecht * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -249,9 +249,9 @@ class FormCompany extends Form * The key of the list is the code (there can be several entries for a given code but in this case, the country field differs). * Thus the links with the departments are done on a department independently of its name. * - * @param string $selected Code state preselected - * @param int $country_codeid 0=list for all countries, otherwise country code or country rowid to show - * @param string $htmlname Id of department + * @param string $selected Code state preselected + * @param int|string $country_codeid 0=list for all countries, otherwise country code or country rowid to show + * @param string $htmlname Id of department * @return void */ public function select_departement($selected = '', $country_codeid = 0, $htmlname = 'state_id') @@ -267,11 +267,11 @@ class FormCompany extends Form * The key of the list is the code (there can be several entries for a given code but in this case, the country field differs). * Thus the links with the departments are done on a department independently of its name. * - * @param int $selected Code state preselected (must be state id) - * @param int $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show - * @param string $htmlname Id of department. If '', we want only the string with