* FIX phpstan: Societe::$client (int<0,3>) does not accept -1 (#39244)
Societe::$client is annotated @var int<0,3> (domain 0=no customer,
1=customer, 2=prospect, 3=both) in societe.class.php, but the create
form in societe/card.php pre-set it to -1 as a transient "nothing
pre-selected" placeholder, tripping PHPStan level 10 on develop.
The value is never persisted (save paths compute 0..3) and the only
reader, the switch() building the form, treats -1 and 0 identically via
its default case. Use 0 (the property's own default) so the assignment
matches the declared type. No behavior change.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* FIX Whole session loses its menus after a login done from inside a dialog popup
The URLs opened by dolButtonToOpenUrlInDialogPopup() carry
dol_hide_topmenu=1 and dol_hide_leftmenu=1. If the session expires and
the user logs in again from inside the popup iframe, these flags were
stored into $_SESSION at login and applied to every following page: the
user 'loses' the top and left menus for the whole session, until logout.
Do not persist the two hide-menu flags when the login is done in a
dol_openinpopup context.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Jam Balaya <jambalaya.pyoncafe@outlook.jp>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* UI|UX: Ajax interface for AI
Start UI
* Shortcut correction
* link to assistant full page
* Fix PHPStan "Variable $user might not be defined" in execute_tool.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Per maintainer feedback on #38307: "adding a popup (without leaving
current page) is better than opening a complete page".
The AI Assistant top-toolbar icon (added in develop by e735bed1 via
top_menu_ai() in main.inc.php) is a plain <a href> that navigates
the user away from whatever page they were on. This patch makes the
icon open the Assistant in a popup overlay instead, so the user
keeps their working context while interacting with the assistant.
Approach:
Reuses the existing Dolibarr core helper dolButtonToOpenUrlInDialogPopup()
(htdocs/core/lib/functions.lib.php) which:
- Builds an <a> with accesskey, title, and an icon
- On click, injects an <iframe src="$url" width="100%" height="98%">
into a hidden <div id="idfordialog$name">
- Opens the div as a jQuery UI dialog: modal:true, width:'80%',
height: window.innerHeight - 150
- Auto-appends "dol_hide_topmenu=1&dol_hide_leftmenu=1&dol_openinpopup=$name"
to the URL so the embedded page renders without the surrounding
top/left chrome (Dolibarr core handles these URL params in
main.inc.php; no change needed to /ai/assistant/index.php)
- Falls back gracefully to target="_blank" when JavaScript is off
Zero changes are needed to /ai/assistant/index.php itself: the
dol_openinpopup / dol_hide_topmenu / dol_hide_leftmenu URL params
are already handled generically by main.inc.php (the same way
modulebuilder, ECM and other popup-friendly screens are loaded).
Visible behaviour:
- Click on the AI top-toolbar icon -> Assistant opens centered as
a modal dialog over the current page; the chat UI loads inside
the iframe; closing the dialog returns the user to their original
page with no navigation.
- Accesskey 'a' (unchanged from e735bed1) still focuses/triggers the
icon.
- Tooltip switches from "AI (Ctrl+Alt+a)" to the localized
"AI Assistant" string (the helper uses $label for both the title
attribute and the dialog title -- one string for both is the
helper's design).
Other top_menu_* icons (bookmark, quickadd, search, import) are
unchanged.
Tested:
- Click icon -> popup opens, Assistant chat works inside iframe.
- Close dialog -> back on the original page with no navigation.
- JavaScript disabled -> link degrades to opening in a new tab
(target="_blank"), Assistant page renders normally with its full
chrome.
- Accesskey Ctrl+Alt+a still triggers the icon.
* Update stocktransfer_card.php
* migration: limiter les triggers stocktransfer au script 23->24
* agenda: ajouter les libellés InDolibarr pour stocktransfer
* stocktransfer pdf: éviter method_exists sur ligne nulle
* migration 23-24: ajouter le point-virgule manquant avant triggers
* notification: ajouter le support stocktransfer et event MODIFY
* langs: ajouter traductions Notify_STOCKTRANSFER_*
* langs: ajouter la clé Stocktransfer dans stocks.lang
* feat(stocktransfer): add quick add entry for stock transfers
* fix(quickadd): add stock transfer entry directly in main menu list
* projet: ajouter stocktransfer avant stock_mouvement
* projet: retirer le filtre global sur stocktransfer
* projet: renommer le titre stocktransfer et ajouter traductions
* projet: masquer montant sur la section stocktransfer
* projet: aligner la marge de stocktransfer sur commentaire
* projet: afficher NA pour les montants des stocktransfer
* projet: ajouter tooltip NA pour stocktransfer
* projet: ajouter message dédié NoAmountforStockTransfer
* projet: ajouter colonnes logistiques aux transferts de stock
* projet: retirer colonne date des transferts et aligner totaux
* projet: ajouter stocktransfer au badge de la vue d'ensemble
* projet: uniformiser les largeurs de colonnes stocktransfer
* stocktransfer: use email template type for presend form
* admin: add stock transfer email template type in setup list
* admin: show stock transfer mail template type when module enabled
* admin: move stock transfer mail type below products with box icon
* stocktransfer: align admin icon markup and presend attachment path
* langs: use stocktransfer-prefixed agenda trigger labels
* Update agenda.lang
* Update admin.lang
* Update other.lang
* Update stocks.lang
* Update admin.lang
* Update other.lang
* Update stocks.lang
* Update admin.lang
* Update agenda.lang
* Update stocks.lang
* Update admin.lang
* Update agenda.lang
* Update agenda.lang
* Update other.lang
* Update stocks.lang
* Update other.lang
* Update stocks.lang
* Update notify.class.php
* Remove destocking and stock increment triggers
Removed stock transfer action triggers for destocking and stock increment cancellation.
* Update 23.0.0-24.0.0.sql
* Update agenda.lang
* Update other.lang
* Update stocktransfer_card.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>