* WIP AI design
- Chat Interface
- French Translation
* AI Home Screen
Added a home page for the AI assistant, with pre-recorded prompts
* Fix missing user
* Add copyright
* Fix working tools and alignment
* 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>
* Add new language entries for AI tool management
* Update file reference in assistant.php documentation
* Implement isSystem method in conversation class
* Add Tool Access Control tab
* Initial commit AI general css
* Initial commit AI general js file
* Implement isSystem method in mcptool class
Add isSystem method to determine tool visibility.
* Enhance MCPServer to enforce tool allow-list
* Enhance McpHandler with tool context handling
Added support for tool context in McpHandler class.
* Remove empty line at the start of mcp.class.php
* Refactor tool schema handling for LLM integration
* Modify McpHandler initialization in execute_tool.php
Updated McpHandler initialization to include configuration and context for assistant.
* New AI tool access control
* Fix pre-commit
* fix pre-commit
* fix pre-commit
* fix pre-commit
* fix pre-commit
* fix phan php-stan
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.