69 $ilToolbar = $DIC[
'ilToolbar'];
70 $ilLocator = $DIC[
'ilLocator'];
77 $this->ref_id = $a_ref_id;
78 $this->parent_gui = $a_parent_gui;
82 $this->ilLocator = $ilLocator;
84 $this->toolbar = $ilToolbar;
89 $this->progress_object = null;
93 $lng->loadLanguageModule(
"prg");
97 $cmd = $this->ctrl->getCmd();
98 $next_class = $this->ctrl->getNextClass($this);
105 # TODO: Check permission of user!! 107 switch ($next_class) {
108 case "ilstudyprogrammerepositorysearchgui":
109 require_once(
"./Modules/StudyProgramme/classes/class.ilStudyProgrammeRepositorySearchGUI.php");
111 $rep_search->setCallback($this,
"addUsers");
113 $this->ctrl->setReturn($this,
"view");
114 $this->ctrl->forwardCommand($rep_search);
116 case "ilobjstudyprogrammeindividualplangui":
117 require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgrammeIndividualPlanGUI.php");
119 $this->ctrl->forwardCommand($individual_plan_gui);
124 case "markAccredited":
125 case "unmarkAccredited":
127 case "addUsersWithAcknowledgedCourses":
128 $cont = $this->
$cmd();
131 throw new ilException(
"ilObjStudyProgrammeMembersGUI: ".
132 "Command not supported: $cmd");
136 throw new ilException(
"ilObjStudyProgrammeMembersGUI: Can't forward to next class $next_class");
139 $this->tpl->setContent($cont);
143 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeMembersTableGUI.php");
155 return $table->getHTML();
161 $completed_courses =
array();
163 foreach ($a_users as $user_id) {
164 $completed_crss = $prg->getCompletedCourses($user_id);
165 if ($completed_crss) {
166 $completed_courses[$user_id] = $completed_crss;
170 if (count($completed_courses) > 0) {
177 $this->ctrl->redirect($this,
"view");
181 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeAcknowledgeCompletedCoursesTableGUI.php");
183 $tpl =
new ilTemplate(
"tpl.acknowledge_completed_courses.html",
true,
true,
"Modules/StudyProgramme");
184 $tpl->setVariable(
"TITLE", $this->lng->txt(
"prg_acknowledge_completed_courses"));
185 $tpl->setVariable(
"CAPTION_ADD", $this->lng->txt(
"btn_next"));
186 $tpl->setVariable(
"CAPTION_CANCEL", $this->lng->txt(
"cancel"));
187 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
188 $tpl->setVariable(
"ADD_CMD",
"addUsersWithAcknowledgedCourses");
189 $tpl->setVariable(
"CANCEL_CMD",
"view");
191 foreach ($a_completed_courses as $user_id => $completed_courses) {
193 $tpl->setCurrentBlock(
"usr_section");
194 $tpl->setVariable(
"FIRSTNAME",
$names[
"firstname"]);
195 $tpl->setVariable(
"LASTNAME",
$names[
"lastname"]);
197 $tpl->setVariable(
"TABLE", $table->getHTML());
198 $tpl->parseCurrentBlock();
201 foreach ($a_users as $usr_id) {
202 $tpl->setCurrentBlock(
"usr_ids_section");
203 $tpl->setVariable(
"USR_ID", $usr_id);
204 $tpl->parseCurrentBlock();
207 $this->tpl->setContent(
$tpl->get());
214 $completed_programmes =
$_POST[
"courses"];
215 foreach ($completed_programmes as $user_id => $prg_ref_ids) {
216 $ass_id = $assignments[$user_id]->getId();
217 foreach ($prg_ref_ids as $ids) {
218 list($prg_ref_id, $crs_id, $crsr_id) = explode(
";", $ids);
220 $progress = $prg->getProgressForAssignment($ass_id);
221 $progress->setLPCompleted($crsr_id, $user_id);
225 $this->ctrl->redirect($this,
"view");
231 $assignments =
array();
233 foreach ($a_users as $user_id) {
234 $assignments[$user_id] = $prg->assignUser($user_id);
237 if (count($a_users) == 1) {
240 if (count($a_users) > 1) {
248 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
250 $prgrs->markAccredited($this->
user->getId());
252 $this->ctrl->redirect($this,
"view");
256 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
258 $prgrs->unmarkAccredited();
260 $this->ctrl->redirect($this,
"view");
264 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
266 $ass = $prgrs->getAssignment();
267 $prg = $ass->getStudyProgramme();
269 throw new ilException(
"Can only remove users from the node they where assigned to.");
273 $this->ctrl->redirect($this,
"view");
277 if ($this->progress_object === null) {
278 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
279 if (!is_numeric(
$_GET[
"prgrs_id"])) {
280 throw new ilException(
"Expected integer 'prgrs_id'");
282 $id = (int)
$_GET[
"prgrs_id"];
285 return $this->progress_object;
289 require_once(
"Services/Utilities/classes/class.ilUtil.php");
294 require_once(
"./Modules/StudyProgramme/classes/class.ilStudyProgrammeRepositorySearchGUI.php");
299 "auto_complete_name" => $this->lng->txt(
"user"),
300 "submit_name" => $this->lng->txt(
"add"),
307 if ($a_ref_id === null) {
310 require_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
323 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
327 $target_name =
"markAccredited";
330 $target_name =
"unmarkAccredited";
333 require_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgrammeIndividualPlanGUI.php");
336 $target_name =
"removeUser";
342 $this->ctrl->setParameter($this,
"prgrs_id", $a_prgrs_id);
343 $link = $this->ctrl->getLinkTarget($this, $target_name);
344 $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.
Create styles array
The data for the language used.
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.