ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjStudyProgrammeMembersGUI Class Reference

Class ilObjStudyProgrammeMembersGUI. More...

+ Collaboration diagram for ilObjStudyProgrammeMembersGUI:

Public Member Functions

 __construct ($a_parent_gui, $a_ref_id, ilStudyProgrammeUserProgressDB $sp_user_progress_db)
 
 executeCommand ()
 
 addUsers ($a_users)
 Assigns a users to SP. More...
 
 viewCompletedCourses ($a_completed_courses, $a_users)
 Shows list of completed courses for each user if he should be assigned. More...
 
 addUsersWithAcknowledgedCourses ()
 Assign users if they have any completed course. More...
 
 markAccredited ()
 Mark SP for single user accredited. More...
 
 markAccreditedMulti ()
 Mark SP for users accredited. More...
 
 unmarkAccredited ()
 Unmark SP for single user accredited. More...
 
 unmarkAccreditedMulti ()
 Unmark SP for users accredited. More...
 
 markRelevantMulti ()
 Mark SP as relevant for users. More...
 
 markNotRelevantMulti ()
 Mark SP as not relevant for users. More...
 
 updateFromCurrentPlanMulti ()
 Update user plan from current SP structure if they has no individual plan. More...
 
 removeUser ()
 Remove single user from SP. More...
 
 getStudyProgramme ($a_ref_id=null)
 Get studyprogramm object for ref_id Use this ref_id if argument is null. More...
 
 getLinkTargetForAction ($a_action, $a_prgrs_id, $a_ass_id)
 Get the link target for an action on user progress. More...
 

Data Fields

 $ctrl
 
 $tpl
 
 $object
 
 $ilias
 
 $lng
 
 $toolbar
 
 $user
 

Protected Member Functions

 view ()
 Shows table with all members of the SP. More...
 
 _addUsers ($a_users)
 Add users to SP. More...
 
 getPostPrgsIds ()
 Get post prgs ids. More...
 
 markAccreditedById ($prgrs_id)
 Accredited SP. More...
 
 unmarkAccreditedByProgressId ($prgrs_id)
 Deaccredited SP. More...
 
 removeUserMulti ()
 Remove user from SP. More...
 
 remove ($prgrs_id)
 Rmeove user. More...
 
 getProgressObject ($prgrs_id)
 Get progress object for prgrs id. More...
 
 getPrgrsId ()
 Get current prgrs_id from URL. More...
 
 showSuccessMessage ($a_lng_var)
 Shows ilutil success message. More...
 
 showInfoMessage ($a_lng_var)
 Shows ilutil failed message. More...
 
 initSearchGUI ()
 

Protected Attributes

 $ilAccess
 
 $ilLog
 
 $parent_gui
 
 $sp_user_progress_db
 
 $progress_objects
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgrammeMembersGUI::__construct (   $a_parent_gui,
  $a_ref_id,
ilStudyProgrammeUserProgressDB  $sp_user_progress_db 
)

Definition at line 75 of file class.ilObjStudyProgrammeMembersGUI.php.

76 {
77 global $DIC;
78 $tpl = $DIC['tpl'];
79 $ilCtrl = $DIC['ilCtrl'];
80 $ilAccess = $DIC['ilAccess'];
81 $ilToolbar = $DIC['ilToolbar'];
82 $ilLocator = $DIC['ilLocator'];
83 $tree = $DIC['tree'];
84 $lng = $DIC['lng'];
85 $ilLog = $DIC['ilLog'];
86 $ilias = $DIC['ilias'];
87 $ilUser = $DIC['ilUser'];
88
89 $this->ref_id = $a_ref_id;
90 $this->parent_gui = $a_parent_gui;
91 $this->tpl = $tpl;
92 $this->ctrl = $ilCtrl;
93 $this->ilAccess = $ilAccess;
94 $this->ilLocator = $ilLocator;
95 $this->tree = $tree;
96 $this->toolbar = $ilToolbar;
97 $this->ilLog = $ilLog;
98 $this->ilias = $ilias;
99 $this->lng = $lng;
100 $this->user = $ilUser;
101 $this->sp_user_progress_db = $sp_user_progress_db;
102 $this->progress_objects = array();
103
104 $this->object = null;
105
106 $lng->loadLanguageModule("prg");
107 }
user()
Definition: user.php:4
Class ilAccessHandler.
logging
Definition: class.ilLog.php:19
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18

References $DIC, $ilAccess, $ilCtrl, $ilias, $ilLog, $ilUser, $lng, $sp_user_progress_db, $tpl, $tree, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _addUsers()

ilObjStudyProgrammeMembersGUI::_addUsers (   $a_users)
protected

Add users to SP.

Parameters
int[]$a_users
Returns
ilStudyProgrammeUserAssignment[]

Definition at line 285 of file class.ilObjStudyProgrammeMembersGUI.php.

286 {
287 $prg = $this->getStudyProgramme();
288
289 $assignments = array();
290
291 foreach ($a_users as $user_id) {
292 $assignments[$user_id] = $prg->assignUser($user_id);
293 }
294
295 if (count($a_users) == 1) {
296 ilUtil::sendSuccess($this->lng->txt("prg_added_member"), true);
297 }
298 if (count($a_users) > 1) {
299 ilUtil::sendSuccess($this->lng->txt("prg_added_members"), true);
300 }
301
302 return $assignments;
303 }
getStudyProgramme($a_ref_id=null)
Get studyprogramm object for ref_id Use this ref_id if argument is null.

References getStudyProgramme().

Referenced by addUsers(), and addUsersWithAcknowledgedCourses().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUsers()

ilObjStudyProgrammeMembersGUI::addUsers (   $a_users)

Assigns a users to SP.

Parameters
int[]$a_users
Returns
null

Definition at line 190 of file class.ilObjStudyProgrammeMembersGUI.php.

191 {
192 $prg = $this->getStudyProgramme();
193
194 $completed_courses = array();
195
196 foreach ($a_users as $user_id) {
197 $completed_crss = $prg->getCompletedCourses($user_id);
198 if ($completed_crss) {
199 $completed_courses[$user_id] = $completed_crss;
200 }
201 }
202
203 if (count($completed_courses) > 0) {
204 $this->viewCompletedCourses($completed_courses, $a_users);
205 return true;
206 }
207
208 $this->_addUsers($a_users);
209
210 $this->ctrl->redirect($this, "view");
211 }
viewCompletedCourses($a_completed_courses, $a_users)
Shows list of completed courses for each user if he should be assigned.

References _addUsers(), getStudyProgramme(), and viewCompletedCourses().

+ Here is the call graph for this function:

◆ addUsersWithAcknowledgedCourses()

ilObjStudyProgrammeMembersGUI::addUsersWithAcknowledgedCourses ( )

Assign users if they have any completed course.

Returns
null

Definition at line 257 of file class.ilObjStudyProgrammeMembersGUI.php.

258 {
259 $users = $_POST["users"];
260 $assignments = $this->_addUsers($users);
261
262 $completed_programmes = $_POST["courses"];
263 if (is_array($completed_programmes)) {
264 foreach ($completed_programmes as $user_id => $prg_ref_ids) {
265 $ass_id = $assignments[$user_id]->getId();
266 foreach ($prg_ref_ids as $ids) {
267 list($prg_ref_id, $crs_id, $crsr_id) = explode(";", $ids);
268 $prg = $this->getStudyProgramme($prg_ref_id);
269 $progress = $prg->getProgressForAssignment($ass_id);
270 $progress->setLPCompleted($crsr_id, $user_id);
271 }
272 }
273 }
274
275 $this->ctrl->redirect($this, "view");
276 }
$users
Definition: authpage.php:44
$_POST["username"]

References $_POST, $users, _addUsers(), and getStudyProgramme().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjStudyProgrammeMembersGUI::executeCommand ( )

Definition at line 109 of file class.ilObjStudyProgrammeMembersGUI.php.

110 {
111 $cmd = $this->ctrl->getCmd();
112 $next_class = $this->ctrl->getNextClass($this);
113
114 if ($cmd == "") {
115 $cmd = "view";
116 }
117
118 # TODO: Check permission of user!!
119
120 switch ($next_class) {
121 case "ilstudyprogrammerepositorysearchgui":
122 require_once("./Modules/StudyProgramme/classes/class.ilStudyProgrammeRepositorySearchGUI.php");
123 $rep_search = new ilStudyProgrammeRepositorySearchGUI();
124 $rep_search->setCallback($this, "addUsers");
125
126 $this->ctrl->setReturn($this, "view");
127 $this->ctrl->forwardCommand($rep_search);
128 return;
129 case "ilobjstudyprogrammeindividualplangui":
130 require_once("./Modules/StudyProgramme/classes/class.ilObjStudyProgrammeIndividualPlanGUI.php");
131 $individual_plan_gui = new ilObjStudyProgrammeIndividualPlanGUI($this, $this->ref_id, $this->sp_user_progress_db);
132 $this->ctrl->forwardCommand($individual_plan_gui);
133 return;
134 case false:
135 switch ($cmd) {
136 case "view":
137 case "markAccredited":
138 case "markAccreditedMulti":
139 case "unmarkAccredited":
140 case "unmarkAccreditedMulti":
141 case "removeUser":
142 case "removeUserMulti":
143 case "addUsersWithAcknowledgedCourses":
144 case "markNotRelevantMulti":
145 case "markRelevantMulti":
146 case "updateFromCurrentPlanMulti":
147 $cont = $this->$cmd();
148 break;
149 default:
150 throw new ilException("ilObjStudyProgrammeMembersGUI: " .
151 "Command not supported: $cmd");
152 }
153 break;
154 default:
155 throw new ilException("ilObjStudyProgrammeMembersGUI: Can't forward to next class $next_class");
156 }
157
158 $this->tpl->setContent($cont);
159 }
Base class for ILIAS Exception handling.
Custom repository search gui class for study programme to make it possible to get a handle on users s...

◆ getLinkTargetForAction()

ilObjStudyProgrammeMembersGUI::getLinkTargetForAction (   $a_action,
  $a_prgrs_id,
  $a_ass_id 
)

Get the link target for an action on user progress.

Parameters
int$a_actionOne of ilStudyProgrammeUserProgress::ACTION_*
int$a_prgrs_idId of the progress object to act on.
int$a_ass_idId of the assignment object to act on.
Returns
string The link to the action.

Definition at line 630 of file class.ilObjStudyProgrammeMembersGUI.php.

631 {
632 switch ($a_action) {
634 $target_name = "markAccredited";
635 break;
637 $target_name = "unmarkAccredited";
638 break;
640 require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgrammeIndividualPlanGUI.php");
641 return ilObjStudyProgrammeIndividualPlanGUI::getLinkTargetView($this->ctrl, $a_ass_id);
643 $target_name = "removeUser";
644 break;
645 default:
646 throw new ilException("Unknown action: $action");
647 }
648
649 $this->ctrl->setParameter($this, "prgrs_id", $a_prgrs_id);
650 $link = $this->ctrl->getLinkTarget($this, $target_name);
651 $this->ctrl->setParameter($this, "prgrs_id", null);
652 return $link;
653 }

References ilStudyProgrammeUserProgress\ACTION_MARK_ACCREDITED, ilStudyProgrammeUserProgress\ACTION_REMOVE_USER, ilStudyProgrammeUserProgress\ACTION_SHOW_INDIVIDUAL_PLAN, ilStudyProgrammeUserProgress\ACTION_UNMARK_ACCREDITED, and ilObjStudyProgrammeIndividualPlanGUI\getLinkTargetView().

+ Here is the call graph for this function:

◆ getPostPrgsIds()

ilObjStudyProgrammeMembersGUI::getPostPrgsIds ( )
protected

Get post prgs ids.

Returns
string[]

Definition at line 310 of file class.ilObjStudyProgrammeMembersGUI.php.

311 {
312 $prgrs_ids = $_POST['prgs_ids'];
313 if ($prgrs_ids === null) {
314 $this->showInfoMessage("no_user_selected");
315 $this->ctrl->redirect($this, "view");
316 }
317 return $prgrs_ids;
318 }
showInfoMessage($a_lng_var)
Shows ilutil failed message.

References $_POST, and showInfoMessage().

Referenced by markAccreditedMulti(), markNotRelevantMulti(), markRelevantMulti(), removeUserMulti(), unmarkAccreditedMulti(), and updateFromCurrentPlanMulti().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPrgrsId()

ilObjStudyProgrammeMembersGUI::getPrgrsId ( )
protected

Get current prgrs_id from URL.

Exceptions
ilExceptionif no prgrs id is in url
Returns
int

Definition at line 563 of file class.ilObjStudyProgrammeMembersGUI.php.

564 {
565 if (!is_numeric($_GET["prgrs_id"])) {
566 throw new ilException("Expected integer 'prgrs_id'");
567 }
568 return (int) $_GET["prgrs_id"];
569 }
$_GET["client_id"]

References $_GET.

Referenced by markAccredited(), removeUser(), and unmarkAccredited().

+ Here is the caller graph for this function:

◆ getProgressObject()

ilObjStudyProgrammeMembersGUI::getProgressObject (   $prgrs_id)
protected

Get progress object for prgrs id.

Parameters
int$prgrs_id
Returns
ilStudyProgrammeUserProgress

Definition at line 546 of file class.ilObjStudyProgrammeMembersGUI.php.

547 {
548 assert(is_int($prgrs_id));
549 if (!array_key_exists($prgrs_id, $this->progress_objects)) {
550 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
551 $this->progress_objects[$prgrs_id] = $this->sp_user_progress_db->getInstanceById($prgrs_id);
552 }
553 return $this->progress_objects[$prgrs_id];
554 }

Referenced by markAccreditedById(), markNotRelevantMulti(), markRelevantMulti(), remove(), unmarkAccreditedByProgressId(), unmarkAccreditedMulti(), and updateFromCurrentPlanMulti().

+ Here is the caller graph for this function:

◆ getStudyProgramme()

ilObjStudyProgrammeMembersGUI::getStudyProgramme (   $a_ref_id = null)

Get studyprogramm object for ref_id Use this ref_id if argument is null.

Returns
ilObjStudyProgramme

Definition at line 613 of file class.ilObjStudyProgrammeMembersGUI.php.

614 {
615 if ($a_ref_id === null) {
616 $a_ref_id = $this->ref_id;
617 }
618 require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
620 }
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.

References ilObjStudyProgramme\getInstanceByRefId().

Referenced by _addUsers(), addUsers(), addUsersWithAcknowledgedCourses(), and view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSearchGUI()

ilObjStudyProgrammeMembersGUI::initSearchGUI ( )
protected

Definition at line 593 of file class.ilObjStudyProgrammeMembersGUI.php.

594 {
595 require_once("./Modules/StudyProgramme/classes/class.ilStudyProgrammeRepositorySearchGUI.php");
597 $this,
598 $this->toolbar,
599 array(
600 "auto_complete_name" => $this->lng->txt("user"),
601 "submit_name" => $this->lng->txt("add"),
602 "add_search" => true
603 )
604 );
605 }
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.

References ilStudyProgrammeRepositorySearchGUI\fillAutoCompleteToolbar().

Referenced by view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ markAccredited()

ilObjStudyProgrammeMembersGUI::markAccredited ( )

Mark SP for single user accredited.

Returns
null

Definition at line 325 of file class.ilObjStudyProgrammeMembersGUI.php.

326 {
327 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
328 $prgrs_id = $this->getPrgrsId();
329 $this->markAccreditedById($prgrs_id);
330 $this->showSuccessMessage("mark_accredited_success");
331 $this->ctrl->redirect($this, "view");
332 }
showSuccessMessage($a_lng_var)
Shows ilutil success message.

References getPrgrsId(), markAccreditedById(), and showSuccessMessage().

+ Here is the call graph for this function:

◆ markAccreditedById()

ilObjStudyProgrammeMembersGUI::markAccreditedById (   $prgrs_id)
protected

Accredited SP.

Parameters
int$prgrs_id
Returns
null

Definition at line 356 of file class.ilObjStudyProgrammeMembersGUI.php.

357 {
358 $prgrs = $this->getProgressObject($prgrs_id);
359 $prgrs->markAccredited($this->user->getId());
360 }
getProgressObject($prgrs_id)
Get progress object for prgrs id.

References getProgressObject(), and user().

Referenced by markAccredited(), and markAccreditedMulti().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ markAccreditedMulti()

ilObjStudyProgrammeMembersGUI::markAccreditedMulti ( )

Mark SP for users accredited.

Returns
null

Definition at line 339 of file class.ilObjStudyProgrammeMembersGUI.php.

340 {
341 $prgrs_ids = $this->getPostPrgsIds();
342 foreach ($prgrs_ids as $key => $prgrs_id) {
343 $this->markAccreditedById((int) $prgrs_id);
344 }
345 $this->showSuccessMessage("mark_accredited_multi_success");
346 $this->ctrl->redirect($this, "view");
347 }
$key
Definition: croninfo.php:18

References $key, getPostPrgsIds(), markAccreditedById(), and showSuccessMessage().

+ Here is the call graph for this function:

◆ markNotRelevantMulti()

ilObjStudyProgrammeMembersGUI::markNotRelevantMulti ( )

Mark SP as not relevant for users.

Returns
null

Definition at line 435 of file class.ilObjStudyProgrammeMembersGUI.php.

436 {
437 $prgrs_ids = $this->getPostPrgsIds();
438
439 foreach ($prgrs_ids as $key => $prgrs_id) {
440 $prgrs = $this->getProgressObject((int) $prgrs_id);
441 $prgrs->markNotRelevant($this->user->getId());
442 }
443
444 $this->showSuccessMessage("mark_not_relevant_multi_success");
445 $this->ctrl->redirect($this, "view");
446 }

References $key, getPostPrgsIds(), getProgressObject(), showSuccessMessage(), and user().

+ Here is the call graph for this function:

◆ markRelevantMulti()

ilObjStudyProgrammeMembersGUI::markRelevantMulti ( )

Mark SP as relevant for users.

Returns
null

Definition at line 411 of file class.ilObjStudyProgrammeMembersGUI.php.

412 {
413 $prgrs_ids = $this->getPostPrgsIds();
414
415 foreach ($prgrs_ids as $key => $prgrs_id) {
416 $prgrs = $this->getProgressObject((int) $prgrs_id);
417 if (
418 $this->getProgressObject((int) $prgrs_id)->getStatus() == ilStudyProgrammeProgress::STATUS_IN_PROGRESS ||
419 $this->getProgressObject((int) $prgrs_id)->getStatus() == ilStudyProgrammeProgress::STATUS_ACCREDITED
420 ) {
421 continue;
422 }
423 $prgrs->markRelevant($this->user->getId());
424 }
425
426 $this->showSuccessMessage("mark_relevant_multi_success");
427 $this->ctrl->redirect($this, "view");
428 }

References $key, getPostPrgsIds(), getProgressObject(), showSuccessMessage(), ilStudyProgrammeProgress\STATUS_ACCREDITED, ilStudyProgrammeProgress\STATUS_IN_PROGRESS, and user().

+ Here is the call graph for this function:

◆ remove()

ilObjStudyProgrammeMembersGUI::remove (   $prgrs_id)
protected

Rmeove user.

Parameters
int$prgrs_id
Returns
null

Definition at line 528 of file class.ilObjStudyProgrammeMembersGUI.php.

529 {
530 $prgrs = $this->getProgressObject($prgrs_id);
531 $ass = $prgrs->getAssignment();
532 $prg = $ass->getStudyProgramme();
533 if ($prg->getRefId() != $this->ref_id) {
534 throw new ilException("Can only remove users from the node they where assigned to.");
535 }
536 $ass->deassign();
537 }

References getProgressObject().

+ Here is the call graph for this function:

◆ removeUser()

ilObjStudyProgrammeMembersGUI::removeUser ( )

Remove single user from SP.

Returns
null

Definition at line 486 of file class.ilObjStudyProgrammeMembersGUI.php.

487 {
488 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
489 $prgrs_id = $this->getPrgrsId();
490 $this->remove($prgrs_id);
491 $this->showSuccessMessage("remove_user_success");
492 $this->ctrl->redirect($this, "view");
493 }

References getPrgrsId(), and showSuccessMessage().

+ Here is the call graph for this function:

◆ removeUserMulti()

ilObjStudyProgrammeMembersGUI::removeUserMulti ( )
protected

Remove user from SP.

Returns
null

Definition at line 500 of file class.ilObjStudyProgrammeMembersGUI.php.

501 {
502 $prgrs_ids = $this->getPostPrgsIds();
503 $not_removed = array();
504 foreach ($prgrs_ids as $key => $prgrs_id) {
505 try {
506 $this->remove((int) $prgrs_id);
507 } catch (ilException $e) {
508 $not_removed[] = $prgrs_id;
509 }
510 }
511 if (count($not_removed) == count($prgrs_ids)) {
512 $this->showInfoMessage("remove_users_not_possible");
513 } elseif (count($not_removed) > 0) {
514 $this->showSuccessMessage("remove_users_partitial_success");
515 } else {
516 $this->showSuccessMessage("remove_users_success");
517 }
518 $this->ctrl->redirect($this, "view");
519 }

References $key, getPostPrgsIds(), showInfoMessage(), and showSuccessMessage().

+ Here is the call graph for this function:

◆ showInfoMessage()

ilObjStudyProgrammeMembersGUI::showInfoMessage (   $a_lng_var)
protected

Shows ilutil failed message.

Returns
null

Definition at line 587 of file class.ilObjStudyProgrammeMembersGUI.php.

588 {
589 require_once("Services/Utilities/classes/class.ilUtil.php");
590 ilUtil::sendInfo($this->lng->txt("prg_$a_lng_var"), true);
591 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References ilUtil\sendInfo().

Referenced by getPostPrgsIds(), removeUserMulti(), and updateFromCurrentPlanMulti().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSuccessMessage()

ilObjStudyProgrammeMembersGUI::showSuccessMessage (   $a_lng_var)
protected

Shows ilutil success message.

Returns
null

Definition at line 576 of file class.ilObjStudyProgrammeMembersGUI.php.

577 {
578 require_once("Services/Utilities/classes/class.ilUtil.php");
579 ilUtil::sendSuccess($this->lng->txt("prg_$a_lng_var"), true);
580 }

Referenced by markAccredited(), markAccreditedMulti(), markNotRelevantMulti(), markRelevantMulti(), removeUser(), removeUserMulti(), unmarkAccredited(), unmarkAccreditedMulti(), and updateFromCurrentPlanMulti().

+ Here is the caller graph for this function:

◆ unmarkAccredited()

ilObjStudyProgrammeMembersGUI::unmarkAccredited ( )

Unmark SP for single user accredited.

Returns
null

Definition at line 367 of file class.ilObjStudyProgrammeMembersGUI.php.

368 {
369 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
370 $prgrs_id = $this->getPrgrsId();
371 $this->unmarkAccreditedByProgressId($prgrs_id);
372 $this->showSuccessMessage("unmark_accredited_success");
373 $this->ctrl->redirect($this, "view");
374 }

References getPrgrsId(), showSuccessMessage(), and unmarkAccreditedByProgressId().

+ Here is the call graph for this function:

◆ unmarkAccreditedByProgressId()

ilObjStudyProgrammeMembersGUI::unmarkAccreditedByProgressId (   $prgrs_id)
protected

Deaccredited SP.

Parameters
int$prgrs_id
Returns
null

Definition at line 383 of file class.ilObjStudyProgrammeMembersGUI.php.

384 {
385 $prgrs = $this->getProgressObject($prgrs_id);
386 $prgrs->unmarkAccredited();
387 }

References getProgressObject().

Referenced by unmarkAccredited(), and unmarkAccreditedMulti().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unmarkAccreditedMulti()

ilObjStudyProgrammeMembersGUI::unmarkAccreditedMulti ( )

Unmark SP for users accredited.

Returns
null

Definition at line 394 of file class.ilObjStudyProgrammeMembersGUI.php.

395 {
396 $prgrs_ids = $this->getPostPrgsIds();
397 foreach ($prgrs_ids as $key => $prgrs_id) {
398 if ($this->getProgressObject((int) $prgrs_id)->getStatus() == ilStudyProgrammeProgress::STATUS_ACCREDITED) {
399 $this->unmarkAccreditedByProgressId((int) $prgrs_id);
400 }
401 }
402 $this->showSuccessMessage("unmark_accredited_multi_success");
403 $this->ctrl->redirect($this, "view");
404 }

References $key, getPostPrgsIds(), getProgressObject(), showSuccessMessage(), ilStudyProgrammeProgress\STATUS_ACCREDITED, and unmarkAccreditedByProgressId().

+ Here is the call graph for this function:

◆ updateFromCurrentPlanMulti()

ilObjStudyProgrammeMembersGUI::updateFromCurrentPlanMulti ( )

Update user plan from current SP structure if they has no individual plan.

Returns
null

Definition at line 453 of file class.ilObjStudyProgrammeMembersGUI.php.

454 {
455 $prgrs_ids = $this->getPostPrgsIds();
456 $not_updated = array();
457
458 foreach ($prgrs_ids as $key => $prgrs_id) {
459 $prgrs = $this->getProgressObject((int) $prgrs_id);
460 $ass = $prgrs->getAssignment();
461 $prg = $ass->getStudyProgramme();
462 if ($prg->getRefId() != $this->ref_id) {
463 $not_updated[] = $prgrs_id;
464 continue;
465 }
466
467 $ass->updateFromProgram();
468 }
469
470 if (count($not_updated) == count($prgrs_ids)) {
471 $this->showInfoMessage("update_from_current_plan_not_possible");
472 } elseif (count($not_updated) > 0) {
473 $this->showSuccessMessage("update_from_current_plan_partitial_success");
474 } else {
475 $this->showSuccessMessage("update_from_current_plan_success");
476 }
477
478 $this->ctrl->redirect($this, "view");
479 }

References $key, getPostPrgsIds(), getProgressObject(), showInfoMessage(), and showSuccessMessage().

+ Here is the call graph for this function:

◆ view()

ilObjStudyProgrammeMembersGUI::view ( )
protected

Shows table with all members of the SP.

Returns
string

Definition at line 166 of file class.ilObjStudyProgrammeMembersGUI.php.

167 {
168 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeMembersTableGUI.php");
169
170 if ($this->getStudyProgramme()->isActive()) {
171 $this->initSearchGUI();
172 }
173
174 if (!$this->getStudyProgramme()->isActive()) {
175 ilUtil::sendInfo($this->lng->txt("prg_no_members_not_active"));
176 }
177
178 $prg_id = ilObject::_lookupObjId($this->ref_id);
179 $table = new ilStudyProgrammeMembersTableGUI($prg_id, $this->ref_id, $this, "view", "", $this->sp_user_progress_db);
180 return $table->getHTML();
181 }
static _lookupObjId($a_id)
Class ilObjStudyProgrammeMembersTableGUI.
if(empty($password)) $table
Definition: pwgen.php:24

References $table, ilObject\_lookupObjId(), getStudyProgramme(), initSearchGUI(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ viewCompletedCourses()

ilObjStudyProgrammeMembersGUI::viewCompletedCourses (   $a_completed_courses,
  $a_users 
)

Shows list of completed courses for each user if he should be assigned.

Parameters
int[]$a_completed_courses
int[]$a_users
Returns
null

Definition at line 221 of file class.ilObjStudyProgrammeMembersGUI.php.

222 {
223 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeAcknowledgeCompletedCoursesTableGUI.php");
224
225 $tpl = new ilTemplate("tpl.acknowledge_completed_courses.html", true, true, "Modules/StudyProgramme");
226 $tpl->setVariable("TITLE", $this->lng->txt("prg_acknowledge_completed_courses"));
227 $tpl->setVariable("CAPTION_ADD", $this->lng->txt("btn_next"));
228 $tpl->setVariable("CAPTION_CANCEL", $this->lng->txt("cancel"));
229 $tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
230 $tpl->setVariable("ADD_CMD", "addUsersWithAcknowledgedCourses");
231 $tpl->setVariable("CANCEL_CMD", "view");
232
233 foreach ($a_completed_courses as $user_id => $completed_courses) {
234 $names = ilObjUser::_lookupName($user_id);
235 $tpl->setCurrentBlock("usr_section");
236 $tpl->setVariable("FIRSTNAME", $names["firstname"]);
237 $tpl->setVariable("LASTNAME", $names["lastname"]);
238 $table = new ilStudyProgrammeAcknowledgeCompletedCoursesTableGUI($this, $user_id, $completed_courses);
239 $tpl->setVariable("TABLE", $table->getHTML());
240 $tpl->parseCurrentBlock();
241 }
242
243 foreach ($a_users as $usr_id) {
244 $tpl->setCurrentBlock("usr_ids_section");
245 $tpl->setVariable("USR_ID", $usr_id);
246 $tpl->parseCurrentBlock();
247 }
248
249 $this->tpl->setContent($tpl->get());
250 }
static _lookupName($a_user_id)
lookup user name
TableGUI class for acknowledgement of completed courses for new members of a study programme.
special template class to simplify handling of ITX/PEAR

References $table, $tpl, and ilObjUser\_lookupName().

Referenced by addUsers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilObjStudyProgrammeMembersGUI::$ctrl

Definition at line 21 of file class.ilObjStudyProgrammeMembersGUI.php.

◆ $ilAccess

ilObjStudyProgrammeMembersGUI::$ilAccess
protected

Definition at line 31 of file class.ilObjStudyProgrammeMembersGUI.php.

Referenced by __construct().

◆ $ilias

ilObjStudyProgrammeMembersGUI::$ilias

Definition at line 46 of file class.ilObjStudyProgrammeMembersGUI.php.

Referenced by __construct().

◆ $ilLog

ilObjStudyProgrammeMembersGUI::$ilLog
protected

Definition at line 41 of file class.ilObjStudyProgrammeMembersGUI.php.

Referenced by __construct().

◆ $lng

ilObjStudyProgrammeMembersGUI::$lng

Definition at line 51 of file class.ilObjStudyProgrammeMembersGUI.php.

Referenced by __construct().

◆ $object

ilObjStudyProgrammeMembersGUI::$object

Definition at line 36 of file class.ilObjStudyProgrammeMembersGUI.php.

◆ $parent_gui

ilObjStudyProgrammeMembersGUI::$parent_gui
protected

Definition at line 63 of file class.ilObjStudyProgrammeMembersGUI.php.

◆ $progress_objects

ilObjStudyProgrammeMembersGUI::$progress_objects
protected

Definition at line 73 of file class.ilObjStudyProgrammeMembersGUI.php.

◆ $sp_user_progress_db

ilObjStudyProgrammeMembersGUI::$sp_user_progress_db
protected

Definition at line 68 of file class.ilObjStudyProgrammeMembersGUI.php.

Referenced by __construct().

◆ $toolbar

ilObjStudyProgrammeMembersGUI::$toolbar

Definition at line 56 of file class.ilObjStudyProgrammeMembersGUI.php.

◆ $tpl

ilObjStudyProgrammeMembersGUI::$tpl

Definition at line 26 of file class.ilObjStudyProgrammeMembersGUI.php.

Referenced by __construct(), and viewCompletedCourses().

◆ $user

ilObjStudyProgrammeMembersGUI::$user

Definition at line 61 of file class.ilObjStudyProgrammeMembersGUI.php.


The documentation for this class was generated from the following file: