Commit Graph

3207 Commits

Author SHA1 Message Date
ldestailleur
ddbe0427b7 Doc 2025-08-11 19:36:44 +02:00
Laurent Destailleur
d4469f34e0 Fix error message 2025-08-11 00:26:19 +02:00
Laurent Destailleur
654d3eda8a Fix error message 2025-08-11 00:25:37 +02:00
ldestailleur
a23e79f081 Fix warning 2025-08-09 14:12:23 +02:00
ldestailleur
267871e805 Prepare code for simplification 2025-08-07 15:26:57 +02:00
ldestailleur
d03af36d95 Fix use of const trigger to avoid compatibility pb in future. 2025-08-06 19:08:01 +02:00
ldestailleur
8bf946dab0 Doc on TRIGGER_PREFIX 2025-08-06 18:47:18 +02:00
ldestailleur
16e7c54947 Fix warnings 2025-08-06 13:19:01 +02:00
ldestailleur
a8173ff888 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2025-08-06 12:39:32 +02:00
ldestailleur
3298062561 Fix regression 2025-08-06 01:20:57 +02:00
ldestailleur
86f5db7aa9 Fix better comaptibilty for extrafield email/mail 2025-08-05 00:45:00 +02:00
Maxime Kohlhaas
1a4226ff64 NEW : add extrafield option "empty on clone" (#34866)
* NEW : add extrafield option "empty on clone"

* NEW : empty extrafield value on clone

* Fix : missing parameter in function call

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-08-04 16:48:11 +02:00
ldestailleur
a486c64387 Move common trigger code into a dedicated file 2025-08-04 16:32:44 +02:00
ldestailleur
6363022c6b Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2025-08-04 11:17:18 +02:00
ldestailleur
24d2e83be1 Doc 2025-08-04 11:15:06 +02:00
Lenin Rivas
c67e5f70c0 Forever update user and date modified (#34862) 2025-08-04 11:08:53 +02:00
Florian Mortgat
e8cb259d05 NEW hook allowing external modules to replace the behavior of fetchObjectLinked() (#34724)
Note: if subclasses overload fetchObjectLinked, adding the same hook should be considered as well if deemed useful.
2025-08-02 00:21:53 +02:00
ldestailleur
ce6fc756fa Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2025-07-29 11:27:58 +02:00
ldestailleur
ae8e509c9f Fix CI 2025-07-28 18:59:12 +02:00
ldestailleur
0fa59d0e9c Fix CI and warning message 2025-07-28 16:17:03 +02:00
ldestailleur
c75663b2de Fix CI 2025-07-28 15:40:54 +02:00
ldestailleur
6339eaf879 Fix date variables must be in UTC in memory. 2025-07-18 02:57:49 +02:00
VIAL-GOUTEYRON Quentin
7f9b477401 Fix(core): Ensure tms field is always updated in updateCommon (#34723)
* fix(commonobject): ensure `tms` field is updated with current timestamp

- Added logic to automatically update the `tms` field with the current timestamp when it exists in `$fieldvalues`.
- Aligns `tms` behavior with other timestamp fields like `date_modification`.

Improves consistency in timestamp handling across the codebase.

* fix(commonobject): set timezone for `dol_now()` call

- Updated `dol_now()` to use the user's timezone (`tz_user`).
- Ensures timestamps are consistent with user-specific settings.

* fix(commonobject): correct parameter for `dol_now()` function

- Updated `dol_now()` to use 'tzuser' instead of 'tz_user'.
- Fixes incorrect parameter causing potential timezone inconsistencies.

* fix(commonobject): respect `MAIN_DISABLE_AUTO_UPDATE_OF_TMS_FIELDS` setting

- Added a check for `MAIN_DISABLE_AUTO_UPDATE_OF_TMS_FIELDS` in the logic updating the `tms` field.
- Ensures the `tms` field is not auto-updated when this global setting is enabled.
- Retains the update behavior for `date_modification` and `fk_user_modif` fields.

Improves flexibility by honoring user-defined global settings for timestamp management.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-07-18 02:54:07 +02:00
ldestailleur
67494f497f Fix warning 2025-07-10 15:16:53 +02:00
Laurent Destailleur
6b68f5aad0 Fix CI 2025-07-05 11:33:46 +02:00
ldestailleur
358daa3ca0 Clean doc and code 2025-06-27 13:39:50 +02:00
ldestailleur
497d774a21 Fix the selectForFormsList was not using correctly the
ismultientitymanaged. Replace a join with and exists.
2025-06-27 00:21:50 +02:00
Alexandre Janniaux
efd95ad107 Qual commonobject: line_max: factor conditonals together (#34600)
* commonobject: line_max: factor conditonals together

The SQL request is shared, except for the additional filter.

* Update commonobject.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-06-23 18:28:13 +02:00
ldestailleur
cf8beb8505 Fix error return 2025-06-21 14:39:53 +02:00
Alexandre Janniaux
1a3430f40a commonobject: updateLineDown: use early return on query failure (#34598)
Simplify the code by early returning on query failure, which removes
almost every indentation level of the function.

It also highlights some important flaws here, since there is a return
without value (void return type) between the two queries if an error
happened, which would indicate the first query failed and nothing was
registered, but also an error check leading to printing an error message
if the second query fails, without actually reverting the first one, and
since there is no error code, there's no way to trigger a db->rollback()
from the caller code for this reason.
2025-06-21 14:36:07 +02:00
Alexandre Janniaux
1113ae6dc1 Qual: Commonobject reverse happy path (#34599)
* commonobject: getRangOfLine: reverse happy and error path

* commonobject: getIdOfLine: reverse error and happy path
2025-06-21 14:35:01 +02:00
ldestailleur
9c2da8b9b6 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-06-19 11:31:44 +02:00
ldestailleur
a78e63dbf0 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2025-06-19 11:13:59 +02:00
ldestailleur
ec098b2632 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0 2025-06-19 10:59:07 +02:00
ldestailleur
0da1e6b464 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2025-06-19 10:48:18 +02:00
ldestailleur
247847cd14 Fix warnings 2025-06-19 10:39:19 +02:00
Alexandre Janniaux
0770e79749 commonobject: updateLineUp: use early return on query failure (#34570)
Simplify the code by early returning on query failure, which removes
almost every indentation level of the function.

It also highlights some important flaws here, since there is a return
without value (void return type) between the two queries if an error
happened, which would indicate the first query failed and nothing was
registered, but also an error check leading to printing an error message
if the second query fails, without actually reverting the first one, and
since there is no error code, there's no way to trigger a db->rollback()
from the caller code for this reason.
2025-06-19 10:12:55 +02:00
Alexandre Janniaux
1da9aab8d4 commonobject: updateRangOfLine: de-indent happy path (#34569)
There's no need for the else{} block when the if block early returns,
and it helps highlighting the happy path. Note that this kind of change
only make sense when one of the block is an error, not a choice between
two possibilities.
2025-06-19 10:11:12 +02:00
Alexandre Janniaux
f04a390cb5 commonobject: getChildrenOfLine: early return on query error (#34547)
This makes the code more readable by deindenting two whole levels on the
happy path.
2025-06-18 14:19:37 +02:00
Marc de Lima Lucio
467c772504 FIX: common fields: php warning with select input field (#34495) 2025-06-14 11:58:25 +02:00
Laurent Destailleur
b1812b1080 Debug v22 2025-06-10 02:24:08 +02:00
Laurent Destailleur
221c27c091 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-06-09 18:15:59 +02:00
Laurent Destailleur
326c75dc51 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2025-06-09 17:58:54 +02:00
kkhelifa-opendsi
115a430652 FIX: Fix delete ecm file into database when delete a contract (#34310) 2025-06-04 14:31:23 +02:00
Günter Lukas
eaf0ec2e30 Fix #34346 - SQL Error (#34347)
* Fix #34346 - SQL Error

* Update commonobject.class.php
2025-06-03 17:05:10 +02:00
Laurent Destailleur
c35965030c Debug v22 2025-05-28 01:16:02 +02:00
Laurent Destailleur
1b3b123472 Debug v22 2025-05-28 00:09:02 +02:00
Quentin-Seekness
024f266089 Allow insertion of value equals to 0 with int type (#34294)
The issue is that right now we can't insert a value of 0 as an int extrafields (unless the filed is mandatory, wich is not always the case)
2025-05-27 18:55:28 +02:00
Laurent Destailleur
393537d1e4 FIX portal module, prepare to replace duplication of code 2025-05-27 18:47:19 +02:00
ldestailleur
62e305f7fa Debug the asset module. Can't delete. 2025-05-10 21:03:27 +02:00