dolibarr  17.0.4
modules_holiday.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
5  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
7  * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
8  * Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
9  * Copyright (C) 2014 Marcos GarcĂ­a <marcosgdf@gmail.com>
10  * Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>.
24  * or see https://www.gnu.org/
25  */
26 
33  require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
34 
35 
39 abstract class ModelePDFHoliday extends CommonDocGenerator
40 {
44  public $error = '';
45 
46 
47  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
55  public static function liste_modeles($db, $maxfilenamelength = 0)
56  {
57  // phpcs:enable
58  global $conf;
59 
60  $type = 'holiday';
61  $list = array();
62 
63  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
64  $list = getListOfModels($db, $type, $maxfilenamelength);
65 
66  return $list;
67  }
68 }
69 
70 
75 {
79  public $error = '';
80 
86  public function isEnabled()
87  {
88  return true;
89  }
90 
96  public function info()
97  {
98  global $langs;
99  $langs->load("holiday");
100  return $langs->trans("NoDescription");
101  }
102 
108  public function getExample()
109  {
110  global $langs;
111  $langs->load("holiday");
112  return $langs->trans("NoExample");
113  }
114 
120  public function canBeActivated()
121  {
122  return true;
123  }
124 
132  public function getNextValue($objsoc, $holiday)
133  {
134  global $langs;
135  return $langs->trans("NotAvailable");
136  }
137 
143  public function getVersion()
144  {
145  global $langs;
146  $langs->load("admin");
147 
148  if ($this->version == 'development') {
149  return $langs->trans("VersionDevelopment");
150  } elseif ($this->version == 'experimental') {
151  return $langs->trans("VersionExperimental");
152  } elseif ($this->version == 'dolibarr') {
153  return DOL_VERSION;
154  } elseif ($this->version) {
155  return $this->version;
156  } else {
157  return $langs->trans("NotAvailable");
158  }
159  }
160 }
Parent class for documents generators.
Parent class for all holidays numbering modules.
getVersion()
Return numbering version module.
getExample()
Return numbering example.
canBeActivated()
Test if existing numbers make problems with numbering.
info()
Return default description of numbering model.
getNextValue($objsoc, $holiday)
Return next value.
isEnabled()
Return if a module can be used or not.
Parent class to manage holidays document templates.
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.