dolibarr  13.0.2
modHRM.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
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 <https://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  $this->module_position = '50';
47  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
48  $this->name = preg_replace('/^mod/i', '', get_class($this));
49  $this->description = "Management of employees carrier and feelings (department, employment contract)";
50 
51  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
52  $this->version = 'experimental';
53 
54  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
55  // Name of image file used for this module.
56  // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
57  // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
58  $this->picto = 'hrm';
59 
60  // define triggers
61  $this->module_parts = array();
62 
63  // Data directories to create when module is enabled
64  $this->dirs = array();
65 
66  // Config pages
67  $this->config_page_url = array('admin_hrm.php@hrm');
68 
69  // Dependencies
70  $this->hidden = false; // A condition to hide module
71  $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
72  $this->requiredby = array(/*"modSalaries, modExpenseReport, modHoliday"*/); // List of module ids to disable if this one is disabled
73  $this->conflictwith = array(); // List of module class names as string this module is in conflict with
74  $this->phpmin = array(5, 4); // Minimum version of PHP required by module
75  $this->need_dolibarr_version = array(3, 9); // Minimum version of Dolibarr required by module
76  $this->langfiles = array("hrm");
77 
78  // Dictionaries
79  $this->dictionaries = array();
80 
81  // Constantes
82  $this->const = array();
83  $r = 0;
84 
85  // Boxes
86  $this->boxes = array();
87 
88  // Permissions
89  $this->rights = array(); // Permission array used by this module
90  $r = 0;
91 
92  $this->rights[$r][0] = 4001;
93  $this->rights[$r][1] = 'See employees';
94  $this->rights[$r][3] = 0;
95  $this->rights[$r][4] = 'employee';
96  $this->rights[$r][5] = 'read';
97  $r++;
98 
99  $this->rights[$r][0] = 4002;
100  $this->rights[$r][1] = 'Create employees';
101  $this->rights[$r][3] = 0;
102  $this->rights[$r][4] = 'employee';
103  $this->rights[$r][5] = 'write';
104  $r++;
105 
106  $this->rights[$r][0] = 4003;
107  $this->rights[$r][1] = 'Delete employees';
108  $this->rights[$r][3] = 0;
109  $this->rights[$r][4] = 'employee';
110  $this->rights[$r][5] = 'delete';
111  $r++;
112 
113  $this->rights[$r][0] = 4004;
114  $this->rights[$r][1] = 'Export employees';
115  $this->rights[$r][3] = 0;
116  $this->rights[$r][4] = 'employee';
117  $this->rights[$r][5] = 'export';
118  $r++;
119 
120 
121  // Menus
122  //-------
123  $this->menu = 1; // This module add menu entries. They are coded into menu manager.
124  }
125 
135  public function init($options = '')
136  {
137  // Permissions
138  $this->remove($options);
139 
140  $sql = array();
141 
142  return $this->_init($sql, $options);
143  }
144 }
init($options= '')
Function called when module is enabled.
Class DolibarrModules.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</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:750
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:108
$conf db
API class for accounts.
Definition: inc.php:54
__construct($db)
Constructor.
_init($array_sql, $options= '')
Enables a module.