dolibarr  17.0.4
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 
30 abstract class ModelePdfReception extends CommonDocGenerator
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  global $conf;
47 
48  $type = 'reception';
49  $list = array();
50 
51  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
52  $list = getListOfModels($db, $type, $maxfilenamelength);
53 
54  return $list;
55  }
56 }
57 
58 
62 abstract class ModelNumRefReception
63 {
64  public $error = '';
65 
70  public function isEnabled()
71  {
72  return true;
73  }
74 
80  public function info()
81  {
82  global $langs;
83  $langs->load("reception");
84  return $langs->trans("NoDescription");
85  }
86 
92  public function getExample()
93  {
94  global $langs;
95  $langs->load("reception");
96  return $langs->trans("NoExample");
97  }
98 
104  public function canBeActivated()
105  {
106  return true;
107  }
108 
116  public function getNextValue($objsoc, $reception)
117  {
118  global $langs;
119  return $langs->trans("NotAvailable");
120  }
121 
127  public function getVersion()
128  {
129  global $langs;
130  $langs->load("admin");
131 
132  if ($this->version == 'development') {
133  return $langs->trans("VersionDevelopment");
134  } elseif ($this->version == 'experimental') {
135  return $langs->trans("VersionExperimental");
136  } elseif ($this->version == 'dolibarr') {
137  return DOL_VERSION;
138  } elseif ($this->version) {
139  return $this->version;
140  }
141  return $langs->trans("NotAvailable");
142  }
143 }
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.