dolibarr  16.0.5
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 
135  public function isEnabled()
136  {
137  return true;
138  }
139 
145  public function info()
146  {
147  global $langs;
148  $langs->load("projects");
149  return $langs->trans("NoDescription");
150  }
151 
157  public function getExample()
158  {
159  global $langs;
160  $langs->load("projects");
161  return $langs->trans("NoExample");
162  }
163 
170  public function canBeActivated()
171  {
172  return true;
173  }
174 
182  public function getNextValue($objsoc, $project)
183  {
184  global $langs;
185  return $langs->trans("NotAvailable");
186  }
187 
193  public function getVersion()
194  {
195  global $langs;
196  $langs->load("admin");
197 
198  if ($this->version == 'development') {
199  return $langs->trans("VersionDevelopment");
200  } elseif ($this->version == 'experimental') {
201  return $langs->trans("VersionExperimental");
202  } elseif ($this->version == 'dolibarr') {
203  return DOL_VERSION;
204  } elseif ($this->version) {
205  return $this->version;
206  } else {
207  return $langs->trans("NotAvailable");
208  }
209  }
210 }
ModeleNumRefProjects\getNextValue
getNextValue($objsoc, $project)
Renvoi prochaine valeur attribuee.
Definition: modules_project.php:182
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:157
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:135
ModeleNumRefProjects\canBeActivated
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
Definition: modules_project.php:170
getListOfModels
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
Definition: functions2.lib.php:1919
ModeleNumRefProjects\getVersion
getVersion()
Renvoi version du module numerotation.
Definition: modules_project.php:193
ModeleNumRefProjects\info
info()
Renvoi la description par defaut du modele de numerotation.
Definition: modules_project.php:145
CommonDocGenerator
Parent class for documents generators.
Definition: commondocgenerator.class.php:36
ModelePDFProjects
Parent class for projects models.
Definition: modules_project.php:32