27require_once DOL_DOCUMENT_ROOT.
'/core/modules/ticket/modules_ticket.php';
38 public $version =
'dolibarr';
50 public $nom =
'Universal';
55 public $name =
'Universal';
63 public function info($langs)
68 $langs->loadLangs(array(
"ticket",
"admin"));
70 $form =
new Form($db);
72 $text = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
73 $text .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
74 $text .=
'<input type="hidden" name="token" value="'.newToken().
'">';
75 $text .=
'<input type="hidden" name="action" value="updateMask">';
76 $text .=
'<input type="hidden" name="maskconstticket" value="TICKET_UNIVERSAL_MASK">';
77 $text .=
'<table class="nobordernopadding" width="100%">';
79 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"Ticket"), $langs->transnoentities(
"Ticket"));
80 $tooltip .= $langs->trans(
"GenericMaskCodes1");
82 $tooltip .= $langs->trans(
"GenericMaskCodes2");
84 $tooltip .= $langs->trans(
"GenericMaskCodes3");
85 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"Ticket"), $langs->transnoentities(
"Ticket"));
86 $tooltip .= $langs->trans(
"GenericMaskCodes5");
90 $text .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
91 $text .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskticket" value="'.
getDolGlobalString(
"TICKET_UNIVERSAL_MASK").
'">', $tooltip, 1,
'help',
'valignmiddle', 0, 3, $this->
name).
'</td>';
93 $text .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans(
"Modify").
'"></td>';
112 require_once DOL_DOCUMENT_ROOT .
'/ticket/class/ticket.class.php';
113 require_once DOL_DOCUMENT_ROOT .
'/societe/class/societe.class.php';
115 $ticket =
new Ticket($db);
116 $ticket->initAsSpecimen();
117 $thirdparty =
new Societe($db);
118 $thirdparty->initAsSpecimen();
120 $numExample = $this->
getNextValue($thirdparty, $ticket);
123 $numExample = $langs->trans(
'NotConfigured');
140 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
146 $this->error = $langs->trans(
'NotConfigured');
151 $entity =
getEntity(
'ticketnumber', 1, $ticket);
153 $date = empty($ticket->datec) ?
dol_now() : $ticket->datec;
154 $numFinal =
get_next_value($db, $mask,
'ticket',
'ref',
'', $objsoc->code_client, $date,
'next',
false,
null, $entity);
Parent Class of the project reference numbering model classes.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage the numbering module Universal for Ticket references.
getNextValue($objsoc, $ticket)
Return next value.
getExample()
Return an example of numbering.
info($langs)
Returns the description of the numbering model.
get_next_value($db, $mask, $table, $field, $where='', $objsoc='', $date='', $mode='next', $bentityon=true, $objuser=null, $forceentity=null, $objbookkeeping=null)
Return last or next value for a mask (according to area we should not reset)
dol_now($mode='auto')
Return date for now.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
Class to generate the form for creating a new ticket.
$conf db name
Only used if Module[ID]Name translation string is not found.