dolibarr  13.0.2
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  $liste = array();
110 
111  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
112  $liste = getListOfModels($db, $type, $maxfilenamelength);
113 
114  return $liste;
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') return $langs->trans("VersionDevelopment");
199  elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental");
200  elseif ($this->version == 'dolibarr') return DOL_VERSION;
201  elseif ($this->version) return $this->version;
202  else return $langs->trans("NotAvailable");
203  }
204 }
getExample()
Return an example of numbering.
getVersion()
Renvoi version du module numerotation.
info()
Renvoi la description par defaut du modele de numerotation.
Parent class for projects models.
Classe mere des modeles de numerotation des references de projets.
isEnabled()
Return if a module can be used or not.
getNextValue($objsoc, $project)
Renvoi prochaine valeur attribuee.
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Parent class for documents generators.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.