32 include_once DOL_DOCUMENT_ROOT.
"/core/modules/DolibarrModules.class.php";
53 $this->numero = 20000;
55 $this->rights_class =
'holiday';
60 $this->module_position =
'42';
62 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
66 $this->version =
'dolibarr';
68 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
72 $this->picto =
'holiday';
76 $this->dirs = array(
"/holiday/temp");
80 $this->config_page_url = array(
"holiday.php");
83 $this->hidden =
false;
84 $this->depends = array();
85 $this->requiredby = array();
86 $this->conflictwith = array();
87 $this->phpmin = array(7, 0);
88 $this->need_dolibarr_version = array(3, 0);
89 $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'; $keyforelement =
'user'; $keyforaliasextra =
'extrau';
252 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
254 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
255 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'holiday as d';
256 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'holiday_extrafields as extra on d.rowid = extra.fk_object';
257 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_holiday_types as t ON t.rowid = d.fk_type';
258 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as ua ON ua.rowid = d.fk_validator,';
259 $this->export_sql_end[$r] .=
' '.MAIN_DB_PREFIX.
'user as u';
260 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user_extrafields as extrau ON u.rowid = extrau.fk_object';
261 $this->export_sql_end[$r] .=
' WHERE d.fk_user = u.rowid';
262 $this->export_sql_end[$r] .=
' AND d.entity IN ('.getEntity(
'holiday').
')';
300 public function init($options =
'')
305 $this->
remove($options);
_init($array_sql, $options='')
Enables a module.
Description and activation class for module holiday.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_now($mode='auto')
Return date for now.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
$conf db name
Only used if Module[ID]Name translation string is not found.