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 = '
'.$newemail.' '.$linktoaddaction.'
'; } } + } elseif ($addlink == 'thirdparty') { + $newemail = ''; + $newemail .= ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto), 'class="paddingrightonly"') : '').$newemail; + $newemail .= ''; } else { $newemail = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto), 'class="paddingrightonly"') : '').$newemail; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8a991f8f690..0369e2a9acc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2267,7 +2267,7 @@ ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector RecipientEmailsWillBeReplacedWithThisValue=Recipient emails will be always replaced with this value AtLeastOneDefaultBankAccountMandatory=At least 1 default bank account must be defined RESTRICT_ON_IP=Allow API access to only certain client IPs (wildcard not allowed, use space between values). Empty means every clients can access. -StaticIPsOfUsers=If applicable, list of all static IPs of users +StaticIPsOfUsers=If applicable, list of all static IPs of users IPListExample=127.0.0.1 192.168.0.2 [::1] BaseOnSabeDavVersion=Based on the library SabreDAV version NotAPublicIp=Not a public IP @@ -2487,7 +2487,7 @@ AI_CONFIGURATIONS_PROMPT=Custom prompt TextGeneration=Text generation ImageGeneration=Image generation VideoGeneration=Video generation -AudioText=Audio - Text +AudioGeneration=Audio generation AIPromptForFeatures=AI custom prompts for features EnterAnIP=Enter an IP address ConvertInto=Convert into diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 0e49df28f56..5600ab8efa4 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2466,7 +2466,8 @@ class Project extends CommonObject } /** - * Function sending an email to the current member with the text supplied in parameter. + * Function sending an email to the current project with the text supplied in parameter. + * TODO When this is used ? * * @param string $text Content of message (not html entities encoded) * @param string $subject Subject of message @@ -2484,11 +2485,11 @@ class Project extends CommonObject */ public function sendEmail($text, $subject, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = -1, $errors_to = '', $moreinheader = '') { - global $conf, $langs; // TODO EMAIL return 1; } + /** * Return clicable link of object (with eventually picto) * @@ -2540,13 +2541,18 @@ class Project extends CommonObject $return .= ''.dol_print_date($this->date_end, 'day').''; }*/ if (property_exists($this, 'thirdparty') && !is_null($this->thirdparty) && is_object($this->thirdparty) && $this->thirdparty instanceof Societe) { - $return .= '
'.$this->thirdparty->getNomUrl(1); + $return .= '
'.$this->thirdparty->getNomUrl(1); $return .= '
'; if (!empty($this->thirdparty->phone)) { $return .= '
'; $return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone', $this->thirdparty->phone, 0, 'marginleftonly'); $return .= '
'; } + if (!empty($this->thirdparty->email)) { + $return .= '
'; + $return .= dol_print_email($this->thirdparty->email, 0, $this->thirdparty->id, 'thirdparty', -1, 1, 1); + $return .= '
'; + } } if (!empty($arraydata['assignedusers'])) { $return .= '
';