43 public $version =
'dolibarr';
53 public $name =
'advanced';
58 public $position = 60;
67 public function info($langs)
71 $langs->load(
"bills");
75 $text = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
76 $text .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
77 $text .=
'<input type="hidden" name="token" value="'.newToken().
'">';
78 $text .=
'<input type="hidden" name="action" value="updateMask">';
79 $text .=
'<input type="hidden" name="maskconst" value="MYMODULE_MYOBJECT_ADVANCED_MASK">';
80 $text .=
'<table class="nobordernopadding centpercent">';
82 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"MyObject"), $langs->transnoentities(
"MyObject"));
83 $tooltip .= $langs->trans(
"GenericMaskCodes1");
85 $tooltip .= $langs->trans(
"GenericMaskCodes2");
87 $tooltip .= $langs->trans(
"GenericMaskCodes3");
88 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"MyObject"), $langs->transnoentities(
"MyObject"));
89 $tooltip .= $langs->trans(
"GenericMaskCodes5");
90 $tooltip .=
'<br>'.$langs->trans(
"GenericMaskCodes5b");
93 $text .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
94 $text .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskvalue" value="'.
getDolGlobalString(
'MYMODULE_MYOBJECT_ADVANCED_MASK').
'">', $tooltip, 1,
'help').
'</td>';
95 $text .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'" name="Button"></td>';
127 $numExample = $langs->trans(
'NotConfigured');
142 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
148 $this->error =
'NotConfigured';
152 $date =
$object->date_creation;
154 $numFinal =
get_next_value(
$db, $mask,
'mymodule_myobject',
'ref',
'',
'', $date);
if(! $sortfield) if(! $sortorder) $object
Parent class to manage numbering of MyObject.
Class to manage the Advanced numbering rule for MyObject.
info($langs)
Returns the description of the numbering model.
getExample()
Return an example of numbering.
getNextValue($object)
Return next free value.
get_next_value($db, $mask, $table, $field, $where='', $objsoc='', $date='', $mode='next', $bentityon=true, $objuser=null, $forceentity=null, $objbookkeeping=null)
Return last or next value for a mask (according to area we should not reset)
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.