24 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
65 public function info($langs)
67 $langs->load(
"bills");
68 return $langs->trans(
"NoDescription");
78 return empty($this->
name) ? get_class($this) : $this->name;
88 $langs->load(
"bills");
89 return $langs->trans(
"NoExample");
102 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
112 $langs->load(
"admin");
114 if ($this->version ==
'development') {
115 return $langs->trans(
"VersionDevelopment");
117 if ($this->version ==
'experimental') {
118 return $langs->trans(
"VersionExperimental");
120 if ($this->version ==
'dolibarr') {
123 if ($this->version) {
124 return $this->version;
126 return $langs->trans(
"NotAvailable");
141 $langs->loadLangs(array(
"admin",
"companies"));
144 $s .= $langs->trans(
"Name").
': <b>'.$this->
name.
'</b><br>';
145 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
147 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getNom($langs).
'</b><br>';
150 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
152 $s .= $langs->trans(
"RequiredIfProduct").
': ';
153 if (!empty($conf->global->MAIN_BARCODE_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
156 $s .=
yn(!$this->code_null, 1, 2);
157 if (!empty($conf->global->MAIN_BARCODE_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
158 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
163 $s .= $langs->trans(
"RequiredIfService").
': ';
164 if (!empty($conf->global->MAIN_BARCODE_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
167 $s .=
yn(!$this->code_null, 1, 2);
168 if (!empty($conf->global->MAIN_BARCODE_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
169 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
174 $s .= $langs->trans(
"Required").
': ';
175 if (!empty($conf->global->MAIN_BARCODE_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
178 $s .=
yn(!$this->code_null, 1, 2);
179 if (!empty($conf->global->MAIN_BARCODE_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
180 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
189 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
193 if (empty($nextval)) {
194 $nextval = $langs->trans(
"Undefined");
196 $s .= $langs->trans(
"NextValue").
': <b>'.$nextval.
'</b><br>';
Parent class for barcode document models.
isEnabled()
Return if a model can be used or not.
Parent class for barcode numbering models.
getVersion()
Return version of module.
getExample($langs)
Return a numbering example.
info($langs)
Return default description of numbering model.
getToolTip($langs, $soc, $type)
Return description of module parameters.
getNextValue($objproduct, $type='')
Return next value available.
getNom($langs)
Return model name.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
$conf db name
Only used if Module[ID]Name translation string is not found.