dolibarr 25.0.0-alpha
modTicket.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
3 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
4 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 *
19 * Module descriptor for ticket system
20 */
21
29require_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php";
30
31
36{
42 public function __construct($db)
43 {
44 global $langs, $conf, $user;
45 $langs->load("ticket");
46
47 $this->db = $db;
48
49 // Id for module (must be unique).
50 // Use a free id here
51 // (See in Home -> System information -> Dolibarr for list of used modules id).
52 $this->numero = 56000;
53 // Key text used to identify module (for permissions, menus, etc...)
54 $this->rights_class = 'ticket';
55
56 // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
57 // It is used to group modules in module setup page
58 $this->family = "crm";
59 // Module position in the family
60 $this->module_position = '60';
61 // Module label (no space allowed)
62 // used if translation string 'ModuleXXXName' not found
63 // (where XXX is value of numeric property 'numero' of module)
64 $this->name = preg_replace('/^mod/i', '', get_class($this));
65 // Module description
66 // used if translation string 'ModuleXXXDesc' not found
67 // (where XXX is value of numeric property 'numero' of module)
68 $this->description = "Incident/support ticket management";
69 // Possible values for version are: 'development', 'experimental' or version
70 $this->version = 'dolibarr';
71 // Key used in llx_const table to save module status enabled/disabled
72 // (where MYMODULE is value of property name of module in uppercase)
73 $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
74 // Name of image file used for this module.
75 // If file is in theme/yourtheme/img directory under name object_pictovalue.png
76 // use this->picto='pictovalue'
77 // If file is in module/img directory under name object_pictovalue.png
78 // use this->picto='pictovalue@module'
79 $this->picto = 'ticket'; // mypicto@ticket
80 // Defined all module parts (triggers, login, substitutions, menus, css, etc...)
81 // for default path (eg: /ticket/core/xxxxx) (0=disable, 1=enable)
82 // for specific path of parts (eg: /ticket/core/modules/barcode)
83 // for specific css file (eg: /ticket/css/ticket.css.php)
84 $this->module_parts = [
85 // Set this to 1 if module has its own trigger directory
86 'triggers' => 1,
87 ];
88
89 // Data directories to create when module is enabled.
90 // Example: this->dirs = ["/ticket/temp"];
91 $this->dirs = [];
92
93 // Config pages. Put here list of php pages
94 // stored into ticket/admin directory, used to setup module.
95 $this->config_page_url = ["ticket.php"];
96
97 // Dependencies
98 $this->hidden = false; // A condition to hide module
99 $this->depends = ['modAgenda']; // List of module class names as string that must be enabled if this module is enabled
100 $this->requiredby = []; // List of module ids to disable if this one is disabled
101 $this->conflictwith = []; // List of module class names as string this module is in conflict with
102 $this->langfiles = ["ticket"];
103
104 // Constants
105 // List of particular constants to add when module is enabled
106 // (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
107 // Example:
108 $default_footer = $langs->trans('TicketMessageMailFooterText', getDolGlobalString('MAIN_INFO_SOCIETE_NOM'));
109 $this->const = [
110 ['TICKET_ENABLE_PUBLIC_INTERFACE', 'chaine', '0', 'Enable ticket public interface', 0],
111 ['TICKET_ADDON', 'chaine', 'mod_ticket_simple', 'Ticket ref module', 0],
112 ['TICKET_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT'.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/tickets', 'Ticket templates ODT/ODS directory for templates', 0],
113 ['TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'chaine', 0, 'Automatically mark ticket as read when created from backend', 0],
114 ['TICKET_DELAY_BEFORE_FIRST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time before a first answer to a ticket (in hours). Display a warning in tickets list if not respected.', 0],
115 ['TICKET_DELAY_SINCE_LAST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time between two answers on the same ticket (in hours). Display a warning in tickets list if not respected.', 0],
116 ['TICKET_NOTIFY_AT_CLOSING', 'chaine', '0', 'Default notify contacts when closing a module', 0],
117 ['TICKET_PRODUCT_CATEGORY', 'chaine', 0, 'The category of product that is being used to find contract to link to created ticket', 0],
118 ['TICKET_NOTIFICATION_EMAIL_FROM', 'chaine', getDolGlobalString('MAIN_MAIL_EMAIL_FROM'), 'Email to use by default as sender for messages sent from Dolibarr', 0],
119 ['TICKET_MESSAGE_MAIL_INTRO', 'chaine', $langs->trans('TicketMessageMailIntroText'), 'Introduction text of ticket replies sent from Dolibarr', 0],
120 ['TICKET_MESSAGE_MAIL_SIGNATURE', 'chaine', $default_footer, 'Signature to use by default for messages sent from Dolibarr', 0],
121 ['MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER', 'chaine', "1", 'Disable the rendering of headers in tickets', 0],
122 ['MAIN_SECURITY_ENABLECAPTCHA_TICKET', 'chaine', getDolGlobalInt('MAIN_SECURITY_ENABLECAPTCHA_TICKET'), 'Enable captcha code by default', 0],
123 ['TICKET_SHOW_COMPANY_LOGO', 'chaine', getDolGlobalInt('TICKET_SHOW_COMPANY_LOGO', 1), 'Enable logo header on ticket public page', 0],
124 ['TICKET_SHOW_COMPANY_FOOTER', 'chaine', getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER', 1), 'Enable footer on ticket public page', 0],
125 ['TICKET_EMAIL_TEMPLATE_REMIND_STALE', 'emailtemplate:ticket', '(SendingReminderForStaleTicket)', 'Email template used to remind the assigned user of a late ticket (see TICKET_DELAY_BEFORE_FIRST_RESPONSE and TICKET_DELAY_SINCE_LAST_RESPONSE)', 0],
126 ];
127
128 /*
129 $this->tabs = [
130 'thirdparty:+ticket:Tickets:ticket:$user->hasRight("ticket","read"):/ticket/list.php?socid=__ID__',
131 ];
132 */
133
134 // Dictionaries
135 if (!isset($conf->ticket->enabled)) {
136 $conf->ticket = new stdClass();
137 $conf->ticket->enabled = 0;
138 }
139
140 // Dictionary of ticket types
142 [
143 'name' => 'c_ticket_type',
144 'lib' => 'TicketDictType',
145 'sql' => 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.entity FROM '.$this->db->prefix().'c_ticket_type as f WHERE f.entity IN ('.getEntity('c_ticket_type').')',
146 'sqlsort' => 'pos ASC',
147 'field' => 'code,label,pos,use_default',
148 'fieldvalue' => 'code,label,pos,use_default',
149 'fieldinsert' => 'code,label,pos,use_default,entity',
150 'rowid' => 'rowid',
151 'cond' => isModEnabled('ticket'),
152 'help' => ['code' => $langs->trans('EnterAnyCode'), 'use_default' => $langs->trans('EnterYesOrNo')],
153 ]
154 );
155
156 // Dictionary of ticket severities
158 [
159 'name' => 'c_ticket_severity',
160 'lib' => 'TicketDictSeverity',
161 'sql' => 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.entity FROM '.$this->db->prefix().'c_ticket_severity as f WHERE f.entity IN ('.getEntity('c_ticket_severity').')',
162 'sqlsort' => 'pos ASC',
163 'field' => 'code,label,pos,use_default',
164 'fieldvalue' => 'code,label,pos,use_default',
165 'fieldinsert' => 'code,label,pos,use_default,entity',
166 'rowid' => 'rowid',
167 'cond' => isModEnabled('ticket'),
168 'help' => [
169 'code' => $langs->trans('EnterAnyCode'),
170 'use_default' => $langs->trans('EnterYesOrNo'),
171 ],
172 ]
173 );
174
175 // Dictionary of ticket categories
177 [
178 'name' => 'c_ticket_category',
179 'lib' => 'TicketDictCategory',
180 'sql' => 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent, f.entity FROM '.$this->db->prefix().'c_ticket_category as f WHERE f.entity IN ('.getEntity('c_ticket_category').')',
181 'sqlsort' => 'pos ASC',
182 'field' => 'code,label,pos,use_default,public,fk_parent',
183 'fieldvalue' => 'code,label,pos,use_default,public,fk_parent',
184 'fieldinsert' => 'code,label,pos,use_default,public,fk_parent,entity',
185 'rowid' => 'rowid',
186 'cond' => isModEnabled('ticket'),
187 'help' => [
188 'code' => $langs->trans('EnterAnyCode'),
189 'use_default' => $langs->trans('EnterYesOrNo'),
190 'public' => $langs->trans('Enter0or1').'<br>'.$langs->trans('TicketGroupIsPublicDesc'),
191 'fk_parent' => $langs->trans('IfThisCategoryIsChildOfAnother'),
192 ],
193 ]
194 );
195
196 // Dictionary of ticket resolutions (apparently unused except if TICKET_ENABLE_RESOLUTION is on)
198 [
199 'name' => 'c_ticket_resolution',
200 'lib' => 'TicketDictResolution',
201 'sql' => 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.entity FROM '.$this->db->prefix().'c_ticket_resolution as f WHERE f.entity IN ('.getEntity('c_ticket_resolution').')',
202 'sqlsort' => 'pos ASC',
203 'field' => 'code,label,pos,use_default',
204 'fieldvalue' => 'code,label,pos,use_default',
205 'fieldinsert' => 'code,label,pos,use_default,entity',
206 'rowid' => 'rowid',
207 'cond' => isModEnabled('ticket') && getDolGlobalString('TICKET_ENABLE_RESOLUTION'),
208 'help' => [
209 'code' => $langs->trans('EnterAnyCode'),
210 'use_default' => $langs->trans('Enter0or1'),
211 ],
212 ]
213 );
214
215 // Cronjobs
216 $arraydate = dol_getdate(dol_now());
217 $datestart = dol_mktime(22, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
218 $this->cronjobs = array(
219 0 => array(
220 'label' => 'SendReminderForStaleTicketsTitle',
221 'jobtype' => 'method',
222 'class' => 'ticket/class/ticket.class.php',
223 'objectname' => 'Ticket',
224 'method' => 'sendReminderForStaleTickets',
225 'parameters' => '',
226 'comment' => 'SendReminderForStaleTickets',
227 'frequency' => 1,
228 'unitfrequency' => 3600 * 24,
229 'priority' => 50,
230 'status' => 1,
231 'test' => 'isModEnabled("ticket")',
232 'datestart' => $datestart
233 ),
234 );
235
236 // Boxes
237 // Add here list of php file(s) stored in core/boxes that contains class to show a box.
238 $this->boxes = [
239 ['file' => 'box_last_ticket.php', 'enabledbydefaulton' => 'Home'],
240 ['file' => 'box_last_modified_ticket.php', 'enabledbydefaulton' => 'Home'],
241 ['file' => 'box_graph_ticket_by_severity.php', 'enabledbydefaulton' => 'ticketindex'],
242 ['file' => 'box_graph_nb_ticket_last_x_days.php', 'enabledbydefaulton' => 'ticketindex'],
243 ['file' => 'box_graph_nb_tickets_type.php', 'enabledbydefaulton' => 'ticketindex'],
244 ['file' => 'box_new_vs_close_ticket.php', 'enabledbydefaulton' => 'ticketindex'],
245 ];
246
247 // Permissions
248 $this->rights = []; // Permission array used by this module
249
250 $r = 0;
251 $this->rights[$r][0] = 56001; // Permission id (must not be already used)
252 $this->rights[$r][1] = "Read ticket"; // Permission label
253 $this->rights[$r][2] = 'r'; // Permission type (deprecated)
254 $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
255 $this->rights[$r][4] = 'read';
256
257 $r++;
258 $this->rights[$r][0] = 56002; // Permission id (must not be already used)
259 $this->rights[$r][1] = "Create les tickets"; // Permission label
260 $this->rights[$r][2] = 'w'; // Permission type (deprecated)
261 $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
262 $this->rights[$r][4] = 'write';
263
264 $r++;
265 $this->rights[$r][0] = 56003; // Permission id (must not be already used)
266 $this->rights[$r][1] = "Delete les tickets"; // Permission label
267 $this->rights[$r][2] = 'd'; // Permission type (deprecated)
268 $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
269 $this->rights[$r][4] = 'delete';
270
271 $r++;
272 $this->rights[$r][0] = 56004; // Permission id (must not be already used)
273 $this->rights[$r][1] = "Manage tickets"; // Permission label
274 //$this->rights[$r][2] = 'd'; // Permission type (deprecated)
275 $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
276 $this->rights[$r][4] = 'manage_advance';
277
278 $r++;
279 $this->rights[$r][0] = 56006; // Permission id (must not be already used)
280 $this->rights[$r][1] = "Export ticket"; // Permission label
281 //$this->rights[$r][2] = 'd'; // Permission type (deprecated)
282 $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
283 $this->rights[$r][4] = 'export';
284
285 /* Seems not used and in conflict with societe->client->voir (see all thirdparties)
286 $r++;
287 $this->rights[$r][0] = 56005; // Permission id (must not be already used)
288 $this->rights[$r][1] = 'See all tickets, even if not assigned to (not effective for external users, always restricted to the thirdpardy they depends on)'; // Permission label
289 $this->rights[$r][2] = 'r'; // Permission type (deprecated)
290 $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
291 $this->rights[$r][4] = 'view';
292 $this->rights[$r][5] = 'all';
293 */
294
295 // Main menu entries
296 $this->menu = []; // List of menus to add
297 $r = 0;
298
299 $this->menu[$r] = [
300 'fk_menu' => 'fk_mainmenu=ticket',
301 'type' => 'left',
302 'titre' => 'Ticket',
303 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'),
304 'mainmenu' => 'ticket',
305 'leftmenu' => 'ticket',
306 'url' => '/ticket/index.php',
307 'langs' => 'ticket',
308 'position' => 101,
309 'enabled' => 'isModEnabled("ticket")',
310 'perms' => '$user->hasRight("ticket","read")',
311 'target' => '',
312 'user' => 2,
313 ];
314 $r++;
315
316 $this->menu[$r] = [
317 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket',
318 'type' => 'left',
319 'titre' => 'NewTicket',
320 'mainmenu' => 'ticket',
321 'url' => '/ticket/card.php?action=create&mode=init',
322 'langs' => 'ticket',
323 'position' => 102,
324 'enabled' => 'isModEnabled("ticket")',
325 'perms' => '$user->hasRight("ticket", "write")',
326 'target' => '',
327 'user' => 2,
328 ];
329 $r++;
330
331 $this->menu[$r] = [
332 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket',
333 'type' => 'left',
334 'titre' => 'List',
335 'mainmenu' => 'ticket',
336 'leftmenu' => 'ticketlist',
337 'url' => '/ticket/list.php?search_fk_statut=openall',
338 'langs' => 'ticket',
339 'position' => 103,
340 'enabled' => 'isModEnabled("ticket")',
341 'perms' => '$user->hasRight("ticket","read")',
342 'target' => '',
343 'user' => 2,
344 ];
345 $r++;
346
347 $this->menu[$r] = [
348 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket',
349 'type' => 'left',
350 'titre' => 'MenuTicketMyAssign',
351 'mainmenu' => 'ticket',
352 'leftmenu' => 'ticketmy',
353 'url' => '/ticket/list.php?mode=mine&search_fk_statut=openall',
354 'langs' => 'ticket',
355 'position' => 105,
356 'enabled' => 'isModEnabled("ticket")',
357 'perms' => '$user->hasRight("ticket","read")',
358 'target' => '',
359 'user' => 0,
360 ];
361 $r++;
362
363 $this->menu[$r] = [
364 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket',
365 'type' => 'left',
366 'titre' => 'Statistics',
367 'mainmenu' => 'ticket',
368 'url' => '/ticket/stats/index.php',
369 'langs' => 'ticket',
370 'position' => 107,
371 'enabled' => 'isModEnabled("ticket") && getDolGlobalString("MAIN_STATISTICS_IN_MENU")',
372 'perms' => '$user->hasRight("ticket","read")',
373 'target' => '',
374 'user' => 0,
375 ];
376 $r++;
377
378 $this->menu[$r] = [
379 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket',
380 'type' => 'left',
381 'titre' => 'Categories',
382 'mainmenu' => 'ticket',
383 'url' => '/categories/categorie_list.php?type=12',
384 'langs' => 'ticket',
385 'position' => 107,
386 'enabled' => 'isModEnabled("ticket") && isModEnabled("categorie") && getDolGlobalString("CATEGORY_EDIT_IN_MENU_NOT_IN_POPUP")',
387 'perms' => '$user->hasRight("ticket","read")',
388 'target' => '',
389 'user' => 0,
390 ];
391 $r++;
392
393 // Exports
394 //--------
395 $r = 1;
396
397 // Export list of tickets and attributes
398 $langs->load("ticket");
399 $this->export_code[$r] = $this->rights_class.'_'.$r;
400 $this->export_label[$r] = 'ExportDataset_ticket_1'; // Translation key (used only if key ExportDataset_xxx_z not found)
401 $this->export_permission[$r] = [["ticket", "export"]];
402 $this->export_icon[$r] = 'ticket';
403 $keyforclass = 'Ticket';
404 $keyforclassfile = '/ticket/class/ticket.class.php';
405 $keyforelement = 'ticket';
406 include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php';
407 $keyforselect = 'ticket';
408 $keyforaliasextra = 'extra';
409 $keyforelement = 'ticket';
410 include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
411 $this->export_sql_start[$r] = 'SELECT DISTINCT ';
412 $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'ticket as t';
413 $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'ticket_extrafields as extra on (t.rowid = extra.fk_object)';
414 $this->export_sql_end[$r] .= ' WHERE 1 = 1';
415 $this->export_sql_end[$r] .= ' AND t.entity IN ('.getEntity('ticket').')';
416 if (is_object($user) && !$user->hasRight('societe', 'client', 'voir')) {
417 // Restrict to tickets with no thirdparty or with a thirdparty the user is sales representative of
418 $this->export_sql_end[$r] .= ' AND (t.fk_soc IS NULL OR EXISTS (SELECT sc.fk_soc FROM '.MAIN_DB_PREFIX.'societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = '.((int) $user->id).'))';
419 }
420 $r++;
421 }
422
431 public function init($options = '')
432 {
433 global $conf, $langs;
434
435 $result = $this->_load_tables('/install/mysql/', 'ticket');
436 if ($result < 0) {
437 return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
438 }
439
440 // Permissions
441 $this->remove($options);
442
443 // ODT template
444 $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/tickets/template_ticket.odt';
445 $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/tickets';
446 $dest = $dirodt.'/template_ticket.odt';
447
448 if (file_exists($src) && !file_exists($dest)) {
449 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
450 dol_mkdir($dirodt);
451 $result = dol_copy($src, $dest, '0', 0);
452 if ($result < 0) {
453 $langs->load("errors");
454 $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest);
455 return 0;
456 }
457 }
458
459 $sql = [
460 ["sql" => "INSERT INTO ".$this->db->prefix()."c_type_contact(rowid, element, source, code, libelle, active ) values (110120, 'ticket', 'internal', 'SUPPORTTEC', 'Utilisateur assigné au ticket', 1);", "ignoreerror" => 1],
461 ["sql" => "INSERT INTO ".$this->db->prefix()."c_type_contact(rowid, element, source, code, libelle, active ) values (110121, 'ticket', 'internal', 'CONTRIBUTOR', 'Intervenant', 1);", "ignoreerror" => 1],
462 ["sql" => "INSERT INTO ".$this->db->prefix()."c_type_contact(rowid, element, source, code, libelle, active ) values (110122, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1);", "ignoreerror" => 1],
463 ["sql" => "INSERT INTO ".$this->db->prefix()."c_type_contact(rowid, element, source, code, libelle, active ) values (110123, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1);", "ignoreerror" => 1],
464 // remove old settings
465 ["sql" => "DELETE FROM ".$this->db->prefix()."document_model WHERE nom = 'TICKET_ADDON_PDF_ODT_PATH' AND type = 'ticket' AND entity = ".((int) $conf->entity), "ignoreerror" => 1],
466 // activate default odt templates
467 ["sql" => "INSERT INTO ".$this->db->prefix()."document_model (nom, type, libelle, entity, description) VALUES('generic_ticket_odt','ticket','ODT templates',".((int) $conf->entity).",'TICKET_ADDON_PDF_ODT_PATH');", "ignoreerror" => 1],
468 ];
469
470 return $this->_init($sql, $options);
471 }
472}
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class DolibarrModules.
_init($array_sql, $options='')
Enables a module.
_load_tables($reldir, $onlywithsuffix='')
Create tables and keys required by module:
declareNewDictionary($dictionaryArray, $langs='')
Helper method to declare dictionaries one at a time (rather than declaring dictionaries property by p...
Description and activation class for module Ticket.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_copy($srcfile, $destfile, $newmask='0', $overwriteifexists=1, $testvirus=0, $indexdatabase=0)
Copy a file to another file.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
$conf browser version
Definition main.inc.php:229
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:165