class FormTicket (View source)

Class to generate the form for creating a new ticket.

Usage: $formticket = new FormTicket($db) $formticket->proprietes = 1 or string or array of values $formticket->show_form() shows the form

Properties

DoliDB $db
string $track_id
string $trackid
int $fk_user_create
string $message
string $topic_title
string $action
int<0, 1> $withtopic
int<0, 1> $withemail
int<0, 1> $withsubstit
int<0, 2> $withfile
int<0, 1> $withfilereadonly
string $backtopage
int<0, 1> $ispublic
int<0, 1> $withtitletopic
int<0, 1> $withtopicreadonly
int<0, 1> $withreadid
int<0, 1> $withcompany
int<0, 1> $withfromsocid
int<0, 1> $withfromcontactid
int<0, 1> $withnotifytiersatcreate
int<0, 1> $withusercreate
int<0, 1> $withcreatereadonly
int<0, 1> $withextrafields
int<0, 1> $withref
int<0, 1> $withcancel
string $type_code
string $category_code
string $severity_code
array<string, string> $substit
array<string, mixed|array> $param
string $error
string[] $errors

Methods

__construct(DoliDB $db)

Constructor

static void
checkRequiredFields(array $fields, int $errors)

Check required fields

void
showForm(int $withdolfichehead = 0, "create"|"edit" $mode = 'edit', int<0, 1> $public = 0, Contact $with_contact = null, string $action = '', Ticket $object = null)

Show the form to input ticket

selectTypesTickets($selected = '', string $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $multiselect = 0)

Return html list of tickets type

selectGroupTickets($selected = '', string $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0, $outputlangs = null)

Return html list of ticket analytic codes

selectSeveritiesTickets($selected = '', string $htmlname = 'ticketseverity', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '')

Return html list of ticket severitys (priorities)

void
clear_attached_files()

Clear list of attached files in send mail form (also stored in session)

void
showMessageForm(string $width = '40%')

Show the form to add message on ticket

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db

Database handler

static void checkRequiredFields(array $fields, int $errors)

Check required fields

Parameters

array $fields

Array of fields to check

int $errors

Reference of errors variable

Return Value

void

void showForm(int $withdolfichehead = 0, "create"|"edit" $mode = 'edit', int<0, 1> $public = 0, Contact $with_contact = null, string $action = '', Ticket $object = null)

Show the form to input ticket

Parameters

int $withdolfichehead

With dol_get_fiche_head() and dol_get_fiche_end()

"create"|"edit" $mode

Mode ('create' or 'edit')

int<0, 1> $public

1=If we show the form for the public interface

Contact $with_contact

[=NULL] Contact to link to this ticket if it exists

string $action

[=''] Action in card

Ticket $object

[=NULL] Ticket object

Return Value

void

selectTypesTickets($selected = '', string $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $multiselect = 0)

Return html list of tickets type

@param string|int[] $selected Id of preselected field or array of Ids

Parameters

$selected
string $htmlname

Nom de la zone select @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code @param int|string $empty 1 = can be empty or 'string' to show the string as the empty value, 0 = can't be empty, 'ifone' = can be empty but autoselected if there is one only @param int $noadmininfo 0=Add admin info, 1=Disable admin info @param int $maxlength Max length of label @param string $morecss More CSS @param int $multiselect Is multiselect ? @return void

$filtertype
$format
$empty
$noadmininfo
$maxlength
$morecss
$multiselect

selectGroupTickets($selected = '', string $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0, $outputlangs = null)

Return html list of ticket analytic codes

@param string $selected Id pre-selected category

Parameters

$selected
string $htmlname

Name of select component @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users. @param int $format 0 = id+label, 1 = code+code, 2 = code+label, 3 = id+code @param int|string $empty 1 = can be empty or 'string' to show the string as the empty value, 0 = can't be empty, 'ifone' = can be empty but autoselected if there is one only @param int $noadmininfo 0 = ddd admin info, 1 = disable admin info @param int $maxlength Max length of label @param string $morecss More CSS @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes. @param Translate $outputlangs Output language @return string|void String of HTML component

$filtertype
$format
$empty
$noadmininfo
$maxlength
$morecss
$use_multilevel
$outputlangs

selectSeveritiesTickets($selected = '', string $htmlname = 'ticketseverity', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '')

Return html list of ticket severitys (priorities)

@param string $selected Id severity pre-selected

Parameters

$selected
string $htmlname

Name of the select area @param string $filtertype To filter on field type in llx_c_ticket_severity (array('code'=>xx,'label'=>zz)) @param int $format 0 = id+label, 1 = code+code, 2 = code+label, 3 = id+code @param int|string $empty 1 = can be empty or 'string' to show the string as the empty value, 0 = can't be empty, 'ifone' = can be empty but autoselected if there is one only @param int $noadmininfo 0 = add admin info, 1 = disable admin info @param int $maxlength Max length of label @param string $morecss More CSS @return void

$filtertype
$format
$empty
$noadmininfo
$maxlength
$morecss

void clear_attached_files()

Clear list of attached files in send mail form (also stored in session)

Return Value

void

void showMessageForm(string $width = '40%')

Show the form to add message on ticket

Parameters

string $width

Width of form

Return Value

void