dolibarr  7.0.0-beta
modPrelevement.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
5  * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
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 <http://www.gnu.org/licenses/>.
19  */
20 
29 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
30 
31 
36 {
37 
43  function __construct($db)
44  {
45  global $conf;
46 
47  $this->db = $db;
48  $this->numero = 57;
49 
50  $this->family = "financial";
51  $this->module_position = 520;
52  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
53  $this->name = preg_replace('/^mod/i','',get_class($this));
54  $this->description = "Gestion des Prelevements";
55 
56  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
57  $this->version = 'dolibarr';
58 
59  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
60  $this->special = 0;
61  // Name of png file (without png) used for this module
62  $this->picto='payment';
63 
64  // Data directories to create when module is enabled
65  $this->dirs = array("/prelevement/temp","/prelevement/receipts");
66 
67  // Dependancies
68  $this->depends = array("modFacture","modBanque");
69  $this->requiredby = array();
70 
71  // Config pages
72  $this->config_page_url = array("prelevement.php");
73 
74  // Constants
75  $this->const = array();
76  $r=0;
77 
78  $this->const[$r][0] = "BANK_ADDON_PDF";
79  $this->const[$r][1] = "chaine";
80  $this->const[$r][2] = "sepamandate";
81  $this->const[$r][3] = 'Name of manager to generate SEPA mandate';
82  $this->const[$r][4] = 0;
83  $r++;
84 
85 
86  // Boxes
87  $this->boxes = array();
88 
89  // Permissions
90  $this->rights = array();
91  $this->rights_class = 'prelevement';
92  $r=0;
93  $r++;
94  $this->rights[$r][0] = 151;
95  $this->rights[$r][1] = 'Read direct debit payment orders';
96  $this->rights[$r][2] = 'r';
97  $this->rights[$r][3] = 0;
98  $this->rights[$r][4] = 'bons';
99  $this->rights[$r][5] = 'lire';
100 
101  $r++;
102  $this->rights[$r][0] = 152;
103  $this->rights[$r][1] = 'Create/modify a direct debit payment order';
104  $this->rights[$r][2] = 'w';
105  $this->rights[$r][3] = 0;
106  $this->rights[$r][4] = 'bons';
107  $this->rights[$r][5] = 'creer';
108 
109  $r++;
110  $this->rights[$r][0] = 153;
111  $this->rights[$r][1] = 'Send/Transmit direct debit payment orders';
112  $this->rights[$r][2] = 'a';
113  $this->rights[$r][3] = 0;
114  $this->rights[$r][4] = 'bons';
115  $this->rights[$r][5] = 'send';
116 
117  $r++;
118  $this->rights[$r][0] = 154;
119  $this->rights[$r][1] = 'Record Credits/Rejects of direct debit payment orders';
120  $this->rights[$r][2] = 'a';
121  $this->rights[$r][3] = 0;
122  $this->rights[$r][4] = 'bons';
123  $this->rights[$r][5] = 'credit';
124 
125 /* $this->rights[2][0] = 154;
126  $this->rights[2][1] = 'Setup withdraw account';
127  $this->rights[2][2] = 'w';
128  $this->rights[2][3] = 0;
129  $this->rights[2][4] = 'bons';
130  $this->rights[2][5] = 'configurer';
131 */
132 
133  // Menus
134  //-------
135  $this->menu = 1; // This module add menu entries. They are coded into menu manager.
136 
137  }
138 
139 
148  function init($options='')
149  {
150  global $conf;
151 
152  // Permissions
153  $this->remove($options);
154 
155  $sql = array(
156  "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'bankaccount' AND entity = ".$conf->entity,
157  "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','bankaccount',".$conf->entity.")",
158  );
159 
160  return $this->_init($sql,$options);
161  }
162 }
Class DolibarrModules.
</td >< tdclass="liste_titre"align="right"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow img yes disabled img no img no< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="'.$i.'"'.$disabled.'></td >< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"></td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:554
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
Class to describe and enable module Prelevement.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
_init($array_sql, $options='')
Enables a module.