dolibarr  7.0.0-beta
modules_expensereport.php
1 <?php
2 /* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
19 
20 
25 {
26  var $error='';
27 
28 
36  static function liste_modeles($db,$maxfilenamelength=0)
37  {
38  global $conf;
39 
40  $type='expensereport';
41  $liste=array();
42 
43  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
44  $liste=getListOfModels($db,$type,$maxfilenamelength);
45 
46  return $liste;
47  }
48 
49 }
50 
64 function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
65 {
66  return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
67 }
68 
75 {
76  var $error='';
77 
83  function isEnabled()
84  {
85  return true;
86  }
87 
93  function info()
94  {
95  global $langs;
96  $langs->load("orders");
97  return $langs->trans("NoDescription");
98  }
99 
105  function getExample()
106  {
107  global $langs;
108  $langs->load("trips");
109  return $langs->trans("NoExample");
110  }
111 
117  function canBeActivated()
118  {
119  return true;
120  }
121 
129  function getNextValue($objsoc,$object)
130  {
131  global $langs;
132  return $langs->trans("NotAvailable");
133  }
134 
140  function getVersion()
141  {
142  global $langs;
143  $langs->load("admin");
144 
145  if ($this->version == 'development') return $langs->trans("VersionDevelopment");
146  if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
147  if ($this->version == 'dolibarr') return DOL_VERSION;
148  if ($this->version) return $this->version;
149  return $langs->trans("NotAvailable");
150  }
151 }
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
getVersion()
Renvoie version du module numerotation.
getExample()
Renvoie un exemple de numerotation.
isEnabled()
Return if a module can be used or not.
Class to manage Dolibarr database access.
Parent class for trips and expenses templates.
Parent class for numbering masks of expense reports.
Class to manage Trips and Expenses.
Parent class for documents generators.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
getNextValue($objsoc, $object)
Renvoie prochaine valeur attribuee.
canBeActivated()
Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cett...
info()
Renvoie la description par defaut du modele de numerotation.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Create a document onto disk accordign to template module.