29require
'../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
31require_once DOL_DOCUMENT_ROOT.
"/core/class/doleditor.class.php";
32require_once DOL_DOCUMENT_ROOT.
"/ai/lib/ai.lib.php";
42$langs->loadLangs(array(
"admin",
"website",
"other"));
46$action =
GETPOST(
'action',
'aZ09');
47$backtopage =
GETPOST(
'backtopage',
'alpha');
48$modulepart =
GETPOST(
'modulepart',
'aZ09');
63if (!class_exists(
'FormSetup')) {
64 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
75$item = $formSetup->newItem(
'AI_API_SERVICE');
76$item->setAsSelect($arrayofai);
77$item->cssClass =
'minwidth150';
79foreach ($arrayofai as $ia => $iarecord) {
80 $ialabel = $iarecord[
'label'];
86 $item = $formSetup->newItem(
'AI_API_'.strtoupper($ia).
'_KEY')->setAsSecureKey();
87 $item->nameText = $langs->trans(
"AI_API_KEY").
' ('.$ialabel.
')';
88 $item->defaultFieldValue =
'';
89 $item->fieldParams[
'hideGenerateButton'] = 1;
90 $item->fieldParams[
'trClass'] =
'iaservice '.$ia;
91 $item->cssClass =
'minwidth500 text-security input'.$ia;
93 $item = $formSetup->newItem(
'AI_API_'.strtoupper($ia).
'_URL');
94 $item->nameText = $langs->trans(
"AI_API_URL").
' ('.$ialabel.
')';
95 $item->defaultFieldValue =
'';
96 $item->fieldParams[
'trClass'] =
'iaservice iaurl '.$ia;
97 $item->cssClass =
'minwidth500 input'.$ia;
98 if ($ia ==
'custom') {
99 $item->fieldAttr[
'placeholder'] =
'https://domainofapi.com/v1/';
103$setupnotempty = + count($formSetup->items);
106$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
121include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
133llxHeader(
'', $langs->trans($title), $help_url,
'', 0, 0,
'',
'',
'',
'mod-ai page-admin');
136$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
144print
'There is no MCP server available yet.';
getListOfAIFeatures()
Prepare admin pages header.
aiAdminPrepareHead()
Prepare admin pages header.
getListOfAIServices()
Get list of available ai services.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.