29 require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
91 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
114 $langs->load(
"bills");
115 return $langs->trans(
"NoDescription");
125 return empty($this->
name) ? $this->nom : $this->name;
136 return $langs->trans(
"NoExample");
160 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
171 $langs->load(
"admin");
173 if ($this->version ==
'development') {
174 return $langs->trans(
"VersionDevelopment");
176 if ($this->version ==
'experimental') {
177 return $langs->trans(
"VersionExperimental");
179 if ($this->version ==
'dolibarr') {
182 if ($this->version) {
183 return $this->version;
185 return $langs->trans(
"NotAvailable");
202 $resql = $dbs->query($sql);
204 $num = $dbs->num_rows($resql);
207 $row = $dbs->fetch_row($resql);
208 $list[$row[0]] = $row[1];
229 $langs->loadLangs(array(
"admin",
"companies"));
233 if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
234 $strikestart =
'<strike>';
235 $strikeend =
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
239 $s .= $langs->trans(
"Name").
': <b>'.$this->
getNom($langs).
'</b><br>';
240 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
241 } elseif ($type == 0) {
242 $s .= $langs->trans(
"ProductCodeDesc").
'<br>';
243 } elseif ($type == 1) {
244 $s .= $langs->trans(
"ServiceCodeDesc").
'<br>';
247 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getNom($langs).
'</b><br>';
250 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
252 $s .= $langs->trans(
"RequiredIfProduct").
': '.$strikestart;
253 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
255 } elseif ($type == 1) {
256 $s .= $langs->trans(
"RequiredIfService").
': '.$strikestart;
257 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
259 } elseif ($type == -1) {
260 $s .= $langs->trans(
"Required").
': '.$strikestart;
261 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
264 $s .= $langs->trans(
"CanBeModifiedIfOk").
': ';
265 $s .=
yn($this->code_modifiable, 1, 2);
267 $s .= $langs->trans(
"CanBeModifiedIfKo").
': '.
yn($this->code_modifiable_invalide, 1, 2).
'<br>';
268 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
270 if ($type == 0 || $type == -1) {
272 if (empty($nextval)) {
273 $nextval = $langs->trans(
"Undefined");
275 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Product").
')' :
'').
': <b>'.$nextval.
'</b><br>';
277 if ($type == 1 || $type == -1) {
279 if (empty($nextval)) {
280 $nextval = $langs->trans(
"Undefined");
282 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Service").
')' :
'').
': <b>'.$nextval.
'</b>';
Parent class for documents generators.
Parent class to manage intervention document templates.
static liste_modeles($dbs, $maxfilenamelength=0)
Return list of active generation modules.
Class template for classes of numbering product.
getNom($langs)
Renvoi nom module.
info($langs)
Returns the default description of the numbering pattern.
verif_prefixIsUsed()
Check if mask/numbering use prefix.
getNextValue($objproduct=0, $type=-1)
Return next value available.
getToolTip($langs, $product, $type)
Return description of module parameters.
getExample($langs)
Return an example of numbering.
static liste_modeles($dbs, $maxfilenamelength=0)
Renvoi la liste des modeles de numérotation.
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
getVersion()
Return version of module.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
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.