54 $this->rights_class =
'ai';
58 $this->family =
"technic";
61 $this->module_position =
'50';
66 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
71 $this->descriptionlong =
"AiDescriptionLong";
77 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
83 $this->picto =
'fa-magic';
86 $this->module_parts = array(
114 'hooks' => array(
'all'),
116 'moduleforexternal' => 0,
121 $this->dirs = array(
"/ai/temp");
124 $this->config_page_url = array(
"setup.php@ai");
128 $this->hidden =
false;
130 $this->depends = array();
131 $this->requiredby = array();
132 $this->conflictwith = array();
135 $this->langfiles = array(
"ai");
138 $this->phpmin = array(7, 0);
141 $this->warnings_activation = array();
142 $this->warnings_activation_ext = array();
150 $this->
const = array(
151 1 => array(
'AI_EMAILCLEANER_ENABLED',
'yesno',
'0',
'Enable AI cleaner hook for EmailCollector (no business decision)', 0,
'current'),
152 2 => array(
'AI_EMAILCLEANER_MAX_INPUT',
'integer',
'16000',
'Max input size for EmailCleaner prompt', 0,
'current'),
153 3 => array(
'AI_EMAILCLEANER_MIN_CONFIDENCE',
'chaine',
'0.60',
'Minimum confidence to trust AI cleaned text', 0,
'current'),
154 4 => array(
'AI_EMAILCLEANER_EXPOSE_OPERATION',
'yesno',
'0',
'Expose AI Email Cleaner operation in EmailCollector card', 0,
'current'),
155 5 => array(
'AI_EMAILCLEANER_ISOLATED_MODE',
'yesno',
'1',
'Force isolated cleaner runtime (no business decision / no cross-module side effects)', 0,
'current'),
164 if (!isset(
$conf->ai) || !isset(
$conf->ai->enabled)) {
166 $conf->ai->enabled = 0;
170 $this->tabs = array();
198 $this->dictionaries = array();
227 $this->boxes = array(
238 $this->cronjobs = array(
260 $this->rights = array();
278 $this->rights[$r][0] = $this->numero + 1;
279 $this->rights[$r][1] =
'Use the AI Assistant';
280 $this->rights[$r][3] = 0;
281 $this->rights[$r][4] =
'assistant';
282 $this->rights[$r][5] =
'use';
287 $this->menu = array();
299 $this->menu[$r++] = array(
300 'fk_menu' =>
'fk_mainmenu=tools',
302 'titre' =>
'AIAssistant',
303 'prefix' => img_picto(
'',
'fa-robot',
'class="paddingright pictofixedwidth"'),
304 'mainmenu' =>
'tools',
306 'url' =>
'/ai/assistant/index.php?mainmenu=tools&leftmenu=ai',
309 'enabled' =>
'isModEnabled("ai") && getDolGlobalString("AI_ASSISTANT_ENABLED") && getDolGlobalString("AI_MENU_SHOW_TOOLSMENU")',
310 'perms' =>
'$user->hasRight("ai", "assistant", "use")',