Browse Source

Clean/Debug module hrm.

Laurent Destailleur 3 years ago
parent
commit
7b68ef1fb8
39 changed files with 72 additions and 158 deletions
  1. 5 1
      htdocs/admin/hrm.php
  2. 26 9
      htdocs/hrm/class/skill.class.php
  3. 4 4
      htdocs/hrm/class/skilldet.class.php
  4. 1 1
      htdocs/hrm/skill_agenda.php
  5. 15 11
      htdocs/hrm/skill_card.php
  6. 1 1
      htdocs/hrm/skill_contact.php
  7. 1 1
      htdocs/hrm/skill_document.php
  8. 1 1
      htdocs/hrm/skill_note.php
  9. 2 2
      htdocs/hrm/skill_tab.php
  10. 2 22
      htdocs/install/mysql/migration/14.0.0-15.0.0.sql
  11. 0 0
      htdocs/install/mysql/tables/llx_hrm_evaluation-hrm.key.sql
  12. 0 0
      htdocs/install/mysql/tables/llx_hrm_evaluation-hrm.sql
  13. 0 0
      htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields-hrm.key.sql
  14. 0 0
      htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields-hrm.sql
  15. 0 0
      htdocs/install/mysql/tables/llx_hrm_evaluationdet-hrm.key.sql
  16. 0 0
      htdocs/install/mysql/tables/llx_hrm_evaluationdet-hrm.sql
  17. 0 0
      htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields-hrm.key.sql
  18. 0 0
      htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields-hrm.sql
  19. 0 0
      htdocs/install/mysql/tables/llx_hrm_job-hrm.key.sql
  20. 0 0
      htdocs/install/mysql/tables/llx_hrm_job-hrm.sql
  21. 0 0
      htdocs/install/mysql/tables/llx_hrm_job_extrafields-hrm.key.sql
  22. 0 0
      htdocs/install/mysql/tables/llx_hrm_job_extrafields-hrm.sql
  23. 0 0
      htdocs/install/mysql/tables/llx_hrm_job_user-hrm.key.sql
  24. 0 0
      htdocs/install/mysql/tables/llx_hrm_job_user-hrm.sql
  25. 0 21
      htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql
  26. 0 25
      htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql
  27. 0 0
      htdocs/install/mysql/tables/llx_hrm_skill-hrm.key.sql
  28. 0 0
      htdocs/install/mysql/tables/llx_hrm_skill-hrm.sql
  29. 0 0
      htdocs/install/mysql/tables/llx_hrm_skill_extrafields-hrm.key.sql
  30. 0 0
      htdocs/install/mysql/tables/llx_hrm_skill_extrafields-hrm.sql
  31. 0 0
      htdocs/install/mysql/tables/llx_hrm_skilldet-hrm.key.sql
  32. 3 3
      htdocs/install/mysql/tables/llx_hrm_skilldet-hrm.sql
  33. 0 21
      htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql
  34. 0 24
      htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql
  35. 0 0
      htdocs/install/mysql/tables/llx_hrm_skillrank-hrm.key.sql
  36. 0 0
      htdocs/install/mysql/tables/llx_hrm_skillrank-hrm.sql
  37. 9 9
      htdocs/install/step2.php
  38. 1 1
      htdocs/install/step5.php
  39. 1 1
      htdocs/langs/en_US/hrm.lang

+ 5 - 1
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 '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
 	print '<input type="hidden" name="token" value="'.newToken().'">';
 	print '<input type="hidden" name="action" value="update">';
 
 	print '<table class="noborder centpercent">';
-	print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
+	print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
 
 	foreach ($arrayofparameters as $constname => $val) {
 		if ($val['enabled']==1) {

+ 26 - 9
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();
 	}
 
 

+ 4 - 4
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
 
 

+ 1 - 1
htdocs/hrm/skill_agenda.php

@@ -147,7 +147,7 @@ if ($object->id > 0) {
 
 	// Object card
 	// ------------------------------------------------------------
-	$linkback = '<a href="'.dol_buildpath('/hrm/skill_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
+	$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
 
 	$morehtmlref = '<div class="refid">';
 	$morehtmlref.= $object->label;

+ 15 - 11
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 '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
 	print '<input type="hidden" name="token" value="' . newToken() . '">';
 	print '<input type="hidden" name="action" value="add">';
-	$backtopage .= "&objecttype=job";
+	$backtopage .= (strpos($backtopage, '?') > 0 ? '&' : '?' ) ."objecttype=job";
 	if ($backtopage) {
-		print '<input type="hidden" name="backtopage" value="' . $backtopage . ' &objecttype=job ">';
+		print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
 	}
 	if ($backtopageforcancel) {
 		print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
@@ -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 '<table>';
 		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 = '<a href="' . dol_buildpath('/hrm/skill_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
+	$linkback = '<a href="' . DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
 
 
 	$morehtmlref = '<div class="refid">';
@@ -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;
 		}

+ 1 - 1
htdocs/hrm/skill_contact.php

@@ -129,7 +129,7 @@ if ($object->id) {
 
 	print dol_get_fiche_head($head, 'contact', '', -1, $object->picto);
 
-	$linkback = '<a href="'.dol_buildpath('/hrm/skill_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
+	$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
 
 	$morehtmlref = '<div class="refidno">';
 	/*

+ 1 - 1
htdocs/hrm/skill_document.php

@@ -127,7 +127,7 @@ if ($object->id) {
 
 	// Object card
 	// ------------------------------------------------------------
-	$linkback = '<a href="'.dol_buildpath('/hrm/skill_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
+	$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
 
 	$morehtmlref = '<div class="refid">';
 	$morehtmlref.= $object->label;

+ 1 - 1
htdocs/hrm/skill_note.php

@@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) {
 
 	// Object card
 	// ------------------------------------------------------------
-	$linkback = '<a href="'.dol_buildpath('/hrm/skill_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
+	$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/skill_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
 
 	$morehtmlref = '<div class="refid">';
 	$morehtmlref.= $object->label;

+ 2 - 2
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__');
 			}
 		}
 	}

+ 2 - 22
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,

+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_evaluation.key.sql → htdocs/install/mysql/tables/llx_hrm_evaluation-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_evaluation.sql → htdocs/install/mysql/tables/llx_hrm_evaluation-hrm.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.key.sql → htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.sql → htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields-hrm.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_evaluationdet.key.sql → htdocs/install/mysql/tables/llx_hrm_evaluationdet-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql → htdocs/install/mysql/tables/llx_hrm_evaluationdet-hrm.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.key.sql → htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.sql → htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields-hrm.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_job.key.sql → htdocs/install/mysql/tables/llx_hrm_job-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_job.sql → htdocs/install/mysql/tables/llx_hrm_job-hrm.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_job_extrafields.key.sql → htdocs/install/mysql/tables/llx_hrm_job_extrafields-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_job_extrafields.sql → htdocs/install/mysql/tables/llx_hrm_job_extrafields-hrm.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_job_user.key.sql → htdocs/install/mysql/tables/llx_hrm_job_user-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_job_user.sql → htdocs/install/mysql/tables/llx_hrm_job_user-hrm.sql


+ 0 - 21
htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql

@@ -1,21 +0,0 @@
--- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
--- Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
--- Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
---
--- 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

+ 0 - 25
htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql

@@ -1,25 +0,0 @@
--- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
--- Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
--- Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
---
--- 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;
-

+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_skill.key.sql → htdocs/install/mysql/tables/llx_hrm_skill-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_skill.sql → htdocs/install/mysql/tables/llx_hrm_skill-hrm.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_skill_extrafields.key.sql → htdocs/install/mysql/tables/llx_hrm_skill_extrafields-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_skill_extrafields.sql → htdocs/install/mysql/tables/llx_hrm_skill_extrafields-hrm.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_skilldet.key.sql → htdocs/install/mysql/tables/llx_hrm_skilldet-hrm.key.sql


+ 3 - 3
htdocs/install/mysql/tables/llx_hrm_skilldet.sql → 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;

+ 0 - 21
htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql

@@ -1,21 +0,0 @@
--- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
--- Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
--- Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
---
--- 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

+ 0 - 24
htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql

@@ -1,24 +0,0 @@
--- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
--- Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
--- Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
--- 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;
-

+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_skillrank.key.sql → htdocs/install/mysql/tables/llx_hrm_skillrank-hrm.key.sql


+ 0 - 0
htdocs/install/mysql/tables/llx_hrm_skillrank.sql → htdocs/install/mysql/tables/llx_hrm_skillrank-hrm.sql


+ 9 - 9
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.
 					}

+ 1 - 1
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 '<img class="valignmiddle inline-block paddingright" src="../theme/common/octicons/build/svg/checklist.svg" width="20" alt="Configuration"> '.$langs->trans("SystemIsUpgraded")."<br>";
+		print '<img class="valignmiddle inline-block paddingright" src="../theme/common/octicons/build/svg/checklist.svg" width="20" alt="Configuration"> <span class="valignmiddle">'.$langs->trans("SystemIsUpgraded")."</span><br>";
 
 		$createlock = 0;
 

+ 1 - 1
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