dolibarr  13.0.2
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 <https://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.ScopeNotCamelCaps
40  public static function liste_modeles($db, $maxfilenamelength = 0)
41  {
42  // phpcs:enable
43  global $conf;
44 
45  $type = 'expensereport';
46  $list = array();
47 
48  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
49  $list = getListOfModels($db, $type, $maxfilenamelength);
50 
51  return $list;
52  }
53 }
54 
68 function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
69 {
70  return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
71 }
72 
79 {
83  public $error = '';
84 
90  public function isEnabled()
91  {
92  return true;
93  }
94 
100  public function info()
101  {
102  global $langs;
103  $langs->load("orders");
104  return $langs->trans("NoDescription");
105  }
106 
112  public function getExample()
113  {
114  global $langs;
115  $langs->load("trips");
116  return $langs->trans("NoExample");
117  }
118 
124  public function canBeActivated()
125  {
126  return true;
127  }
128 
135  public function getNextValue($object)
136  {
137  global $langs;
138  return $langs->trans("NotAvailable");
139  }
140 
146  public function getVersion()
147  {
148  global $langs;
149  $langs->load("admin");
150 
151  if ($this->version == 'development') return $langs->trans("VersionDevelopment");
152  elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental");
153  elseif ($this->version == 'dolibarr') return DOL_VERSION;
154  elseif ($this->version) return $this->version;
155  else return $langs->trans("NotAvailable");
156  }
157 }
static liste_modeles($db, $maxfilenamelength=0)
Return list of active models generation.
getVersion()
Returns the version of the numbering module.
getExample()
Returns an example of numbering.
getNextValue($object)
Returns next assigned value.
isEnabled()
Return if a model 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 whether the numbers already in force in the base do not cause conflicts that would prevent this ...
info()
Returns the default description of the numbering model.