25require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
42 public $version =
'dolibarr';
54 public $nom =
'Universal';
59 public $name =
'Universal';
72 $langs->loadLangs(array(
"projects",
"admin"));
74 $form =
new Form($this->db);
76 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
77 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
78 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
79 $texte .=
'<input type="hidden" name="action" value="updateMask">';
80 $texte .=
'<input type="hidden" name="maskconstproject" value="PROJECT_UNIVERSAL_MASK">';
81 $texte .=
'<table class="nobordernopadding" width="100%">';
83 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"Project"), $langs->transnoentities(
"Project"));
84 $tooltip .= $langs->trans(
"GenericMaskCodes2");
85 $tooltip .= $langs->trans(
"GenericMaskCodes3");
86 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"Project"), $langs->transnoentities(
"Project"));
87 $tooltip .= $langs->trans(
"GenericMaskCodes5");
90 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
91 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskproject" value="'.
getDolGlobalString(
'PROJECT_UNIVERSAL_MASK').
'">', $tooltip, 1, 1).
'</td>';
93 $texte .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans(
"Modify").
'"></td>';
110 global $conf, $langs, $mysoc;
112 $old_code_client = $mysoc->code_client;
113 $mysoc->code_client =
'CCCCCCCCCC';
115 $mysoc->code_client = $old_code_client;
118 $numExample = $langs->trans(
'NotConfigured');
134 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
140 $this->error =
'NotConfigured';
145 $entity =
getEntity(
'projectnumber', 1, $project);
147 $date = (empty($project->date_c) ?
dol_now() : $project->date_c);
148 $numFinal =
get_next_value($db, $mask,
'projet',
'ref',
'', (is_object($objsoc) ? $objsoc :
''), $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.
info()
Returns the description of the numbering model.
getExample()
Return an example of numbering.
project_get_num($objsoc=0, $project='')
Return next reference not yet used as a reference.
getNextValue($objsoc, $project)
Return next value.
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.