dolibarr  7.0.0-beta
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 = 10;
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->special = 0;
59  $this->picto = 'list';
60 
61  // Data directories to create when module is enabled
62  $this->dirs = array();
63 
64  // Config pages. Put here list of php page names stored in admmin directory used to setup module.
65  $this->config_page_url = array("cashdesk.php@cashdesk");
66 
67  // Dependencies
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(4,1); // 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  $this->rights_class = 'cashdesk';
85  $r=0;
86 
87  $r++;
88  $this->rights[$r][0] = 50101;
89  $this->rights[$r][1] = 'Use point of sale';
90  $this->rights[$r][2] = 'a';
91  $this->rights[$r][3] = 0;
92  $this->rights[$r][4] = 'use';
93 
94  // Main menu entries
95  $this->menus = array(); // List of menus to add
96  $r=0;
97 
98  // This is to declare the Top Menu entry:
99  $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu
100  'type'=>'top', // This is a Top menu entry
101  'titre'=>'CashDeskMenu',
102  'mainmenu'=>'cashdesk',
103  'url'=>'/cashdesk/index.php?user=__LOGIN__',
104  'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
105  'position'=>900,
106  'enabled'=>'$conf->cashdesk->enabled',
107  'perms'=>'$user->rights->cashdesk->use', // Use 'perms'=>'1' if you want your menu with no permission rules
108  'target'=>'pointofsale',
109  'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
110 
111  $r++;
112 
113  // This is to declare a Left Menu entry:
114  // $this->menu[$r]=array( 'fk_menu'=>'r=0', // Use r=value where r is index key used for the top menu entry
115  // 'type'=>'left', // This is a Left menu entry
116  // 'titre'=>'Title left menu',
117  // 'mainmenu'=>'mymodule',
118  // 'url'=>'/comm/action/index2.php',
119  // 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
120  // 'position'=>100,
121  // 'perms'=>'$user->rights->mymodule->level1->level2', // Use 'perms'=>'1' if you want your menu with no permission rules
122  // 'target'=>'',
123  // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
124  // $r++;
125  }
126 
127 
136  function init($options='')
137  {
138  $sql = array();
139 
140  // Remove permissions and default values
141  $this->remove($options);
142 
143  return $this->_init($sql,$options);
144  }
145 }
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
Class to describe and enable module Point Of Sales.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
$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.