dolibarr  18.0.0-alpha
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  $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 
60 abstract class ModelNumRefReception
61 {
62  public $error = '';
63 
68  public function isEnabled()
69  {
70  return true;
71  }
72 
78  public function info()
79  {
80  global $langs;
81  $langs->load("reception");
82  return $langs->trans("NoDescription");
83  }
84 
90  public function getExample()
91  {
92  global $langs;
93  $langs->load("reception");
94  return $langs->trans("NoExample");
95  }
96 
102  public function canBeActivated()
103  {
104  return true;
105  }
106 
114  public function getNextValue($objsoc, $reception)
115  {
116  global $langs;
117  return $langs->trans("NotAvailable");
118  }
119 
125  public function getVersion()
126  {
127  global $langs;
128  $langs->load("admin");
129 
130  if ($this->version == 'development') {
131  return $langs->trans("VersionDevelopment");
132  } elseif ($this->version == 'experimental') {
133  return $langs->trans("VersionExperimental");
134  } elseif ($this->version == 'dolibarr') {
135  return DOL_VERSION;
136  } elseif ($this->version) {
137  return $this->version;
138  }
139  return $langs->trans("NotAvailable");
140  }
141 }
ModelNumRefReception\info
info()
Return default description of numbering model.
Definition: modules_reception.php:78
ModelNumRefReception
Parent Class of numbering models of sending receipts references.
Definition: modules_reception.php:60
ModelNumRefReception\getVersion
getVersion()
Returns version of the numbering model.
Definition: modules_reception.php:125
ModelNumRefReception\isEnabled
isEnabled()
Return if a model can be used or not.
Definition: modules_reception.php:68
ModelNumRefReception\getNextValue
getNextValue($objsoc, $reception)
Returns next value assigned.
Definition: modules_reception.php:114
getListOfModels
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
Definition: functions2.lib.php:1925
ModelePdfReception
Parent class of sending receipts models.
Definition: modules_reception.php:30
ModelNumRefReception\canBeActivated
canBeActivated()
Test if existing numbers make problems with numbering.
Definition: modules_reception.php:102
ModelNumRefReception\getExample
getExample()
Returns numbering example.
Definition: modules_reception.php:90
CommonDocGenerator
Parent class for documents generators.
Definition: commondocgenerator.class.php:36
ModelePdfReception\liste_modeles
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Definition: modules_reception.php:43