dolibarr  7.0.0-beta
modules_propale.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
5  * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
6  * Copyright (C) 2014 Marcos GarcĂ­a <marcosgdf@gmail.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  * or see http://www.gnu.org/
21  */
22 
30 require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis car utilise dans les classes qui heritent
32 
33 
37 abstract class ModelePDFPropales extends CommonDocGenerator
38 {
39  var $error='';
40 
41 
49  static function liste_modeles($db,$maxfilenamelength=0)
50  {
51  global $conf;
52 
53  $type='propal';
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 
67 abstract class ModeleNumRefPropales
68 {
69  var $error='';
70 
76  function isEnabled()
77  {
78  return true;
79  }
80 
86  function info()
87  {
88  global $langs;
89  $langs->load("propale");
90  return $langs->trans("NoDescription");
91  }
92 
98  function getExample()
99  {
100  global $langs;
101  $langs->load("propale");
102  return $langs->trans("NoExample");
103  }
104 
111  function canBeActivated()
112  {
113  return true;
114  }
115 
123  function getNextValue($objsoc,$propal)
124  {
125  global $langs;
126  return $langs->trans("NotAvailable");
127  }
128 
134  function getVersion()
135  {
136  global $langs;
137  $langs->load("admin");
138 
139  if ($this->version == 'development') return $langs->trans("VersionDevelopment");
140  if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
141  if ($this->version == 'dolibarr') return DOL_VERSION;
142  if ($this->version) return $this->version;
143  return $langs->trans("NotAvailable");
144  }
145 }
info()
Renvoi la description par defaut du modele de numerotation.
canBeActivated()
Test si les numeros deja en vigueur dans la base ne provoquent pas de de conflits qui empechera cette...
getVersion()
Renvoi version du module numerotation.
getNextValue($objsoc, $propal)
Renvoi prochaine valeur attribuee.
Classe mere des modeles de propale.
isEnabled()
Return if a module can be used or not.
getExample()
Renvoi un exemple de numerotation.
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.
Classe mere des modeles de numerotation des references de propales.