* fix(ecm): add support for custom entity in file operations
This commit addresses missing support for specifying custom `entity` values during file operations, ensuring proper handling of multi-entity configurations. Changes include:
- Adding an `entity` parameter to the `fetch` method of `EcmFiles` and ensuring proper filtering based on the provided entity.
- Modifying `dol_move`, `deleteFilesIntoDatabaseIndex`, and other file-related functions to support the `entity` parameter.
- Ensuring entity propagation in operations like file indexing, renaming, and deletion.
This resolves issues where operations were limited to the default entity value (`$conf->entity`), improving flexibility and correctness in multi-entity setups.
* fix(ecm): improve code formatting for entity checks
Ensure consistent coding style for entity-related conditions across file operations by adding spacing around `empty()` calls.
This improves code readability and maintains uniformity in the handling of multi-entity configurations within the `EcmFiles` class and related modules.
* fix(ecm): cast entity to int in SQL queries
Ensure `entity` values are explicitly cast to integers in SQL conditions, improving type safety and preventing potential SQL injection vulnerabilities.
This change applies consistent casting in multiple entity-related checks within the `EcmFiles` class to enhance code security and reliability.
* Add HRM module support in `dol_check_secure_access_document()` function to manage file access rights.
* fix space
* Update files.lib.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
The functions assigns value to `$obj` on line 976, but doesn't assign value to `$object`, that is then assigned to `$objectoffield` in line 75 of `extrafields_list_print_fields.tpl.php`. Also `$objectoffield` is the recommended value to use for computed extrafields, according to the docs.
But assigning `$object` is not enough, because `$objectoffield` at this moment is not grabbed from the global scope, so the value stays local and `dol_eval()` doesn't find it. So it also needs to grab the variable from the global scope to affect it correctly.
The changed function, `projectLinesa()` is called only twice in the project: by itself recursively to go through all subtasks, and on the page where I detected the bug initially, `tasks.php`, so the impact should be minimal.