From 4e6158d23c6772f13320a721ac02a16da18daf08 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Aug 2020 02:54:14 +0200 Subject: [PATCH] Work on recruitment module --- .../install/mysql/migration/12.0.0-13.0.0.sql | 13 +++++++- .../mysql/tables/llx_c_recruitment_origin.sql | 33 +++++++++++++++++++ ...llx_recruitment_recruitmentcandidature.sql | 3 +- .../class/recruitmentcandidature.class.php | 3 ++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 htdocs/install/mysql/tables/llx_c_recruitment_origin.sql diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 347985aad2b..3bb62c53e61 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -148,16 +148,20 @@ CREATE TABLE llx_recruitment_recruitmentcandidature( firstname varchar(128), lastname varchar(128), remuneration_requested integer, - remuneration_proposed integer + remuneration_proposed integer, + fk_recruitment_origin INTEGER NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; +ALTER TABLE llx_recruitment_recruitmentcandidature ADD COLUMN fk_recruitment_origin INTEGER NULL; + 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); + create table llx_recruitment_recruitmentcandidature_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -208,3 +212,10 @@ insert into llx_c_stcommcontact (id,code,libelle) values ( 3, 'ST_DONE', 'Conta ALTER TABLE llx_socpeople ADD COLUMN fk_prospectcontactlevel varchar(12) AFTER priv; ALTER TABLE llx_socpeople ADD COLUMN fk_stcommcontact integer DEFAULT 0 NOT NULL AFTER fk_prospectcontactlevel; +create table llx_c_recruitment_origin +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + code varchar(32) NOT NULL, + label varchar(64) NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_recruitment_origin.sql b/htdocs/install/mysql/tables/llx_c_recruitment_origin.sql new file mode 100644 index 00000000000..b18f7eb383c --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_recruitment_origin.sql @@ -0,0 +1,33 @@ +-- ======================================================================== +-- Copyright (C) 2005-2016 Laurent Destailleur +-- +-- 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 . +-- +-- Defini les types de contact d'un element sert de reference pour +-- la table llx_element_contact +-- +-- element est le nom de la table utilisant le type de contact. +-- i.e. contact, facture, projet, societe (sans le llx_ devant). +-- Libelle est un texte decrivant le type de contact. +-- active precise si cette valeur est 'active' ou 'archive'. +-- +-- ======================================================================== + +create table llx_c_recruitment_origin +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + code varchar(32) NOT NULL, + label varchar(64) NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql index fb9cf56c8b2..43bdb14e7bd 100644 --- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql +++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql @@ -32,6 +32,7 @@ CREATE TABLE llx_recruitment_recruitmentcandidature( firstname varchar(128), lastname varchar(128), remuneration_requested integer, - remuneration_proposed integer + remuneration_proposed integer, + fk_recruitment_origin INTEGER NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 4ee4bccbb7a..4a18ddf85fb 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -111,9 +111,11 @@ class RecruitmentCandidature extends CommonObject 'lastname' => array('type'=>'varchar(128)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>21, 'notnull'=>0, 'visible'=>1,), 'remuneration_requested' => array('type'=>'integer', 'label'=>'RequestedRemuneration', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1,), 'remuneration_proposed' => array('type'=>'integer', 'label'=>'ProposedRemuneration', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1,), + 'fk_recruitment_origin' => array('type'=>'integer:CRecruitmentOrigin:recruitment/class/recruitment_crecruitmentorigin.class.php', 'label'=>'Origin', 'enabled'=>'1', 'position'=>45, 'visible'=>1, 'index'=>1), ); public $rowid; public $ref; + public $fk_recruitmentjobposition; public $description; public $note_public; public $note_private; @@ -128,6 +130,7 @@ class RecruitmentCandidature extends CommonObject public $lastname; public $remuneration_requested; public $remuneration_proposed; + public $fk_recruitment_origin; // END MODULEBUILDER PROPERTIES