Commit graph

2959 commits

Author SHA1 Message Date
Frédéric FRANCE
1cafc092df
pdf logo header mutualization (#39503)
* FIX: Restore PHPUnit 11 compatibility in CommonClassTest

onNotSuccessfulTest() overrode PHPUnit\Framework\TestCase's method with
an incompatible return type (void vs never), and the assertMatchesRegularExpression
back-compat shim for PHPUnit <8 now illegally overrides that method, which
PHPUnit 11 declares final. Both faults made every test extending
CommonClassTest fatal immediately on this environment's PHPUnit 11.5.55.
Pre-existing breakage, unrelated to the PDF mutualization work in this
branch — fixed here because Task 1's plan requires a passing
BuildDocTest.php baseline before any implementer is dispatched.

* NEW: Mutualize PDF header logo block into pdf_writeLogoOrCompanyName() (sponge, einstein, azur, muscadet)

* NEW: Mutualize PDF header logo block into pdf_writeLogoOrCompanyName() (cornas, standard, cyan, octopus, strato)

* FIX: Resolve $logodir before calling pdf_writeLogoOrCompanyName() in cornas, standard, cyan, octopus, strato

* NEW: Mutualize PDF header logo block into pdf_writeLogoOrCompanyName() (eratosthene, eagle_proforma, standard_asset)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* NEW: Mutualize PDF header logo block into pdf_writeLogoOrCompanyName() (aurore, zenith)

* FIX: Complete PHPUnit 11 compatibility fix in CommonClassTest::onNotSuccessfulTest

The prior compatibility fix (f29129aae43) resolved the two class-load
fatals but left onNotSuccessfulTest() calling getName()/getDataSetAsString(),
neither of which exists on PHPUnit 11's TestCase (renamed to name() and
dataSetAsStringWithData()/dataSetAsString()). The undefined-method error
was silently absorbed by PHPUnit's own exception handling, so every test
failure across the suite still ran and reported correctly, but the
method's entire diagnostic block (log tail, backtrace, DB info dump) never
executed. Verified with a throwaway reproduction test before and after:
the diagnostic ##[group] output was empty before this fix and complete
after it.

Found during the final whole-branch review of the PDF logo-block
mutualization branch; unrelated to that refactor but touches the same
file already modified by the earlier compatibility commit.

* FIX: Drop unneeded by-ref $pdf and rename $ltrdirection to $align in pdf_writeLogoOrCompanyName()

TCPDF objects are handles, so passing $pdf by reference bought nothing
and was inconsistent with every sibling function in this file
(pdf_pagehead, pdf_watermark, pdf_bank, pdf_pagefoot, ...), all of which
take $pdf by value. $ltrdirection was also a misnomer: three of the 14
callers pass the literal 'L' and one passes 'J' (justify) - none of those
is a text direction, it's an alignment. Renaming is call-site-transparent
(all 14 callers use positional arguments).

Found during the final whole-branch review of the PDF logo-block
mutualization branch.

* NEW: Document pdf_writeLogoOrCompanyName() helper in ChangeLog

Per repo convention (CLAUDE.md: "Always update ChangeLog for
significant changes"). Flagged during the final whole-branch review
of the PDF logo-block mutualization branch: a new reusable pdf_lib.php
function is part of the surface third-party PDF document-model modules
build against.

* restore commonclasstest

* fix

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-08-19 02:37:18 +02:00
Frédéric FRANCE
81e92fc497
NEW: Finish unifying extrafields admin pages into a single secured page 2026-08-12 04:59:24 +02:00
minimexat
c95e337c40
FIX: Require delete permission for email templates API (#39134)
Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 14:59:15 +02:00
minimexat
bd9e8a55e8
FIX: Delete establishment by object rowid (#39135)
Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 14:29:42 +02:00
minimexat
95701131bc
FIX: use generic online signature token fallback (#39138)
* FIX: Use generic online signature token fallback

* FIX: Avoid nullable source in signature token lookup

* FIX: Initialize online signature message

* FIX: Print online signature error directly

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
2026-07-13 11:45:45 +02:00
Nathan
95bcefbb9e
FIX: #39068 Ignore warning text in product search (#39071) 2026-07-10 17:46:28 +02:00
Francis Appels
0a3ba8e740
Revert "NEW: Show bom net needs treeview by line position. (#37459)" (#39083)
* Revert "NEW: Show bom net needs treeview by line position. (#37459)"

This reverts commit b02f1a4ebf.

* Update changelog and fix stan

* fix stan
2026-07-10 17:44:53 +02:00
Laurent Destailleur
f2172fb33b Doc 2026-06-28 05:21:20 +02:00
Laurent Destailleur
ee9377f4f2 SEC #39000 Escalation to admin when user has clone permission - credit
Abderrahmane Aksoum on the fix commit
2026-06-28 05:20:48 +02:00
Laurent Destailleur
0ef1eb7269 Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 2026-06-28 05:18:20 +02:00
Laurent Destailleur
b96613ce8a Doc 2026-06-27 17:01:18 +02:00
Laurent Destailleur
3b246cb35d Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2026-06-22 02:51:55 +02:00
VIAL-GOUTEYRON Quentin
de80dc40ac
FIX : ModuleBuilder apply showoncombobox to fields other than ref/code (#38904)
The addproperty action built the field definition array without capturing
propshowoncombobox, so the 'Show on combobox' option chosen in the property
form was silently dropped for every field; only ref and code got it (they
are hardcoded in the build-from-table path). Capture it like the other
field flags so rebuildObjectClass serializes it into the generated class.

Fixes #35076.

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-06-21 23:30:54 +02:00
VIAL-GOUTEYRON Quentin
d67ac89a65
FIX : ModuleBuilder list page derives email trackid from object name (#38906)
The generated list page set $trackid = 'xxxx'.$object->id, where 'xxxx'
is not a NamingContract substitution token. It leaked verbatim into every
generated module and made the mass-emailing trackid collide across modules.

Align it with the card page (myobject_card.php) and core list pages
(comm/propal/list.php => 'pro', societe/list.php => 'thi') by using the
substitutable 'myobject' token, so the trackid derives from the object name.

Addresses #32460 (item 14, email/trackid handling).

Next: push to remote quentin, open upstream PR on Dolibarr/dolibarr:develop
Next: linking #32460 item 14

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-06-21 23:27:34 +02:00
Laurent Destailleur
580a5adde8 Clean code - removed old deprecated module Deplacement 2026-06-20 16:03:50 +02:00
Laurent Destailleur
25e49fb6ee CI 2026-06-12 14:22:57 +02:00
Laurent Destailleur
ed5c0bc2b0 Doc 2026-06-10 12:11:13 +02:00
Laurent Destailleur
7f70d9b003 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-06-09 19:04:40 +02:00
Laurent Destailleur
9fbab9840b Doc 2026-06-09 19:04:25 +02:00
VIAL-GOUTEYRON Quentin
3216098ab5
NEW: ModuleBuilder - selectable object tabs (+ fixes for multi-object generation) (#38570)
* NEW : add ModuleBuilder object-tabs map and filter helpers

Add getModuleBuilderObjectTabs() (source-of-truth map of optional object
tabs) and filterEnabledTabs() (sanitizes user-requested tab keys against the
map). Covered by ModuleBuilderLibTest.

Next: add BEGIN/END markers around tab flags and blocks in template lib (Task 2)

* NEW : wrap object tab flags and blocks with MODULEBUILDER markers

Surround each optional tab flag declaration (TABFLAG) and each prepareHead tab
block (TAB) with BEGIN/END MODULEBUILDER comment markers, so the generator can
purge a whole tab atomically while keeping $h and $head intact. Card tab is
not wrapped (always generated).

Next: add tab selection checkboxes to the newobject form in modulebuilder/index.php (Task 3)

* NEW : add object tab selection checkboxes to newobject form

Render one checkbox per optional tab (contact, note, document, agenda) in the
ModuleBuilder newobject form, all checked by default and reflecting posted
state on redisplay.

Next: handle enabledtab in initobject — exclude files, purge blocks, hardcode flags (Task 4)

* NEW : apply object tab selection during object generation

Excludes page files of unselected tabs, purges their prepareHead flag and
block via MODULEBUILDER markers, and hardcodes the show flag to 1 for selected
tabs. Emits a best-effort warning when regenerating an existing object.

Next: add language keys EnabledTabsForObject(Help) + WarningTabSelectionOnRegeneration (Task 5)

* NEW : add language keys for object tab selection

Next: add ChangeLog entry (Task 6)

* DOC : changelog entry for ModuleBuilder selectable object tabs

* FIX : purge agenda card widget when agenda tab is excluded

Audit finding: myobject_card.php hardcodes a 'SeeAll' link to myobject_agenda.php
in an event widget. When the agenda tab is excluded the page is not generated,
leaving a latent dead link if the widget is enabled. Wrap the widget with
MODULEBUILDER TAB AGENDA markers and purge it from the generated card when the
agenda tab is not selected.

Next: functional verification (step 5 of dev workflow)

* FIX : check file operation results when applying object tab selection

PR review: align with the nogeneratelines pattern by checking the return of
removePatternFromFile/dolReplaceInFile and raising $error + dol_syslog with the
failing tab/file context, instead of ignoring silent write failures during
object generation. Add PR reference to the changelog entry.

* FIX : do not abort object generation when nogeneratelines targets a missing file

The nogeneratelines handler purges the MODULEBUILDER LINES block from class,
API and card files. When API generation is disabled the api_<module>.class.php
file does not exist, so removePatternFromFile returns false and $error was
incremented, which skipped the whole success path (name substitution,
rebuildObjectClass, $tabobj assignment). Generated classes kept the literal
'class MyObject', so dolGetListOfObjectClasses listed every object as MyObject.
Guard each purge with file_exists so a missing optional file is skipped.

* FIX : keep module descriptor out of the blanket name substitution

The 'substitute all module php files' pass applied the object/module name map
to every .php file including the module descriptor. That rewrote the persistent
/* ... MODULEBUILDER TOPMENU/LEFTMENU MYOBJECT */ marker placeholders to the
first object name, so generating a second object could no longer find them
(checkExistComment returned -1, 'comments not found for section Menus' warning)
and its menu entries were not inserted. Skip the descriptor in that loop: its
module name is already resolved by initmodule and its object entries are added
by the dedicated menu/permission blocks.

* FIX : preserve MODULEBUILDER markers when substituting the module descriptor

The previous commit only skipped the descriptor in the secondary substitution
pass, but the primary pass (over $filetogenerate, which includes the descriptor)
still rewrote its persistent /* ... MODULEBUILDER TOPMENU/LEFTMENU MYOBJECT */
markers to the first object name. Those markers cannot simply be excluded from
substitution because the descriptor also has functional MYOBJECT/MYMODULE tokens
(e.g. the MYMODULE_MYOBJECT_ADDON numbering constant) that must be resolved.

Add dolReplaceInFilePreservingModuleBuilderMarkers(): it hides every MODULEBUILDER
marker behind a sentinel, applies the substitution, then restores the markers
verbatim. Use it for the descriptor in the primary pass; the descriptor stays
excluded from the secondary pass. Generating a second object now finds the
markers (checkExistComment) and inserts its menu entries without warning.

Verified by CLI: markers preserved across two successive objects, while content
(rights, exports, addon constant) is correctly substituted.

* FIX : silence phan on the new ModuleBuilder test and typed closure

CI phan (diff-only) flagged the freshly added test file: PhanUndeclaredExtendedClass
(\CommonClassTest) and PhanUndeclaredMethod (assertSame), like the sibling
NamingContractTest. Add the same @phan-file-suppress block (plus
PhanTypeMismatchArgumentProbablyReal for the non-array guard test case). Also
type the preg_replace_callback parameter (array $matches) to clear
PhanPluginUnknownClosureParamType. phpstan is already green; no phpstan
annotations added.

* FIX : drop closure in marker-preserving substitution to satisfy phan

phan's PhanPluginUnknownArrayClosureParamType wanted key/value types on the
preg_replace_callback closure parameter. Replace the callback with preg_match_all
plus a str_replace loop over the unique markers: same behaviour, no closure,
no plugin warning.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-06-09 19:04:00 +02:00
Laurent Destailleur
02da77bb67 CI 2026-06-09 11:53:26 +02:00
Laurent Destailleur
c7b0f1e10e Automated merge from 23.0 to develop 2026-06-09 00:27:55 +02:00
Laurent Destailleur
b0f2411d84 Test 2026-06-08 22:27:02 +02:00
Laurent Destailleur
c1ad1e4e32 Test 2026-06-08 22:27:01 +02:00
Laurent Destailleur
247a076ebd Doc 2026-06-08 18:18:02 +02:00
Alexandre SPANGARO
c37a729b7d
Update ChangeLog 2026-06-04 05:48:11 +02:00
Laurent Destailleur
070b0ac850 Doc 2026-06-01 22:22:36 +02:00
Laurent Destailleur
a0bac65c51 Doc 2026-05-30 01:48:23 +02:00
Laurent Destailleur
58e52ee86f Doc 2026-05-26 14:35:00 +02:00
Laurent Destailleur
b045de9e9b Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into develop 2026-05-25 01:09:03 +02:00
Laurent Destailleur
f32a4884e8 Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 2026-05-25 01:07:38 +02:00
Laurent Destailleur
e67c919850 Prepare 22.0.5 2026-05-24 21:30:14 +02:00
Laurent Destailleur
be296e12c9 Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into develop 2026-05-22 11:30:41 +02:00
Alexandre SPANGARO
92b10c71eb
ChangeLog (#38315) 2026-05-21 21:52:11 +02:00
Laurent Destailleur
eae494af73 Automated merge from 23.0 to develop 2026-05-20 17:53:51 +02:00
Laurent Destailleur
38409ec7c0 Automated merge from 22.0 to 23.0 by tool pullmerge.sh 2026-05-20 17:27:41 +02:00
Laurent Destailleur
48cca7954c Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into 22.0 2026-05-20 17:09:31 +02:00
Laurent Destailleur
3bcbb55e7b Automated merge from 20.0 to 21.0 by tool pullmerge.sh 2026-05-20 17:03:28 +02:00
Laurent Destailleur
3fde18d7f7 Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-05-20 17:00:35 +02:00
Laurent Destailleur
0168bdfeb1 Automated merge from 18.0 to 19.0 by tool pullmerge.sh 2026-05-20 16:59:16 +02:00
MDW
4b191b12b4
Qual: Upgrade tool versions in pre-commit setup (#38233)
* Qual: Upgrade tool versions in pre-commit

* Qual: avoid codespell notice

* Qual: Fix spelling

* Qual: Fix spelling

* Qual: Add spelling exceptions

* Qual: whitespace/line-ending
2026-05-18 03:05:44 +02:00
Laurent Destailleur
8ecf2f9700 Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into develop 2026-05-17 15:38:08 +02:00
Laurent Destailleur
f5776c68e1 Prepare 23.0.3 2026-05-17 15:34:44 +02:00
Laurent Destailleur
0481c412c0 Doc 2026-05-11 01:53:13 +02:00
Laurent Destailleur
c48bf45f7e NEW Add MAIN_FORCE_SYSTEM_MESSAGE
Renamed hook "info_admin" into "messageOfTheDay"
2026-05-07 09:59:49 +02:00
Eric Seigne
be15e9f401 Prepare 18.0.10 2026-05-07 09:17:38 +02:00
Laurent Destailleur
1172677b01 Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into develop 2026-04-30 14:57:57 +02:00
Laurent Destailleur
2126f2315e SEC: Advisory for bbbbb56c64 - Better
sanitization param for GETPOST of htmlheader of website page
2026-04-30 14:42:21 +02:00
Laurent Destailleur
a0688ba8fc Doc 2026-04-24 18:54:18 +02:00
Laurent Destailleur
1a1031e209 Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into develop 2026-04-23 13:54:04 +02:00