dolibarr  9.0.0
modStripe.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
3  * Copyright (C) 2017 Saasprov <saasprov@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
26 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
27 
28 
33 {
39  function __construct($db)
40  {
41  $this->db = $db;
42 
43  // Id for module (must be unique).
44  // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
45  $this->numero = 50300;
46  // Key text used to identify module (for permissions, menus, etc...)
47  $this->rights_class = 'stripe';
48 
49  // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
50  // It is used to group modules in module setup page
51  $this->family = "interface";
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  // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
55  $this->description = "Module to offer an online payment page by credit card with Stripe";
56  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
57  $this->version = 'dolibarr';
58  // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
59  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
60  // Name of image file used for this module.
61  // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
62  // If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png'
63  $this->picto='stripe';
64 
65  // Data directories to create when module is enabled.
66  $this->dirs = array();
67 
68  // Config pages. Put here list of php page names stored in admin directory used to setup module.
69  $this->config_page_url = array("stripe.php@stripe");
70 
71  // Dependencies
72  $this->hidden = false; // A condition to hide module
73  $this->depends = array(); // List of modules id that must be enabled if this module is enabled
74  $this->requiredby = array(); // List of modules id to disable if this one is disabled
75  $this->phpmin = array(5,4); // Minimum version of PHP required by module
76  $this->need_dolibarr_version = array(5,0); // Minimum version of Dolibarr required by module
77  $this->langfiles = array("stripe");
78 
79  // Constants
80  $this->const = array(); // List of particular constants to add when module is enabled
81 
82  // New pages on tabs
83  $this->tabs = array();
84 
85  // Boxes
86  $this->boxes = array(); // List of boxes
87  $r=0;
88 
89  // Permissions
90  $this->rights = array(); // Permission array used by this module
91  $r=0;
92 
93  // Main menu entries
94  $r=0;
95  /* $this->menu[$r]=array(
96  'fk_menu'=>'fk_mainmenu=billing,fk_leftmenu=customers_bills_payment', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
97  'mainmenu'=>'billing',
98  'leftmenu'=>'customers_bills_payment_stripe',
99  'type'=>'left', // This is a Left menu entry
100  'titre'=>'StripeImportPayment',
101  'url'=>'/stripe/importpayments.php',
102  'langs'=>'stripe', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
103  'position'=>500,
104  'enabled'=>'$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
105  'perms'=>'$user->rights->banque->modifier', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
106  'target'=>'',
107  'user'=>2
108  ); // 0=Menu for internal users, 1=external users, 2=both
109  $r++;*/
110 
111  $this->menu[$r] = array(
112  'fk_menu'=>'fk_mainmenu=bank',
113  'type'=>'left',
114  'titre'=>'StripeAccount',
115  'mainmenu'=>'bank',
116  'leftmenu'=>'stripe',
117  'url' => '',
118  'langs' => 'stripe',
119  'position' => 100,
120  'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',
121  'perms' => '$user->rights->banque->lire',
122  'target' => '',
123  'user' => 0
124  );
125 
126  $r++;
127  $this->menu[$r] = array(
128  'fk_menu' => 'fk_mainmenu=bank,fk_leftmenu=stripe',
129  'type' => 'left',
130  'titre' => 'StripeChargeList',
131  'url' => '/stripe/charge.php',
132  'langs' => 'stripe',
133  'position' => 102,
134  'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',
135  'perms' => '$user->rights->banque->lire',
136  'target' => '',
137  'user' => 0
138  );
139 
140  $r++;
141  $this->menu[$r] = array(
142  'fk_menu' => 'fk_mainmenu=bank,fk_leftmenu=stripe',
143  'type' => 'left',
144  'titre' => 'StripeTransactionList',
145  'url' => '/stripe/transaction.php',
146  'langs' => 'stripe',
147  'position' => 102,
148  'enabled' => '$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',
149  'perms' => '$user->rights->banque->lire',
150  'target' => '',
151  'user' => 0
152  );
153 
154  // Exports
155  $r=1;
156  }
157 }
158 
Description and activation class for module Paybox.
__construct($db)
Constructor.
Class DolibarrModules.
</td >< td class="liste_titre" align="right"></td ></tr >< tr class="liste_titre">< input type="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< tr class="oddeven">< td >< input type="checkbox" class="check" name="' . $i . '"' . $disabled . '></td >< td >< input type="checkbox" class="check" name="choose'.$i.'"></td >< td class="nowrap"></td >< td >< input type="hidden" name="desc' . $i . '" value="' . dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:573
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103