* Update discount.class.php
Add a hook to change the sql request in function getAvailableDiscounts
* Update discount.class.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* 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>
The current solutions only uses time() which is a timestamp based on seconds. In some scenarios like automizing mails this is not enough. Even with the mt_rand there could be more likely collisions of the ids which is not allowed as it should be overall unique.
The newly used uniqid used a timestamp based on milliseconds and adds additionally a bit randomness which reduces the collision changes much more.
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* FIX 21.0: $height and $width can be ints, but also 'auto' (which is commonly used), so check for this special value before typecasting
* Update html.form.class.php
* Update html.form.class.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* 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>