forked from Wavyzz/dolibarr
WIP Recruitment module
This commit is contained in:
@@ -207,11 +207,12 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
||||
* @param string $objectname Name of object
|
||||
* @param string $newmask New mask
|
||||
* @param string $readdir Directory source (use $destdir when not defined)
|
||||
* @param Object $object If object was already loaded/known, it is pass to avaoid another include and new.
|
||||
* @param Object $object If object was already loaded/known, it is pass to avoid another include and new.
|
||||
* @param string $moduletype 'external' or 'internal'
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @see rebuildObjectClass()
|
||||
*/
|
||||
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null)
|
||||
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null, $moduletype = 'external')
|
||||
{
|
||||
global $db, $langs;
|
||||
|
||||
@@ -223,8 +224,14 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
||||
$pathoffiletoclasssrc = $readdir.'/class/'.strtolower($objectname).'.class.php';
|
||||
|
||||
// Edit .sql file
|
||||
if ($moduletype == 'internal') {
|
||||
$pathoffiletoeditsrc = $readdir.'/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
|
||||
$pathoffiletoedittarget = $destdir.'/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'.($readdir != $destdir ? '.new' : '');
|
||||
} else {
|
||||
$pathoffiletoeditsrc = $readdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
|
||||
$pathoffiletoedittarget = $destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'.($readdir != $destdir ? '.new' : '');
|
||||
}
|
||||
|
||||
if (!dol_is_file($pathoffiletoeditsrc))
|
||||
{
|
||||
$langs->load("errors");
|
||||
@@ -293,8 +300,13 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
||||
}
|
||||
|
||||
// Edit .key.sql file
|
||||
if ($moduletype == 'internal') {
|
||||
$pathoffiletoeditsrc = $readdir.'/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql';
|
||||
$pathoffiletoedittarget = $destdir.'/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql'.($readdir != $destdir ? '.new' : '');
|
||||
} else {
|
||||
$pathoffiletoeditsrc = $destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql';
|
||||
$pathoffiletoedittarget = $destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql'.($readdir != $destdir ? '.new' : '');
|
||||
}
|
||||
|
||||
$contentsql = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r');
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
-- Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation, either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
-- BEGIN MODULEBUILDER INDEXES
|
||||
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_rowid (rowid);
|
||||
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_ref (ref);
|
||||
ALTER TABLE llx_recruitment_recruitmentcandidature ADD CONSTRAINT llx_recruitment_recruitmentcandidature_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
|
||||
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_status (status);
|
||||
-- END MODULEBUILDER INDEXES
|
||||
|
||||
--ALTER TABLE llx_mymodule_myobject ADD UNIQUE INDEX uk_mymodule_myobject_fieldxy(fieldx, fieldy);
|
||||
|
||||
--ALTER TABLE llx_mymodule_myobject ADD CONSTRAINT llx_mymodule_myobject_fk_field FOREIGN KEY (fk_field) REFERENCES llx_mymodule_myotherobject(rowid);
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
-- Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation, either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
CREATE TABLE llx_recruitment_recruitmentcandidature(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||
description text,
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
model_pdf varchar(255),
|
||||
status smallint NOT NULL,
|
||||
firstname varchar(128),
|
||||
lastname varchar(128),
|
||||
remuneration_requested integer,
|
||||
remuneration_proposed integer
|
||||
-- END MODULEBUILDER FIELDS
|
||||
) ENGINE=innodb;
|
||||
@@ -0,0 +1,19 @@
|
||||
-- Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
-- BEGIN MODULEBUILDER INDEXES
|
||||
ALTER TABLE llx_recruitment_recruitmentcandidature_extrafields ADD INDEX idx_fk_object(fk_object);
|
||||
-- END MODULEBUILDER INDEXES
|
||||
@@ -0,0 +1,23 @@
|
||||
-- Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
create table llx_recruitment_recruitmentcandidature_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL,
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
@@ -95,6 +95,85 @@ $result = restrictedArea($user, 'modulebuilder', null);
|
||||
$error = 0;
|
||||
|
||||
|
||||
// Define $listofmodules
|
||||
$dirsrootforscan = array($dirread);
|
||||
// Add also the core modules into the list of modules to show/edit
|
||||
if ($dirread != DOL_DOCUMENT_ROOT && ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->MODULEBUILDER_ADD_DOCUMENT_ROOT))) { $dirsrootforscan[] = DOL_DOCUMENT_ROOT; }
|
||||
|
||||
// Search modules to edit
|
||||
$textforlistofdirs = '<!-- Scanned dir -->'."\n";
|
||||
$listofmodules = array();
|
||||
$i = 0;
|
||||
foreach ($dirsrootforscan as $dirread)
|
||||
{
|
||||
$moduletype = 'external';
|
||||
if ($dirread == DOL_DOCUMENT_ROOT) {
|
||||
$moduletype = 'internal';
|
||||
}
|
||||
|
||||
$dirsincustom = dol_dir_list($dirread, 'directories');
|
||||
if (is_array($dirsincustom) && count($dirsincustom) > 0) {
|
||||
foreach ($dirsincustom as $dircustomcursor) {
|
||||
$fullname = $dircustomcursor['fullname'];
|
||||
if (dol_is_file($fullname.'/'.$FILEFLAG))
|
||||
{
|
||||
// Get real name of module (MyModule instead of mymodule)
|
||||
$dirtoscanrel = basename($fullname).'/core/modules/';
|
||||
|
||||
$descriptorfiles = dol_dir_list(dirname($fullname).'/'.$dirtoscanrel, 'files', 0, 'mod.*\.class\.php$');
|
||||
if (empty($descriptorfiles)) // If descriptor not found into module dir, we look into main module dir.
|
||||
{
|
||||
$dirtoscanrel = 'core/modules/';
|
||||
$descriptorfiles = dol_dir_list($fullname.'/../'.$dirtoscanrel, 'files', 0, 'mod'.strtoupper(basename($fullname)).'\.class\.php$');
|
||||
}
|
||||
$modulenamewithcase = '';
|
||||
$moduledescriptorrelpath = '';
|
||||
$moduledescriptorfullpath = '';
|
||||
|
||||
foreach ($descriptorfiles as $descriptorcursor) {
|
||||
$modulenamewithcase = preg_replace('/^mod/', '', $descriptorcursor['name']);
|
||||
$modulenamewithcase = preg_replace('/\.class\.php$/', '', $modulenamewithcase);
|
||||
$moduledescriptorrelpath = $dirtoscanrel.$descriptorcursor['name'];
|
||||
$moduledescriptorfullpath = $descriptorcursor['fullname'];
|
||||
//var_dump($descriptorcursor);
|
||||
}
|
||||
if ($modulenamewithcase)
|
||||
{
|
||||
$listofmodules[$dircustomcursor['name']] = array(
|
||||
'modulenamewithcase'=>$modulenamewithcase,
|
||||
'moduledescriptorrelpath'=> $moduledescriptorrelpath,
|
||||
'moduledescriptorfullpath'=>$moduledescriptorfullpath,
|
||||
'moduledescriptorrootpath'=>$dirread,
|
||||
'moduletype'=>$moduletype
|
||||
);
|
||||
}
|
||||
//var_dump($listofmodules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($forceddirread && empty($listofmodules)) // $forceddirread is 1 if we forced dir to read with dirins=... or with module=...@mydir
|
||||
{
|
||||
$listofmodules[strtolower($module)] = array(
|
||||
'modulenamewithcase'=>$module,
|
||||
'moduledescriptorrelpath'=> 'notyetimplemented',
|
||||
'moduledescriptorfullpath'=> 'notyetimplemented',
|
||||
'moduledescriptorrootpath'=> 'notyetimplemented',
|
||||
);
|
||||
}
|
||||
|
||||
// Show description of content
|
||||
$newdircustom = $dirins;
|
||||
if (empty($newdircustom)) $newdircustom = img_warning();
|
||||
// If dirread was forced to somewhere else, by using URL
|
||||
// htdocs/modulebuilder/index.php?module=Inventory@/home/ldestailleur/git/dolibarr/htdocs/product
|
||||
if (empty($i)) $textforlistofdirs .= $langs->trans("DirScanned").' : ';
|
||||
else $textforlistofdirs .= ', ';
|
||||
$textforlistofdirs .= '<strong class="wordbreakimp">'.$dirread.'</strong>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@@ -214,7 +293,6 @@ if ($dirins && $action == 'initmodule' && $modulename)
|
||||
}
|
||||
|
||||
$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
|
||||
|
||||
//var_dump($result);
|
||||
if ($result < 0)
|
||||
{
|
||||
@@ -769,6 +847,9 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
|
||||
{
|
||||
$objectname = ucfirst($objectname);
|
||||
|
||||
$dirins = $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
|
||||
$moduletype = $listofmodules[strtolower($module)]['moduletype'];
|
||||
|
||||
if (preg_match('/[^a-z0-9_]/i', $objectname))
|
||||
{
|
||||
$error++;
|
||||
@@ -1076,6 +1157,9 @@ if ($dirins && $action == 'addproperty' && !empty($module) && !empty($tabobj))
|
||||
|
||||
$objectname = $tabobj;
|
||||
|
||||
$dirins = $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
|
||||
$moduletype = $listofmodules[strtolower($module)]['moduletype'];
|
||||
|
||||
$srcdir = $dirread.'/'.strtolower($module);
|
||||
$destdir = $dirins.'/'.strtolower($module);
|
||||
dol_mkdir($destdir);
|
||||
@@ -1125,7 +1209,9 @@ if ($dirins && $action == 'addproperty' && !empty($module) && !empty($tabobj))
|
||||
// Edit the class file to write properties
|
||||
if (!$error)
|
||||
{
|
||||
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry);
|
||||
$moduletype = 'external';
|
||||
|
||||
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry, $moduletype);
|
||||
if (is_numeric($object) && $object <= 0)
|
||||
{
|
||||
$error++;
|
||||
@@ -1135,7 +1221,9 @@ if ($dirins && $action == 'addproperty' && !empty($module) && !empty($tabobj))
|
||||
// Edit sql with new properties
|
||||
if (!$error)
|
||||
{
|
||||
$result = rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object);
|
||||
$moduletype = 'external';
|
||||
|
||||
$result = rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object, $moduletype);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
@@ -1477,79 +1565,11 @@ print load_fiche_titre($text, '', 'title_setup');
|
||||
|
||||
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModuleBuilderDesc", 'https://wiki.dolibarr.org/index.php/Module_development#Create_your_module').'</span><br>';
|
||||
|
||||
$dirsrootforscan = array($dirread);
|
||||
// Add also the core modules into the list of modules to show/edit
|
||||
if ($dirread != DOL_DOCUMENT_ROOT && ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->MODULEBUILDER_ADD_DOCUMENT_ROOT))) { $dirsrootforscan[] = DOL_DOCUMENT_ROOT; }
|
||||
|
||||
// Search modules to edit
|
||||
print '<!-- Scanned dir -->'."\n";
|
||||
$listofmodules = array();
|
||||
$i = 0;
|
||||
foreach ($dirsrootforscan as $dirread)
|
||||
{
|
||||
$dirsincustom = dol_dir_list($dirread, 'directories');
|
||||
if (is_array($dirsincustom) && count($dirsincustom) > 0) {
|
||||
foreach ($dirsincustom as $dircustomcursor) {
|
||||
$fullname = $dircustomcursor['fullname'];
|
||||
if (dol_is_file($fullname.'/'.$FILEFLAG))
|
||||
{
|
||||
// Get real name of module (MyModule instead of mymodule)
|
||||
$dirtoscanrel = basename($fullname).'/core/modules/';
|
||||
|
||||
$descriptorfiles = dol_dir_list(dirname($fullname).'/'.$dirtoscanrel, 'files', 0, 'mod.*\.class\.php$');
|
||||
if (empty($descriptorfiles)) // If descriptor not found into module dir, we look into main module dir.
|
||||
{
|
||||
$dirtoscanrel = 'core/modules/';
|
||||
$descriptorfiles = dol_dir_list($fullname.'/../'.$dirtoscanrel, 'files', 0, 'mod'.strtoupper(basename($fullname)).'\.class\.php$');
|
||||
}
|
||||
$modulenamewithcase = '';
|
||||
$moduledescriptorrelpath = '';
|
||||
$moduledescriptorfullpath = '';
|
||||
|
||||
foreach ($descriptorfiles as $descriptorcursor) {
|
||||
$modulenamewithcase = preg_replace('/^mod/', '', $descriptorcursor['name']);
|
||||
$modulenamewithcase = preg_replace('/\.class\.php$/', '', $modulenamewithcase);
|
||||
$moduledescriptorrelpath = $dirtoscanrel.$descriptorcursor['name'];
|
||||
$moduledescriptorfullpath = $descriptorcursor['fullname'];
|
||||
//var_dump($descriptorcursor);
|
||||
}
|
||||
if ($modulenamewithcase)
|
||||
{
|
||||
$listofmodules[$dircustomcursor['name']] = array(
|
||||
'modulenamewithcase'=>$modulenamewithcase,
|
||||
'moduledescriptorrelpath'=> $moduledescriptorrelpath,
|
||||
'moduledescriptorfullpath'=>$moduledescriptorfullpath,
|
||||
'moduledescriptorrootpath'=>$dirread
|
||||
);
|
||||
}
|
||||
//var_dump($listofmodules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($forceddirread && empty($listofmodules)) // $forceddirread is 1 if we forced dir to read with dirins=... or with module=...@mydir
|
||||
{
|
||||
$listofmodules[strtolower($module)] = array(
|
||||
'modulenamewithcase'=>$module,
|
||||
'moduledescriptorrelpath'=> 'notyetimplemented',
|
||||
'moduledescriptorfullpath'=> 'notyetimplemented',
|
||||
'moduledescriptorrootpath'=> 'notyetimplemented',
|
||||
);
|
||||
}
|
||||
|
||||
// Show description of content
|
||||
$newdircustom = $dirins;
|
||||
if (empty($newdircustom)) $newdircustom = img_warning();
|
||||
// If dirread was forced to somewhere else, by using URL
|
||||
// htdocs/modulebuilder/index.php?module=Inventory@/home/ldestailleur/git/dolibarr/htdocs/product
|
||||
if (empty($i)) print $langs->trans("DirScanned").' : ';
|
||||
else print ', ';
|
||||
print '<strong class="wordbreakimp">'.$dirread.'</strong>';
|
||||
$i++;
|
||||
}
|
||||
print $textforlistofdirs;
|
||||
print '<br>';
|
||||
//var_dump($listofmodules);
|
||||
|
||||
|
||||
$message = '';
|
||||
if (!$dirins)
|
||||
{
|
||||
@@ -1583,7 +1603,6 @@ $error = 0;
|
||||
$moduleobj = null;
|
||||
|
||||
|
||||
|
||||
if (!empty($module) && $module != 'initmodule' && $module != 'deletemodule')
|
||||
{
|
||||
$modulelowercase = strtolower($module);
|
||||
@@ -1835,6 +1854,8 @@ if ($module == 'initmodule')
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Note module is inside $dirread
|
||||
|
||||
if ($tab == 'description')
|
||||
{
|
||||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
@@ -2315,29 +2336,31 @@ if ($module == 'initmodule')
|
||||
$pathtopicto = strtolower($module).'/img/object_'.strtolower($tabobj).'.png';
|
||||
$pathtoscript = strtolower($module).'/scripts/'.strtolower($tabobj).'.php';
|
||||
|
||||
//var_dump($pathtolib);
|
||||
$realpathtoclass = dol_buildpath($pathtoclass, 0, 2);
|
||||
$realpathtoapi = dol_buildpath($pathtoapi, 0, 2);
|
||||
$realpathtoagenda = dol_buildpath($pathtoagenda, 0, 2);
|
||||
$realpathtocard = dol_buildpath($pathtocard, 0, 2);
|
||||
$realpathtodocument = dol_buildpath($pathtodocument, 0, 2);
|
||||
$realpathtolist = dol_buildpath($pathtolist, 0, 2);
|
||||
$realpathtonote = dol_buildpath($pathtonote, 0, 2);
|
||||
$realpathtophpunit = dol_buildpath($pathtophpunit, 0, 2);
|
||||
$realpathtosql = dol_buildpath($pathtosql, 0, 2);
|
||||
$realpathtosqlextra = dol_buildpath($pathtosqlextra, 0, 2);
|
||||
$realpathtosqlkey = dol_buildpath($pathtosqlkey, 0, 2);
|
||||
$realpathtosqlextrakey = dol_buildpath($pathtosqlextrakey, 0, 2);
|
||||
$realpathtolib = dol_buildpath($pathtolib, 0, 2);
|
||||
$realpathtoobjlib = dol_buildpath($pathtoobjlib, 0, 2);
|
||||
$realpathtopicto = dol_buildpath($pathtopicto, 0, 2);
|
||||
$realpathtoscript = dol_buildpath($pathtoscript, 0, 2);
|
||||
//var_dump($pathtoclass); var_dump($dirread);
|
||||
$realpathtoclass = $dirread.'/'.$pathtoclass;
|
||||
$realpathtoapi = $dirread.'/'.$pathtoapi;
|
||||
$realpathtoagenda = $dirread.'/'.$pathtoagenda;
|
||||
$realpathtocard = $dirread.'/'.$pathtocard;
|
||||
$realpathtodocument = $dirread.'/'.$pathtodocument;
|
||||
$realpathtolist = $dirread.'/'.$pathtolist;
|
||||
$realpathtonote = $dirread.'/'.$pathtonote;
|
||||
$realpathtophpunit = $dirread.'/'.$pathtophpunit;
|
||||
$realpathtosql = $dirread.'/'.$pathtosql;
|
||||
$realpathtosqlextra = $dirread.'/'.$pathtosqlextra;
|
||||
$realpathtosqlkey = $dirread.'/'.$pathtosqlkey;
|
||||
$realpathtosqlextrakey = $dirread.'/'.$pathtosqlextrakey;
|
||||
$realpathtolib = $dirread.'/'.$pathtolib;
|
||||
$realpathtoobjlib = $dirread.'/'.$pathtoobjlib;
|
||||
$realpathtopicto = $dirread.'/'.$pathtopicto;
|
||||
$realpathtoscript = $dirread.'/'.$pathtoscript;
|
||||
|
||||
if (empty($realpathtoapi)) // For compatibility with some old modules
|
||||
{
|
||||
$pathtoapi = strtolower($module).'/class/api_'.strtolower($module).'s.class.php';
|
||||
$realpathtoapi = dol_buildpath($pathtoapi, 0, 2);
|
||||
$realpathtoapi = $dirread.'/'.$pathtoapi;
|
||||
}
|
||||
$urloflist = $dirread.'/'.$pathtolist;
|
||||
$urlofcard = $dirread.'/'.$pathtocard;
|
||||
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("ClassFile").' : <strong>'.($realpathtoclass ? '' : '<strike>').$pathtoclass.($realpathtoclass ? '' : '</strike>').'</strong>';
|
||||
@@ -2423,9 +2446,6 @@ if ($module == 'initmodule')
|
||||
print '<br>';
|
||||
print '</div>';
|
||||
|
||||
$urloflist = dol_buildpath($pathtolist, 1);
|
||||
$urlofcard = dol_buildpath($pathtocard, 1);
|
||||
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForList").' : <strong><a href="'.$urloflist.'" target="_test">'.($realpathtolist ? '' : '<strike>').$pathtolist.($realpathtolist ? '' : '</strike>').'</a></strong>';
|
||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtolist).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
@@ -2472,7 +2492,7 @@ if ($module == 'initmodule')
|
||||
|
||||
if (function_exists('opcache_invalidate')) opcache_invalidate($dirread.'/'.$pathtoclass, true); // remove the include cache hell !
|
||||
|
||||
if (empty($forceddirread))
|
||||
if (empty($forceddirread) && empty($dirread))
|
||||
{
|
||||
$result = dol_include_once($pathtoclass);
|
||||
} else {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# DO NOT DELETE THIS FILE MANUALLY
|
||||
# File to flag module built using official module template.
|
||||
# When this file is present into a module directory, you can edit it with the module builder tool. Use ModuleBuilder if you want to delete module.
|
||||
# When this file is present into a module directory, you can edit it with the module builder tool.
|
||||
@@ -264,6 +264,12 @@ if ($object->date_planned > $now) {
|
||||
}
|
||||
print '</b><br>';
|
||||
|
||||
// Remuneration
|
||||
print $langs->trans("Remuneration").' : ';
|
||||
print '<b>';
|
||||
print $object->remuneration_suggested;
|
||||
print '</b><br>';
|
||||
|
||||
// Contact
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($object->fk_user_recruiter);
|
||||
|
||||
1040
htdocs/recruitment/class/recruitmentcandidature.class.php
Normal file
1040
htdocs/recruitment/class/recruitmentcandidature.class.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -45,7 +45,7 @@ class RecruitmentJobPosition extends CommonObject
|
||||
* @var int Does this object support multicompany module ?
|
||||
* 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table
|
||||
*/
|
||||
public $ismultientitymanaged = 0;
|
||||
public $ismultientitymanaged = 1;
|
||||
|
||||
/**
|
||||
* @var int Does object support extrafields ? 0=No, 1=Yes
|
||||
|
||||
@@ -358,10 +358,10 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
|
||||
$pdf->SetDrawColor(128, 128, 128);
|
||||
|
||||
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
|
||||
$pdf->SetSubject($outputlangs->transnoentities("JobPosition"));
|
||||
$pdf->SetSubject($object->label);
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("JobPosition")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$object->label." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
|
||||
if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
// Set certificate
|
||||
@@ -872,11 +872,11 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
|
||||
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0, 0, 60);
|
||||
$title = $outputlangs->transnoentities("JobPosition");
|
||||
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
|
||||
$title = $object->label;
|
||||
/*if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
|
||||
$title .= ' - ';
|
||||
$title .= $outputlangsbis->transnoentities("JobPosition");
|
||||
}
|
||||
}*/
|
||||
$pdf->MultiCell($w, 3, $title, '', 'R');
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size);
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# DO NOT DELETE THIS FILE MANUALLY
|
||||
# File to flag module built using official module template.
|
||||
# When this file is present into a module directory, you can edit it with the module builder tool. Use ModuleBuilder if you want to delete module.
|
||||
# When this file is present into a module directory, you can edit it with the module builder tool.
|
||||
@@ -539,52 +539,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
$includedocgeneration = 1;
|
||||
|
||||
// Documents
|
||||
if ($includedocgeneration) {
|
||||
$objref = dol_sanitizeFileName($object->ref);
|
||||
$relativepath = $objref . '/' . $objref . '.pdf';
|
||||
$filedir = $conf->recruitment->dir_output.'/'.$object->element.'/'.$objref;
|
||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||
$genallowed = $user->rights->recruitment->recruitmentjobposition->read; // If you can read, you can build the PDF to read content
|
||||
$delallowed = $user->rights->recruitment->recruitmentjobposition->write; // If you can create/edit, you can remove a file on card
|
||||
print $formfile->showdocuments('recruitment:RecruitmentJobPosition', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
|
||||
}
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('recruitmentjobposition'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
// Show link to public job page
|
||||
if ($object->status != RecruitmentJobPosition::STATUS_DRAFT)
|
||||
{
|
||||
print '<br><!-- Link to go on public job page -->'."\n";
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('recruitment'));
|
||||
|
||||
$out = img_picto('', 'globe').' '.$langs->trans("PublicUrl").'<br>';
|
||||
|
||||
$url = getPublicJobPositionUrl(0, $object->ref);
|
||||
$out .= '<input type="text" id="recruitmentjobpositionurl" class="quatrevingtpercent" value="'.$url.'">';
|
||||
$out .= '<a href="'.$url.'" target="_blank">'.img_picto('', 'globe').'</a>';
|
||||
$out .= ajax_autoselect("recruitmentjobpositionurl", 0);
|
||||
|
||||
print $out;
|
||||
}
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.dol_buildpath('/recruitment/recruitmentjobposition_agenda.php', 1).'?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element.'@recruitment', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user