27require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
44 public $version =
'dolibarr';
56 public $nom =
'Universal';
61 public $name =
'Universal';
70 public function info($langs)
75 $langs->loadLangs(array(
"projects",
"admin"));
77 $form =
new Form($this->db);
79 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
80 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
81 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
82 $texte .=
'<input type="hidden" name="action" value="updateMask">';
83 $texte .=
'<input type="hidden" name="maskconstproject" value="PROJECT_UNIVERSAL_MASK">';
84 $texte .=
'<table class="nobordernopadding" width="100%">';
86 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"Project"), $langs->transnoentities(
"Project"));
87 $tooltip .= $langs->trans(
"GenericMaskCodes2");
88 $tooltip .= $langs->trans(
"GenericMaskCodes3");
89 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"Project"), $langs->transnoentities(
"Project"));
90 $tooltip .= $langs->trans(
"GenericMaskCodes5");
91 $tooltip .=
'<br>'.$langs->trans(
"GenericMaskCodes5b");
94 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
95 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskproject" value="'.
getDolGlobalString(
'PROJECT_UNIVERSAL_MASK').
'">', $tooltip, 1, 1).
'</td>';
97 $texte .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans(
"Modify").
'"></td>';
101 $texte .=
'</table>';
116 require_once DOL_DOCUMENT_ROOT .
'/projet/class/project.class.php';
117 require_once DOL_DOCUMENT_ROOT .
'/societe/class/societe.class.php';
120 $project->initAsSpecimen();
121 $thirdparty =
new Societe($db);
122 $thirdparty->initAsSpecimen();
124 $numExample = $this->
getNextValue($thirdparty, $project);
127 $numExample = $langs->trans(
'NotConfigured');
144 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
150 $this->error = $langs->trans(
'NotConfigured');
155 $entity =
getEntity(
'projectnumber', 1, $project);
157 $date = (empty($project->date_c) ?
dol_now() : $project->date_c);
158 $numFinal =
get_next_value($db, $mask,
'projet',
'ref',
'', (is_object($objsoc) ? $objsoc :
''), $date,
'next',
false,
null, $entity);
Class parent for numbering modules of tasks.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage the numbering module Universal for project references.
getExample()
Return an example of numbering.
info($langs)
Returns the description of the numbering model.
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 a Dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.