dolibarr  9.0.0
modCashDesk.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2008-2011 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 
25 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
26 
27 
32 {
38  function __construct($db)
39  {
40  $this->db = $db;
41 
42  // Id for module (must be unique).
43  // Use here a free id (See in Home -> System information -> Dolibarr for list of used module id).
44  $this->numero = 50100;
45  // Key text used to identify module (for permission, menus, etc...)
46  $this->rights_class = 'cashdesk';
47 
48  $this->family = "portal";
49  $this->module_position = '55';
50  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
51  $this->name = preg_replace('/^mod/i','',get_class($this));
52  $this->description = "CashDesk module";
53 
54  $this->revision = '1.27';
55  $this->version = 'dolibarr';
56 
57  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
58  $this->picto = 'list';
59 
60  // Data directories to create when module is enabled
61  $this->dirs = array();
62 
63  // Config pages. Put here list of php page names stored in admmin directory used to setup module.
64  $this->config_page_url = array("cashdesk.php@cashdesk");
65 
66  // Dependencies
67  $this->hidden = false; // A condition to hide module
68  $this->depends = array('always'=>"modBanque", 'always'=>"modFacture", 'always'=>"modProduct", 'FR'=>'modBlockedLog'); // List of modules id that must be enabled if this module is enabled
69  $this->requiredby = array(); // List of modules id to disable if this one is disabled
70  $this->phpmin = array(5,4); // Minimum version of PHP required by module
71  $this->need_dolibarr_version = array(2,4); // Minimum version of Dolibarr required by module
72  $this->langfiles = array("cashdesk");
73  $this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text')
74  //$this->warnings_activation_ext = array('FR'=>'WarningInstallationMayBecomeNotCompliantWithLaw'); // Warning to show when we activate an external module. array('always'='text') or array('FR'='text')
75 
76  // Constants
77  $this->const = array();
78 
79  // Boxes
80  $this->boxes = array();
81 
82  // Permissions
83  $this->rights = array();
84  $r=0;
85 
86  $r++;
87  $this->rights[$r][0] = 50101;
88  $this->rights[$r][1] = 'Use point of sale';
89  $this->rights[$r][2] = 'a';
90  $this->rights[$r][3] = 0;
91  $this->rights[$r][4] = 'use';
92 
93  // Main menu entries
94  $this->menus = array(); // List of menus to add
95  $r=0;
96 
97  // This is to declare the Top Menu entry:
98  $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu
99  'type'=>'top', // This is a Top menu entry
100  'titre'=>'PointOfSaleShort',
101  'mainmenu'=>'cashdesk',
102  'url'=>'/cashdesk/index.php?user=__LOGIN__',
103  'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
104  'position'=>900,
105  'enabled'=>'$conf->cashdesk->enabled',
106  'perms'=>'$user->rights->cashdesk->use', // Use 'perms'=>'1' if you want your menu with no permission rules
107  'target'=>'pointofsale',
108  'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
109 
110  $r++;
111 
112  // This is to declare a Left Menu entry:
113  // $this->menu[$r]=array( 'fk_menu'=>'r=0', // Use r=value where r is index key used for the top menu entry
114  // 'type'=>'left', // This is a Left menu entry
115  // 'titre'=>'Title left menu',
116  // 'mainmenu'=>'mymodule',
117  // 'url'=>'/comm/action/index2.php',
118  // 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
119  // 'position'=>100,
120  // 'perms'=>'$user->rights->mymodule->level1->level2', // Use 'perms'=>'1' if you want your menu with no permission rules
121  // 'target'=>'',
122  // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
123  // $r++;
124  }
125 
126 
135  function init($options='')
136  {
137  $sql = array();
138 
139  // Remove permissions and default values
140  $this->remove($options);
141 
142  return $this->_init($sql,$options);
143  }
144 }
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
Class to describe and enable module Point Of Sales.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
_init($array_sql, $options='')
Enables a module.