dolibarr  9.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 <http://www.gnu.org/licenses/>.
17  * or see http://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 $error='';
38 
39 
40  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
48  static function liste_modeles($db,$maxfilenamelength=0)
49  {
50  // phpcs:enable
51  global $conf;
52 
53  $type='project';
54  $liste=array();
55 
56  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
57  $liste=getListOfModels($db,$type,$maxfilenamelength);
58 
59  return $liste;
60  }
61 }
62 
63 
64 
68 abstract class ModeleNumRefProjects
69 {
73  public $error='';
74 
80  function isEnabled()
81  {
82  return true;
83  }
84 
90  function info()
91  {
92  global $langs;
93  $langs->load("projects");
94  return $langs->trans("NoDescription");
95  }
96 
102  function getExample()
103  {
104  global $langs;
105  $langs->load("projects");
106  return $langs->trans("NoExample");
107  }
108 
115  function canBeActivated()
116  {
117  return true;
118  }
119 
127  function getNextValue($objsoc, $project)
128  {
129  global $langs;
130  return $langs->trans("NotAvailable");
131  }
132 
138  function getVersion()
139  {
140  global $langs;
141  $langs->load("admin");
142 
143  if ($this->version == 'development') return $langs->trans("VersionDevelopment");
144  if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
145  if ($this->version == 'dolibarr') return DOL_VERSION;
146  if ($this->version) return $this->version;
147  return $langs->trans("NotAvailable");
148  }
149 }
getExample()
Renvoi un exemple de numerotation.
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()
Test si les numeros deja en vigueur dans la base ne provoquent pas de de conflits qui empechera cette...
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.