29include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
51 $this->rights_class =
'recruitment';
56 $this->module_position =
'44';
60 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
62 $this->
description =
"Manage and follow recruitment campaign for new job positions";
64 $this->descriptionlong =
"Manage and follow recruitment campaign for new job positions";
66 $this->version =
'dolibarr';
71 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
75 $this->picto =
'recruitmentjobposition';
77 $this->module_parts = array(
111 'moduleforexternal' => 0,
115 $this->dirs = array(
"/recruitment/temp");
117 $this->config_page_url = array(
"setup.php@recruitment");
120 $this->hidden =
false;
122 $this->depends = array();
123 $this->requiredby = array();
124 $this->conflictwith = array();
125 $this->langfiles = array(
"recruitment");
126 $this->phpmin = array(7, 0);
127 $this->need_dolibarr_version = array(11, -3);
128 $this->warnings_activation = array();
129 $this->warnings_activation_ext = array();
139 $this->
const[$r][0] =
"RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON";
140 $this->
const[$r][1] =
"chaine";
141 $this->
const[$r][2] =
"mod_recruitmentjobposition_standard";
142 $this->
const[$r][3] =
'Name of manager to generate recruitment job position ref number';
143 $this->
const[$r][4] = 0;
146 $this->
const[$r][0] =
"RECRUITMENT_RECRUITMENTCANDIDATURE_ADDON";
147 $this->
const[$r][1] =
"chaine";
148 $this->
const[$r][2] =
"mod_recruitmentcandidature_standard";
149 $this->
const[$r][3] =
'Name of manager to generate recruitment candidature ref number';
150 $this->
const[$r][4] = 0;
159 if (!isset($conf->recruitment) || !isset($conf->recruitment->enabled)) {
160 $conf->recruitment =
new stdClass();
161 $conf->recruitment->enabled = 0;
165 $this->tabs = array();
193 $this->dictionaries = array();
197 $this->boxes = array(
208 $this->cronjobs = array(
230 $this->rights = array();
234 $this->rights[$r][0] = $this->numero + $r;
235 $this->rights[$r][1] =
'Read job positions to fill and candidatures';
236 $this->rights[$r][4] =
'recruitmentjobposition';
237 $this->rights[$r][5] =
'read';
239 $this->rights[$r][0] = $this->numero + $r;
240 $this->rights[$r][1] =
'Create/Update job positions to fill and candidatures';
241 $this->rights[$r][4] =
'recruitmentjobposition';
242 $this->rights[$r][5] =
'write';
244 $this->rights[$r][0] = $this->numero + $r;
245 $this->rights[$r][1] =
'Delete Job positions to fill and candidatures';
246 $this->rights[$r][4] =
'recruitmentjobposition';
247 $this->rights[$r][5] =
'delete';
252 $this->menu = array();
258 $this->menu[$r++] = array(
259 'fk_menu' =>
'fk_mainmenu=hrm',
261 'titre' =>
'Recruitment',
262 'prefix' =>
img_picto(
'', $this->picto,
'class="paddingright pictofixedwidth"'),
264 'leftmenu' =>
'recruitmentjobposition',
265 'url' =>
'/recruitment/index.php',
266 'langs' =>
'recruitment',
267 'position' => 1000 + $r,
268 'enabled' =>
'$conf->recruitment->enabled',
269 'perms' =>
'$user->hasRight("recruitment", "recruitmentjobposition", "read")',
273 $this->menu[$r++] = array(
274 'fk_menu' =>
'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition',
276 'titre' =>
'NewPositionToBeFilled',
278 'leftmenu' =>
'recruitment_recruitmentjobposition_new',
279 'url' =>
'/recruitment/recruitmentjobposition_card.php?action=create',
280 'langs' =>
'recruitment',
281 'position' => 1000 + $r,
282 'enabled' =>
'$conf->recruitment->enabled',
283 'perms' =>
'$user->rights->recruitment->recruitmentjobposition->write',
287 $this->menu[$r++] = array(
288 'fk_menu' =>
'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition',
290 'titre' =>
'ListOfPositionsToBeFilled',
292 'leftmenu' =>
'recruitment_recruitmentjobposition_list',
293 'url' =>
'/recruitment/recruitmentjobposition_list.php',
294 'langs' =>
'recruitment',
295 'position' => 1000 + $r,
296 'enabled' =>
'$conf->recruitment->enabled',
297 'perms' =>
'$user->hasRight("recruitment", "recruitmentjobposition", "read")',
301 $this->menu[$r++] = array(
302 'fk_menu' =>
'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition',
304 'titre' =>
'NewCandidature',
306 'leftmenu' =>
'recruitment_recruitmentcandidature_new',
307 'url' =>
'/recruitment/recruitmentcandidature_card.php?action=create',
308 'langs' =>
'recruitment',
309 'position' => 1000 + $r,
310 'enabled' =>
'$conf->recruitment->enabled',
311 'perms' =>
'$user->rights->recruitment->recruitmentjobposition->write',
315 $this->menu[$r++] = array(
316 'fk_menu' =>
'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition',
318 'titre' =>
'ListOfCandidatures',
320 'leftmenu' =>
'recruitment_recruitmentcandidature_list',
321 'url' =>
'/recruitment/recruitmentcandidature_list.php',
322 'langs' =>
'recruitment',
323 'position' => 1000 + $r,
324 'enabled' =>
'$conf->recruitment->enabled',
325 'perms' =>
'$user->hasRight("recruitment", "recruitmentjobposition", "read")',
391 public function init($options =
'')
393 global $conf, $langs;
395 $result = $this->
_load_tables(
'/install/mysql/',
'recruitment');
410 $this->
remove($options);
415 $moduledir =
'recruitment';
416 $myTmpObjects = array();
417 $myTmpObjects[
'RecruitmentJobPosition'] = array(
'includerefgeneration' => 1,
'includedocgeneration' => 1);
419 foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
420 if ($myTmpObjectArray[
'includedocgeneration']) {
421 $src = DOL_DOCUMENT_ROOT.
'/install/doctemplates/'.$moduledir.
'/template_recruitmentjobposition.odt';
422 $dirodt = DOL_DATA_ROOT.
'/doctemplates/'.$moduledir;
423 $dest = $dirodt.
'/template_recruitmentjobposition.odt';
425 if (file_exists($src) && !file_exists($dest)) {
426 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
428 $result =
dol_copy($src, $dest,
'0', 0);
430 $langs->load(
"errors");
431 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
436 $sql = array_merge($sql, array(
437 "DELETE FROM ".MAIN_DB_PREFIX.
"document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey).
"' AND type = '".$this->db->escape(strtolower($myTmpObjectKey)).
"' AND entity = ".((
int) $conf->entity),
438 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey).
"','".$this->db->escape(strtolower($myTmpObjectKey)).
"',".((
int) $conf->entity).
")",
440 "DELETE FROM ".MAIN_DB_PREFIX.
"document_model WHERE nom = 'generic_".strtolower($myTmpObjectKey).
"_odt' AND type = '".$this->db->escape(strtolower($myTmpObjectKey)).
"' AND entity = ".((
int) $conf->entity),
441 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey).
"_odt', '".$this->db->escape(strtolower($myTmpObjectKey)).
"', ".((
int) $conf->entity).
")"
446 return $this->
_init($sql, $options);
457 public function remove($options =
'')
460 return $this->
_remove($sql, $options);
_init($array_sql, $options='')
Enables a module.
_remove($array_sql, $options='')
Disable function.
_load_tables($reldir, $onlywithsuffix='')
Create tables and keys required by module:
Description and activation class for module Recruitment.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_copy($srcfile, $destfile, $newmask='0', $overwriteifexists=1, $testvirus=0, $indexdatabase=0)
Copy a file to another file.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
$conf db name
Only used if Module[ID]Name translation string is not found.