Commit graph

9 commits

Author SHA1 Message Date
VIAL-GOUTEYRON Quentin
e837854094
NEW: ModuleBuilder - consistent status labels and explicit trigger naming (#38883)
* NEW : Derive ModuleBuilder status labels from arrayofkeyval

LibStatut() in the ModuleBuilder object template hardcoded the
Draft/Enabled/Disabled labels, which diverged from the labels defined
in the 'status' field arrayofkeyval used by the list filter and the
select. Build labelStatus/labelStatusShort from arrayofkeyval so the
badge, the filter and the select all show the same configurable labels.

Add ModuleBuilderTemplateConventionsTest covering the derivation.

Next: normalize trigger codes to MYMODULE_MYOBJECT_ACTION in class line 637 + typo line 50, sql/data.sql lines 27/30-32, myobject_card.php line 378; extend the test with trigger assertions.

* NEW : Use explicit MODULE_OBJECT_ACTION trigger naming in template

The ModuleBuilder object template emitted the validate trigger as the
generic MYOBJECT_VALIDATE, inconsistent with the MYMODULE_MYOBJECT
prefix already advertised by $TRIGGER_PREFIX and used by the
unvalidate/cancel/reopen/sentbymail trigger codes. Normalize the
validate trigger, the seed data.sql agenda triggers and the close
notification example to the MYMODULE_MYOBJECT_<ACTION> policy so
generated modules expose clear, non-ambiguous trigger codes. Also fix a
typo in the $TRIGGER_PREFIX comment.

Extend ModuleBuilderTemplateConventionsTest with trigger naming checks.

Next: ChangeLog entry covering both features, then dolibarr-audit + functional verification, then push to remote quentin and run pr-review-v2.

* DOC : Add ChangeLog entries for ModuleBuilder status labels and triggers

Next: dolibarr-audit on both features, then functional verification, then push to remote quentin and run pr-review-v2.

* FIX : Guard ModuleBuilder LibStatut against undefined status key

Hardening from audit: when LibStatut() is called with a status value
that is not present in the 'status' field arrayofkeyval, reading
labelStatus/labelStatusShort raised an undefined-array-key warning under
PHP 8. Default both labels to an empty string, which dolGetStatus
already accepts, so the badge degrades gracefully to the status code.

Next: push branch to remote quentin and run dolibarr-pr-review-v2 on the full diff vs develop.

* CHORE Drop the files CONTRIBUTING forbids to edit in a PR [skip-claudemd]

ChangeLog is generated from the commit messages at release time, and the
language files other than en_US are synced from Transifex.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Co-authored-by: Alexandre SPANGARO <aspangaro.dolibarr@gmail.com>
2026-08-17 21:41:18 +02:00
Anthony Berton
311c194a5b
FIX - Template sql modulebuilder (#33703)
Co-authored-by: Anthony Berton <anthony.berton@bb2a.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-04-03 15:59:30 +02:00
MDW
b0087aaf61
Qual: Enable phan on modulebuilder (#30652)
* Allow null for buyer, and force '' for  in printObjectLine(s)

* Allow null for Contact in show_actions_done

* Qual: Enable phan on modulebuilder

# Qual: Enable phan on modulebuilder

Most files of the modulebuilder template can be checked as regular files.
It will help improve the template

* Update baseline (enable modulebuilder notices)

* Add properties that are expected to exist on modules_boxes

* Qual: Ignore false positive (phan)

* Set phpdoc type to include null on formAddObjectLine

* Qual: Fixes for modulebuilder (phan, phpstan, bugs, format)

* Fix phpcs for intracom

* Make ModeleBoxes:showBox() signature match child class's

* Fix *box::showBox() phpdoc types

* Update index.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-18 18:16:08 +02:00
Laurent Destailleur
4a734e53a6 Fix column too low.
Fix automatic event not found if from a module with several objects
2019-12-17 14:47:58 +01:00
Alexandre SPANGARO
02dbc11f98 Move Gnu.org to https 2019-09-23 21:55:30 +02:00
Laurent Destailleur
9458c80c48 Work on reminders 2017-10-31 23:10:29 +01:00
Laurent Destailleur
8db4e91888 Debug modulebuilder 2017-07-08 15:43:36 +02:00
Laurent Destailleur
c651f1da45 Work on modulebuilder tool 2017-05-27 19:05:36 +02:00
Laurent Destailleur
dd71fdc82f Work on modulebuilder template 2017-05-08 21:00:23 +02:00