12require_once(
'./Modules/StudyProgramme/classes/class.ilObjStudyProgrammeAdmin.php');
15 protected static $tpl_file =
"tpl.progress_list_item.html";
61 $this->il_lng->loadLanguageModule(
"prg");
64 $this->progress = $a_progress;
67 $this->show_info_mesage =
false;
68 $this->visible_on_pd_mode =
"read";
73 if ($this->html ===
null) {
74 $tpl = $this->
getTemplate(
"Modules/StudyProgramme", static::$tpl_file,
true,
true);
76 $this->html =
$tpl->get();
83 $programme = $this->progress->getStudyProgramme();
86 if ($title_and_icon_target) {
87 $tpl->setCurrentBlock(
"linked_icon");
89 $tpl->setVariable(
"ALT_ICON", $this->
getAltIcon($programme->getId()));
90 $tpl->setVariable(
"ICON_HREF", $title_and_icon_target);
91 $tpl->parseCurrentBlock();
93 $tpl->setCurrentBlock(
"linked_title");
95 $tpl->setVariable(
"HREF_TITLE", $title_and_icon_target);
96 $tpl->parseCurrentBlock();
98 $tpl->setCurrentBlock(
"not_linked_icon");
100 $tpl->setVariable(
"ALT_ICON", $this->
getAltIcon($programme->getId()));
101 $tpl->parseCurrentBlock();
103 $tpl->setCurrentBlock(
"not_linked_title");
105 $tpl->parseCurrentBlock();
108 if ($this->show_info_mesage) {
110 $tpl->setVariable(
"MORE_OBJECTS", $this->il_lng->txt(
"prg_more_objects_without_read_permission"));
113 $tpl->setVariable(
"TXT_DESC", $programme->getDescription());
122 protected function getTemplate($a_component, $a_file, $a_remove_unknown_vars, $a_remove_empty_blocks)
124 return new ilTemplate($a_file, $a_remove_unknown_vars, $a_remove_empty_blocks, $a_component);
129 return ilObject::_getIcon($a_obj_id,
"small",
"prg");
134 return $this->il_lng->txt(
"icon") .
" " . $this->il_lng->txt(
"obj_prg");
139 $this->il_ctrl->setParameterByClass(
"ilDashboardGUI",
"prg_progress_id", $a_progress->
getId());
140 $this->il_ctrl->setParameterByClass(
"ilDashboardGUI",
"expand", 1);
141 $link = $this->il_ctrl->getLinkTargetByClass(
"ilDashboardGUI",
"jumpToSelectedItems");
142 $this->il_ctrl->setParameterByClass(
"ilDashboardGUI",
"prg_progress_id",
null);
143 $this->il_ctrl->setParameterByClass(
"ilDashboardGUI",
"expand",
null);
149 $tooltip_id =
"prg_" . $a_progress->
getId();
155 if ($maximum_possible_amount_of_points > 0) {
156 $current_percent = (int) ($current_amount_of_points * 100 / $maximum_possible_amount_of_points);
157 $required_percent = (int) ($required_amount_of_points * 100 / $maximum_possible_amount_of_points);
160 $current_percent = 100;
161 $required_percent = 100;
163 $current_percent = 0;
164 $required_percent = 0;
169 if ($required_percent == 0) {
170 $required_percent = 0.1;
182 require_once(
"Services/Container/classes/class.ilContainerObjectiveGUI.php");
189 $this->il_lng->txt(
"prg_progress_info"),
197 $lang_val =
"prg_progress_status";
201 if ($study_programm->hasChildren() && !$study_programm->hasLPChildren()) {
202 $lang_val =
"prg_progress_status_with_child_sp";
209 $this->il_lng->txt($lang_val),
232 $children = $programme->getChildren();
233 foreach ($children as $key => $child) {
234 $read = $this->il_access->checkAccess(
"read",
"", $child->getRefId(),
"prg", $child->getId());
An exception for terminatinating execution or to throw for unit testing.
static renderProgressBar( $a_perc_result=null, $a_perc_limit=null, $a_css=null, $a_caption=null, $a_url=null, $a_tt_id=null, $a_tt_txt=null, $a_next_step=null, $a_sub=false, $a_sub_style=30)
Render progress bar(s)
const SETTING_VISIBLE_ON_PD_ALLWAYS
getTitle()
get object title @access public
Class ilStudyProgrammeProgressListGUI.
buildProgressBar(ilStudyProgrammeUserProgress $a_progress)
setShowInfoMessage($show_info_mesage)
const SUCCESSFUL_PROGRESS_CSS_CLASS
const NON_SUCCESSFUL_PROGRESS_CSS_CLASS
buildToolTip(ilStudyProgrammeUserProgress $a_progress)
getTemplate($a_component, $a_file, $a_remove_unknown_vars, $a_remove_empty_blocks)
getTitleAndIconTarget(ilStudyProgrammeUserProgress $a_progress)
buildProgressStatus(ilStudyProgrammeUserProgress $a_progress)
__construct(ilStudyProgrammeUserProgress $a_progress)
showMoreObjectsInfo($programme)
setVisibleOnPDMode($visible_on_pd_mode)
setOnlyRelevant($only_relevant)
getTitleForItem(ilObjStudyProgramme $a_programme)
Represents the progress of a user at one node of a study programme.
getMaximumPossibleAmountOfPoints(bool $only_relevant=false)
Get the maximum possible amount of points a user can achieve for the completion of this node.
getId()
Get the id of the progress.
isSuccessful()
Check whether the user was successful on this node.
getCurrentAmountOfPoints()
Get the amount of points the user currently achieved.
getAmountOfPoints()
Get the amount of points needed to complete the node.
getStudyProgramme()
Get the program node this progress belongs to.
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl