mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-03 23:52:24 +01:00
Debug v22
This commit is contained in:
@@ -58,7 +58,7 @@ class Ai
|
||||
const AI_DEFAULT_PROMPT_FOR_WEBPAGE = 'You are a website editor. Return all HTML content inside a section tag. Do not add explanation.';
|
||||
const AI_DEFAULT_PROMPT_FOR_TEXT_TRANSLATION = 'You are a translator, give only the translation with no comment and explanation.';
|
||||
const AI_DEFAULT_PROMPT_FOR_TEXT_SUMMARIZE = 'You are a writer, make the answer in the same language than the original text to summarize.';
|
||||
const AI_DEFAULT_PROMPT_FOR_TEXT_REPHRASER = 'You are a writer, give only one answer with no comment and explanation and give the answer in the same language than the original to rephrase.';
|
||||
const AI_DEFAULT_PROMPT_FOR_TEXT_REPHRASER = 'You are a writer, give only one answer with no comment and explanation and give the answer in the same language than the original text to rephrase.';
|
||||
const AI_DEFAULT_PROMPT_FOR_EXTRAFIELD_FILLER = 'Give only one answer with no comment and explanation, I want the text to be ready to copy and paste.';
|
||||
|
||||
/**
|
||||
@@ -104,6 +104,7 @@ class Ai
|
||||
|
||||
// In most cases, it is empty and we must get it from $function and $this->apiService
|
||||
if (empty($this->apiEndpoint)) {
|
||||
// Return the endpoint from $this->apiService.
|
||||
if ($function == 'imagegeneration') {
|
||||
$this->apiEndpoint = getDolGlobalString('AI_API_'.strtoupper($this->apiService).'_URL', $arrayofai[$this->apiService]['url']);
|
||||
$this->apiEndpoint .= (preg_match('/\/$/', $this->apiEndpoint) ? '' : '/').'images/generations';
|
||||
@@ -122,7 +123,7 @@ class Ai
|
||||
// $model may be undefined or 'auto'.
|
||||
// If this is the case, we must get it from $function and $this->apiService
|
||||
if (empty($model) || $model == 'auto') {
|
||||
// Return the endpoint and the model from $this->apiService.
|
||||
// Return the model from $this->apiService.
|
||||
if ($function == 'imagegeneration') {
|
||||
$model = getDolGlobalString('AI_API_'.strtoupper($this->apiService).'_MODEL_IMAGE', $arrayofai[$this->apiService][$function]);
|
||||
} elseif ($function == 'audiogeneration') {
|
||||
|
||||
@@ -372,7 +372,7 @@ class FormWebsite
|
||||
$arrayofsamples[$key] = $labelkey;
|
||||
}
|
||||
}
|
||||
$out = '<div id="template-selector" class="template-container hidden">';
|
||||
$out = '<div id="template-selector" class="template-selector template-container hidden">';
|
||||
|
||||
// We disable some not ready templates
|
||||
unset($arrayofsamples['dynamiccontent']);
|
||||
|
||||
@@ -139,6 +139,7 @@ if (empty($conf->dol_no_mouse_hover)) {
|
||||
|
||||
print '
|
||||
jQuery(".classfortooltiponclicktext").dialog({
|
||||
/* title: \'No title\', */
|
||||
closeOnEscape: true, classes: { "ui-dialog": "highlight" },
|
||||
maxHeight: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? max((empty($_SESSION['dol_screenwidth']) ? 0 : $_SESSION['dol_screenwidth']) - 20, 320) : 700).',
|
||||
modal: true,
|
||||
|
||||
@@ -5161,8 +5161,10 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
|
||||
|
||||
print '<tr><td class="tdhtmlheader tdtop">';
|
||||
$htmlhelp = $langs->trans("EditTheWebSiteForACommonHeader").'<br><br>';
|
||||
$htmlhelp .= $langs->trans("Example").' :<br>';
|
||||
$htmlhelp .= $langs->trans("Examples").' :<br>';
|
||||
$htmlhelp .= '<span class="small">';
|
||||
$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
|
||||
$htmlhelp .= '</span>';
|
||||
print $form->textwithpicto($langs->transnoentitiesnoconv('HtmlHeaderPage'), $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
|
||||
print '</td><td>';
|
||||
$poscursor = array('x' => GETPOST('htmlheader_x'), 'y' => GETPOST('htmlheader_y'));
|
||||
|
||||
Reference in New Issue
Block a user