67 $this->ref_id = $a_ref_id;
68 $this->parent_gui = $a_parent_gui;
72 $this->ilLocator = $ilLocator;
74 $this->toolbar = $ilToolbar;
79 $this->progress_object = null;
83 $lng->loadLanguageModule(
"prg");
87 $cmd = $this->ctrl->getCmd();
88 $next_class = $this->ctrl->getNextClass($this);
95 # TODO: Check permission of user!! 97 switch ($next_class) {
98 case "ilstudyprogrammerepositorysearchgui":
99 require_once(
"./Modules/StudyProgramme/classes/class.ilStudyProgrammeRepositorySearchGUI.php");
101 $rep_search->setCallback($this,
"addUsers");
103 $this->ctrl->setReturn($this,
"view");
104 $this->ctrl->forwardCommand($rep_search);
106 case "ilobjstudyprogrammeindividualplangui":
107 require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgrammeIndividualPlanGUI.php");
109 $this->ctrl->forwardCommand($individual_plan_gui);
114 case "markAccredited":
115 case "unmarkAccredited":
117 case "addUsersWithAcknowledgedCourses":
118 $cont = $this->
$cmd();
121 throw new ilException(
"ilObjStudyProgrammeMembersGUI: ".
122 "Command not supported: $cmd");
126 throw new ilException(
"ilObjStudyProgrammeMembersGUI: Can't forward to next class $next_class");
129 $this->tpl->setContent($cont);
133 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeMembersTableGUI.php");
145 return $table->getHTML();
151 $completed_courses = array();
153 foreach ($a_users as $user_id) {
154 $completed_crss = $prg->getCompletedCourses($user_id);
155 if ($completed_crss) {
156 $completed_courses[$user_id] = $completed_crss;
160 if (count($completed_courses) > 0) {
167 $this->ctrl->redirect($this,
"view");
171 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeAcknowledgeCompletedCoursesTableGUI.php");
173 $tpl =
new ilTemplate(
"tpl.acknowledge_completed_courses.html",
true,
true,
"Modules/StudyProgramme");
174 $tpl->setVariable(
"TITLE", $this->lng->txt(
"prg_acknowledge_completed_courses"));
175 $tpl->setVariable(
"CAPTION_ADD", $this->lng->txt(
"btn_next"));
176 $tpl->setVariable(
"CAPTION_CANCEL", $this->lng->txt(
"cancel"));
177 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
178 $tpl->setVariable(
"ADD_CMD",
"addUsersWithAcknowledgedCourses");
179 $tpl->setVariable(
"CANCEL_CMD",
"view");
181 foreach ($a_completed_courses as $user_id => $completed_courses) {
183 $tpl->setCurrentBlock(
"usr_section");
184 $tpl->setVariable(
"FIRSTNAME", $names[
"firstname"]);
185 $tpl->setVariable(
"LASTNAME", $names[
"lastname"]);
187 $tpl->setVariable(
"TABLE", $table->getHTML());
188 $tpl->parseCurrentBlock();
191 foreach ($a_users as $usr_id) {
192 $tpl->setCurrentBlock(
"usr_ids_section");
193 $tpl->setVariable(
"USR_ID", $usr_id);
194 $tpl->parseCurrentBlock();
197 $this->tpl->setContent(
$tpl->get());
204 $completed_programmes =
$_POST[
"courses"];
205 foreach ($completed_programmes as $user_id => $prg_ref_ids) {
206 $ass_id = $assignments[$user_id]->getId();
207 foreach ($prg_ref_ids as $ids) {
208 list($prg_ref_id, $crs_id, $crsr_id) = split(
";", $ids);
210 $progress = $prg->getProgressForAssignment($ass_id);
211 $progress->setLPCompleted($crsr_id, $user_id);
215 $this->ctrl->redirect($this,
"view");
221 $assignments = array();
223 foreach ($a_users as $user_id) {
224 $assignments[$user_id] = $prg->assignUser($user_id);
227 if (count($a_users) == 1) {
230 if (count($a_users) > 1) {
238 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
240 $prgrs->markAccredited($this->user->getId());
242 $this->ctrl->redirect($this,
"view");
246 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
248 $prgrs->unmarkAccredited();
250 $this->ctrl->redirect($this,
"view");
254 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
256 $ass = $prgrs->getAssignment();
257 $prg = $ass->getStudyProgramme();
259 throw new ilException(
"Can only remove users from the node they where assigned to.");
263 $this->ctrl->redirect($this,
"view");
267 if ($this->progress_object === null) {
268 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
269 if (!is_numeric(
$_GET[
"prgrs_id"])) {
270 throw new ilException(
"Expected integer 'prgrs_id'");
272 $id = (int)
$_GET[
"prgrs_id"];
275 return $this->progress_object;
279 require_once(
"Services/Utilities/classes/class.ilUtil.php");
284 require_once(
"./Modules/StudyProgramme/classes/class.ilStudyProgrammeRepositorySearchGUI.php");
289 "auto_complete_name" => $this->lng->txt(
"user"),
290 "submit_name" => $this->lng->txt(
"add"),
297 if ($a_ref_id === null) {
300 require_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
313 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
317 $target_name =
"markAccredited";
320 $target_name =
"unmarkAccredited";
323 require_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgrammeIndividualPlanGUI.php");
326 $target_name =
"removeUser";
332 $this->ctrl->setParameter($this,
"prgrs_id", $a_prgrs_id);
333 $link = $this->ctrl->getLinkTarget($this, $target_name);
334 $this->ctrl->setParameter($this,
"prgrs_id", null);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
Base class for ILIAS Exception handling.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
This is just the same as in the parent class, except for the hardcoded class name.
addUsersWithAcknowledgedCourses()
Class ilObjStudyProgrammeIndividualPlanGUI.
Class ilObjStudyProgrammeMembersTableGUI.
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const ACTION_SHOW_INDIVIDUAL_PLAN
getLinkTargetForAction($a_action, $a_prgrs_id, $a_ass_id)
Get the link target for an action on user progress.
const ACTION_UNMARK_ACCREDITED
static getLinkTargetView($ctrl, $a_ass_id)
viewCompletedCourses($a_completed_courses, $a_users)
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
Class ilObjStudyProgrammeMembersGUI.
getStudyProgramme($a_ref_id=null)
TableGUI class for acknowledgement of completed courses for new members of a study programme...
Custom repository search gui class for study programme to make it possible to get a handle on users s...
showSuccessMessage($a_lng_var)
__construct($a_parent_gui, $a_ref_id)
const ACTION_MARK_ACCREDITED
static getInstanceById($a_prgrs_id)
Get an instance by progress id.