Files
dolibarr/htdocs/core/modules
VIAL-GOUTEYRON Quentin 5cf613a269 NEW : Major overhaul of DataPolicyCron and add Recruitment policy (#34704)
* refactor(datapolicy): redesign setup and logic for GDPR compliance

- Introduced a data-driven configuration structure for setup.php.
- Added support for a new "recruitment" GDPR datapolicy configuration.
- Streamlined code for managing anonymization and deletion delays.
- Enhanced dropdown generation logic to improve maintainability.
- Simplified data anonymization and deletion methods in cron execution.

This change provides more flexibility and modularity while ensuring compliance with GDPR standards.

* refactor(datapolicy): enhance data cleaning logic and add modular handlers

- Refactored `cleanDataForDataPolicy` method for better readability and efficiency.
- Implemented modular handlers for deletion and anonymization (_handleDelete and _handleAnonymize).
- Added dynamic argument building for method calls based on policy configurations.
- Improved SQL query preparation with placeholders for better database compatibility.
- Enhanced error handling and outcome recording in data processing.

This update simplifies extensibility and ensures robust handling of datapolicies.

* fix precommit

* fix

* fix(datapolicy): resolve uninitialized langs object and improve type hints

- Added a check to ensure `$langs` object is properly initialized, preventing runtime errors.
- Improved type hints in `datapolicycron.class.php` for stronger type checking and clarity.
- Replaced `empty` checks with `isset` for better null safety in setup.php dropdown logic.
- Adjusted SQL placeholders to cast values as strings for compatibility.

These changes enhance code robustness, type safety, and error handling.

* fix(datapolicy): improve type hints and streamline dropdown logic

- Added precise type hints (`string`, `array`) to enhance code clarity and type safety.
- Removed redundant condition in dropdown generation for improved maintainability.
- Added type specification for `$paramName` in `array_map` to strengthen type checking.
- Inserted missing class docblock for `CommonObject` in `datapolicycron.class.php`.

These updates lead to cleaner, safer, and more robust code.

* fix(datapolicy): improve type hints and streamline form submission logic

- Added return type hints (`: int`, `: void`, `: array`) in `datapolicycron.class.php` for better type safety and clarity.
- Simplified loop structures in `setup.php` by removing unnecessary variables.
- Revised `buttonsSaveCancel` method usage to eliminate redundant cancel parameter logic.
- Enhanced maintainability through refactoring `_processPolicyAction`, `_handleDelete`, and `_handleAnonymize` methods.

These refinements improve code readability, maintainability, and robustness.

* refactor(datapolicy): replace custom dropdown generation with `Form::selectarray`

- Removed the custom `$generateSelectHtml` function, simplifying code by using the existing `Form::selectarray` method.
- Updated dropdown generation for 'anonymize' and 'delete' actions to align with Dolibarr's standard practices.
- Enhances maintainability by leveraging built-in utilities and reducing custom logic.

* Update datapolicycron.class.php

* Try to fix CI

* Update datapolicycron.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-07-24 11:41:05 +02:00
..
2025-06-27 13:39:50 +02:00
2025-03-01 20:41:58 +01:00
2025-06-07 14:15:56 +02:00
2025-06-25 13:09:56 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-06-20 16:16:04 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-06-27 13:39:50 +02:00
2025-04-09 15:56:34 +02:00
2025-03-10 01:13:08 +01:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:15:56 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-01-14 10:35:44 +01:00
2025-06-30 15:14:09 +02:00
2025-06-27 13:39:50 +02:00
2025-06-07 14:15:56 +02:00
2025-06-07 14:15:56 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-06-07 14:31:53 +02:00
2025-06-04 19:16:26 +02:00
2025-06-04 19:16:26 +02:00
2025-06-27 13:39:50 +02:00
2025-06-23 00:08:14 +02:00
2025-03-25 19:04:52 +01:00
2024-11-13 21:21:15 +01:00
2025-01-07 18:54:08 +01:00
2025-05-10 00:54:25 +02:00
2025-06-22 22:50:56 +02:00
Doc
2025-06-19 15:58:23 +02:00
2025-05-05 17:09:24 +02:00
2025-03-25 20:22:02 +01:00
2025-01-11 09:14:43 +01:00
2025-04-16 19:55:44 +02:00
2024-12-01 15:47:01 +01:00
2025-04-26 12:06:45 +02:00
2025-03-25 22:27:52 +01:00
2025-03-25 21:32:28 +01:00
2024-11-13 21:21:15 +01:00