31 include_once DOL_DOCUMENT_ROOT.
"/core/modules/DolibarrModules.class.php";
52 $this->numero = 20000;
54 $this->rights_class =
'holiday';
59 $this->module_position =
'42';
61 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
65 $this->version =
'dolibarr';
67 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
71 $this->picto =
'holiday';
75 $this->dirs = array(
"/holiday/temp");
79 $this->config_page_url = array(
"holiday.php");
86 $this->hidden =
false;
87 $this->depends = array();
88 $this->requiredby = array();
89 $this->conflictwith = array();
90 $this->phpmin = array(5, 4);
91 $this->need_dolibarr_version = array(3, 0);
92 $this->langfiles = array(
"holiday");
98 $this->
const = array();
101 $this->
const[$r][0] =
"HOLIDAY_ADDON";
102 $this->
const[$r][1] =
"chaine";
103 $this->
const[$r][2] =
"mod_holiday_madonna";
104 $this->
const[$r][3] =
'Nom du gestionnaire de numerotation des congés';
105 $this->
const[$r][4] = 0;
108 $this->
const[$r][0] =
"HOLIDAY_ADDON_PDF";
109 $this->
const[$r][1] =
"chaine";
110 $this->
const[$r][2] =
"celebrate";
111 $this->
const[$r][3] =
'Name of PDF model of holiday';
112 $this->
const[$r][4] = 0;
115 $this->
const[$r][0] =
"HOLIDAY_ADDON_PDF_ODT_PATH";
116 $this->
const[$r][1] =
"chaine";
117 $this->
const[$r][2] =
"DOL_DATA_ROOT/doctemplates/holiday";
118 $this->
const[$r][3] =
"";
119 $this->
const[$r][4] = 0;
124 $this->tabs[] = array();
127 $this->boxes = array();
139 $this->rights = array();
142 $this->rights[$r][0] = 20001;
143 $this->rights[$r][1] =
'Read leave requests (yours and your subordinates)';
144 $this->rights[$r][3] = 0;
145 $this->rights[$r][4] =
'read';
146 $this->rights[$r][5] =
'';
149 $this->rights[$r][0] = 20002;
150 $this->rights[$r][1] =
'Create/modify leave requests';
151 $this->rights[$r][3] = 0;
152 $this->rights[$r][4] =
'write';
153 $this->rights[$r][5] =
'';
156 $this->rights[$r][0] = 20003;
157 $this->rights[$r][1] =
'Delete leave requests';
158 $this->rights[$r][3] = 0;
159 $this->rights[$r][4] =
'delete';
160 $this->rights[$r][5] =
'';
163 $this->rights[$r][0] = 20007;
164 $this->rights[$r][1] =
'Approve leave requests';
165 $this->rights[$r][2] =
'w';
166 $this->rights[$r][3] = 0;
167 $this->rights[$r][4] =
'approve';
170 $this->rights[$r][0] = 20004;
171 $this->rights[$r][1] =
'Read leave requests for everybody';
172 $this->rights[$r][3] = 0;
173 $this->rights[$r][4] =
'readall';
174 $this->rights[$r][5] =
'';
177 $this->rights[$r][0] = 20005;
178 $this->rights[$r][1] =
'Create/modify leave requests for everybody';
179 $this->rights[$r][3] = 0;
180 $this->rights[$r][4] =
'writeall_advance';
181 $this->rights[$r][5] =
'';
184 $this->rights[$r][0] = 20006;
185 $this->rights[$r][1] =
'Setup leave requests of users (setup and update balance)';
186 $this->rights[$r][3] = 0;
187 $this->rights[$r][4] =
'define_holiday';
188 $this->rights[$r][5] =
'';
201 $this->export_code[$r] =
'leaverequest_'.$r;
202 $this->export_label[$r] =
'ListeCP';
203 $this->export_icon[$r] =
'holiday';
204 $this->export_permission[$r] = array(array(
"holiday",
"readall"));
205 $this->export_fields_array[$r] = array(
206 'd.rowid'=>
"LeaveId",
'd.fk_type'=>
'TypeOfLeaveId',
't.code'=>
'TypeOfLeaveCode',
't.label'=>
'TypeOfLeaveLabel',
'd.fk_user'=>
'UserID',
207 'u.lastname'=>
'Lastname',
'u.firstname'=>
'Firstname',
'u.login'=>
"Login",
'd.date_debut'=>
'DateStart',
'd.date_fin'=>
'DateEnd',
'd.halfday'=>
'HalfDay',
'none.num_open_days'=>
'NbUseDaysCP',
208 'd.date_valid'=>
'DateApprove',
'd.fk_validator'=>
"UserForApprovalID",
'ua.lastname'=>
"UserForApprovalLastname",
'ua.firstname'=>
"UserForApprovalFirstname",
209 'ua.login'=>
"UserForApprovalLogin",
'd.description'=>
'Description',
'd.statut'=>
'Status'
211 $this->export_TypeFields_array[$r] = array(
212 'd.rowid'=>
"Numeric",
't.code'=>
'Text',
't.label'=>
'Text',
'd.fk_user'=>
'Numeric',
213 'u.lastname'=>
'Text',
'u.firstname'=>
'Text',
'u.login'=>
"Text",
'd.date_debut'=>
'Date',
'd.date_fin'=>
'Date',
'none.num_open_days'=>
'NumericCompute',
214 'd.date_valid'=>
'Date',
'd.fk_validator'=>
"Numeric",
'ua.lastname'=>
"Text",
'ua.firstname'=>
"Text",
215 'ua.login'=>
"Text",
'd.description'=>
'Text',
'd.statut'=>
'Numeric'
217 $this->export_entities_array[$r] = array(
218 'u.lastname'=>
'user',
'u.firstname'=>
'user',
'u.login'=>
'user',
'ua.lastname'=>
'user',
'ua.firstname'=>
'user',
'ua.login'=>
'user'
220 $this->export_alias_array[$r] = array(
'd.rowid'=>
"idholiday");
221 $this->export_special_array[$r] = array(
'none.num_open_days'=>
'getNumOpenDays');
222 $this->export_dependencies_array[$r] = array();
224 $keyforselect =
'holiday'; $keyforelement =
'holiday'; $keyforaliasextra =
'extra';
225 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
227 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
228 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'holiday as d';
229 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'holiday_extrafields as extra on d.rowid = extra.fk_object';
230 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_holiday_types as t ON t.rowid = d.fk_type';
231 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as ua ON ua.rowid = d.fk_validator,';
232 $this->export_sql_end[$r] .=
' '.MAIN_DB_PREFIX.
'user as u';
233 $this->export_sql_end[$r] .=
' WHERE d.fk_user = u.rowid';
234 $this->export_sql_end[$r] .=
' AND d.entity IN ('.getEntity(
'holiday').
')';
281 public function init($options =
'')
286 $this->
remove($options);
312 return $this->
_init($sql, $options);
</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.
Description and activation class for module holiday.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
__construct($db)
Constructor.
_init($array_sql, $options= '')
Enables a module.
init($options= '')
Function called when module is enabled.