diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index 28bd0c2b8f3..fbc9ac1e7f7 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -73,9 +73,9 @@ $arrayofaifeatures = array( 'textgeneration' => array('label' => $langs->trans('TextGeneration').' ('.$langs->trans("Other").')', 'picto'=>'', 'status'=>'notused'), 'imagegeneration' => array('label' => 'ImageGeneration', 'picto'=>'', 'status'=>'notused'), 'videogeneration' => array('label' => 'VideoGeneration', 'picto'=>'', 'status'=>'notused'), + 'audiogeneration' => array('label' => 'AudioGeneration', 'picto'=>'', 'status'=>'notused'), 'transcription' => array('label' => 'Transcription', 'picto'=>'', 'status'=>'notused'), - 'translation' => array('label' => 'Translation', 'picto'=>'', 'status'=>'notused'), - 'audiotext' => array('label' => 'AudioText', 'picto'=>'', 'status'=>'notused') + 'translation' => array('label' => 'Translation', 'picto'=>'', 'status'=>'notused') ); diff --git a/htdocs/ai/class/ai.class.php b/htdocs/ai/class/ai.class.php index 5b3297f9e6e..a630edf6d2f 100644 --- a/htdocs/ai/class/ai.class.php +++ b/htdocs/ai/class/ai.class.php @@ -73,7 +73,7 @@ class Ai * * @param string $instructions Instruction to generate content * @param string $model Model name ('gpt-3.5-turbo', 'gpt-4-turbo', 'dall-e-3', ...) - * @param string $function Code of the feature we want to use ('textgeneration', 'transcription', 'audiotext', 'imagegeneration', 'translation') + * @param string $function Code of the feature we want to use ('textgeneration', 'transcription', 'audiogeneration', 'imagegeneration', 'translation') * @param string $format Format for output ('', 'html', ...) * @return mixed $response */ @@ -91,7 +91,7 @@ class Ai $model = getDolGlobalString('AI_API_CHATGPT_MODEL_IMAGE', 'dall-e-3'); } } - } elseif ($function == 'audiotext') { + } elseif ($function == 'audiogeneration') { if ($this->apiService == 'chatgpt') { $this->apiEndpoint = 'https://api.openai.com/v1/audio/speech'; if ($model == 'auto') { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f5ae26357a2..4f7ec2a6a70 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3736,8 +3736,8 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor * @param string $email EMail to show (only email, without 'Name of recipient' before) * @param int $cid Id of contact if known * @param int $socid Id of third party if known - * @param int $addlink 0=no link, 1=email has a html email link (+ link to create action if constant AGENDA_ADDACTIONFOREMAIL is on) - * @param int $max Max number of characters to show + * @param int|string $addlink 0=no link, 1=email has a html email link (+ link to create action if constant AGENDA_ADDACTIONFOREMAIL is on), 'thirdparty'=link to the thirdparty + * @param int $max Max number of characters to show. Use -1 to hide the mail text and show only the picto. * @param int $showinvalid 1=Show warning if syntax email is wrong * @param int|string $withpicto Show picto * @return string HTML Link @@ -3759,7 +3759,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, return ' '; } - if (!empty($addlink)) { + if ($addlink == 1) { $newemail = ' 0) { + $newemail .= dol_trunc($email, $max); + } $newemail .= ''; if ($showinvalid && !isValidEmail($email)) { $langs->load("errors"); @@ -3786,6 +3788,10 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, $newemail = '