26require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
59 abstract public function info($langs);
72 public function writeBarCode($code, $encoding, $readable =
'Y', $scale = 1, $nooutputiferror = 0)
87 public function buildBarCode($code, $encoding, $readable =
'Y', $scale = 1, $nooutputiferror = 0)
126 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
150 $langs->loadLangs(array(
"admin",
"companies"));
153 $s .= $langs->trans(
"Name").
': <b>'.$this->
name.
'</b><br>';
154 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
156 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getName($langs).
'</b><br>';
159 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
161 $s .= $langs->trans(
"RequiredIfProduct").
': ';
162 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
165 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
166 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
167 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
172 $s .= $langs->trans(
"RequiredIfService").
': ';
173 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
176 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
177 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
178 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
183 $s .= $langs->trans(
"Required").
': ';
184 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
187 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
188 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
189 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
198 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
202 if (empty($nextval)) {
203 $nextval = $langs->trans(
"Undefined");
205 $s .= $langs->trans(
"NextValue").
': <b>'.$nextval.
'</b><br>';
226 abstract public function verif($db, &$code,
$object, $thirdparty_type, $type);
if(! $sortfield) if(! $sortorder) $object
Parent class for number ref generators.
getVersion()
Returns version of numbering module.
getName($langs)
Return model name.
isEnabled()
Return if a model can be used or not.
writeBarCode($code, $encoding, $readable='Y', $scale=1, $nooutputiferror=0)
Save an image file on disk (with no output)
buildBarCode($code, $encoding, $readable='Y', $scale=1, $nooutputiferror=0)
Return an image file on the fly (no need to write on disk) with the HTTP content-type of image.
info($langs)
Return description.
encodingIsSupported($encoding)
Return true if encoding is supported.
verif($db, &$code, $object, $thirdparty_type, $type)
Check validity of code according to its rules.
getToolTip($langs, $soc, $type)
Return description of module parameters.
getNextValue($objcommon=null, $type='')
Return next value available.
getExample($langs=null, $object=null)
Return an example of result returned by getNextValue.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
$conf db name
Only used if Module[ID]Name translation string is not found.