* Fix#34774 accept YYYYMMDDHHMMSS datep param sent by /societe/agenda.php
htdocs/societe/agenda.php:195 builds the AddAction button URL with
&datep=...dol_print_date(dol_now(), 'dayhourlog')... which expands to
14 digits (YYYYMMDDHHMMSS). htdocs/comm/action/card.php:104 only accepts
the 8-digit YYYYMMDD variant, so the regex misses, $datep stays null
and the date/time pre-fill on the form fails.
Add a leading regex branch that decodes the dayhourlog form and falls
through to the existing 8-digit handler for legacy callers.
Signed-off-by: Dolicraft <contact@dolicraft.com>
* Fix#34774 follow-up: producer-side emit &datep=now per eldy review
PR #38792 was the consumer-side fix (accept 14-digit datep in comm/action/card.php).
Eldy pointed out the cleaner fix is producer-side: send the documented
&datep=now form that the consumer comment at line 104 already recommends
('Try to not use this. Use instead datep=now'). Apply that on the
AddAction URL in /societe/agenda.php.
Kept the consumer-side 14-digit fallback from the previous commit so any
other caller still emitting the old YmdHis form keeps working until they
are migrated too.
Signed-off-by: Dolicraft <contact@dolicraft.com>
* Fix#34774 CI: cast $search_filtert to string for urlencode (phpstan)
Signed-off-by: Dolicraft <contact@dolicraft.com>
---------
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
htdocs/compta/facture/card.php:1235 calls setOptionalsFromPost() to fill
$object->array_options from the create form, but Facture::create() then
unconditionally overwrites the array with the recurring template values
at line 615. The user-entered extrafields are silently lost.
Only adopt the template's array_options when the caller did not provide
any, so cron-driven recurring invoices keep template values and manual
'generate now' submissions keep what the operator typed in the form.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
Webklex/PHPIMAP getFolders() in pattern mode treats the second argument
as a sourcedir* glob, so INBOX returns INBOX plus every INBOX.* subfolder.
The collector then took $f[0], which is whichever folder the IMAP server
returned first - often an empty 'INBOX.Traites' archive - so the polling
silently scanned the wrong mailbox and reported no new mail while messages
piled up in INBOX.
Walk the returned list once and prefer the folder whose full_name matches
$tmpsourcedir exactly. Fallback to $f[0] preserves the previous behavior
when no exact match exists (e.g. server-side capitalization quirks).
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
SUBTOTALS_SPECIAL_CODE is only defined by the subtotals module
(htdocs/subtotals/class/commonsubtotal.class.php:24). When a PO line
is printed into a vendor invoice create screen and the subtotals module
is not loaded for the current request, htdocs/core/class/commonobject.class.php
line 5872 fatals with 'Undefined constant SUBTOTALS_SPECIAL_CODE',
hiding every origin line.
Wrap the comparison with defined() to match the existing pattern used in
objectline_view.tpl.php:81, objectline_edit.tpl.php:71 and
originproductline.tpl.php:50.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
htdocs/core/class/html.formcompany.class.php:339,341,347 picks
$langs->trans($obj->code) for the province dropdown, where $obj->code
is the c_departements code. For Italy that includes IM = Imperia. The
en_US main.lang key 'IM=Instant messaging' was used as fallback and
shadowed the province label.
Rename the lang key to InstantMessaging. No PHP caller references the
old key (grep finds only the .lang files themselves), so this rename
breaks no flow today. Non-en_US locales will resync through Transifex.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
The API discovery loop in htdocs/api/index.php (around line 308) accepts
both Foo and FooApi class names when scanning module directories. The
dispatch loop on the request-handling side (line 422) only checked
class_exists($classname), so a module exposing class MyModuleApi from
api_mymodule.class.php would appear in the API Explorer yet 501 with
'API not found' when the endpoint was actually called.
Probe class_exists($classname.'Api') first to mirror the discovery
behavior. Falls back to the plain class name so existing modules keep
working.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
# Qual: Avoid variable scope clash (param $conf vs. global $conf)
- Renamed parameter `$conf` to `$conf_obj` to avoid targeted name clash with global statement in if clause.