2018-03-10 04:23:59 +01:00
< ? php
2018-03-11 18:28:27 +01:00
/* Copyright ( C ) - 2013 - 2018 Jean - François FERRY < hello @ librethic . io >
2018-03-10 04:23:59 +01:00
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2018-03-11 18:28:27 +01:00
*
* Module descriptor for ticket system
2018-03-10 04:23:59 +01:00
*/
/**
2019-02-03 18:47:55 +01:00
* \defgroup ticket Module Ticket
2019-09-04 15:11:06 +02:00
* \brief Module for ticket and request management .
2018-06-04 21:49:29 +02:00
* \file core / modules / modTicket . class . php
* \ingroup ticket
2021-03-20 13:55:43 +01:00
* \brief Description and activation file for the module Ticket
2018-03-10 04:23:59 +01:00
*/
2020-04-10 10:59:32 +02:00
require_once DOL_DOCUMENT_ROOT . " /core/modules/DolibarrModules.class.php " ;
2018-03-10 04:23:59 +01:00
2018-03-11 18:28:27 +01:00
2018-03-10 04:23:59 +01:00
/**
2018-06-04 21:49:29 +02:00
* Description and activation class for module Ticket
2018-03-10 04:23:59 +01:00
*/
2018-06-04 21:49:29 +02:00
class modTicket extends DolibarrModules
2018-03-10 04:23:59 +01:00
{
2020-10-31 14:32:18 +01:00
/**
* Constructor . Define names , constants , directories , boxes , permissions
*
* @ param DoliDB $db Database handler
*/
public function __construct ( $db )
{
global $langs , $conf ;
2022-04-17 03:56:36 +02:00
$langs -> load ( " ticket " );
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$this -> db = $db ;
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
// Id for module (must be unique).
// Use a free id here
// (See in Home -> System information -> Dolibarr for list of used modules id).
$this -> numero = 56000 ;
// Key text used to identify module (for permissions, menus, etc...)
$this -> rights_class = 'ticket' ;
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this -> family = " crm " ;
// Module position in the family
$this -> module_position = '60' ;
// Module label (no space allowed)
// used if translation string 'ModuleXXXName' not found
// (where XXX is value of numeric property 'numero' of module)
$this -> name = preg_replace ( '/^mod/i' , '' , get_class ( $this ));
// Module description
// used if translation string 'ModuleXXXDesc' not found
// (where XXX is value of numeric property 'numero' of module)
$this -> description = " Incident/support ticket management " ;
// Possible values for version are: 'development', 'experimental' or version
$this -> version = 'dolibarr' ;
// Key used in llx_const table to save module status enabled/disabled
// (where MYMODULE is value of property name of module in uppercase)
$this -> const_name = 'MAIN_MODULE_' . strtoupper ( $this -> name );
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png
// use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png
// use this->picto='pictovalue@module'
$this -> picto = 'ticket' ; // mypicto@ticket
// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
// for default path (eg: /ticket/core/xxxxx) (0=disable, 1=enable)
// for specific path of parts (eg: /ticket/core/modules/barcode)
// for specific css file (eg: /ticket/css/ticket.css.php)
$this -> module_parts = array (
// Set this to 1 if module has its own trigger directory
'triggers' => 1 ,
);
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
// Data directories to create when module is enabled.
// Example: this->dirs = array("/ticket/temp");
$this -> dirs = array ();
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
// Config pages. Put here list of php pages
// stored into ticket/admin directory, used to setup module.
$this -> config_page_url = array ( " ticket.php " );
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
// Dependencies
$this -> hidden = false ; // A condition to hide module
2020-04-10 10:59:32 +02:00
$this -> depends = array ( 'modAgenda' ); // List of module class names as string that must be enabled if this module is enabled
$this -> requiredby = array (); // List of module ids to disable if this one is disabled
$this -> conflictwith = array (); // List of module class names as string this module is in conflict with
2022-09-27 20:48:47 +02:00
$this -> phpmin = array ( 7 , 0 ); // Minimum version of PHP required by module
2020-10-31 14:32:18 +01:00
$this -> langfiles = array ( " ticket " );
2019-06-19 12:53:28 +02:00
2020-10-31 14:32:18 +01:00
// Constants
// List of particular constants to add when module is enabled
// (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
// Example:
2022-09-30 12:31:29 +02:00
$default_footer = $langs -> trans ( 'TicketMessageMailFooterText' , getDolGlobalString ( 'MAIN_INFO_SOCIETE_NOM' ));
2020-10-31 14:32:18 +01:00
$this -> const = array (
1 => array ( 'TICKET_ENABLE_PUBLIC_INTERFACE' , 'chaine' , '0' , 'Enable ticket public interface' , 0 ),
2020-12-16 19:01:26 +01:00
2 => array ( 'TICKET_ADDON' , 'chaine' , 'mod_ticket_simple' , 'Ticket ref module' , 0 ),
2022-02-10 17:57:28 +01:00
3 => array ( 'TICKET_ADDON_PDF_ODT_PATH' , 'chaine' , 'DOL_DATA_ROOT/doctemplates/tickets' , 'Ticket templates ODT/ODS directory for templates' , 0 ),
2022-01-28 14:31:11 +01:00
4 => array ( 'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND' , 'chaine' , 0 , 'Automatically mark ticket as read when created from backend' , 0 ),
5 => array ( '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 ),
2022-02-08 16:32:02 +01:00
6 => array ( '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 ),
7 => array ( 'TICKET_NOTIFY_AT_CLOSING' , 'chaine' , '0' , 'Default notify contacts when closing a module' , 0 ),
2022-04-17 03:56:36 +02:00
8 => array ( 'TICKET_PRODUCT_CATEGORY' , 'chaine' , 0 , 'The category of product that is being used for ticket accounting' , 0 ),
2022-05-01 21:04:16 +02:00
9 => array ( 'TICKET_NOTIFICATION_EMAIL_FROM' , 'chaine' , getDolGlobalString ( 'MAIN_MAIL_EMAIL_FROM' ), 'Email to use by default as sender for messages sent from Dolibarr' , 0 ),
2022-04-17 03:56:36 +02:00
10 => array ( 'TICKET_MESSAGE_MAIL_INTRO' , 'chaine' , $langs -> trans ( 'TicketMessageMailIntroText' ), 'Introduction text of ticket replies sent from Dolibarr' , 0 ),
2022-09-30 12:31:29 +02:00
11 => array ( 'TICKET_MESSAGE_MAIL_SIGNATURE' , 'chaine' , $default_footer , 'Signature to use by default for messages sent from Dolibarr' , 0 ),
2022-09-27 17:08:08 +02:00
12 => array ( 'MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER' , 'chaine' , " 1 " , 'Disable the rendering of headers in tickets' , 0 ),
2022-11-26 17:22:12 +01:00
13 => array ( 'MAIN_SECURITY_ENABLECAPTCHA_TICKET' , 'chaine' , getDolGlobalInt ( 'MAIN_SECURITY_ENABLECAPTCHA_TICKET' ), 'Enable captcha code by default' , 0 ),
14 => array ( 'TICKET_SHOW_COMPANY_LOGO' , 'chaine' , getDolGlobalInt ( 'TICKET_SHOW_COMPANY_LOGO' ), 'Enable logo header on ticket public page' , 0 )
2020-10-31 14:32:18 +01:00
);
2018-03-10 04:23:59 +01:00
2020-12-16 19:01:26 +01:00
2020-10-31 14:32:18 +01:00
$this -> tabs = array (
2022-09-15 16:55:52 +02:00
'thirdparty:+ticket:Tickets:ticket:$user->rights->ticket->read:/ticket/list.php?socid=__ID__' ,
2020-10-31 14:32:18 +01:00
);
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
// Dictionaries
if ( ! isset ( $conf -> ticket -> enabled )) {
$conf -> ticket = new stdClass ();
$conf -> ticket -> enabled = 0 ;
}
$this -> dictionaries = array (
'langs' => 'ticket' ,
2021-07-30 01:10:15 +02:00
'tabname' => array (
2022-05-11 10:51:43 +02:00
" c_ticket_type " ,
" c_ticket_severity " ,
" c_ticket_category " ,
" c_ticket_resolution "
2021-07-30 01:10:15 +02:00
),
'tablib' => array (
" TicketDictType " ,
" TicketDictSeverity " ,
" TicketDictCategory " ,
" TicketDictResolution "
),
2020-10-31 14:32:18 +01:00
'tabsql' => array (
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_type as f' ,
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_severity as f' ,
2021-07-07 18:30:10 +02:00
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent FROM ' . MAIN_DB_PREFIX . 'c_ticket_category as f' ,
2020-10-31 14:32:18 +01:00
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM ' . MAIN_DB_PREFIX . 'c_ticket_resolution as f'
),
'tabsqlsort' => array ( " pos ASC " , " pos ASC " , " pos ASC " , " pos ASC " ),
2021-07-07 18:30:10 +02:00
'tabfield' => array ( " code,label,pos,use_default " , " code,label,pos,use_default " , " code,label,pos,use_default,public,fk_parent " , " code,label,pos,use_default " ),
'tabfieldvalue' => array ( " code,label,pos,use_default " , " code,label,pos,use_default " , " code,label,pos,use_default,public,fk_parent " , " code,label,pos,use_default " ),
'tabfieldinsert' => array ( " code,label,pos,use_default " , " code,label,pos,use_default " , " code,label,pos,use_default,public,fk_parent " , " code,label,pos,use_default " ),
2020-10-31 14:32:18 +01:00
'tabrowid' => array ( " rowid " , " rowid " , " rowid " , " rowid " ),
2021-07-30 01:10:15 +02:00
'tabcond' => array ( $conf -> ticket -> enabled , $conf -> ticket -> enabled , $conf -> ticket -> enabled , $conf -> ticket -> enabled && ! empty ( $conf -> global -> TICKET_ENABLE_RESOLUTION )),
2021-03-24 12:13:23 +01:00
'tabhelp' => array (
array ( 'code' => $langs -> trans ( " EnterAnyCode " ), 'use_default' => $langs -> trans ( " Enter0or1 " )),
array ( 'code' => $langs -> trans ( " EnterAnyCode " ), 'use_default' => $langs -> trans ( " Enter0or1 " )),
2021-07-07 18:30:10 +02:00
array ( 'code' => $langs -> trans ( " EnterAnyCode " ), 'use_default' => $langs -> trans ( " Enter0or1 " ), 'public' => $langs -> trans ( " Enter0or1 " ) . '<br>' . $langs -> trans ( " TicketGroupIsPublicDesc " ), 'fk_parent' => $langs -> trans ( " IfThisCategoryIsChildOfAnother " )),
2021-03-24 12:13:23 +01:00
array ( 'code' => $langs -> trans ( " EnterAnyCode " ), 'use_default' => $langs -> trans ( " Enter0or1 " ))
),
2020-10-31 14:32:18 +01:00
);
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
// Boxes
// Add here list of php file(s) stored in core/boxes that contains class to show a box.
2020-12-07 11:42:35 +01:00
$this -> boxes = array (
0 => array ( 'file' => 'box_last_ticket.php' , 'enabledbydefaulton' => 'Home' ),
2021-03-08 12:18:55 +01:00
1 => array ( 'file' => 'box_last_modified_ticket.php' , 'enabledbydefaulton' => 'Home' ),
2 => array ( 'file' => 'box_ticket_by_severity.php' , 'enabledbydefaulton' => 'ticketindex' ),
2022-05-09 18:46:23 +02:00
3 => array ( 'file' => 'box_graph_nb_ticket_last_x_days.php' , 'enabledbydefaulton' => 'ticketindex' ),
4 => array ( 'file' => 'box_graph_nb_tickets_type.php' , 'enabledbydefaulton' => 'ticketindex' ),
2021-03-08 15:26:35 +01:00
5 => array ( 'file' => 'box_new_vs_close_ticket.php' , 'enabledbydefaulton' => 'ticketindex' )
2020-12-07 11:42:35 +01:00
); // Boxes list
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
// Permissions
$this -> rights = array (); // Permission array used by this module
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$r = 0 ;
$this -> rights [ $r ][ 0 ] = 56001 ; // id de la permission
$this -> rights [ $r ][ 1 ] = " Read ticket " ; // libelle de la permission
$this -> rights [ $r ][ 2 ] = 'r' ; // type de la permission (deprecie a ce jour)
$this -> rights [ $r ][ 3 ] = 0 ; // La permission est-elle une permission par defaut
$this -> rights [ $r ][ 4 ] = 'read' ;
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 56002 ; // id de la permission
$this -> rights [ $r ][ 1 ] = " Create les tickets " ; // libelle de la permission
$this -> rights [ $r ][ 2 ] = 'w' ; // type de la permission (deprecie a ce jour)
$this -> rights [ $r ][ 3 ] = 0 ; // La permission est-elle une permission par defaut
$this -> rights [ $r ][ 4 ] = 'write' ;
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 56003 ; // id de la permission
$this -> rights [ $r ][ 1 ] = " Delete les tickets " ; // libelle de la permission
$this -> rights [ $r ][ 2 ] = 'd' ; // type de la permission (deprecie a ce jour)
$this -> rights [ $r ][ 3 ] = 0 ; // La permission est-elle une permission par defaut
$this -> rights [ $r ][ 4 ] = 'delete' ;
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 56004 ; // id de la permission
$this -> rights [ $r ][ 1 ] = " Manage tickets " ; // libelle de la permission
//$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this -> rights [ $r ][ 3 ] = 0 ; // La permission est-elle une permission par defaut
$this -> rights [ $r ][ 4 ] = 'manage' ;
2018-03-10 04:23:59 +01:00
2021-02-02 00:19:41 +01:00
/* Seems not used and in conflict with societe -> client -> voir ( see all thirdparties )
2020-10-31 14:32:18 +01:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 56005 ; // id de la permission
$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)' ; // libelle de la permission
$this -> rights [ $r ][ 2 ] = 'r' ; // type de la permission (deprecie a ce jour)
$this -> rights [ $r ][ 3 ] = 0 ; // La permission est-elle une permission par defaut
$this -> rights [ $r ][ 4 ] = 'view' ;
$this -> rights [ $r ][ 5 ] = 'all' ;
2021-02-02 00:19:41 +01:00
*/
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
// Main menu entries
$this -> menus = array (); // List of menus to add
$r = 0 ;
2018-03-10 04:23:59 +01:00
2021-06-26 15:39:52 +02:00
/* $this -> menu [ $r ] = array ( 'fk_menu' => 0 , // Put 0 if this is a top menu
2020-10-31 14:32:18 +01:00
'type' => 'top' , // This is a Top menu entry
'titre' => 'Ticket' ,
2021-03-13 18:56:02 +01:00
'prefix' => img_picto ( '' , $this -> picto , 'class="paddingright pictofixedwidth em092"' ),
2020-10-31 14:32:18 +01:00
'mainmenu' => 'ticket' ,
'leftmenu' => '1' , // Use 1 if you also want to add left menu entries using this descriptor.
'url' => '/ticket/index.php' ,
'langs' => 'ticket' , // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position' => 88 ,
2021-06-26 15:39:52 +02:00
'enabled' => '$conf->ticket->enabled' ,
2020-10-31 14:32:18 +01:00
'perms' => '$user->rights->ticket->read' , // Use 'perms'=>'$user->rights->ticket->level1->level2' if you want your menu with a permission rules
'target' => '' ,
'user' => 2 ); // 0=Menu for internal users, 1=external users, 2=both
2021-06-26 15:39:52 +02:00
$r ++ ; */
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$this -> menu [ $r ] = array ( 'fk_menu' => 'fk_mainmenu=ticket' ,
'type' => 'left' ,
'titre' => 'Ticket' ,
2021-02-15 20:13:38 +01:00
'prefix' => img_picto ( '' , $this -> picto , 'class="paddingright pictofixedwidth em092"' ),
2020-10-31 14:32:18 +01:00
'mainmenu' => 'ticket' ,
'leftmenu' => 'ticket' ,
'url' => '/ticket/index.php' ,
'langs' => 'ticket' ,
'position' => 101 ,
'enabled' => '$conf->ticket->enabled' ,
'perms' => '$user->rights->ticket->read' ,
'target' => '' ,
'user' => 2 );
$r ++ ;
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$this -> menu [ $r ] = array ( 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket' ,
'type' => 'left' ,
'titre' => 'NewTicket' ,
'mainmenu' => 'ticket' ,
'url' => '/ticket/card.php?action=create' ,
'langs' => 'ticket' ,
'position' => 102 ,
'enabled' => '$conf->ticket->enabled' ,
'perms' => '$user->rights->ticket->write' ,
'target' => '' ,
'user' => 2 );
$r ++ ;
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$this -> menu [ $r ] = array ( 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket' ,
'type' => 'left' ,
'titre' => 'List' ,
'mainmenu' => 'ticket' ,
'leftmenu' => 'ticketlist' ,
'url' => '/ticket/list.php?search_fk_status=non_closed' ,
'langs' => 'ticket' ,
'position' => 103 ,
'enabled' => '$conf->ticket->enabled' ,
'perms' => '$user->rights->ticket->read' ,
'target' => '' ,
'user' => 2 );
$r ++ ;
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$this -> menu [ $r ] = array ( 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket' ,
'type' => 'left' ,
'titre' => 'MenuTicketMyAssign' ,
'mainmenu' => 'ticket' ,
'leftmenu' => 'ticketmy' ,
'url' => '/ticket/list.php?mode=mine&search_fk_status=non_closed' ,
'langs' => 'ticket' ,
'position' => 105 ,
'enabled' => '$conf->ticket->enabled' ,
'perms' => '$user->rights->ticket->read' ,
'target' => '' ,
'user' => 0 );
$r ++ ;
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$this -> menu [ $r ] = array ( 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket' ,
'type' => 'left' ,
'titre' => 'Statistics' ,
'mainmenu' => 'ticket' ,
'url' => '/ticket/stats/index.php' ,
'langs' => 'ticket' ,
'position' => 107 ,
'enabled' => '$conf->ticket->enabled' ,
'perms' => '$user->rights->ticket->read' ,
'target' => '' ,
'user' => 0 );
$r ++ ;
2021-07-02 10:26:03 +02:00
$this -> menu [ $r ] = array ( 'fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket' ,
'type' => 'left' ,
'titre' => 'Categories' ,
'mainmenu' => 'ticket' ,
'url' => '/categories/index.php?type=12' ,
'langs' => 'ticket' ,
'position' => 107 ,
'enabled' => '$conf->categorie->enabled' ,
'perms' => '$user->rights->ticket->read' ,
'target' => '' ,
'user' => 0 );
$r ++ ;
2020-10-31 14:32:18 +01:00
}
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
/**
* Function called when module is enabled .
* The init function add constants , boxes , permissions and menus ( defined in constructor ) into Dolibarr database .
* It also creates data directories
*
* @ param string $options Options when enabling module ( '' , 'noboxes' )
* @ return int 1 if OK , 0 if KO
*/
public function init ( $options = '' )
{
2020-12-16 19:01:26 +01:00
global $conf , $langs ;
2022-05-08 15:18:34 +02:00
$result = $this -> _load_tables ( '/install/mysql/' , 'ticket' );
2022-02-17 19:30:18 +01:00
if ( $result < 0 ) {
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')
}
2020-12-16 19:01:26 +01:00
// Permissions
$this -> remove ( $options );
//ODT template
$src = DOL_DOCUMENT_ROOT . '/install/doctemplates/tickets/template_ticket.odt' ;
$dirodt = DOL_DATA_ROOT . '/doctemplates/tickets' ;
$dest = $dirodt . '/template_order.odt' ;
2021-02-23 22:03:23 +01:00
if ( file_exists ( $src ) && ! file_exists ( $dest )) {
2020-12-16 19:01:26 +01:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php' ;
dol_mkdir ( $dirodt );
$result = dol_copy ( $src , $dest , 0 , 0 );
2021-02-23 22:03:23 +01:00
if ( $result < 0 ) {
2020-12-16 19:01:26 +01:00
$langs -> load ( " errors " );
$this -> error = $langs -> trans ( 'ErrorFailToCopyFile' , $src , $dest );
return 0 ;
}
}
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
$sql = array (
array ( " sql " => " insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110120, 'ticket', 'internal', 'SUPPORTTEC', 'Utilisateur assigné au ticket', 1); " , " ignoreerror " => 1 ),
array ( " sql " => " insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110121, 'ticket', 'internal', 'CONTRIBUTOR', 'Intervenant', 1); " , " ignoreerror " => 1 ),
array ( " sql " => " insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110122, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1); " , " ignoreerror " => 1 ),
array ( " sql " => " insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110123, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1); " , " ignoreerror " => 1 ),
2021-08-27 22:42:04 +02:00
" DELETE FROM " . MAIN_DB_PREFIX . " document_model WHERE nom = 'TICKET_ADDON_PDF_ODT_PATH' AND type = 'ticket' AND entity = " . (( int ) $conf -> entity ),
" INSERT INTO " . MAIN_DB_PREFIX . " document_model (nom, type, entity) VALUES('TICKET_ADDON_PDF_ODT_PATH','ticket', " . (( int ) $conf -> entity ) . " ) "
2020-10-31 14:32:18 +01:00
);
2018-03-10 04:23:59 +01:00
2020-10-31 14:32:18 +01:00
return $this -> _init ( $sql , $options );
}
2018-03-10 04:23:59 +01:00
}