dolibarr 18.0.6
modules_reception.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 * or see https://www.gnu.org/
17 */
18
25 require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
26
31{
32 public $error = '';
33
34
35 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
43 public static function liste_modeles($db, $maxfilenamelength = 0)
44 {
45 // phpcs:enable
46 $type = 'reception';
47 $list = array();
48
49 include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
50 $list = getListOfModels($db, $type, $maxfilenamelength);
51
52 return $list;
53 }
54}
55
56
61{
62 public $error = '';
63
64 public $version;
65
66
72 public function isEnabled()
73 {
74 return true;
75 }
76
82 public function info()
83 {
84 global $langs;
85 $langs->load("reception");
86 return $langs->trans("NoDescription");
87 }
88
94 public function getExample()
95 {
96 global $langs;
97 $langs->load("reception");
98 return $langs->trans("NoExample");
99 }
100
106 public function canBeActivated()
107 {
108 return true;
109 }
110
118 public function getNextValue($objsoc, $reception)
119 {
120 global $langs;
121 return $langs->trans("NotAvailable");
122 }
123
129 public function getVersion()
130 {
131 global $langs;
132 $langs->load("admin");
133
134 if ($this->version == 'development') {
135 return $langs->trans("VersionDevelopment");
136 } elseif ($this->version == 'experimental') {
137 return $langs->trans("VersionExperimental");
138 } elseif ($this->version == 'dolibarr') {
139 return DOL_VERSION;
140 } elseif ($this->version) {
141 return $this->version;
142 }
143 return $langs->trans("NotAvailable");
144 }
145}
Parent class for documents generators.
Parent Class of numbering models of sending receipts references.
getExample()
Returns numbering example.
info()
Return default description of numbering model.
canBeActivated()
Test if existing numbers make problems with numbering.
getNextValue($objsoc, $reception)
Returns next value assigned.
getVersion()
Returns version of the numbering model.
isEnabled()
Return if a model can be used or not.
Parent class of sending receipts models.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.