dolibarr  18.0.0
modules_ticket.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@inodbox.com>
3  * Copyright (C) 2014 Marcos GarcĂ­a <marcosgdf@gmail.com>
4  * Copyright (C) 2020 Charlene Benke <charlie@patas-monkey.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  * or see https://www.gnu.org/
19  */
20 
28 require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
29 
33 abstract class ModelePDFTicket extends CommonDocGenerator
34 {
35 
36  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
44  public static function liste_modeles($db, $maxfilenamelength = 0)
45  {
46  // phpcs:enable
47  $type = 'ticket';
48  $list = array();
49 
50  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
51  $list = getListOfModels($db, $type, $maxfilenamelength);
52 
53  return $list;
54  }
55 }
56 
57 
61 abstract class ModeleNumRefTicket
62 {
66  public $error = '';
67 
68  public $version;
69 
70 
76  public function isEnabled()
77  {
78  return true;
79  }
80 
86  public function info()
87  {
88  global $langs;
89  $langs->load("ticket");
90  return $langs->trans("NoDescription");
91  }
92 
98  public function getExample()
99  {
100  global $langs;
101  $langs->load("ticket");
102  return $langs->trans("NoExample");
103  }
104 
111  public function canBeActivated()
112  {
113  return true;
114  }
115 
123  public function getNextValue($objsoc, $ticket)
124  {
125  global $langs;
126  return $langs->trans("NotAvailable");
127  }
128 
134  public function getVersion()
135  {
136  global $langs;
137  $langs->load("admin");
138 
139  if ($this->version == 'development') {
140  return $langs->trans("VersionDevelopment");
141  }
142 
143  if ($this->version == 'experimental') {
144  return $langs->trans("VersionExperimental");
145  }
146 
147  if ($this->version == 'dolibarr') {
148  return DOL_VERSION;
149  }
150 
151  if ($this->version) {
152  return $this->version;
153  }
154 
155  return $langs->trans("NotAvailable");
156  }
157 }
ModeleNumRefTicket\getExample
getExample()
Return an example of numbering.
Definition: modules_ticket.php:98
ModeleNumRefTicket
Classe mere des modeles de numerotation des references de projets.
Definition: modules_ticket.php:61
ModelePDFTicket\liste_modeles
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Definition: modules_ticket.php:44
ModeleNumRefTicket\getNextValue
getNextValue($objsoc, $ticket)
Renvoi prochaine valeur attribuee.
Definition: modules_ticket.php:123
ModeleNumRefTicket\info
info()
Returns the default description of the numbering pattern.
Definition: modules_ticket.php:86
ModelePDFTicket
Parent class for documents models.
Definition: modules_ticket.php:33
ModeleNumRefTicket\isEnabled
isEnabled()
Return if a module can be used or not.
Definition: modules_ticket.php:76
ModeleNumRefTicket\getVersion
getVersion()
Renvoi version du module numerotation.
Definition: modules_ticket.php:134
getListOfModels
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
Definition: functions2.lib.php:1925
ModeleNumRefTicket\canBeActivated
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
Definition: modules_ticket.php:111
CommonDocGenerator
Parent class for documents generators.
Definition: commondocgenerator.class.php:36