* 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>