25require_once DOL_DOCUMENT_ROOT.
'/core/modules/ticket/modules_ticket.php';
36 public $version =
'dolibarr';
48 public $nom =
'Universal';
53 public $name =
'Universal';
62 global $db, $conf, $langs;
65 $langs->loadLangs(array(
"ticket",
"admin"));
67 $form =
new Form($db);
69 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
70 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
71 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
72 $texte .=
'<input type="hidden" name="action" value="updateMask">';
73 $texte .=
'<input type="hidden" name="maskconstticket" value="TICKET_UNIVERSAL_MASK">';
74 $texte .=
'<table class="nobordernopadding" width="100%">';
76 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"Ticket"), $langs->transnoentities(
"Ticket"));
77 $tooltip .= $langs->trans(
"GenericMaskCodes2");
78 $tooltip .= $langs->trans(
"GenericMaskCodes3");
79 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"Ticket"), $langs->transnoentities(
"Ticket"));
80 $tooltip .= $langs->trans(
"GenericMaskCodes5");
83 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
84 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskticket" value="'.
getDolGlobalString(
"TICKET_UNIVERSAL_MASK").
'">', $tooltip, 1, 1).
'</td>';
86 $texte .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans(
"Modify").
'"></td>';
103 global $conf, $langs, $mysoc;
105 $old_code_client = $mysoc->code_client;
106 $mysoc->code_client =
'CCCCCCCCCC';
108 $mysoc->code_client = $old_code_client;
111 $numExample = $langs->trans(
'NotConfigured');
127 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
133 $this->error =
'NotConfigured';
138 $entity =
getEntity(
'ticketnumber', 1, $ticket);
140 $date = empty($ticket->datec) ?
dol_now() : $ticket->datec;
141 $numFinal =
get_next_value($db, $mask,
'ticket',
'ref',
'', $objsoc->code_client, $date,
'next',
false,
null, $entity);
Classe mere des modeles de numerotation des references de projets.
Classe du modele de numerotation de reference de projet Universal.
getNextValue($objsoc, $ticket)
Return next value.
getExample()
Return an example of numbering.
info()
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)
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 dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.