diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 7fc315451a8..1ad84ce19ac 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -469,13 +469,17 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { print load_fiche_titre($langs->trans('OtherOptions'), '', ''); +if (empty($conf->global->HRM_MAXRANK)) { + $conf->global->HRM_MAXRANK = Skill::DEFAULT_MAX_RANK_PER_SKILL; +} + if ($action == 'edit') { print '
'; print ''; print ''; print ''; - print ''; + print ''; foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 478b267ac1f..0b247e7f5f4 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -241,29 +241,46 @@ class Skill extends CommonObject } /** - * @param int $i rank from which we want to create skilldets + * createSkills + * + * @param int $i Rank from which we want to create skilldets (level $i to HRM_MAXRANK wil be created) * @return null */ public function createSkills($i = 1) { - global $conf, $user, $langs; $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : self::DEFAULT_MAX_RANK_PER_SKILL; $defaultSkillDesc = !empty($conf->global->HRM_DEFAULT_SKILL_DESCRIPTION) ? $conf->global->HRM_DEFAULT_SKILL_DESCRIPTION : 'no Description'; + + $error = 0; + require_once __DIR__ . '/skilldet.class.php'; + + $this->db->begin(); + + // Create level of skills for ($i; $i <= $MaxNumberSkill ; $i++) { $skilldet = new Skilldet($this->db); - $skilldet->description = $defaultSkillDesc . " " . $i ; - $skilldet->rank = $i; + $skilldet->description = $defaultSkillDesc . " " . $i; + $skilldet->rankorder = $i; $skilldet->fk_skill = $this->id; $result = $skilldet->create($user); - - if ($result > 0) { - setEventMessage($langs->trans('TraductionCreadted'), $i); + if ($result <= 0) { + $error++; } } + + if (! $error) { + $this->db->commit(); + + setEventMessage($langs->trans('SkillCreated'), $i); + return 1; + } else { + $this->db->rollback(); + return -1; + } } /** @@ -384,7 +401,7 @@ class Skill extends CommonObject /** * Load object lines in memory from the database * - * @return array|int <0 if KO, 0 if not found, array if OK + * @return array <0 if KO, array of skill level found */ public function fetchLines() { @@ -393,7 +410,7 @@ class Skill extends CommonObject $skilldet = new Skilldet($this->db); $this->lines = $skilldet->fetchAll('ASC', '', '', '', array('fk_skill' => $this->id), ''); - return (count($this->lines) > 0 ) ? $this->lines : 0; + return (count($this->lines) > 0 ) ? $this->lines : array(); } diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index c3acdd0982e..0e0ce87382f 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -104,18 +104,18 @@ class Skilldet extends CommonObject */ public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'rankorder' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>2, 'notnull'=>0, 'visible'=>2,), + 'fk_skill' => array('type'=>'integer:Skill:/hrm/class/skill.class.php', 'label'=>'fk_skill', 'enabled'=>'1', 'position'=>5, 'notnull'=>1, 'visible'=>0,), + 'rankorder' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>10, 'notnull'=>0, 'visible'=>2,), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>0,), - 'fk_skill' => array('type'=>'integer:Skill:/hrm/class/skill.class.php', 'label'=>'fk_skill', 'enabled'=>'1', 'position'=>513, 'notnull'=>1, 'visible'=>0,), ); public $rowid; + public $fk_skill; + public $rankorder; public $description; public $fk_user_creat; public $fk_user_modif; - public $fk_skill; - public $rank; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index 9c1821fb8d7..a352988c297 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -147,7 +147,7 @@ if ($object->id > 0) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; $morehtmlref.= $object->label; diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 3c72b5478ce..6fa601249db 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -21,8 +21,8 @@ /** * \file skill_card.php - * \ingroup hrm - * \brief Page to create/edit/view skill + * \ingroup hrm + * \brief Page to create/edit/view skill */ @@ -84,6 +84,8 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti if (empty($conf->hrm->enabled)) accessforbidden(); if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); +$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL; + /* * Actions @@ -98,14 +100,14 @@ if ($reshook < 0) { if (empty($reshook)) { $error = 0; - $backurlforlist = dol_buildpath('/hrm/skill_list.php', 1); + $backurlforlist = DOL_URL_ROOT.'/hrm/skill_list.php'; if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/hrm/skill_card.php?id=' . ($id > 0 ? $id : '__ID__'); } } } @@ -166,8 +168,6 @@ if (empty($reshook)) { /* * View - * - * Put here all code to build page */ $form = new Form($db); @@ -186,9 +186,9 @@ if ($action == 'create') { print ''; print ''; print ''; - $backtopage .= "&objecttype=job"; + $backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?' ) ."objecttype=job"; if ($backtopage) { - print ''; + print ''; } if ($backtopageforcancel) { print ''; @@ -254,11 +254,16 @@ if (($id || $ref) && $action == 'edit') { // SKILLDET print dol_get_fiche_head(array(), ''); + $SkilldetRecords = $object->fetchLines(); + + if (is_array($SkilldetRecords) && count($SkilldetRecords) == 0) { + $object->createSkills(1); + } + if (is_array($SkilldetRecords) && count($SkilldetRecords) > 0) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; foreach ($SkilldetRecords as $sk) { - $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL; if ($sk->rank > $MaxNumberSkill) { continue; } @@ -397,7 +402,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref = '
'; @@ -691,7 +696,6 @@ if ($action != "create" && $action != "edit") { break; // Should not happen } - $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL; if ($obj->rank > $MaxNumberSkill) { continue; } diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php index f8ea2a04a9f..d8fecd74610 100644 --- a/htdocs/hrm/skill_contact.php +++ b/htdocs/hrm/skill_contact.php @@ -129,7 +129,7 @@ if ($object->id) { print dol_get_fiche_head($head, 'contact', '', -1, $object->picto); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* diff --git a/htdocs/hrm/skill_document.php b/htdocs/hrm/skill_document.php index 77f3325de15..65549dbfe7a 100644 --- a/htdocs/hrm/skill_document.php +++ b/htdocs/hrm/skill_document.php @@ -127,7 +127,7 @@ if ($object->id) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; $morehtmlref.= $object->label; diff --git a/htdocs/hrm/skill_note.php b/htdocs/hrm/skill_note.php index 1510f746e5e..45a0690f176 100644 --- a/htdocs/hrm/skill_note.php +++ b/htdocs/hrm/skill_note.php @@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; $morehtmlref.= $object->label; diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 9a9ea39e31d..e7c6798bbec 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -93,14 +93,14 @@ if ($reshook < 0) { if (empty($reshook)) { $error = 0; - $backurlforlist = dol_buildpath('/hrm/skill_list.php', 1); + $backurlforlist = DOL_URL_ROOT.'/hrm/skill_list.php'; if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/hrm/skill_list.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/hrm/skill_list.php?id=' . ($id > 0 ? $id : '__ID__'); } } } diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 6091556037c..f3f92b39dae 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -306,17 +306,6 @@ ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid); -- ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_ref (ref); -create table llx_hrm_job_user_extrafields -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - fk_object integer NOT NULL, - import_key varchar(14) -- import key -) ENGINE=innodb; - -ALTER TABLE llx_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_object); - - CREATE TABLE llx_hrm_skill ( @@ -360,20 +349,11 @@ CREATE TABLE llx_hrm_skilldet rankorder integer ) ENGINE=innodb; +ALTER TABLE llx_hrm_skilldet ADD COLUMN rankorder integer NOT NULL DEFAULT '1'; + ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid); ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); -create table llx_hrm_skilldet_extrafields -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - fk_object integer NOT NULL, - import_key varchar(14) -- import key -) ENGINE=innodb; - -ALTER TABLE llx_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object); - - CREATE TABLE llx_hrm_skillrank ( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_evaluation.key.sql rename to htdocs/install/mysql/tables/llx_hrm_evaluation-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_evaluation.sql rename to htdocs/install/mysql/tables/llx_hrm_evaluation-hrm.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.key.sql rename to htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.sql rename to htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields-hrm.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_evaluationdet.key.sql rename to htdocs/install/mysql/tables/llx_hrm_evaluationdet-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql rename to htdocs/install/mysql/tables/llx_hrm_evaluationdet-hrm.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.key.sql rename to htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.sql rename to htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields-hrm.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_job.key.sql b/htdocs/install/mysql/tables/llx_hrm_job-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_job.key.sql rename to htdocs/install/mysql/tables/llx_hrm_job-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_job.sql b/htdocs/install/mysql/tables/llx_hrm_job-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_job.sql rename to htdocs/install/mysql/tables/llx_hrm_job-hrm.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_job_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_job_extrafields-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_job_extrafields.key.sql rename to htdocs/install/mysql/tables/llx_hrm_job_extrafields-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_job_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_job_extrafields-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_job_extrafields.sql rename to htdocs/install/mysql/tables/llx_hrm_job_extrafields-hrm.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user.key.sql b/htdocs/install/mysql/tables/llx_hrm_job_user-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_job_user.key.sql rename to htdocs/install/mysql/tables/llx_hrm_job_user-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user.sql b/htdocs/install/mysql/tables/llx_hrm_job_user-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_job_user.sql rename to htdocs/install/mysql/tables/llx_hrm_job_user-hrm.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql deleted file mode 100644 index 99ed1f4c1bc..00000000000 --- a/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Copyright (C) 2021 Gauthier VERDOL --- Copyright (C) 2021 Greg Rastklan --- Copyright (C) 2021 Jean-Pascal BOUDET --- --- 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_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_object); --- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql deleted file mode 100644 index 7495563f68d..00000000000 --- a/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql +++ /dev/null @@ -1,25 +0,0 @@ --- Copyright (C) 2021 Gauthier VERDOL --- Copyright (C) 2021 Greg Rastklan --- Copyright (C) 2021 Jean-Pascal BOUDET --- --- 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_hrm_job_user_extrafields -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - fk_object integer NOT NULL, - import_key varchar(14) -- import key -) ENGINE=innodb; - diff --git a/htdocs/install/mysql/tables/llx_hrm_skill.key.sql b/htdocs/install/mysql/tables/llx_hrm_skill-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_skill.key.sql rename to htdocs/install/mysql/tables/llx_hrm_skill-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_skill.sql b/htdocs/install/mysql/tables/llx_hrm_skill-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_skill.sql rename to htdocs/install/mysql/tables/llx_hrm_skill-hrm.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_skill_extrafields.key.sql rename to htdocs/install/mysql/tables/llx_hrm_skill_extrafields-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_skill_extrafields.sql rename to htdocs/install/mysql/tables/llx_hrm_skill_extrafields-hrm.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet.key.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_skilldet.key.sql rename to htdocs/install/mysql/tables/llx_hrm_skilldet-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet-hrm.sql similarity index 94% rename from htdocs/install/mysql/tables/llx_hrm_skilldet.sql rename to htdocs/install/mysql/tables/llx_hrm_skilldet-hrm.sql index 0257d886813..18a1cdcf9dc 100644 --- a/htdocs/install/mysql/tables/llx_hrm_skilldet.sql +++ b/htdocs/install/mysql/tables/llx_hrm_skilldet-hrm.sql @@ -18,9 +18,9 @@ CREATE TABLE llx_hrm_skilldet( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_skill integer NOT NULL, + rankorder integer NOT NULL DEFAULT '1', description text, fk_user_creat integer NOT NULL, - fk_user_modif integer, - fk_skill integer NOT NULL, - rankorder integer + fk_user_modif integer ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql deleted file mode 100644 index 319eb193a18..00000000000 --- a/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Copyright (C) 2021 Gauthier VERDOL --- Copyright (C) 2021 Greg Rastklan --- Copyright (C) 2021 Jean-Pascal BOUDET --- --- 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_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object); --- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql deleted file mode 100644 index a6e14f476c0..00000000000 --- a/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql +++ /dev/null @@ -1,24 +0,0 @@ --- Copyright (C) 2021 Gauthier VERDOL --- Copyright (C) 2021 Greg Rastklan --- Copyright (C) 2021 Jean-Pascal BOUDET --- 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_hrm_skilldet_extrafields -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - fk_object integer NOT NULL, - import_key varchar(14) -- import key -) ENGINE=innodb; - diff --git a/htdocs/install/mysql/tables/llx_hrm_skillrank.key.sql b/htdocs/install/mysql/tables/llx_hrm_skillrank-hrm.key.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_skillrank.key.sql rename to htdocs/install/mysql/tables/llx_hrm_skillrank-hrm.key.sql diff --git a/htdocs/install/mysql/tables/llx_hrm_skillrank.sql b/htdocs/install/mysql/tables/llx_hrm_skillrank-hrm.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_hrm_skillrank.sql rename to htdocs/install/mysql/tables/llx_hrm_skillrank-hrm.sql diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 30bee881584..45b7d742f3e 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -154,8 +154,8 @@ if ($action == "set") { /************************************************************************************** * - * Chargement fichiers tables/*.sql (non *.key.sql) - * A faire avant les fichiers *.key.sql + * Load files tables/*.sql (not the *.key.sql). Files with '-xxx' in name are excluded (they will be loaded during activation o fmodule 'xxx'). + * To do before the files *.key.sql * ***************************************************************************************/ if ($ok && $createtables) { @@ -169,7 +169,7 @@ if ($action == "set") { $tabledata = array(); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && !preg_match('/\.key\.sql$/i', $file)) { + if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && !preg_match('/\.key\.sql$/i', $file) && !preg_match('/\-/', $file)) { $tablefound++; $tabledata[] = $file; } @@ -252,8 +252,8 @@ if ($action == "set") { /*************************************************************************************** * - * Chargement fichiers tables/*.key.sql - * A faire apres les fichiers *.sql + * Load files tables/*.key.sql. Files with '-xxx' in name are excluded (they will be loaded during activation o fmodule 'xxx'). + * To do after the files *.sql * ***************************************************************************************/ if ($ok && $createkeys) { @@ -267,7 +267,7 @@ if ($action == "set") { $tabledata = array(); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && preg_match('/\.key\.sql$/i', $file)) { + if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && preg_match('/\.key\.sql$/i', $file) && !preg_match('/\-/', $file)) { $tablefound++; $tabledata[] = $file; } @@ -372,7 +372,7 @@ if ($action == "set") { /*************************************************************************************** * - * Chargement fichier functions.sql + * Lod the file 'functions.sql' * ***************************************************************************************/ if ($ok && $createfunctions) { @@ -449,7 +449,7 @@ if ($action == "set") { /*************************************************************************************** * - * Load files data/*.sql + * Load files data/*.sql. Files with '-xxx' in name are excluded (they will be loaded during activation o fmodule 'xxx'). * ***************************************************************************************/ if ($ok && $createdata) { @@ -463,7 +463,7 @@ if ($action == "set") { $tabledata = array(); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file)) { + if (preg_match('/\.sql$/i', $file) && preg_match('/^llx_/i', $file) && !preg_match('/\-/', $file)) { if (preg_match('/^llx_accounting_account_/', $file)) { continue; // We discard data file of chart of account. Will be loaded when a chart is selected. } diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index f9424f51a32..6effe4316a5 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -404,7 +404,7 @@ if ($action == "set" && $success) { // If upgrade if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) { // Upgrade is finished - print 'Configuration '.$langs->trans("SystemIsUpgraded")."
"; + print 'Configuration '.$langs->trans("SystemIsUpgraded")."
"; $createlock = 0; diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index dedbb1f5923..c571ec6ca8a 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -21,7 +21,7 @@ NewEmployee=New employee ListOfEmployees=List of employees HrmSetup=HRM module setup SkillsManagement=Skills management -HRM_MAXRANK=Maximum rank for a skill +HRM_MAXRANK=Maximum number of levels to rank a skill HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created deplacement=Shift DateEval=Evaluation date