2024-02-07 19:41:50 +01:00
< ? php
2024-07-08 22:10:25 +02:00
/* Copyright ( C ) 2004 - 2017 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2022 Alice Adminson < aadminson @ example . com >
* Copyright ( C ) 2024 Frédéric France < frederic . france @ free . fr >
* Coryright ( C ) 2024 Alexandre Spangaro < alexandre @ inovea - conseil . com >
2024-02-07 19:41:50 +01:00
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < https :// www . gnu . org / licenses />.
*/
/**
2024-04-06 17:38:39 +02:00
* \file htdocs / ai / admin / custom_prompt . php
2024-02-07 19:41:50 +01:00
* \ingroup ai
* \brief Ai other custom page .
*/
// Load Dolibarr environment
require '../../main.inc.php' ;
require_once DOL_DOCUMENT_ROOT . " /core/lib/admin.lib.php " ;
2025-02-16 19:51:53 +01:00
require_once DOL_DOCUMENT_ROOT . " /ai/lib/ai.lib.php " ;
2025-02-19 11:24:13 +01:00
require_once DOL_DOCUMENT_ROOT . " /core/class/html.formai.class.php " ;
2024-02-07 19:41:50 +01:00
2024-11-04 23:53:20 +01:00
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Translate $langs
* @ var User $user
*/
2024-04-24 13:07:47 +02:00
$langs -> loadLangs ( array ( " admin " , " website " , " other " ));
2024-02-14 01:42:38 +01:00
2025-02-19 14:44:54 +01:00
$arrayofaifeatures = getListOfAIFeatures ();
$arrayofia = getListOfAIServices ();
2025-02-16 19:51:53 +01:00
2024-02-07 19:41:50 +01:00
// Parameters
$action = GETPOST ( 'action' , 'aZ09' );
$backtopage = GETPOST ( 'backtopage' , 'alpha' );
2024-07-19 15:38:52 +02:00
$cancel = GETPOST ( 'cancel' );
2024-02-07 19:41:50 +01:00
$modulepart = GETPOST ( 'modulepart' , 'aZ09' ); // Used by actions_setmoduleoptions.inc.php
2024-07-19 15:38:52 +02:00
$functioncode = GETPOST ( 'functioncode' , 'alpha' );
$pre_prompt = GETPOST ( 'prePrompt' );
$post_prompt = GETPOST ( 'postPrompt' );
$blacklists = GETPOST ( 'blacklists' );
$test = GETPOST ( 'test' );
2024-02-10 10:38:29 +01:00
if ( empty ( $action )) {
$action = 'edit' ;
}
2024-02-07 19:41:50 +01:00
$error = 0 ;
$setupnotempty = 0 ;
// Access control
if ( ! $user -> admin ) {
accessforbidden ();
}
// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
$useFormSetup = 1 ;
if ( ! class_exists ( 'FormSetup' )) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formsetup.class.php' ;
}
$formSetup = new FormSetup ( $db );
2025-02-19 14:44:54 +01:00
$aiservice = getDolGlobalString ( 'AI_API_SERVICE' , 'chatgpt' );
// Setup conf for AI model
$formSetup -> formHiddenInputs [ 'action' ] = " updatefeaturemodel " ;
foreach ( $arrayofaifeatures as $key => $val ) {
$item = $formSetup -> newItem ( 'AI_API_' . strtoupper ( $aiservice ) . '_MODEL_' . $val [ " function " ]); // Name of constant must end with _KEY so it is encrypted when saved into database.
$item -> nameText = $langs -> trans ( " AI_API_MODEL_ " . $val [ " function " ]);
$item -> cssClass = 'minwidth500 input' ;
}
2024-02-07 19:41:50 +01:00
2024-02-13 20:43:25 +01:00
$setupnotempty += count ( $formSetup -> items );
2024-02-07 19:41:50 +01:00
$dirmodels = array_merge ( array ( '/' ), ( array ) $conf -> modules_parts [ 'models' ]);
2024-02-10 10:38:29 +01:00
2024-02-07 19:41:50 +01:00
/*
* Actions
*/
2024-02-10 10:38:29 +01:00
// get all configs in const AI
2024-02-07 19:41:50 +01:00
2024-03-06 00:46:04 +01:00
$currentConfigurationsJson = getDolGlobalString ( 'AI_CONFIGURATIONS_PROMPT' );
2024-02-10 10:38:29 +01:00
$currentConfigurations = json_decode ( $currentConfigurationsJson , true );
2024-02-07 19:41:50 +01:00
2025-02-19 15:19:52 +01:00
if ( $action == 'updatefeaturemodel' && ! empty ( $user -> admin )) {
2025-02-19 14:44:54 +01:00
$formSetup -> saveConfFromPost ();
$action = 'edit' ;
}
2024-07-19 15:38:52 +02:00
if ( $action == 'update' && $cancel ) {
2024-02-13 20:43:25 +01:00
$action = 'edit' ;
}
2024-07-15 21:42:25 +02:00
2024-07-19 15:38:52 +02:00
if ( $action == 'update' && ! $cancel && ! $test ) {
2024-02-07 19:41:50 +01:00
$error = 0 ;
2024-03-06 00:46:04 +01:00
if ( empty ( $functioncode )) {
2024-02-07 19:41:50 +01:00
$error ++ ;
setEventMessages ( $langs -> trans ( 'ErrorInputRequired' ), null , 'errors' );
}
if ( ! is_array ( $currentConfigurations )) {
$currentConfigurations = [];
}
2024-07-15 21:42:25 +02:00
$blacklistArray = array_filter ( array_map ( 'trim' , explode ( ',' , $blacklists )));
if ( empty ( $functioncode ) || ( empty ( $pre_prompt ) && empty ( $post_prompt ) && empty ( $blacklists ))) {
2024-03-06 00:46:04 +01:00
if ( isset ( $currentConfigurations [ $functioncode ])) {
unset ( $currentConfigurations [ $functioncode ]);
2024-02-07 19:41:50 +01:00
}
} else {
2024-03-06 00:46:04 +01:00
$currentConfigurations [ $functioncode ] = [
2024-02-07 19:41:50 +01:00
'prePrompt' => $pre_prompt ,
'postPrompt' => $post_prompt ,
2024-07-15 21:42:25 +02:00
'blacklists' => $blacklistArray ,
2024-02-07 19:41:50 +01:00
];
}
$newConfigurationsJson = json_encode ( $currentConfigurations , JSON_UNESCAPED_UNICODE );
$result = dolibarr_set_const ( $db , 'AI_CONFIGURATIONS_PROMPT' , $newConfigurationsJson , 'chaine' , 0 , '' , $conf -> entity );
if ( ! $error ) {
if ( $result ) {
header ( " Location: " . $_SERVER [ 'PHP_SELF' ]);
2024-02-13 20:43:25 +01:00
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
2024-02-07 19:41:50 +01:00
exit ;
} else {
setEventMessages ( $langs -> trans ( " ErrorUpdating " ), null , 'errors' );
}
}
2024-02-10 10:38:29 +01:00
$action = 'edit' ;
2024-02-07 19:41:50 +01:00
}
2024-07-19 15:38:52 +02:00
// Update entry
if ( $action == 'updatePrompts' && ! $test ) {
2024-03-13 18:03:10 +01:00
$key = GETPOST ( 'key' , 'alpha' );
2024-07-15 21:42:25 +02:00
$blacklistArray = array_filter ( array_map ( 'trim' , explode ( ',' , $blacklists )));
2024-03-13 18:03:10 +01:00
$currentConfigurations [ $key ] = [
'prePrompt' => $pre_prompt ,
'postPrompt' => $post_prompt ,
2024-07-15 21:42:25 +02:00
'blacklists' => $blacklistArray ,
2024-03-13 18:03:10 +01:00
];
$newConfigurationsJson = json_encode ( $currentConfigurations , JSON_UNESCAPED_UNICODE );
$result = dolibarr_set_const ( $db , 'AI_CONFIGURATIONS_PROMPT' , $newConfigurationsJson , 'chaine' , 0 , '' , $conf -> entity );
if ( ! $error ) {
2024-07-19 15:38:52 +02:00
$action = 'edit' ;
2024-03-13 18:03:10 +01:00
if ( $result ) {
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
} else {
setEventMessages ( $langs -> trans ( " ErrorUpdating " ), null , 'errors' );
}
}
}
2024-07-19 15:38:52 +02:00
// Test entry
if ( $action == 'updatePrompts' && $test ) {
$action = 'edit' ;
}
// Delete entry
2024-03-13 18:03:10 +01:00
if ( $action == 'confirm_deleteproperty' && GETPOST ( 'confirm' ) == 'yes' ) {
2024-03-12 18:22:59 +01:00
$key = GETPOST ( 'key' , 'alpha' );
if ( isset ( $currentConfigurations [ $key ])) {
unset ( $currentConfigurations [ $key ]);
$newConfigurationsJson = json_encode ( $currentConfigurations , JSON_UNESCAPED_UNICODE );
$res = dolibarr_set_const ( $db , 'AI_CONFIGURATIONS_PROMPT' , $newConfigurationsJson , 'chaine' , 0 , '' , $conf -> entity );
if ( $res ) {
header ( " Location: " . $_SERVER [ 'PHP_SELF' ]);
2024-03-16 12:49:42 +01:00
setEventMessages ( $langs -> trans ( " RecordDeleted " ), null , 'mesgs' );
2024-03-12 18:22:59 +01:00
exit ;
} else {
2024-03-16 12:49:42 +01:00
setEventMessages ( $langs -> trans ( " NoRecordDeleted " ), null , 'errors' );
2024-03-12 18:22:59 +01:00
}
}
}
2024-02-10 10:38:29 +01:00
2024-02-07 19:41:50 +01:00
/*
* View
*/
2024-02-10 10:38:29 +01:00
$form = new Form ( $db );
2025-02-19 11:24:13 +01:00
$formai = new FormAI ( $db );
2024-02-07 19:41:50 +01:00
2024-02-10 10:38:29 +01:00
$help_url = '' ;
$title = " AiSetup " ;
2024-02-07 19:41:50 +01:00
2024-07-08 22:10:25 +02:00
llxHeader ( '' , $langs -> trans ( $title ), $help_url , '' , 0 , 0 , '' , '' , '' , 'mod-ai page-admin_custom_prompt' );
2024-02-07 19:41:50 +01:00
2024-02-10 10:38:29 +01:00
// Subheader
$linkback = '<a href="' . ( $backtopage ? $backtopage : DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1' ) . '">' . $langs -> trans ( " BackToModuleList " ) . '</a>' ;
2024-02-07 19:41:50 +01:00
2024-02-10 10:38:29 +01:00
print load_fiche_titre ( $langs -> trans ( $title ), $linkback , 'title_setup' );
2024-02-07 19:41:50 +01:00
2024-02-10 10:38:29 +01:00
// Configuration header
$head = aiAdminPrepareHead ();
2025-02-16 22:47:22 +01:00
print dol_get_fiche_head ( $head , 'custom' , $langs -> trans ( $title ), - 1 , " ai " );
2024-02-07 19:41:50 +01:00
2024-02-13 20:43:25 +01:00
//$newbutton = '<a href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("New").'</a>';
$newbutton = '' ;
print load_fiche_titre ( $langs -> trans ( " AIPromptForFeatures " ), $newbutton , '' );
2024-03-12 18:22:59 +01:00
if ( $action == 'deleteproperty' ) {
$formconfirm = $form -> formconfirm (
$_SERVER [ " PHP_SELF " ] . '?key=' . urlencode ( GETPOST ( 'key' , 'alpha' )),
$langs -> trans ( 'Delete' ),
2024-03-12 20:31:01 +01:00
$langs -> trans ( 'ConfirmDeleteSetup' , GETPOST ( 'key' , 'alpha' )),
2024-03-12 18:22:59 +01:00
'confirm_deleteproperty' ,
'' ,
0 ,
1
);
print $formconfirm ;
}
2024-04-24 13:13:54 +02:00
if ( $action == 'edit' || $action == 'deleteproperty' ) {
2024-03-16 21:33:55 +01:00
$out = '<form action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST">' ;
2024-02-07 19:41:50 +01:00
$out .= '<input type="hidden" name="token" value="' . newToken () . '">' ;
$out .= '<input type="hidden" name="action" value="update">' ;
2024-02-13 20:43:25 +01:00
2024-03-12 18:22:59 +01:00
2024-02-07 19:41:50 +01:00
$out .= '<table class="noborder centpercent">' ;
$out .= '<thead>' ;
$out .= '<tr class="liste_titre">' ;
2024-02-13 20:43:25 +01:00
$out .= '<td>' . $langs -> trans ( 'Add' ) . '</td>' ;
$out .= '<td></td>' ;
2024-02-07 19:41:50 +01:00
$out .= '</tr>' ;
$out .= '</thead>' ;
2024-07-15 22:24:16 +02:00
2024-02-07 19:41:50 +01:00
$out .= '<tbody>' ;
$out .= '<tr class="oddeven">' ;
2024-07-15 22:24:16 +02:00
$out .= '<td class="col-setup-title titlefield">' ;
2024-02-10 10:38:29 +01:00
$out .= '<span id="module" class="spanforparamtooltip">' . $langs -> trans ( " Feature " ) . '</span>' ;
2024-02-07 19:41:50 +01:00
$out .= '</td>' ;
$out .= '<td>' ;
2024-02-13 20:43:25 +01:00
// Combo list of AI features
2024-03-06 00:46:04 +01:00
$out .= '<select name="functioncode" id="functioncode" class="flat minwidth500">' ;
2024-02-13 20:43:25 +01:00
$out .= '<option> </option>' ;
foreach ( $arrayofaifeatures as $key => $val ) {
2024-04-20 19:32:38 +02:00
$labelhtml = $langs -> trans ( $arrayofaifeatures [ $key ][ 'label' ]) . ( $arrayofaifeatures [ $key ][ 'status' ] == 'notused' ? ' <span class="opacitymedium">(' . $langs -> trans ( " NotYetAvailable " ) . ')</span>' : " " );
2024-03-06 00:46:04 +01:00
$labeltext = $langs -> trans ( $arrayofaifeatures [ $key ][ 'label' ]);
$out .= '<option value="' . $key . '" data-html="' . dol_escape_htmltag ( $labelhtml ) . '">' . dol_escape_htmltag ( $labeltext ) . '</option>' ;
2024-02-13 20:43:25 +01:00
}
2024-02-10 10:38:29 +01:00
/*
2024-02-07 19:41:50 +01:00
$sql = " SELECT name FROM llx_const WHERE name LIKE 'MAIN_MODULE_%' AND value = '1' " ;
$resql = $db -> query ( $sql );
if ( $resql ) {
while ( $obj = $db -> fetch_object ( $resql )) {
$moduleName = str_replace ( 'MAIN_MODULE_' , '' , $obj -> name );
$out .= '<option value="' . htmlspecialchars ( $moduleName ) . '">' . htmlspecialchars ( $moduleName ) . '</option>' ;
}
} else {
$out .= '<option disabled>Erreur :' . $db -> lasterror () . '</option>' ;
}
2024-02-10 10:38:29 +01:00
*/
2024-02-07 19:41:50 +01:00
$out .= '</select>' ;
2024-03-06 00:46:04 +01:00
$out .= ajax_combobox ( " functioncode " );
2024-02-13 20:43:25 +01:00
2024-02-07 19:41:50 +01:00
$out .= '</td>' ;
$out .= '</tr>' ;
2025-02-16 19:51:53 +01:00
2024-02-07 19:41:50 +01:00
$out .= '<tr class="oddeven">' ;
$out .= '<td class="col-setup-title">' ;
2025-01-07 11:44:59 +01:00
$out .= '<span id="prePrompt" class="spanforparamtooltip">' ;
$out .= $form -> textwithpicto ( $langs -> trans ( " Pre-Prompt " ), $langs -> trans ( " Pre-PromptHelp " ));
$out .= '</span>' ;
2024-02-07 19:41:50 +01:00
$out .= '</td>' ;
$out .= '<td>' ;
2024-04-20 19:32:38 +02:00
$out .= '<textarea class="flat minwidth500 quatrevingtpercent" id="prePromptInput" name="prePrompt" rows="3"></textarea>' ;
2024-02-07 19:41:50 +01:00
$out .= '</td>' ;
$out .= '</tr>' ;
$out .= '<tr class="oddeven">' ;
$out .= '<td class="col-setup-title">' ;
2025-01-07 11:44:59 +01:00
$out .= '<span id="postPrompt" class="spanforparamtooltip">' ;
$out .= $form -> textwithpicto ( $langs -> trans ( " Post-Prompt " ), $langs -> trans ( " Post-PromptHelp " ));
$out .= '</span>' ;
2024-02-07 19:41:50 +01:00
$out .= '</td>' ;
$out .= '<td>' ;
2024-04-20 19:32:38 +02:00
$out .= '<textarea class="flat minwidth500 quatrevingtpercent" id="postPromptInput" name="postPrompt" rows="3"></textarea>' ;
2024-02-07 19:41:50 +01:00
$out .= '</td>' ;
$out .= '</tr>' ;
2024-07-15 21:42:25 +02:00
$out .= '<tr class="oddeven">' ;
$out .= '<td class="col-setup-title">' ;
2025-01-07 11:44:59 +01:00
$out .= '<span id="blacklists" class="spanforparamtooltip">' ;
$out .= $form -> textwithpicto ( $langs -> trans ( " BlackListWords " ), $langs -> trans ( " BlackListWordsAIHelp " ) . '.<br>' . $langs -> trans ( " BlackListWordsHelp " ));
$out .= '</span>' ;
2024-07-15 21:42:25 +02:00
$out .= '</td>' ;
$out .= '<td>' ;
$out .= '<textarea class="flat minwidth500 quatrevingtpercent" id="blacklistsInput" name="blacklists" rows="3"></textarea>' ;
$out .= '</td>' ;
$out .= '</tr>' ;
2024-02-07 19:41:50 +01:00
$out .= '</tbody>' ;
$out .= '</table>' ;
2024-02-10 10:38:29 +01:00
2024-02-13 20:43:25 +01:00
$out .= $form -> buttonsSaveCancel ( " Add " , " " );
2024-03-13 18:03:10 +01:00
$out .= '</form>' ;
2025-02-16 22:45:14 +01:00
2024-02-13 20:43:25 +01:00
$out .= '<br><br><br>' ;
print $out ;
}
2024-04-24 13:13:54 +02:00
if ( $action == 'edit' || $action == 'create' || $action == 'deleteproperty' ) {
2024-03-06 00:46:04 +01:00
$out = '' ;
if ( ! empty ( $currentConfigurations )) {
foreach ( $currentConfigurations as $key => $config ) {
if ( ! empty ( $key ) && ! preg_match ( '/^[a-z]+$/i' , $key )) { // Ignore empty saved setup
continue ;
}
2024-07-15 22:24:16 +02:00
$out .= '<form action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST">' ;
$out .= '<input type="hidden" name="token" value="' . newToken () . '">' ;
$out .= '<input type="hidden" name="key" value="' . $key . '" />' ;
$out .= '<input type="hidden" name="action" value="updatePrompts">' ;
2024-07-19 15:38:52 +02:00
$out .= '<input type="hidden" name="page_y" value="">' ;
2024-07-15 22:24:16 +02:00
$out .= '<table class="noborder centpercent">' ;
2024-03-06 00:46:04 +01:00
$out .= '<thead>' ;
$out .= '<tr class="liste_titre">' ;
2024-07-15 22:24:16 +02:00
$out .= '<td class="titlefield">' . $arrayofaifeatures [ $key ][ 'picto' ] . ' ' . $langs -> trans ( $arrayofaifeatures [ $key ][ 'label' ]);
2024-04-24 13:13:54 +02:00
$out .= '<a class="deletefielda reposition marginleftonly right" href="' . $_SERVER [ " PHP_SELF " ] . '?action=deleteproperty&token=' . newToken () . '&key=' . urlencode ( $key ) . '">' . img_delete () . '</a>' ;
2024-03-12 18:22:59 +01:00
$out .= '</td>' ;
2024-03-06 00:46:04 +01:00
$out .= '<td></td>' ;
$out .= '</tr>' ;
$out .= '</thead>' ;
$out .= '<tbody>' ;
2024-03-13 18:03:10 +01:00
2024-03-06 00:46:04 +01:00
$out .= '<tr class="oddeven">' ;
$out .= '<td class="col-setup-title">' ;
2024-04-20 19:32:38 +02:00
$out .= '<span id="prePrompt" class="spanforparamtooltip">' . $langs -> trans ( " Pre-Prompt " ) . '</span>' ;
2024-03-06 00:46:04 +01:00
$out .= '</td>' ;
$out .= '<td>' ;
2024-07-19 15:38:52 +02:00
$out .= '<textarea class="flat minwidth500 quatrevingtpercent" id="prePromptInput_' . $key . '" name="prePrompt" rows="2">' . $config [ 'prePrompt' ] . '</textarea>' ;
2024-03-06 00:46:04 +01:00
$out .= '</td>' ;
$out .= '</tr>' ;
2024-07-15 22:24:16 +02:00
2024-03-06 00:46:04 +01:00
$out .= '<tr class="oddeven">' ;
$out .= '<td class="col-setup-title">' ;
2024-04-20 19:32:38 +02:00
$out .= '<span id="postPrompt" class="spanforparamtooltip">' . $langs -> trans ( " Post-Prompt " ) . '</span>' ;
2024-03-06 00:46:04 +01:00
$out .= '</td>' ;
$out .= '<td>' ;
2024-07-19 15:38:52 +02:00
$out .= '<textarea class="flat minwidth500 quatrevingtpercent" id="postPromptInput_' . $key . '" name="postPrompt" rows="2">' . $config [ 'postPrompt' ] . '</textarea>' ;
2024-07-15 21:42:25 +02:00
$out .= '</td>' ;
$out .= '</tr>' ;
2024-07-15 22:24:16 +02:00
$out .= '<tr id="fichetwothirdright-' . $key . '" class="oddeven">' ;
2024-07-15 21:42:25 +02:00
$out .= '<td>' . $langs -> trans ( " BlackListWords " ) . '</td>' ;
$out .= '<td>' ;
2024-07-19 15:38:52 +02:00
$out .= '<textarea class="flat minwidth500 quatrevingtpercent" id="blacklist_' . $key . '" name="blacklists" rows="3">' . ( isset ( $config [ 'blacklists' ]) ? implode ( ', ' , ( array ) $config [ 'blacklists' ]) : '' ) . '</textarea>' ;
2024-03-06 00:46:04 +01:00
$out .= '</td>' ;
$out .= '</tr>' ;
2024-07-15 22:24:16 +02:00
2024-07-15 21:42:25 +02:00
$out .= '<tr>' ;
$out .= '<td></td>' ;
$out .= '<td>' ;
2025-02-16 22:45:14 +01:00
$out .= '<input type="submit" class="button small submitBtn reposition" name="modify" data-index="' . $key . '" value="' . dol_escape_htmltag ( $langs -> trans ( " Save " )) . '"/>' ;
2024-07-19 15:38:52 +02:00
$out .= ' ' ;
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php' ;
$showlinktoai = $key ; // 'textgeneration', 'imagegeneration', ...
$showlinktoailabel = $langs -> trans ( " ToTest " );
$formmail = new FormMail ( $db );
$htmlname = $key ;
2025-02-16 19:51:53 +01:00
$out .= '<br><br>' ;
2024-07-19 15:38:52 +02:00
// Fill $out
include DOL_DOCUMENT_ROOT . '/core/tpl/formlayoutai.tpl.php' ;
$out .= '<div id="' . $htmlname . '"></div>' ;
2024-07-15 21:42:25 +02:00
$out .= '</td>' ;
2024-07-15 22:24:16 +02:00
$out .= '</tr>' ;
$out .= '</tbody>' ;
$out .= '</table>' ;
2024-07-15 21:42:25 +02:00
2024-03-13 18:03:10 +01:00
$out .= '</form>' ;
2024-02-13 20:43:25 +01:00
}
}
2024-02-07 19:41:50 +01:00
print $out ;
print '<br>' ;
}
2025-02-19 14:44:54 +01:00
if ( $action == 'edit' || $action == 'create' || $action == 'deleteproperty' ) {
print load_fiche_titre ( $langs -> trans ( " AIModelForFeature " , $arrayofia [ $aiservice ]), $newbutton , '' );
print $formSetup -> generateOutput ( true );
}
2024-02-07 19:41:50 +01:00
if ( empty ( $setupnotempty )) {
print '<br>' . $langs -> trans ( " NothingToSetup " );
}
// Page end
print dol_get_fiche_end ();
llxFooter ();
$db -> close ();