dolibarr  9.0.0
modHRM.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
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 
23 include_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php";
24 
28 class modHRM extends DolibarrModules
29 {
36  public function __construct($db)
37  {
38  global $langs, $conf;
39 
40  $this->db = $db;
41 
42  $this->numero = 4000;
43  $this->rights_class = 'hrm';
44 
45  $this->family = "hr";
46  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
47  $this->name = preg_replace( '/^mod/i', '', get_class($this));
48  $this->description = "Management of employees carrier and feelings (department, employment contract)";
49 
50  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
51  $this->version = 'development';
52 
53  $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
54  // Name of image file used for this module.
55  // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
56  // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
57  $this->picto='generic';
58 
59  // define triggers
60  $this->module_parts = array();
61 
62  // Data directories to create when module is enabled
63  $this->dirs = array();
64 
65  // Config pages
66  $this->config_page_url = array('admin_hrm.php@hrm');
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(/*"modSalaries, modExpenseReport, modHoliday"*/); // 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,9); // Minimum version of Dolibarr required by module
75  $this->langfiles = array ("hrm");
76 
77  // Dictionaries
78  $this->dictionaries=array();
79 
80  // Constantes
81  $this->const = array ();
82  $r = 0;
83 
84  // Boxes
85  $this->boxes = array ();
86 
87  // Permissions
88  $this->rights = array(); // Permission array used by this module
89  $r = 0;
90 
91  $this->rights[$r][0] = 4001;
92  $this->rights[$r][1] = 'See employees';
93  $this->rights[$r][3] = 0;
94  $this->rights[$r][4] = 'employee';
95  $this->rights[$r][5] = 'read';
96  $r ++;
97 
98  $this->rights[$r][0] = 4002;
99  $this->rights[$r][1] = 'Create employees';
100  $this->rights[$r][3] = 0;
101  $this->rights[$r][4] = 'employee';
102  $this->rights[$r][5] = 'write';
103  $r ++;
104 
105  $this->rights[$r][0] = 4003;
106  $this->rights[$r][1] = 'Delete employees';
107  $this->rights[$r][3] = 0;
108  $this->rights[$r][4] = 'employee';
109  $this->rights[$r][5] = 'delete';
110  $r ++;
111 
112  $this->rights[$r][0] = 4004;
113  $this->rights[$r][1] = 'Export employees';
114  $this->rights[$r][3] = 0;
115  $this->rights[$r][4] = 'employee';
116  $this->rights[$r][5] = 'export';
117  $r ++;
118 
119 
120  // Menus
121  //-------
122  $this->menu = 1; // This module add menu entries. They are coded into menu manager.
123  }
124 
134  function init($options='')
135  {
136  // Permissions
137  $this->remove($options);
138 
139  $sql = array();
140 
141  return $this->_init($sql,$options);
142  }
143 }
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 the HRM module.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103
__construct($db)
Constructor.
init($options='')
Function called when module is enabled.
_init($array_sql, $options='')
Enables a module.