dolibarr  18.0.0
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  $type = 'project';
107  $list = array();
108 
109  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
110  $list = getListOfModels($db, $type, $maxfilenamelength);
111 
112  return $list;
113  }
114 }
115 
116 
117 
121 abstract class ModeleNumRefProjects
122 {
126  public $error = '';
127 
131  public $version;
132 
138  public function isEnabled()
139  {
140  return true;
141  }
142 
148  public function info()
149  {
150  global $langs;
151  $langs->load("projects");
152  return $langs->trans("NoDescription");
153  }
154 
160  public function getExample()
161  {
162  global $langs;
163  $langs->load("projects");
164  return $langs->trans("NoExample");
165  }
166 
173  public function canBeActivated()
174  {
175  return true;
176  }
177 
185  public function getNextValue($objsoc, $project)
186  {
187  global $langs;
188  return $langs->trans("NotAvailable");
189  }
190 
196  public function getVersion()
197  {
198  global $langs;
199  $langs->load("admin");
200 
201  if ($this->version == 'development') {
202  return $langs->trans("VersionDevelopment");
203  } elseif ($this->version == 'experimental') {
204  return $langs->trans("VersionExperimental");
205  } elseif ($this->version == 'dolibarr') {
206  return DOL_VERSION;
207  } elseif ($this->version) {
208  return $this->version;
209  } else {
210  return $langs->trans("NotAvailable");
211  }
212  }
213 }
ModeleNumRefProjects\getNextValue
getNextValue($objsoc, $project)
Renvoi prochaine valeur attribuee.
Definition: modules_project.php:185
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:160
ModeleNumRefProjects
Classe mere des modeles de numerotation des references de projets.
Definition: modules_project.php:121
ModeleNumRefProjects\isEnabled
isEnabled()
Return if a module can be used or not.
Definition: modules_project.php:138
ModeleNumRefProjects\canBeActivated
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
Definition: modules_project.php:173
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:196
ModeleNumRefProjects\info
info()
Returns the default description of the numbering pattern.
Definition: modules_project.php:148
CommonDocGenerator
Parent class for documents generators.
Definition: commondocgenerator.class.php:36
ModelePDFProjects
Parent class for projects models.
Definition: modules_project.php:32