Commit graph

331 commits

Author SHA1 Message Date
MDW
f551727df9
Qual/Sec: Use db->sanitize instead of db->escape when not quoted, fix some quoting (#39286)
* FIX phpstan: Societe::$client (int<0,3>) does not accept -1 (#39244)

Societe::$client is annotated @var int<0,3> (domain 0=no customer,
1=customer, 2=prospect, 3=both) in societe.class.php, but the create
form in societe/card.php pre-set it to -1 as a transient "nothing
pre-selected" placeholder, tripping PHPStan level 10 on develop.

The value is never persisted (save paths compute 0..3) and the only
reader, the switch() building the form, treats -1 and 0 identically via
its default case. Use 0 (the property's own default) so the assignment
matches the declared type. No behavior change.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* Qual: Fix entity handling in bonprelevement.class.php

The variable name 'entities' was changed to 'entity' to better reflect the singular nature of the value being retrieved.
It was also casted to an int instead of using an unquoted db->escape.

* Qual: Improve SQL query construction in company.lib.php

By escaping the concatenated string, injection verification does not identify a false positive.

* Qual: Avoid void positive, sanitize instead of escape

* Qual: Avoid false positive, sanitize instead of escape

* Sec: Fix potential injection with cast to int (timespent_duration)

* Qual: Avoid false positive, sanitize instead of escape

* Qual: Avoid false positive, sanitize instead of escape

* fix: Replace escape() with sanitize() in SQL queries

# FIX: Replace escape() with sanitize() in SQL queries

- Replace escape() with sanitize() in SQL queries to ensure proper SQL injection protection
- Update SQL queries in multiple files to use sanitize() instead of escape()
- Ensure consistent use of sanitize() across the codebase for better security

* fix(sql): Replace escape with sanitize in SQL queries

# FIX: Replace escape with sanitize in SQL queries

- Replace `escape` with `sanitize` in SQL queries to ensure proper SQL injection prevention

* Qual: Improve field escaping/quoting

# Qual: Qual: Improve field escaping/quoting

---------

Co-authored-by: Jam Balaya <jambalaya.pyoncafe@outlook.jp>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 13:00:33 +02:00
Laurent Destailleur
3ecc61845e Fix type 2026-07-16 01:19:08 +02:00
Laurent Destailleur
a1c2470021 Debug v24 2026-07-15 13:04:32 +02:00
Laurent Destailleur
ee201f1c6c FIX list of email template when template for disabled modules 2026-06-02 19:04:15 +02:00
Laurent Destailleur
2f226300f3 FIX Pagination in dictionary and email template list 2026-05-25 15:55:50 +02:00
Pierre Ardoin
58d2b2f282
# NEW|New Stock transfer module stabilization and full functional coverage (#37557)
* Update stocktransfer_card.php

* migration: limiter les triggers stocktransfer au script 23->24

* agenda: ajouter les libellés InDolibarr pour stocktransfer

* stocktransfer pdf: éviter method_exists sur ligne nulle

* migration 23-24: ajouter le point-virgule manquant avant triggers

* notification: ajouter le support stocktransfer et event MODIFY

* langs: ajouter traductions Notify_STOCKTRANSFER_*

* langs: ajouter la clé Stocktransfer dans stocks.lang

* feat(stocktransfer): add quick add entry for stock transfers

* fix(quickadd): add stock transfer entry directly in main menu list

* projet: ajouter stocktransfer avant stock_mouvement

* projet: retirer le filtre global sur stocktransfer

* projet: renommer le titre stocktransfer et ajouter traductions

* projet: masquer montant sur la section stocktransfer

* projet: aligner la marge de stocktransfer sur commentaire

* projet: afficher NA pour les montants des stocktransfer

* projet: ajouter tooltip NA pour stocktransfer

* projet: ajouter message dédié NoAmountforStockTransfer

* projet: ajouter colonnes logistiques aux transferts de stock

* projet: retirer colonne date des transferts et aligner totaux

* projet: ajouter stocktransfer au badge de la vue d'ensemble

* projet: uniformiser les largeurs de colonnes stocktransfer

* stocktransfer: use email template type for presend form

* admin: add stock transfer email template type in setup list

* admin: show stock transfer mail template type when module enabled

* admin: move stock transfer mail type below products with box icon

* stocktransfer: align admin icon markup and presend attachment path

* langs: use stocktransfer-prefixed agenda trigger labels

* Update agenda.lang

* Update admin.lang

* Update other.lang

* Update stocks.lang

* Update admin.lang

* Update other.lang

* Update stocks.lang

* Update admin.lang

* Update agenda.lang

* Update stocks.lang

* Update admin.lang

* Update agenda.lang

* Update agenda.lang

* Update other.lang

* Update stocks.lang

* Update other.lang

* Update stocks.lang

* Update notify.class.php

* Remove destocking and stock increment triggers

Removed stock transfer action triggers for destocking and stock increment cancellation.

* Update 23.0.0-24.0.0.sql

* Update agenda.lang

* Update other.lang

* Update stocktransfer_card.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-04-28 11:07:19 +02:00
Laurent Destailleur
b116273033 Clean code 2026-04-23 17:41:15 +02:00
Laurent Destailleur
b3d355885a Clean code 2026-04-14 17:57:48 +02:00
Laurent Destailleur
d0366b0562 Rename substitution var 2026-03-30 11:07:47 +02:00
Frédéric FRANCE
95da49edf3
fix french doc (#37056)
* fix french doc

* fix french doc

* fix french doc

* doc translation

* doc translation

* doc translation

* doc translation

* doc translation
2026-02-02 19:22:04 +01:00
Laurent Destailleur
7bd0a8a76e CSS 2025-12-13 11:04:16 +01:00
Laurent Destailleur
0e42497112 Debug v23 2025-12-09 11:20:21 +01:00
Laurent Destailleur
ab3204a88a Debug v23 2025-12-01 11:42:20 +01:00
Laurent Destailleur
9e5043bed6 Restore view in one page without scrolling. TODO Must migrate this page
with modulebuilder.
2025-11-20 16:12:57 +01:00
Laurent Destailleur
ad165e3712 Clean permissions 2025-11-12 12:55:21 +01:00
Jon Bendtsen
df4cd2fc65
FIX adding tms and datec to email templates (#36189)
* NEW: adding tms and datec to email templates

* Escaping a timestamp string I just generated myself

* switching single and double quotes in escape line for tms and datec to make the build system happy?

* Add an id to the table

* showing better names than tms and datec

* Changing code to label to fix #29116

* using hregis advice to use idate not escape the string with date

* requested changes

* forgot to add my name to editors

* had to make class changes for API to work

* setting datec back to int|string

* removing unused code lines and using idate in the api file

* no tms in create or update, but select. No datec in update

* expanding hurl tests to prevent post with id or tms, put with id or datec

---------

Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2025-11-11 09:02:57 +01:00
Laurent Destailleur
dfbf173b17 Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-11-07 19:25:42 +01:00
Regis Houssin
fa10fc0f94
FIX avoid NULL value (#36126) 2025-11-06 13:15:03 +01:00
Laurent Destailleur
4bae3f6eec Must use StudlyCaps or PascalCase for class name 2025-10-22 18:15:27 +02:00
Jon Bendtsen
1f47cfd583
NEW API for getting, adding, deleting and/or modifying email templates (#35853)
* NEW API for getting, adding, deleting and/or modifying email templates

* removing duplicate class formmail which has been moved to a separate file

* hurl file for testing the emailtemplates api

* more comprehensive tests of posting a new email template, all required fields and making sure that ID is rejected

* first GUI test of email templates

---------

Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-10-22 18:04:39 +02:00
Vincent Maury
27ed249561
NEW : add supplier payment mail template (#35877)
* Fix 35865 no formail displayed in supplier payment

* - add possibility to create custom mail template for supplier invoices payment
- add a default template
- add 2 new substitutions keys : __SUPPLIER_PAYMENT_INVOICES_LIST__ and  __SUPPLIER_PAYMENT_INVOICES_TOTAL__

* - add possibility to create custom mail template for supplier invoices payment
- add a default template
- add 2 new substitutions keys : __SUPPLIER_PAYMENT_INVOICES_LIST__ and  __SUPPLIER_PAYMENT_INVOICES_TOTAL__

---------

Co-authored-by: vmaury <vmaury@vmaury-Lafite-Pro-16-AMD>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-10-22 17:44:01 +02:00
ldestailleur
8dd9ed56a1 spellcheck war 2025-10-07 08:56:18 +02:00
ldestailleur
62d05df912 Look and feel v23 2025-10-04 00:50:49 +02:00
ldestailleur
e45fe1f988 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2025-09-27 15:57:27 +02:00
Dylan Bourdere
56a73c5cd9
fix: PHP warning in mail and card presend (#35474)
* fix: PHP warning in mail and card presend

* phpstan

* fix: PHP warning in mail and card presend
2025-09-26 20:48:54 +02:00
ldestailleur
4a363478ae Clean code with rector 2025-09-18 16:26:38 +02:00
VIAL-GOUTEYRON Quentin
1874deef49
FIX delivery triggers and mail templates: correct inconsistencies in email triggers and templates` (#35264)
* `fix(delivery): correct inconsistencies in email triggers and templates`

**Body:**
- Adjusted email trigger names from `RECEPTION_*` to `SHIPPING_*`.
- Updated parameters and placeholders for shipment email tracking.
- Removed redundant `reception_send` entry in mail templates for shipping.

* `fix(delivery): update email triggers and templates for deliveries`

**Body:**
- Replaced email trigger `SHIPPING_SENTBYMAIL` with `DELIVERY_SENTBYMAIL`.
- Updated template references from `shipping_*` to `delivery_*` for consistency.
- Modified tracking ID format from `shi` to `del` in `card.php`.
- Added `MailToSendDelivery` language entry for email labels.
- Adjusted mail templates to include `delivery_send` entries.
2025-09-18 13:23:57 +02:00
ldestailleur
6ed764bedf Clean code 2025-09-18 11:40:56 +02:00
ldestailleur
2572847b2a Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-09-17 18:29:07 +02:00
HENRY Florian
bf5a0c9ce7
fix: php 8 warning (#35363)
* fix: php 8 warning

* fix: php 8 warning

* fix: php 8 warning

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-09-17 18:16:48 +02:00
atm-GregM
e081e3be33
NEW ADD Send mail for reception / Delivery (#34829)
* Send mail for reception

* back pre-commit

* empty reshook
2025-07-31 21:59:35 +02:00
ldestailleur
a0ec0002f6 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-03-19 13:47:25 +01:00
ldestailleur
302ab362d5 Fix edit of template with back to page 2025-03-18 17:41:37 +01:00
MDW
2c95fba2ee
Qual: Fix phan notices (admin) (#33483)
* Qual: Fix phan notices (accountancy, adherents)

* Qual: Fix phan notices (admin)

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-03-16 20:21:22 +01:00
MDW
988fc75ca2
Qual: Fix phan notices (emailcollector, bookkeeping) (#33375)
* Qual: Fix phan notices (mostly propal)

* Fix some const arguments to Form::select_dolusers()

* Update phan baseline

* Qual: Fix phan notices (propal)

* Qual: Fix phan notices (emailcollector, bookkeeping)
2025-03-10 15:47:55 +01:00
ATM-Lucas
4afb100767 Adding model Mail 2025-01-24 16:52:50 +01:00
Laurent Destailleur
93ec6f9ef7 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-11-19 13:02:26 +01:00
Laurent Destailleur
423cc7b845 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 20.0 2024-11-19 12:41:22 +01:00
Laurent Destailleur
023856cf73 FIX #31997 2024-11-19 12:40:23 +01:00
Laurent Destailleur
1386d8c388 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2024-11-19 04:21:29 +01:00
Laurent Destailleur
e9e1175134 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0 2024-11-19 04:04:10 +01:00
Sami Filali
fac36d2376
add hook (#31938) 2024-11-16 14:51:24 +01:00
Frédéric FRANCE
1adc883b56
add baseline exclude for phpstan (#31632)
* add baseline exclude for phpstan

* update

* update

* update

* update

* update

* merge

* restore one filter

* delete old errors

* fix

* fix

* fix

* $moreforfilter can t be empty

* fix

* enable check

* refresh baseline

* add phpdoc

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* update phpstan baseline

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-04 23:53:20 +01:00
Laurent Destailleur
cb0ab53709 Look and feel v21 2024-10-27 14:08:59 +01:00
Frédéric FRANCE
331c5e9f4b
fix phpstan (#31547)
* fix phpstan

* fix phpstan

* fix phpstan
2024-10-25 13:24:10 +02:00
Laurent Destailleur
9dce6c7689 Merge 2024-10-14 01:33:15 +02:00
MDW
099dbd9c1e
Qual: Fix notices for htdocs/admin/* (#30982)
* Fix (Possibly)UndeclaredGlobalVariable

* Update phan baseline

* Fix (Possibly)UndeclaredGlobalVariable (2)

* Qual: Fix notices for htdocs/admin/*

# Qual: Fix notices for htdocs/admin/*

Fixes most phan/phpstan noticies for files under htdocs/admin/* and ai.
2024-09-18 03:27:25 +02:00
Laurent Destailleur
5513b573b0 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-07-24 04:06:06 +02:00
Laurent Destailleur
8a257ac93f Fix permission to edit email template - Debug v20 2024-07-23 02:12:46 +02:00
Laurent Destailleur
403fcd234e Debug v20 2024-07-22 21:49:47 +02:00