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(
"GenericMaskCodes2");
81 $tooltip .= $langs->trans(
"GenericMaskCodes3");
82 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"Ticket"), $langs->transnoentities(
"Ticket"));
83 $tooltip .= $langs->trans(
"GenericMaskCodes5");
87 $text .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
88 $text .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskticket" value="'.
getDolGlobalString(
"TICKET_UNIVERSAL_MASK").
'">', $tooltip, 1, 1).
'</td>';
90 $text .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans(
"Modify").
'"></td>';
109 require_once DOL_DOCUMENT_ROOT .
'/ticket/class/ticket.class.php';
110 require_once DOL_DOCUMENT_ROOT .
'/societe/class/societe.class.php';
112 $ticket =
new Ticket($db);
113 $ticket->initAsSpecimen();
114 $thirdparty =
new Societe($db);
115 $thirdparty->initAsSpecimen();
117 $numExample = $this->
getNextValue($thirdparty, $ticket);
120 $numExample = $langs->trans(
'NotConfigured');
137 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
143 $this->error = $langs->trans(
'NotConfigured');
148 $entity =
getEntity(
'ticketnumber', 1, $ticket);
150 $date = empty($ticket->datec) ?
dol_now() : $ticket->datec;
151 $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)
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.