54 $this->numero = 20000;
56 $this->rights_class =
'holiday';
61 $this->module_position =
'42';
63 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
67 $this->version =
'dolibarr';
69 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
73 $this->picto =
'holiday';
77 $this->dirs = array(
"/holiday/temp");
81 $this->config_page_url = array(
"holiday.php");
84 $this->hidden =
false;
85 $this->depends = array();
86 $this->requiredby = array();
87 $this->conflictwith = array();
88 $this->phpmin = array(7, 0);
89 $this->need_dolibarr_version = array(3, 0);
90 $this->langfiles = array(
"holiday");
95 $this->
const = array();
98 $this->
const[$r][0] =
"HOLIDAY_ADDON";
99 $this->
const[$r][1] =
"chaine";
100 $this->
const[$r][2] =
"mod_holiday_madonna";
101 $this->
const[$r][3] =
'Nom du gestionnaire de numerotation des congés';
102 $this->
const[$r][4] = 0;
105 $this->
const[$r][0] =
"HOLIDAY_ADDON_PDF";
106 $this->
const[$r][1] =
"chaine";
107 $this->
const[$r][2] =
"celebrate";
108 $this->
const[$r][3] =
'Name of PDF model of holiday';
109 $this->
const[$r][4] = 0;
112 $this->
const[$r][0] =
"HOLIDAY_ADDON_PDF_ODT_PATH";
113 $this->
const[$r][1] =
"chaine";
114 $this->
const[$r][2] =
"DOL_DATA_ROOT/doctemplates/holiday";
115 $this->
const[$r][3] =
"";
116 $this->
const[$r][4] = 0;
121 $this->tabs[] = array();
124 $this->boxes = array();
137 $datestart =
dol_mktime(4, 0, 0, $arraydate[
'mon'], $arraydate[
'mday'], $arraydate[
'year']);
138 $this->cronjobs = array(
140 'label' =>
'HolidayBalanceMonthlyUpdate:holiday',
141 'jobtype' =>
'method',
142 'class' =>
'holiday/class/holiday.class.php',
143 'objectname' =>
'Holiday',
144 'method' =>
'updateBalance',
146 'comment' =>
'Update holiday balance every month',
148 'unitfrequency' => 3600 * 24,
151 'test' =>
'$conf->holiday->enabled',
152 'datestart' => $datestart
158 $this->rights = array();
161 $this->rights[$r][0] = 20001;
162 $this->rights[$r][1] =
'Read leave requests (yours and your subordinates)';
163 $this->rights[$r][3] = 0;
164 $this->rights[$r][4] =
'read';
165 $this->rights[$r][5] =
'';
168 $this->rights[$r][0] = 20002;
169 $this->rights[$r][1] =
'Create/modify leave requests';
170 $this->rights[$r][3] = 0;
171 $this->rights[$r][4] =
'write';
172 $this->rights[$r][5] =
'';
175 $this->rights[$r][0] = 20003;
176 $this->rights[$r][1] =
'Delete leave requests';
177 $this->rights[$r][3] = 0;
178 $this->rights[$r][4] =
'delete';
179 $this->rights[$r][5] =
'';
182 $this->rights[$r][0] = 20007;
183 $this->rights[$r][1] =
'Approve leave requests';
184 $this->rights[$r][2] =
'w';
185 $this->rights[$r][3] = 0;
186 $this->rights[$r][4] =
'approve';
189 $this->rights[$r][0] = 20004;
190 $this->rights[$r][1] =
'Read leave requests for everybody';
191 $this->rights[$r][3] = 0;
192 $this->rights[$r][4] =
'readall';
193 $this->rights[$r][5] =
'';
196 $this->rights[$r][0] = 20005;
197 $this->rights[$r][1] =
'Create/modify leave requests for everybody';
198 $this->rights[$r][3] = 0;
199 $this->rights[$r][4] =
'writeall';
200 $this->rights[$r][5] =
'';
203 $this->rights[$r][0] = 20006;
204 $this->rights[$r][1] =
'Setup leave requests of users (setup and update balance)';
205 $this->rights[$r][3] = 0;
206 $this->rights[$r][4] =
'define_holiday';
207 $this->rights[$r][5] =
'';
220 $this->export_code[$r] =
'leaverequest_'.$r;
221 $this->export_label[$r] =
'ListeCP';
222 $this->export_icon[$r] =
'holiday';
223 $this->export_permission[$r] = array(array(
"holiday",
"readall"));
224 $this->export_fields_array[$r] = array(
225 'd.rowid' =>
"LeaveId",
'd.fk_type' =>
'TypeOfLeaveId',
't.code' =>
'TypeOfLeaveCode',
't.label' =>
'TypeOfLeaveLabel',
'd.fk_user' =>
'UserID',
226 'd.date_debut' =>
'DateStart',
'd.date_fin' =>
'DateEnd',
'd.halfday' =>
'HalfDay',
'none.num_open_days' =>
'NbUseDaysCP',
227 'd.date_valid' =>
'DateApprove',
'd.fk_validator' =>
"UserForApprovalID",
228 'u.lastname' =>
'Lastname',
'u.firstname' =>
'Firstname',
'u.login' =>
"Login",
229 'ua.lastname' =>
"UserForApprovalLastname",
'ua.firstname' =>
"UserForApprovalFirstname",
230 'ua.login' =>
"UserForApprovalLogin",
'd.description' =>
'Description',
'd.statut' =>
'Status'
232 $this->export_TypeFields_array[$r] = array(
233 'd.rowid' =>
"Numeric",
't.code' =>
'Text',
't.label' =>
'Text',
'd.fk_user' =>
'Numeric',
234 'd.date_debut' =>
'Date',
'd.date_fin' =>
'Date',
'none.num_open_days' =>
'NumericCompute',
235 'd.date_valid' =>
'Date',
'd.fk_validator' =>
"Numeric",
236 'u.lastname' =>
'Text',
'u.firstname' =>
'Text',
'u.login' =>
"Text",
237 'ua.lastname' =>
"Text",
'ua.firstname' =>
"Text",
238 'ua.login' =>
"Text",
'd.description' =>
'Text',
'd.statut' =>
'Numeric'
240 $this->export_entities_array[$r] = array(
241 'u.lastname' =>
'user',
'u.firstname' =>
'user',
'u.login' =>
'user',
'ua.lastname' =>
'user',
'ua.firstname' =>
'user',
'ua.login' =>
'user'
244 $this->export_special_array[$r] = array(
'none.num_open_days' =>
'getNumOpenDays');
245 $this->export_dependencies_array[$r] = array();
247 $keyforselect =
'holiday';
248 $keyforelement =
'holiday';
249 $keyforaliasextra =
'extra';
250 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
251 $keyforselect =
'user';
252 $keyforelement =
'user';
253 $keyforaliasextra =
'extrau';
254 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
256 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
257 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'holiday as d';
258 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'holiday_extrafields as extra on d.rowid = extra.fk_object';
259 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_holiday_types as t ON t.rowid = d.fk_type AND t.entity IN ('.
getEntity(
'c_holiday_types').
')';
260 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as ua ON ua.rowid = d.fk_validator,';
261 $this->export_sql_end[$r] .=
' '.MAIN_DB_PREFIX.
'user as u';
262 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user_extrafields as extrau ON u.rowid = extrau.fk_object';
263 $this->export_sql_end[$r] .=
' WHERE d.fk_user = u.rowid';
264 $this->export_sql_end[$r] .=
' AND d.entity IN ('.getEntity(
'holiday').
')';