12require_once(
'./Modules/StudyProgramme/classes/class.ilObjStudyProgrammeAdmin.php');
14 protected static $tpl_file =
"tpl.progress_list_item.html";
57 $this->il_lng->loadLanguageModule(
"prg");
60 $this->progress = $a_progress;
63 $this->show_info_mesage =
false;
64 $this->visible_on_pd_mode =
"read";
68 if ($this->html ===
null) {
69 $tpl = $this->
getTemplate(
"Modules/StudyProgramme", static::$tpl_file,
true,
true);
71 $this->html =
$tpl->get();
77 $programme = $this->progress->getStudyProgramme();
80 if ($title_and_icon_target) {
81 $tpl->setCurrentBlock(
"linked_icon");
83 $tpl->setVariable(
"ALT_ICON", $this->
getAltIcon($programme->getId()));
84 $tpl->setVariable(
"ICON_HREF", $title_and_icon_target);
85 $tpl->parseCurrentBlock();
87 $tpl->setCurrentBlock(
"linked_title");
89 $tpl->setVariable(
"HREF_TITLE", $title_and_icon_target);
90 $tpl->parseCurrentBlock();
93 $tpl->setCurrentBlock(
"not_linked_icon");
95 $tpl->setVariable(
"ALT_ICON", $this->
getAltIcon($programme->getId()));
96 $tpl->parseCurrentBlock();
98 $tpl->setCurrentBlock(
"not_linked_title");
100 $tpl->parseCurrentBlock();
103 if($this->show_info_mesage) {
105 $tpl->setVariable(
"MORE_OBJECTS",$this->il_lng->txt(
"prg_more_objects_without_read_permission"));
108 $tpl->setVariable(
"TXT_DESC", $programme->getDescription());
116 protected function getTemplate($a_component, $a_file, $a_remove_unknown_vars, $a_remove_empty_blocks) {
117 return new ilTemplate($a_file, $a_remove_unknown_vars, $a_remove_empty_blocks, $a_component);
125 return $this->il_lng->txt(
"icon").
" ".$this->il_lng->txt(
"obj_prg");
129 $this->il_ctrl->setParameterByClass(
"ilPersonalDesktopGUI",
"prg_progress_id", $a_progress->
getId());
130 $this->il_ctrl->setParameterByClass(
"ilPersonalDesktopGUI",
"expand", 1);
131 $link = $this->il_ctrl->getLinkTargetByClass(
"ilPersonalDesktopGUI",
"jumpToSelectedItems");
132 $this->il_ctrl->setParameterByClass(
"ilPersonalDesktopGUI",
"prg_progress_id",
null);
133 $this->il_ctrl->setParameterByClass(
"ilPersonalDesktopGUI",
"expand",
null);
138 $tooltip_id =
"prg_".$a_progress->getId();
144 if ($maximum_possible_amount_of_points > 0) {
145 $current_percent = (int)($current_amount_of_points * 100 / $maximum_possible_amount_of_points);
146 $required_percent = (int)($required_amount_of_points * 100 / $maximum_possible_amount_of_points);
150 $current_percent = 100;
151 $required_percent = 100;
154 $current_percent = 0;
155 $required_percent = 0;
160 if($required_percent == 0) {
161 $required_percent = 0.1;
174 require_once(
"Services/Container/classes/class.ilContainerObjectiveGUI.php");
176 , $progress_status,
null, $tooltip_id, $tooltip_txt);
180 return sprintf( $this->il_lng->txt(
"prg_progress_info")
187 $lang_val =
"prg_progress_status";
191 if($study_programm->hasChildren() && !$study_programm->hasLPChildren()) {
192 $lang_val =
"prg_progress_status_with_child_sp";
198 return sprintf( $this->il_lng->txt($lang_val)
217 $children = $programme->getChildren();
218 foreach ($children as $key => $child) {
219 $read = $this->il_access->checkAccess(
"read",
"", $child->getRefId(),
"prg", $child->getId());
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
Class ilObjStudyProgramme.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
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($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 where this progress belongs to was made.
special template class to simplify handling of ITX/PEAR