dolibarr  9.0.0
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 {
29  public $error='';
30 
31 
32  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
40  static function liste_modeles($db,$maxfilenamelength=0)
41  {
42  // phpcs:enable
43  global $conf;
44 
45  $type='expensereport';
46  $liste=array();
47 
48  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
49  $liste=getListOfModels($db,$type,$maxfilenamelength);
50 
51  return $liste;
52  }
53 }
54 
55 // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
69 function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
70 {
71  // phpcs:enable
72  return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
73 }
74 
81 {
85  public $error='';
86 
92  function isEnabled()
93  {
94  return true;
95  }
96 
102  function info()
103  {
104  global $langs;
105  $langs->load("orders");
106  return $langs->trans("NoDescription");
107  }
108 
114  function getExample()
115  {
116  global $langs;
117  $langs->load("trips");
118  return $langs->trans("NoExample");
119  }
120 
126  function canBeActivated()
127  {
128  return true;
129  }
130 
137  function getNextValue($object)
138  {
139  global $langs;
140  return $langs->trans("NotAvailable");
141  }
142 
148  function getVersion()
149  {
150  global $langs;
151  $langs->load("admin");
152 
153  if ($this->version == 'development') return $langs->trans("VersionDevelopment");
154  if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
155  if ($this->version == 'dolibarr') return DOL_VERSION;
156  if ($this->version) return $this->version;
157  return $langs->trans("NotAvailable");
158  }
159 }
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
getVersion()
Renvoie version du module numerotation.
getExample()
Renvoie un exemple de numerotation.
getNextValue($object)
Renvoie prochaine valeur attribuee.
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.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk accordign to template module.
Parent class for documents generators.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
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.