Commit graph

11 commits

Author SHA1 Message Date
Laurent Destailleur
a17bfdf395 Debug v24 2026-07-24 06:54:27 +02:00
Laurent Destailleur
8b73060f75 Debug v24 2026-06-19 14:57:16 +02:00
Anthony Damhet
4868f65bd8
UI|UX: AI design (#38789)
* 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
2026-06-14 01:05:01 +02:00
Anthony Damhet
79f2df4dd6
UI|UX : AI Assistant Popover (#38756)
* 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>
2026-06-13 04:16:48 +02:00
sonikf
0a35b04674
New AI tool access control (#38668)
* 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
2026-06-10 11:41:10 +02:00
Laurent Destailleur
574128a385 CSS 2026-05-18 22:44:00 +02:00
Pichinov-Jose
74fc27b68b
New: open AI Assistant in a popup overlay from top-toolbar icon (#38311)
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.
2026-05-18 22:04:43 +02:00
sonikf
faa8005eb4
NEW: MCP server and AI Assistant (#37888)
* fix list query

* Update other.lang

* remove duplicate

* initial commit

* AI Assistant initial commit

* Rename htdocs/ai/index.php to htdocs/ai/assistant/index.php

* AI Assistant initial commit

* Initial commit

* Rename htdocs/ai/ai_assistant.css to htdocs/ai/css/ai_assistant.css

* Initial commit

* Rename htdocs/ai/ai_assistant.js to htdocs/ai/js/ai_assistant.js

* Initial commit

* Rename htdocs/ai/mcp_server.php to htdocs/ai/server/mcp_server.php

* Initial commit

* category tools

* Rename htdocs/ai/categories.php to htdocs/ai/tools/categories.php

* Global tools to restrict AI

* Tools for crud actions on Dolibarr objects

* Tools for products and services.

* Tools to generate reports

* Missing PHPDoc

* Tools for thirdparties and contacts

* Tool for generating navigation URLs in Dolibarr

* Tools related to invoices and payments

* Update ai_assistant.js

* Initial commit

* Rename htdocs/ai/purge_logs.php to htdocs/ai/scripts/purge_logs.php

* fix pre commit

* re fix pre-commit

* fix pre-commit

* Rename categories.php to categories.class.php

* Rename conversation.php to conversation.class.php

* Rename crud_objects.php to crud_objects.class.php

* Rename invoices.php to invoices.class.php

* Rename navigation.php to navigation.class.php

* Rename products.php to products.class.php

* Rename reports.php to reports.class.php

* Rename thirdparty.php to thirdparty.class.php

* fix pre-commit

* Update parse_intent.php

* fix pre commit

* fix phpdoc

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* fix pre-commit

* add missing phpdoc

* fix pre-commit

* fix phpdoc

* fix phpdoc

* fix pre-commit

* fix pre-commit

* fix phpdoc

* fix pre-commit

* fix pre-commit

* fix phpdoc

* fix phpdoc

* fix phpdoc

* fix phpdoc

* fix php-stan

* fix php-stan

* fix phan

* fix phan

* fix phan

* security check

* security check

* security check

* security check

* enhance security check

* enhance security check

* fix pre-commit

* Update log_viewer.php

* Improve access control logic in log_viewer.php

Refactor access control checks for admin and module activation.

* fix phan

* fix phan

* fix phan

* fix phan

* fix phan

* try fix phan

* fix pre-commit

* fix phan

* try fix phan

* fix phan

* fix php-stan

* fix phan php-stan

* fix pre-commit

* fix phan php-stan

* fix pre-commit

* fix phan php-stan

* fix phan php-stan

* fix phn php-stan

* fix phan php-stan

* fix phan php-stan

* fix phan php-stan

* fix phan php-stan

* fix pre-commit

* fix phan php-stan

* fix php-stan

* Fix MCP tool registration for .class.php file naming

* fix typo

* fix ci

* fix pre-commit

* fix ci

* fix pre-commit

* Update categories.class.php

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* fix ci

* add missing user in constructor

* add missing user in constructor

* improve invoice validation error handling

* add missing user in constructor

* Rename mcp_protocol.php to mcp_protocol.class.php

* Update mcp_server.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-05-11 01:59:55 +02:00
Laurent Destailleur
50b4e6f81a NEW Add a link "Fill with layout" 2024-02-18 21:15:26 +01:00
Lamrani Abdel
586230adbe add image for boxes 2024-01-29 17:31:23 +01:00
Lamrani Abdel
3cc15d4163 New display for template email in boxes 2024-01-29 15:38:13 +01:00