dolibarr  7.0.0-beta
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  $this->special = 0;
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='generic';
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->depends = array();
71  $this->requiredby = array(/*"
72  modSalaries,
73  modExpenseReport,
74  modHoliday
75  "*/);
76  $this->conflictwith = array();
77  $this->phpmin = array (
78  5,
79  3
80  ); // Minimum version of PHP required by module
81  $this->need_dolibarr_version = array (
82  3,
83  9
84  ); // Minimum version of Dolibarr required by module
85  $this->langfiles = array (
86  "hrm"
87  );
88 
89  // Dictionnaries
90  $this->dictionnaries=array();
91 
92  // Constantes
93  $this->const = array ();
94  $r = 0;
95 
96  // Boxes
97  $this->boxes = array ();
98 
99  // Permissions
100  $this->rights = array(); // Permission array used by this module
101  $r = 0;
102 
103  $this->rights[$r][0] = 4001;
104  $this->rights[$r][1] = 'See employees';
105  $this->rights[$r][3] = 0;
106  $this->rights[$r][4] = 'employee';
107  $this->rights[$r][5] = 'read';
108  $r ++;
109 
110  $this->rights[$r][0] = 4002;
111  $this->rights[$r][1] = 'Create employees';
112  $this->rights[$r][3] = 0;
113  $this->rights[$r][4] = 'employee';
114  $this->rights[$r][5] = 'write';
115  $r ++;
116 
117  $this->rights[$r][0] = 4003;
118  $this->rights[$r][1] = 'Delete employees';
119  $this->rights[$r][3] = 0;
120  $this->rights[$r][4] = 'employee';
121  $this->rights[$r][5] = 'delete';
122  $r ++;
123 
124  $this->rights[$r][0] = 4004;
125  $this->rights[$r][1] = 'Export employees';
126  $this->rights[$r][3] = 0;
127  $this->rights[$r][4] = 'employee';
128  $this->rights[$r][5] = 'export';
129  $r ++;
130 
131 
132  // Menus
133  //-------
134  $this->menu = 1; // This module add menu entries. They are coded into menu manager.
135 
136  }
137 
147  function init($options='')
148  {
149  // Permissions
150  $this->remove($options);
151 
152  $sql = array();
153 
154  return $this->_init($sql,$options);
155  }
156 }
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 activate the HRM module.
__construct($db)
Constructor.
init($options='')
Function called when module is enabled.
$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.