error message
This commit is contained in:
parent
1db52532ff
commit
2f4fe2b898
@ -410,7 +410,13 @@ class Skill extends CommonObject
|
||||
$skilldet = new Skilldet($this->db);
|
||||
$this->lines = $skilldet->fetchAll('ASC', '', '', '', array('fk_skill' => $this->id), '');
|
||||
|
||||
if (is_array($this->lines)) {
|
||||
return (count($this->lines) > 0) ? $this->lines : array();
|
||||
} elseif ($this->lines < 0) {
|
||||
$this->errors = array_merge($this->errors, $skilldet->errors);
|
||||
$this->error = $skilldet->error;
|
||||
return $this->lines;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -115,10 +115,13 @@ function displayRankInfos($selected_rank, $fk_skill, $inputname = 'TNote', $mode
|
||||
$skilldet = new Skilldet($db);
|
||||
$Lines = $skilldet->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_skill = '.$fk_skill));
|
||||
|
||||
if (!is_array($Lines) && $Lines<0) {
|
||||
setEventMessages($skilldet->error, $skilldet->errors, 'errors');
|
||||
}
|
||||
if (empty($Lines)) return $langs->trans('SkillHasNoLines');
|
||||
|
||||
$ret = '<!-- field jquery --><span title="'.$langs->trans('NA').'" class="radio_js_bloc_number '.$inputname.'_'.$fk_skill.(empty($selected_rank) ? ' selected' : '').'">0</span>';
|
||||
|
||||
if (is_array($Lines) && !empty($Lines)) {
|
||||
foreach ($Lines as $line) {
|
||||
$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL;
|
||||
if ($line->rank > $MaxNumberSkill) {
|
||||
@ -154,6 +157,7 @@ function displayRankInfos($selected_rank, $fk_skill, $inputname = 'TNote', $mode
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user