dolibarr  19.0.0-dev
modIntracommreport.class.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) 2019 Open-DSI <support@open-dsi.fr>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
26 include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
27 
28 
33 {
39  public function __construct($db)
40  {
41  global $conf, $langs;
42 
43  $this->db = $db;
44  $this->numero = 68000;
45 
46  $this->family = "financial";
47  $this->module_position = '60';
48  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
49  $this->name = preg_replace('/^mod/i', '', get_class($this));
50  $this->description = "Intracomm report management (Support for French DEB/DES format)";
51 
52  // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
53  $this->version = 'development';
54 
55  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
56  $this->picto = 'intracommreport';
57 
58  // Data directories to create when module is enabled
59  $this->dirs = array('/intracommreport/temp');
60 
61  // Config pages
62  $this->config_page_url = array("intracommreport.php@intracommreport");
63 
64  // Dependencies
65  $this->depends = array("modFacture", "modTax", "modCategorie"); // List of modules id that must be enabled if this module is enabled
66  $this->requiredby = array(); // List of modules id to disable if this one is disabled
67  $this->conflictwith = array(); // List of modules id this module is in conflict with
68  $this->phpmin = array(7, 0); // Minimum version of PHP required by module
69  $this->need_dolibarr_version = array(13, 0, -5); // Minimum version of Dolibarr required by module
70  $this->langfiles = array("intracommreport");
71 
72  // Constants
73  // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
74  // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
75  // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
76  // );
77  $this->const = array();
78 
79  // Tabs
80  $this->tabs = array();
81 
82  // Css
83  $this->module_parts = array();
84 
85  // Boxes
86  $this->boxes = array();
87 
88  // Dictionaries
89  if (!isset($conf->intracommreport->enabled)) {
90  $conf->intracommreport = new stdClass();
91  $conf->intracommreport->enabled = 0;
92  }
93  $this->dictionaries = array();
94 
95  // Permissions
96  $this->rights = array();
97  $this->rights_class = 'intracommreport';
98  $r = 0;
99 
100  $r++;
101  $this->rights[$r][0] = 68001;
102  $this->rights[$r][1] = 'Read intracomm report';
103  $this->rights[$r][2] = 'r';
104  $this->rights[$r][3] = 0;
105  $this->rights[$r][4] = 'read';
106 
107  $r++;
108  $this->rights[$r][0] = 68002;
109  $this->rights[$r][1] = 'Create/modify intracomm report';
110  $this->rights[$r][2] = 'w';
111  $this->rights[$r][3] = 0;
112  $this->rights[$r][4] = 'write';
113 
114  $r++;
115  $this->rights[$r][0] = 68004;
116  $this->rights[$r][1] = 'Delete intracomm report';
117  $this->rights[$r][2] = 'd';
118  $this->rights[$r][3] = 0;
119  $this->rights[$r][4] = 'delete';
120 
121  // Main menu entries
122  $this->menu = array(); // List of menus to add
123  $r = 0;
124 
125  // Exports
126  $r = 1;
127  }
128 
137  public function init($options = '')
138  {
139  global $conf;
140 
141  $result = $this->_load_tables('/install/mysql/', 'intracommreport');
142  if ($result < 0) {
143  return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
144  }
145 
146  $sql = array();
147 
148  return $this->_init($sql, $options);
149  }
150 }
Class DolibarrModules.
_init($array_sql, $options='')
Enables a module.
_load_tables($reldir, $onlywithsuffix='')
Create tables and keys required by module:
Description and activation class for module intracommreport.
init($options='')
Function called when module is enabled.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
Definition: index.php:746
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:123