Fix skill parent "None" that shows if a root skill already exists - Refs #8370

remotes/angel/1.11.x
José Loguercio 8 years ago
parent 0b5590081e
commit 34397791f6
  1. 13
      main/admin/skill_create.php

@ -46,7 +46,18 @@ if ($skillParentId > 0) {
$allSkills = $objSkill->get_all();
$allGradebooks = $objGradebook->find('all');
$skillList = [0 => get_lang('None')];
// This procedure is for check if there is already a Skill with no Parent (Root by default)
$isAlreadyRootSkill = false;
foreach ($allSkills as $checkedSkill) {
if (intval($checkedSkill['parent_id']) > 0) {
$isAlreadyRootSkill = true;
break;
}
}
$skillList = $isAlreadyRootSkill ? [] : [0 => get_lang('None')];
$gradebookList = [];
foreach ($allSkills as $skill) {

Loading…
Cancel
Save