Commit Graph

96 Commits

Author SHA1 Message Date
MDW
a161c5fb67 Qual: Fix phan notices, update baseline (#35528)
# Qual: Fix phan notices, update baseline

Fix some new phan notices and update baseline
2025-09-28 13:55:39 +02:00
ldestailleur
f2f5f23f8f Fix syntax error 2025-09-17 14:22:53 +02:00
ldestailleur
e0073b000d Debug v23 2025-09-17 14:03:09 +02:00
Frédéric FRANCE
8e0b1eb606 fix object reference (#34928)
* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* merge

* fix doc

* fix doc

* fix doc

* fix doc

* fix doc

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-08-17 16:32:09 +02:00
ldestailleur
4edb50855f Enhance datapoliciy module 2025-08-15 17:20:28 +02:00
ldestailleur
f4ae5136c8 Debug v23 2025-08-15 16:05:05 +02:00
ldestailleur
03165e5cae Remove duplicate definition table. 2025-07-24 14:42:45 +02:00
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
Laurent Destailleur (aka Eldy)
4954e84d56 Debug v21 2024-12-30 04:53:07 +01:00
MDW
178d748cad Qual: Fix phan/phpstan notices in class files (part 5) (#31617)
* Qual: fix commonstickergen..don.class

* Fix notifications for pdf_paiement...cronjob.class

* Qual: Fix notifications for emailcollector..price_parser.class

* Ensure that NULL is used in the database when fk's are 0/empty

* Fix notifications for pdf_paiement...cronjob.class

* Cope with updated phpstan, and make fk_origin_stock int in multiple locations
2024-11-06 20:15:15 +01:00
MDW
1834c37c16 Qual: Fix phan notices (#31212)
* Qual: Fix phan notices

# Qual: Fix phan notices

Fix several phan notices related to classes with UnknownObject
classes.

* Qual: Fix phan notices

* Qual: Fix phan notices

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-10-03 19:40:34 +02:00
Laurent Destailleur
c33324210a Clean php code from NOW() in sql 2024-09-05 13:04:13 +02:00
Eric Seigne
0e269102ae use MailSentByTo 2024-03-28 09:38:09 +01:00
MDW
988cd8a61e Fix/ignore PhanPluginPrintfVariableFormatString 2024-03-17 18:56:39 +01:00
Laurent Destailleur
e6b2756c19 QUAL The signature for all ->delete() method has been modified to match
the modulebuilder template (so first param is now always $user), except
  the delete for thirdparty (still accept the id of thirdparty to delete
as first parameter). Will probably be modified into another version.
2024-03-07 17:58:02 +01:00
Frédéric FRANCE
6f58a45220 fix phpstan (#28605)
* fix phpstan

* fix phpstan

* fix too few parameters

* fix typo

* ActionComm::$ref is not covariant with PHPDoc type string

* fix default values
2024-03-03 18:55:30 +01:00
Frédéric FRANCE
fba15178eb all initAsSpecimen return int (#28577)
* all initAsSpecimen return int

* all initAsSpecimen return int

* all initAsSpecimen return int
2024-03-02 16:38:35 +01:00
William Mead
4a3b7d581a Qual phpstan DataPolicyCron class (#28163)
* Fixed default anonym values

* Added contributor details

* Cleaned PHPDoc
2024-02-13 21:35:18 +01:00
Laurent Destailleur
97006d6945 Clean code: Remove code not working (was using hard coded values) 2024-02-02 21:41:40 +01:00
thibdrev
6459ef53f0 qual: phpstan for htdocs/datapolicy/class/actions_datapolicy.class.php
htdocs/datapolicy/class/actions_datapolicy.class.php	118	Property CommonObject::$state_id (int) does not accept string.
htdocs/datapolicy/class/actions_datapolicy.class.php	120	Property CommonObject::$country_id (int) does not accept string.
2024-01-26 09:07:04 +01:00
MDW
bd002480ce Qual: Spelling htdocs/[d-k]* (#27427)
Highlights:

- htdocs/install/doctemplates/websites/website_template-restaurant/containers/page249.tpl.php

  Potential functional change (fix) because toekn was changed to token:
   `<input type=hidden name=toekn`

- htdocs/install/upgrade2.php
  $filles changed to $children

- htdocs/intracommreport/class/intracommreport.class.php
  Local $enveloppe changed to $envelope.

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-01-13 19:48:41 +01:00
Laurent Destailleur
8d6bb378bd Fix a header must be followed by exit 2024-01-10 14:59:31 +01:00
Laurent Destailleur
ccaae7ab24 Clean code 2024-01-05 03:41:22 +01:00
Frédéric FRANCE
61b79fda17 avoid phpstan error with phpdoc 2023-12-06 15:46:39 +01:00
Laurent Destailleur
a7125280bc Fix with php-cs-fixer 2023-12-04 12:12:12 +01:00
Laurent Destailleur
7785ae93a1 Fix php8.2 warnings 2023-11-27 11:41:05 +01:00
Frédéric FRANCE
b8a4181748 delete unused code (fix phpstan also) (#26780) 2023-11-21 23:40:43 +01:00
Lucas Marcouiller
68d996b482 fix some phpstan errors (#26608)
Co-authored-by: Hystepik <lucas.marcouiller@gmail.com>
2023-11-16 15:01:46 +01:00
Laurent Destailleur
bfc8a76567 Clean code 2023-10-10 23:52:46 +02:00
Laurent Destailleur
4f94f898a3 Fix warnings 2023-08-10 11:42:59 +02:00
Laurent Destailleur
b43ca2a0ad Clean code 2023-08-06 13:39:32 +02:00
Laurent Destailleur
0baf8d4117 Fix warnings 2023-08-05 22:57:12 +02:00
Laurent Destailleur
7ce9bf6b23 Clean code 2023-08-05 15:44:28 +02:00
Laurent Destailleur
67a7a71641 Fix warning 2023-06-26 16:38:39 +02:00
Laurent Destailleur
8d7e53a98c Clean code 2023-06-03 13:56:06 +02:00
Laurent Destailleur
fc6e854028 Fix warning 2023-03-21 19:14:43 +01:00
Frédéric FRANCE
a20c511ee9 doc 2023-02-22 20:58:55 +01:00
Laurent Destailleur
2a0a0fc470 Clean old deprecated code on social networks fields 2023-01-30 14:13:02 +01:00
Laurent Destailleur
06d94c9a97 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop 2022-10-19 17:11:32 +02:00
Laurent Destailleur
7c615fafb9 Update datapolicycron.class.php 2022-10-17 23:14:33 +02:00
ptibogxiv
df51c0ea51 Fix php 8 error 2022-10-15 13:07:07 +02:00
Laurent Destailleur
90d58bde27 Clean module datapolicy 2022-09-08 16:19:59 +02:00
Laurent Destailleur
28797930fc Clean code 2022-08-29 18:21:35 +02:00
Laurent Destailleur
2e42f45c99 FIX php8 2022-07-16 12:02:17 +02:00
Laurent Destailleur
441af6b6fb Fix add rel="noopener noreferrer" 2021-11-22 02:35:55 +01:00
Laurent Destailleur
ddad00c8e4 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/takepos/index.php
2021-11-11 16:14:48 +01:00
Laurent Destailleur
f24c38db73 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/datapolicy/class/datapolicy.class.php
	htdocs/takepos/index.php
2021-11-11 16:06:21 +01:00
Laurent Destailleur
e188855dca Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
Conflicts:
	htdocs/datapolicy/class/datapolicy.class.php
2021-11-11 16:01:37 +01:00
Laurent Destailleur
9aa5c94612 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2021-11-11 15:59:48 +01:00
Laurent Destailleur
ba724204a4 FIX Bad use of dol_concatdesc() 2021-11-11 15:50:32 +01:00