protected function addItemDetails(ilObjectListGUI $a_item_list_gui, array $a_item) { global $lng, $ilCtrl; $item_ref_id = $a_item["ref_id"]; if (is_array($this->objective_map)) { $details = array(); if (isset($this->objective_map["material"][$item_ref_id])) { // #12965 foreach ($this->objective_map["material"][$item_ref_id] as $objective_id) { $ilCtrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $objective_id); $url = $ilCtrl->getLinkTargetByClass(array('illoeditorgui', 'ilcourseobjectivesgui'), 'edit'); $ilCtrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', ''); $details[] = array('desc' => $lng->txt('crs_loc_tab_materials') . ': ', 'target' => '_top', 'link' => $url, 'name' => $this->objective_map["names"][$objective_id]); } } if ($this->objective_map["test_i"] == $item_ref_id) { $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 1); $details[] = array('desc' => '', 'target' => '_top', 'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'), 'name' => $lng->txt('crs_loc_tab_itest')); $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0); } if ($this->objective_map["test_q"] == $item_ref_id) { $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2); $details[] = array('desc' => '', 'target' => '_top', 'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testOverview'), 'name' => $lng->txt('crs_loc_tab_qtest')); $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0); } // #15367 - patch LOK if (is_array($this->objective_map["test_ass"][$item_ref_id])) { foreach ($this->objective_map["test_ass"][$item_ref_id] as $type => $items) { if ($type == ilLOSettings::TYPE_TEST_INITIAL) { $caption = $lng->txt('crs_loc_tab_itest'); $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 1); } else { $caption = $lng->txt('crs_loc_tab_qtest'); $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 2); } foreach ($items as $objtv_title) { $details[] = array('desc' => '', 'target' => '_top', 'link' => $ilCtrl->getLinkTargetByClass('illoeditorgui', 'testsOverview'), 'name' => $caption . " (" . $this->lng->txt("crs_loc_learning_objective") . ": " . $objtv_title . ")"); } $ilCtrl->setParameterByClass('illoeditorgui', 'tt', 0); } } if (sizeof($details)) { $a_item_list_gui->enableItemDetailLinks(true); $a_item_list_gui->setItemDetailLinks($details, $lng->txt('crs_loc_settings_tbl') . ': '); } else { $a_item_list_gui->enableItemDetailLinks(false); } } // order if ($this->getContainerGUI()->isActiveOrdering()) { $a_item_list_gui->enableCommands(true, true); $a_item_list_gui->enableProperties(false); } else { if (!$this->getContainerGUI()->isActiveAdministrationPanel()) { $a_item_list_gui->enableCommands(true, true); $a_item_list_gui->enableProperties(false); } } if ($a_item['objective_id']) { $a_item_list_gui->setDefaultCommandParameters(array('objective_id' => $a_item['objective_id'])); if ($this->loc_settings->getQualifiedTest() == $a_item['ref_id']) { $a_item_list_gui->setConditionTarget($this->getContainerObject()->getRefId(), $a_item['objective_id'], 'lobj'); // check conditions of target include_once './Services/AccessControl/classes/class.ilConditionHandler.php'; $fullfilled = ilConditionHandler::_checkAllConditionsOfTarget($this->getContainerObject()->getRefId(), $a_item['objective_id'], 'lobj'); if (!$fullfilled || $a_item['objective_status']) { $a_item_list_gui->disableTitleLink(true); } } include_once './Modules/Course/classes/Objectives/class.ilLOUserResults.php'; $res = ilLOUserResults::lookupResult($this->getContainerObject()->getId(), $GLOBALS['ilUser']->getId(), $a_item['objective_id'], ilLOUserResults::TYPE_QUALIFIED); $res = $this->updateResult($res, $a_item['ref_id'], $a_item['objective_id'], $GLOBALS['ilUser']->getId()); if ($res['is_final']) { $a_item_list_gui->disableTitleLink(true); $a_item_list_gui->enableProperties(true); $a_item_list_gui->addCustomProperty($this->lng->txt('crs_loc_passes_reached'), '', true); } elseif ($this->loc_settings->getQualifiedTest() == $a_item['ref_id']) { include_once './Modules/Course/classes/class.ilCourseObjective.php'; $poss_pass = ilCourseObjective::lookupMaxPasses($a_item['objective_id']); if ($poss_pass) { $a_item_list_gui->enableProperties(true); $a_item_list_gui->addCustomProperty($this->lng->txt('crs_loc_passes_left'), $poss_pass - $res['tries'] > 0 ? $poss_pass - $res['tries'] : 1, false); } } } }