26require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
60 abstract public function info($langs);
73 public function writeBarCode($code, $encoding, $readable =
'Y', $scale = 1, $nooutputiferror = 0)
88 public function buildBarCode($code, $encoding, $readable =
'Y', $scale = 1, $nooutputiferror = 0)
127 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
151 $langs->loadLangs(array(
"admin",
"companies"));
154 $s .= $langs->trans(
"Name").
': <b>'.$this->
name.
'</b><br>';
155 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
157 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getName($langs).
'</b><br>';
160 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
162 $s .= $langs->trans(
"RequiredIfProduct").
': ';
163 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
166 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
167 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
168 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
173 $s .= $langs->trans(
"RequiredIfService").
': ';
174 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
177 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
178 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
179 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
184 $s .= $langs->trans(
"Required").
': ';
185 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
188 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
189 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
190 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
199 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
203 if (empty($nextval)) {
204 $nextval = $langs->trans(
"Undefined");
206 $s .= $langs->trans(
"NextValue").
': <b>'.$nextval.
'</b><br>';
227 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.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
$conf db name
Only used if Module[ID]Name translation string is not found.