dolibarr 24.0.0-beta
popover.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2026 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2026 Anthony Damhet <a.damhet@progiseize.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
30if (!defined('NOTOKENRENEWAL')) {
31 define('NOTOKENRENEWAL', 1);
32}
33if (!defined('NOREQUIREMENU')) {
34 define('NOREQUIREMENU', 1);
35}
36if (!defined('NOREQUIREHTML')) {
37 define('NOREQUIREHTML', 1);
38}
39if (!defined('NOREQUIREAJAX')) {
40 define('NOREQUIREAJAX', 1);
41}
42
43require '../../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.'/ai/lib/ai.lib.php';
51// Security check (same gates as ai/assistant/index.php)
52if (!isModEnabled('ai') || !getDolGlobalString('AI_ASSISTANT_ENABLED')) {
53 accessforbidden('Module or feature not allowed');
54}
55if (!$user->hasRight('ai', 'assistant', 'use')) {
57}
58
59$langs->loadLangs(array("main", "other", "dict"));
60
61top_httphead('text/html');
62
63print getAiChatAssistantHtml('popover');
getAiChatAssistantHtml($mode='page')
Build the HTML of the AI Assistant chat interface.
Definition ai.lib.php:617
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.