dolibarr  17.0.3
modules_project.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  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  * or see https://www.gnu.org/
18  */
19 
26 require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
27 
28 
32 abstract class ModelePDFProjects extends CommonDocGenerator
33 {
37  public $db;
38 
42  public $name;
43 
47  public $description;
48 
52  public $type;
53 
57  public $page_largeur;
58 
62  public $page_hauteur;
63 
67  public $format;
68 
72  public $marge_gauche;
73 
77  public $marge_droite;
78 
82  public $marge_haute;
83 
87  public $marge_basse;
88 
92  public $error = '';
93 
94 
95  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
103  public static function liste_modeles($db, $maxfilenamelength = 0)
104  {
105  // phpcs:enable
106  global $conf;
107 
108  $type = 'project';
109  $list = array();
110 
111  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
112  $list = getListOfModels($db, $type, $maxfilenamelength);
113 
114  return $list;
115  }
116 }
117 
118 
119 
123 abstract class ModeleNumRefProjects
124 {
128  public $error = '';
129 
133  public $version;
134 
140  public function isEnabled()
141  {
142  return true;
143  }
144 
150  public function info()
151  {
152  global $langs;
153  $langs->load("projects");
154  return $langs->trans("NoDescription");
155  }
156 
162  public function getExample()
163  {
164  global $langs;
165  $langs->load("projects");
166  return $langs->trans("NoExample");
167  }
168 
175  public function canBeActivated()
176  {
177  return true;
178  }
179 
187  public function getNextValue($objsoc, $project)
188  {
189  global $langs;
190  return $langs->trans("NotAvailable");
191  }
192 
198  public function getVersion()
199  {
200  global $langs;
201  $langs->load("admin");
202 
203  if ($this->version == 'development') {
204  return $langs->trans("VersionDevelopment");
205  } elseif ($this->version == 'experimental') {
206  return $langs->trans("VersionExperimental");
207  } elseif ($this->version == 'dolibarr') {
208  return DOL_VERSION;
209  } elseif ($this->version) {
210  return $this->version;
211  } else {
212  return $langs->trans("NotAvailable");
213  }
214  }
215 }
ModeleNumRefProjects\getNextValue
getNextValue($objsoc, $project)
Renvoi prochaine valeur attribuee.
Definition: modules_project.php:187
ModelePDFProjects\liste_modeles
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Definition: modules_project.php:103
ModeleNumRefProjects\getExample
getExample()
Return an example of numbering.
Definition: modules_project.php:162
ModeleNumRefProjects
Classe mere des modeles de numerotation des references de projets.
Definition: modules_project.php:123
ModeleNumRefProjects\isEnabled
isEnabled()
Return if a module can be used or not.
Definition: modules_project.php:140
ModeleNumRefProjects\canBeActivated
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
Definition: modules_project.php:175
getListOfModels
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
Definition: functions2.lib.php:1925
ModeleNumRefProjects\getVersion
getVersion()
Renvoi version du module numerotation.
Definition: modules_project.php:198
ModeleNumRefProjects\info
info()
Renvoi la description par defaut du modele de numerotation.
Definition: modules_project.php:150
CommonDocGenerator
Parent class for documents generators.
Definition: commondocgenerator.class.php:36
ModelePDFProjects
Parent class for projects models.
Definition: modules_project.php:32