25require_once DOL_DOCUMENT_ROOT.
'/core/modules/ticket/modules_ticket.php';
36 public $version =
'dolibarr';
48 public $nom =
'Universal';
53 public $name =
'Universal';
61 public function info($langs)
66 $langs->loadLangs(array(
"ticket",
"admin"));
68 $form =
new Form($db);
70 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
71 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
72 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
73 $texte .=
'<input type="hidden" name="action" value="updateMask">';
74 $texte .=
'<input type="hidden" name="maskconstticket" value="TICKET_UNIVERSAL_MASK">';
75 $texte .=
'<table class="nobordernopadding" width="100%">';
77 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"Ticket"), $langs->transnoentities(
"Ticket"));
78 $tooltip .= $langs->trans(
"GenericMaskCodes2");
79 $tooltip .= $langs->trans(
"GenericMaskCodes3");
80 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"Ticket"), $langs->transnoentities(
"Ticket"));
81 $tooltip .= $langs->trans(
"GenericMaskCodes5");
85 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
86 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskticket" value="'.
getDolGlobalString(
"TICKET_UNIVERSAL_MASK").
'">', $tooltip, 1, 1).
'</td>';
88 $texte .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans(
"Modify").
'"></td>';
105 global $conf, $langs, $mysoc;
107 $old_code_client = $mysoc->code_client;
108 $mysoc->code_client =
'CCCCCCCCCC';
110 $mysoc->code_client = $old_code_client;
113 $numExample = $langs->trans(
'NotConfigured');
129 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
135 $this->error =
'NotConfigured';
140 $entity =
getEntity(
'ticketnumber', 1, $ticket);
142 $date = empty($ticket->datec) ?
dol_now() : $ticket->datec;
143 $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 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)
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.