28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
30require_once
'../lib/ai.lib.php';
32$langs->loadLangs(array(
"admin"));
35$action =
GETPOST(
'action',
'aZ09');
36$backtopage =
GETPOST(
'backtopage',
'alpha');
37$modulepart =
GETPOST(
'modulepart',
'aZ09');
43$value =
GETPOST(
'value',
'alpha');
44$label =
GETPOST(
'label',
'alpha');
45$scandir =
GETPOST(
'scan_dir',
'alpha');
60if (!class_exists(
'FormSetup')) {
61 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
68 'chatgpt' =>
'ChatGPT',
73$item = $formSetup->newItem(
'AI_API_SERVICE');
74$item->setAsSelect($arrayofia);
75$item->cssClass =
'minwidth150';
77foreach ($arrayofia as $ia => $ialabel) {
83 $item = $formSetup->newItem(
'AI_API_'.strtoupper($ia).
'_KEY')->setAsSecureKey();
84 $item->nameText = $langs->trans(
"AI_API_KEY").
' ('.$ialabel.
')';
85 $item->defaultFieldValue =
'';
86 $item->fieldParams[
'hideGenerateButton'] = 1;
87 $item->cssClass =
'minwidth500 text-security';
90$setupnotempty = + count($formSetup->items);
93$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
100include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
109$form =
new Form($db);
114llxHeader(
'', $langs->trans($title), $help_url);
117$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
123print
dol_get_fiche_head($head,
'settings', $langs->trans($title), -1,
"fa-microchip");
126if ($action ==
'edit') {
127 print $formSetup->generateOutput(
true);
129} elseif (!empty($formSetup->items)) {
130 print $formSetup->generateOutput();
131 print
'<div class="tabsAction">';
132 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
135 print
'<br>'.$langs->trans(
"NothingToSetup");
139if (empty($setupnotempty)) {
140 print
'<br>'.$langs->trans(
"NothingToSetup");
aiAdminPrepareHead()
Prepare admin pages header.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.