28 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
50 $this->rights_class =
'recruitment';
55 $this->module_position =
'44';
59 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
61 $this->
description =
"Manage and follow recruitment campaign for new job positions";
63 $this->descriptionlong =
"Manage and follow recruitment campaign for new job positions";
65 $this->version =
'experimental';
70 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
74 $this->picto =
'recruitmentjobposition';
76 $this->module_parts = array(
110 'moduleforexternal' => 0,
114 $this->dirs = array(
"/recruitment/temp");
116 $this->config_page_url = array(
"setup.php@recruitment");
119 $this->hidden =
false;
121 $this->depends = array();
122 $this->requiredby = array();
123 $this->conflictwith = array();
124 $this->langfiles = array(
"recruitment");
125 $this->phpmin = array(5, 5);
126 $this->need_dolibarr_version = array(11, -3);
127 $this->warnings_activation = array();
128 $this->warnings_activation_ext = array();
137 $this->
const = array(
147 if (!isset($conf->recruitment) || !isset($conf->recruitment->enabled)) {
148 $conf->recruitment =
new stdClass();
149 $conf->recruitment->enabled = 0;
153 $this->tabs = array();
181 $this->dictionaries = array();
208 $this->boxes = array(
219 $this->cronjobs = array(
241 $this->rights = array();
245 $this->rights[$r][0] = $this->numero + $r;
246 $this->rights[$r][1] =
'Read job positions to fill and candidatures';
247 $this->rights[$r][4] =
'recruitmentjobposition';
248 $this->rights[$r][5] =
'read';
250 $this->rights[$r][0] = $this->numero + $r;
251 $this->rights[$r][1] =
'Create/Update job positions to fill and candidatures';
252 $this->rights[$r][4] =
'recruitmentjobposition';
253 $this->rights[$r][5] =
'write';
255 $this->rights[$r][0] = $this->numero + $r;
256 $this->rights[$r][1] =
'Delete Job positions to fill and candidatures';
257 $this->rights[$r][4] =
'recruitmentjobposition';
258 $this->rights[$r][5] =
'delete';
263 $this->menu = array();
269 $this->menu[$r++] = array(
270 'fk_menu'=>
'fk_mainmenu=hrm',
272 'titre'=>
'Recruitment',
274 'leftmenu'=>
'recruitmentjobposition',
275 'url'=>
'/recruitment/recruitmentindex.php',
276 'langs'=>
'recruitment',
277 'position'=>1000 + $r,
278 'enabled'=>
'$conf->recruitment->enabled',
279 'perms'=>
'$user->rights->recruitment->recruitmentjobposition->read',
283 $this->menu[$r++] = array(
284 'fk_menu'=>
'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition',
286 'titre'=>
'NewPositionToBeFilled',
288 'leftmenu'=>
'recruitment_recruitmentjobposition_new',
289 'url'=>
'/recruitment/recruitmentjobposition_card.php?action=create',
290 'langs'=>
'recruitment',
291 'position'=>1000 + $r,
292 'enabled'=>
'$conf->recruitment->enabled',
293 'perms'=>
'$user->rights->recruitment->recruitmentjobposition->write',
297 $this->menu[$r++] = array(
298 'fk_menu'=>
'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition',
300 'titre'=>
'ListOfPositionsToBeFilled',
302 'leftmenu'=>
'recruitment_recruitmentjobposition_list',
303 'url'=>
'/recruitment/recruitmentjobposition_list.php',
304 'langs'=>
'recruitment',
305 'position'=>1000 + $r,
306 'enabled'=>
'$conf->recruitment->enabled',
307 'perms'=>
'$user->rights->recruitment->recruitmentjobposition->read',
311 $this->menu[$r++] = array(
312 'fk_menu'=>
'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition',
314 'titre'=>
'NewCandidature',
316 'leftmenu'=>
'recruitment_recruitmentcandidature_new',
317 'url'=>
'/recruitment/recruitmentcandidature_card.php?action=create',
318 'langs'=>
'recruitment',
319 'position'=>1000 + $r,
320 'enabled'=>
'$conf->recruitment->enabled',
321 'perms'=>
'$user->rights->recruitment->recruitmentjobposition->write',
325 $this->menu[$r++] = array(
326 'fk_menu'=>
'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition',
328 'titre'=>
'ListOfCandidatures',
330 'leftmenu'=>
'recruitment_recruitmentcandidature_list',
331 'url'=>
'/recruitment/recruitmentcandidature_list.php',
332 'langs'=>
'recruitment',
333 'position'=>1000 + $r,
334 'enabled'=>
'$conf->recruitment->enabled',
335 'perms'=>
'$user->rights->recruitment->recruitmentjobposition->read',
401 public function init($options =
'')
403 global $conf, $langs;
406 if ($result < 0)
return -1;
418 $this->
remove($options);
423 $moduledir =
'mymodule';
424 $myTmpObjects = array();
425 $myTmpObjects[
'RecruitmentJobPosition'] = array(
'includerefgeneration'=>1,
'includedocgeneration'=>1);
427 foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
428 if ($myTmpObjectKey ==
'MyObject')
continue;
429 if ($myTmpObjectArray[
'includerefgeneration']) {
430 $src = DOL_DOCUMENT_ROOT.
'/install/doctemplates/mymodule/template_myobjects.odt';
431 $dirodt = DOL_DATA_ROOT.
'/doctemplates/mymodule';
432 $dest = $dirodt.
'/template_myobjects.odt';
434 if (file_exists($src) && !file_exists($dest))
436 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
438 $result =
dol_copy($src, $dest, 0, 0);
441 $langs->load(
"errors");
442 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
447 $sql = array_merge($sql, array(
448 "DELETE FROM ".MAIN_DB_PREFIX.
"document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey).
"' AND type = '".strtolower($myTmpObjectKey).
"' AND entity = ".$conf->entity,
449 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey).
"','".strtolower($myTmpObjectKey).
"',".$conf->entity.
")",
450 "DELETE FROM ".MAIN_DB_PREFIX.
"document_model WHERE nom = 'generic_".strtolower($myTmpObjectKey).
"_odt' AND type = '".strtolower($myTmpObjectKey).
"' AND entity = ".$conf->entity,
451 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey).
"_odt', '".strtolower($myTmpObjectKey).
"', ".$conf->entity.
")"
456 return $this->
_init($sql, $options);
467 public function remove($options =
'')
470 return $this->
_remove($sql, $options);
dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
Copy a file to another file.
</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.
__construct($db)
Constructor.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
init($options= '')
Function called when module is enabled.
_remove($array_sql, $options= '')
Disable function.
_init($array_sql, $options= '')
Enables a module.
Description and activation class for module Recruitment.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
_load_tables($reldir)
Create tables and keys required by module.