dolibarr  9.0.0
modPrinting.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2014 Frederic France <frederic.france@free.fr>
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 
28 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
29 
30 
31 
36 {
37 
43  function __construct($db)
44  {
45  $this->db = $db ;
46  $this->numero = 64000;
47  // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
48  // It is used to group modules in module setup page
49  $this->family = "interface";
50  $this->module_position = '52';
51  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
52  $this->name = preg_replace('/^mod/i','',get_class($this));
53  // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
54  $this->description = "Enable Direct Printing System.";
55  $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
56  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
57  // Name of image file used for this module.
58  // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
59  // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
60  $this->picto = 'printer';
61 
62  // Data directories to create when module is enabled.
63  $this->dirs = array();
64 
65  // Config pages
66  $this->config_page_url = array("printing.php@printing");
67 
68  // Dependencies
69  $this->hidden = false; // A condition to hide module
70  $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
71  $this->requiredby = array(); // List of module ids to disable if this one is disabled
72  $this->conflictwith = array(); // List of module class names as string this module is in conflict with
73  $this->phpmin = array(5,4); // Minimum version of PHP required by module
74  $this->need_dolibarr_version = array(3,7,-2); // Minimum version of Dolibarr required by module
75  $this->conflictwith = array();
76  $this->langfiles = array("printing");
77 
78  // Constants
79  $this->const = array();
80 
81  // Boxes
82  $this->boxes = array();
83 
84  // Permissions
85  $this->rights = array();
86  $this->rights_class = 'printing';
87 
88  $r=0;
89  // $this->rights[$r][0] Id permission (unique tous modules confondus)
90  // $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission)
91  // $this->rights[$r][2] Non utilise
92  // $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut
93  // $this->rights[$r][4] Niveau 1 pour nommer permission dans code
94  // $this->rights[$r][5] Niveau 2 pour nommer permission dans code
95 
96  $r++;
97  $this->rights[$r][0] = 64001;
98  $this->rights[$r][1] = 'DirectPrint';
99  $this->rights[$r][2] = 'r';
100  $this->rights[$r][3] = 0;
101  $this->rights[$r][4] = 'read';
102 
103  // Main menu entries
104  $this->menus = array(); // List of menus to add
105  $r=0;
106 
107  // This is to declare the Top Menu entry:
108  $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Put 0 if this is a top menu
109  'type'=>'left', // This is a Top menu entry
110  'titre'=>'MenuDirectPrinting',
111  'url'=>'/printing/index.php?mainmenu=home&leftmenu=admintools',
112  'langs'=>'printing', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
113  'position'=>300,
114  'enabled'=>'$conf->printing->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)',
115  'perms'=>'$user->rights->printing->read', // Use 'perms'=>'1' if you want your menu with no permission rules
116  'target'=>'',
117  'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
118 
119  $r++;
120  }
121 }
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 activate module Direct Printing.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103
__construct($db)
Constructor.