ILIAS  release_8 Revision v8.24
ilObjStudyProgrammeMembersGUI Class Reference

@ilCtrl_Calls ilObjStudyProgrammeMembersGUI: ilStudyProgrammeRepositorySearchGUI @ilCtrl_Calls ilObjStudyProgrammeMembersGUI: ilObjStudyProgrammeIndividualPlanGUI @ilCtrl_Calls ilObjStudyProgrammeMembersGUI: ilObjFileGUI @ilCtrl_Calls ilObjStudyProgrammeMembersGUI: ilStudyProgrammeMailMemberSearchGUI @ilCtrl_Calls ilObjStudyProgrammeMembersGUI: ilStudyProgrammeChangeExpireDateGUI @ilCtrl_Calls ilObjStudyProgrammeMembersGUI: ilStudyProgrammeChangeDeadlineGUI @ilCtrl_Calls ilObjStudyProgrammeMembersGUI: ilFormPropertyDispatchGUI More...

+ Collaboration diagram for ilObjStudyProgrammeMembersGUI:

Public Member Functions

 __construct (ilGlobalTemplateInterface $tpl, ilCtrl $ilCtrl, ilToolbarGUI $ilToolbar, ilLanguage $lng, ilObjUser $user, ilTabsGUI $tabs, ilPRGAssignmentDBRepository $assignment_db, ilStudyProgrammeRepositorySearchGUI $repository_search_gui, ilObjStudyProgrammeIndividualPlanGUI $individual_plan_gui, ilPRGMessagePrinter $messages, Factory $data_factory, ilConfirmationGUI $confirmation_gui, ILIAS\HTTP\Wrapper\WrapperFactory $http_wrapper, ILIAS\Refinery\Factory $refinery, ILIAS\UI\Factory $ui_factory, ILIAS\UI\Renderer $ui_renderer, GuzzleHttp\Psr7\ServerRequest $request)
 
 setParentGUI (ilObjectGUI $a_parent_gui)
 
 setRefId (int $ref_id)
 
 executeCommand ()
 
 applyFilter ()
 
 resetFilter ()
 
 addUsers (array $user_ids)
 Assigns a users to SP. More...
 
 viewCompletedCourses (array $assignments)
 Shows list of completed courses for each assignment. More...
 
 unmarkAccreditedMulti ()
 
 markRelevant ()
 
 markRelevantMulti ()
 
 markNotRelevant ()
 
 markNotRelevantMulti ()
 
 updateFromCurrentPlan ()
 
 updateFromCurrentPlanMulti ()
 
 confirmedUpdateFromCurrentPlan ()
 
 acknowledgeCourses ()
 
 acknowledgeCoursesMulti ()
 
 confirmedAcknowledgeAllCourses ()
 
 confirmedAcknowledgeCourses ()
 
 changeDeadline ()
 
 changeDeadlineMulti ()
 
 changeExpireDate ()
 
 changeExpireDateMulti ()
 
 removeUser ()
 
 getStudyProgramme (int $ref_id=null)
 Get studyprogramm object for ref_id Use this ref_id if argument is null. More...
 
 getLinkTargetForAction (string $action, string $prgrs_id, int $ass_id)
 Get the link target for an action on user progress. More...
 

Data Fields

const ACTION_MARK_ACCREDITED = "mark_accredited"
 
const ACTION_UNMARK_ACCREDITED = "unmark_accredited"
 
const ACTION_SHOW_INDIVIDUAL_PLAN = "show_individual_plan"
 
const ACTION_REMOVE_USER = "remove_user"
 
const ACTION_CHANGE_DEADLINE = "change_deadline"
 
const ACTION_MARK_RELEVANT = "mark_relevant"
 
const ACTION_UNMARK_RELEVANT = "unmark_relevant"
 
const ACTION_UPDATE_FROM_CURRENT_PLAN = "update_from_current_plan"
 
const ACTION_CHANGE_EXPIRE_DATE = "change_expire_date"
 
const ACTION_ACKNOWLEDGE_COURSES = "acknowledge_completed_courses"
 
const F_COMMAND_OPTION_ALL = 'select_cmd_all'
 
const F_ALL_PROGRESS_IDS = 'all_progress_ids'
 
const F_SELECTED_PROGRESS_IDS = 'prgs_ids'
 
const F_SELECTED_PROGRESS_ID = 'prgs_id'
 
const F_SELECTED_USER_IDS = 'usrids'
 

Protected Member Functions

 getDefaultCommand ()
 
 getAssignmentsById ()
 
 getMembersTableGUI ()
 
 getPostPrgsIds ()
 
 getGetPrgsIds ()
 
 getPrgrsId ()
 
 view ()
 Shows table with all members of the SP. More...
 
 getAddableUsers (array $users)
 
 markAccredited ()
 
 markAccreditedMulti ()
 
 markAccreditedByProgressId (PRGProgressId $prgrs_id, ilPRGMessageCollection $msgs)
 
 unmarkAccredited ()
 
 unmarkAccreditedByProgressId (PRGProgressId $prgrs_id, ilPRGMessageCollection $msgs)
 
 getAssignmentsFromQuery ()
 
 removeUserMulti ()
 
 confirmRemoveUsers (array $progress_ids)
 
 confirmedRemoveUsers ()
 
 removeAssignment (PRGProgressId $pgs_id)
 Remove user. More...
 
 showSuccessMessage (string $lng_var)
 Shows ilUtil success message. More...
 
 showInfoMessage (string $lng_var)
 Shows ilUtil failed message. More...
 
 initSearchGUI ()
 
 initMailToMemberButton (ilToolbarGUI $toolbar, bool $separator=false)
 
 mayCurrentUserEditProgressForUser (int $usr_id)
 
 getMessageCollection (string $topic)
 
 showMessages (ilPRGMessageCollection $msg)
 
 mailToSelectedUsers ()
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilToolbarGUI $toolbar
 
ilLanguage $lng
 
ilObjUser $user
 
ilTabsGUI $tabs
 
ilPRGAssignmentDBRepository $assignment_db
 
ilStudyProgrammeRepositorySearchGUI $repository_search_gui
 
ilObjStudyProgrammeIndividualPlanGUI $individual_plan_gui
 
ilPRGMessagePrinter $messages
 
Factory $data_factory
 
ilConfirmationGUI $confirmation_gui
 
ILIAS HTTP Wrapper WrapperFactory $http_wrapper
 
ILIAS Refinery Factory $refinery
 
ILIAS UI Factory $ui_factory
 
ILIAS UI Renderer $ui_renderer
 
GuzzleHttp Psr7 ServerRequest $request
 
ilObjStudyProgramme $object
 
ilPRGPermissionsHelper $permissions
 
ilObjectGUI $parent_gui
 
int $ref_id
 

Private Attributes

const DEFAULT_CMD = "view"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgrammeMembersGUI::__construct ( ilGlobalTemplateInterface  $tpl,
ilCtrl  $ilCtrl,
ilToolbarGUI  $ilToolbar,
ilLanguage  $lng,
ilObjUser  $user,
ilTabsGUI  $tabs,
ilPRGAssignmentDBRepository  $assignment_db,
ilStudyProgrammeRepositorySearchGUI  $repository_search_gui,
ilObjStudyProgrammeIndividualPlanGUI  $individual_plan_gui,
ilPRGMessagePrinter  $messages,
Factory  $data_factory,
ilConfirmationGUI  $confirmation_gui,
ILIAS\HTTP\Wrapper\WrapperFactory  $http_wrapper,
ILIAS\Refinery\Factory  $refinery,
ILIAS\UI\Factory  $ui_factory,
ILIAS\UI\Renderer  $ui_renderer,
GuzzleHttp\Psr7\ServerRequest  $request 
)

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

96 {
97 $this->tpl = $tpl;
98 $this->ctrl = $ilCtrl;
99 $this->toolbar = $ilToolbar;
100 $this->lng = $lng;
101 $this->user = $user;
102 $this->tabs = $tabs;
103 $this->assignment_db = $assignment_db;
104 $this->repository_search_gui = $repository_search_gui;
105 $this->individual_plan_gui = $individual_plan_gui;
106 $this->messages = $messages;
107 $this->data_factory = $data_factory;
108 $this->confirmation_gui = $confirmation_gui;
109 $this->http_wrapper = $http_wrapper;
110 $this->refinery = $refinery;
111 $this->ui_factory = $ui_factory;
112 $this->ui_renderer = $ui_renderer;
113 $this->request = $request;
114 $this->object = null;
115 $this->permissions = null;
116
117 $lng->loadLanguageModule("prg");
118 $this->toolbar->setPreventDoubleSubmission(true);
119 }
loadLanguageModule(string $a_module)
Load language module.
ilStudyProgrammeRepositorySearchGUI $repository_search_gui
ILIAS HTTP Wrapper WrapperFactory $http_wrapper
ilObjStudyProgrammeIndividualPlanGUI $individual_plan_gui

References $assignment_db, $confirmation_gui, $data_factory, $http_wrapper, $individual_plan_gui, $lng, $messages, $refinery, $repository_search_gui, $request, $tabs, $tpl, $ui_factory, $ui_renderer, $user, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\refinery(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ acknowledgeCourses()

ilObjStudyProgrammeMembersGUI::acknowledgeCourses ( )

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

672 : string
673 {
674 $progress_id = $this->getPrgrsId();
675 $assignments = [
676 $this->assignment_db->get($progress_id->getAssignmentId())
677 ];
678 return $this->ui_renderer->render(
679 $this->viewCompletedCourses($assignments)
680 );
681 }
viewCompletedCourses(array $assignments)
Shows list of completed courses for each assignment.

References getPrgrsId(), and viewCompletedCourses().

+ Here is the call graph for this function:

◆ acknowledgeCoursesMulti()

ilObjStudyProgrammeMembersGUI::acknowledgeCoursesMulti ( )

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

683 : string
684 {
685 $assignments = [];
686 foreach ($this->getPostPrgsIds() as $progress_id) {
687 $assignments[] = $this->assignment_db->get($progress_id->getAssignmentId());
688 }
689 return $this->ui_renderer->render(
690 $this->viewCompletedCourses($assignments)
691 );
692 }

References getPostPrgsIds(), and viewCompletedCourses().

+ Here is the call graph for this function:

◆ addUsers()

ilObjStudyProgrammeMembersGUI::addUsers ( array  $user_ids)

Assigns a users to SP.

Parameters
string[]$user_ids
Returns
bool|void

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

370 {
371 $user_ids = $this->getAddableUsers($user_ids);
372 $prg = $this->getStudyProgramme();
373 $assignments = [];
374 $with_courses = [];
375
376 foreach ($user_ids as $user_id) {
377 $ass = $prg->assignUser((int) $user_id);
378 $assignments[] = $ass;
379 if($prg->getCompletedCourses((int) $user_id)) {
380 $with_courses[] = $ass;
381 }
382 }
383
384 if (count($assignments) === 1) {
385 $this->tpl->setOnScreenMessage("success", $this->lng->txt("prg_added_member"), true);
386 }
387 if (count($assignments) > 1) {
388 $this->tpl->setOnScreenMessage("success", $this->lng->txt("prg_added_members"), true);
389 }
390
391 if($with_courses) {
392 $this->tpl->setContent(
393 $this->ui_renderer->render(
394 $this->viewCompletedCourses($assignments)
395 )
396 );
397 return true;
398
399 } else {
400 $this->ctrl->redirect($this, "view");
401 }
402 }
getStudyProgramme(int $ref_id=null)
Get studyprogramm object for ref_id Use this ref_id if argument is null.

References ILIAS\Repository\ctrl(), getAddableUsers(), getStudyProgramme(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ applyFilter()

ilObjStudyProgrammeMembersGUI::applyFilter ( )

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

348 : void
349 {
350 $table = $this->getMembersTableGUI();
351 $table->resetOffset();
352 $table->writeFilterToSession();
353 $this->ctrl->redirect($this, "view");
354 }

References ILIAS\Repository\ctrl(), and getMembersTableGUI().

+ Here is the call graph for this function:

◆ changeDeadline()

ilObjStudyProgrammeMembersGUI::changeDeadline ( )

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

769 : void
770 {
771 $this->ctrl->setParameterByClass(
772 'ilStudyProgrammeChangeDeadlineGUI',
773 'prgrs_ids',
774 $this->getPrgrsId()
775 );
776
777 $link = $this->ctrl->getLinkTargetByClass(
778 'ilStudyProgrammeChangeDeadlineGUI',
779 'showDeadlineConfig'
780 );
781
782 $this->ctrl->clearParameterByClass('ilStudyProgrammeChangeDeadlineGUI', 'prgrs_ids');
783 $this->ctrl->redirectToURL($link);
784 }

References ILIAS\Repository\ctrl(), and getPrgrsId().

+ Here is the call graph for this function:

◆ changeDeadlineMulti()

ilObjStudyProgrammeMembersGUI::changeDeadlineMulti ( )

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

786 : void
787 {
788 $this->ctrl->setParameterByClass(
789 'ilStudyProgrammeChangeDeadlineGUI',
790 'prgrs_ids',
791 implode(',', $this->getPostPrgsIds())
792 );
793
794 $link = $this->ctrl->getLinkTargetByClass(
795 'ilStudyProgrammeChangeDeadlineGUI',
796 'showDeadlineConfig'
797 );
798
799 $this->ctrl->clearParameterByClass('ilStudyProgrammeChangeDeadlineGUI', 'prgrs_ids');
800 $this->ctrl->redirectToURL($link);
801 }

References ILIAS\Repository\ctrl(), and getPostPrgsIds().

+ Here is the call graph for this function:

◆ changeExpireDate()

ilObjStudyProgrammeMembersGUI::changeExpireDate ( )

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

803 : void
804 {
805 $this->ctrl->setParameterByClass(
806 'ilStudyProgrammeChangeExpireDateGUI',
807 'prgrs_ids',
808 $this->getPrgrsId()
809 );
810
811 $link = $this->ctrl->getLinkTargetByClass(
812 'ilStudyProgrammeChangeExpireDateGUI',
813 'showExpireDateConfig'
814 );
815
816 $this->ctrl->clearParameterByClass('ilStudyProgrammeChangeExpireDateGUI', 'prgrs_ids');
817 $this->ctrl->redirectToURL($link);
818 }

References ILIAS\Repository\ctrl(), and getPrgrsId().

+ Here is the call graph for this function:

◆ changeExpireDateMulti()

ilObjStudyProgrammeMembersGUI::changeExpireDateMulti ( )

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

820 : void
821 {
822 $this->ctrl->setParameterByClass(
823 'ilStudyProgrammeChangeExpireDateGUI',
824 'prgrs_ids',
825 implode(',', $this->getPostPrgsIds())
826 );
827
828 $link = $this->ctrl->getLinkTargetByClass(
829 'ilStudyProgrammeChangeExpireDateGUI',
830 'showExpireDateConfig'
831 );
832
833 $this->ctrl->clearParameterByClass('ilStudyProgrammeChangeExpireDateGUI', 'prgrs_ids');
834 $this->ctrl->redirectToURL($link);
835 }

References ILIAS\Repository\ctrl(), and getPostPrgsIds().

+ Here is the call graph for this function:

◆ confirmedAcknowledgeAllCourses()

ilObjStudyProgrammeMembersGUI::confirmedAcknowledgeAllCourses ( )

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

717 {
718 $prg = $this->getStudyProgramme();
719 $assignments = $this->getAssignmentsFromQuery();
720 $msgs = $this->getMessageCollection('msg_acknowledge_courses');
721
722 foreach ($assignments as $ass) {
723 $ass_ids[] = $ass->getId();
724 $completed_crss = $prg->getCompletedCourses($ass->getUserId());
725 $nodes = [];
726 foreach($completed_crss as $opt) {
727 $nodes[] = [$opt['prg_obj_id'], $opt['crsr_id']];
728 }
729 $prg->acknowledgeCourses(
730 $ass->getId(),
731 $nodes,
732 $msgs
733 );
734 }
735 $this->showMessages($msgs);
736 $this->ctrl->redirect($this, "view");
737 }

References ILIAS\Repository\ctrl(), getAssignmentsFromQuery(), getMessageCollection(), getStudyProgramme(), and showMessages().

Referenced by executeCommand().

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

◆ confirmedAcknowledgeCourses()

ilObjStudyProgrammeMembersGUI::confirmedAcknowledgeCourses ( )

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

740 {
741 $assignments = $this->getAssignmentsFromQuery();
742
743 $form = $this->viewCompletedCourses($assignments)->withRequest($this->request);
744 $data = $form->getData();
745
746 $msgs = $this->getMessageCollection('msg_acknowledge_courses');
747
748 if($data) {
749 $acknowledge = [];
750 foreach ($data as $ack) {
751 [$assignment_id, $node_obj_id, $course_obj_id] = $ack;
752 if(! array_key_exists($assignment_id, $acknowledge)) {
753 $acknowledge[$assignment_id] = [];
754 }
755 $acknowledge[$assignment_id][] = [(int) $node_obj_id, (int) $course_obj_id];
756 }
757 foreach ($acknowledge as $ass_id => $nodes) {
758 $this->object->acknowledgeCourses(
759 (int) $ass_id,
760 $nodes,
761 $msgs
762 );
763 }
764 $this->showMessages($msgs);
765 }
766 $this->ctrl->redirect($this, "view");
767 }

References $data, ILIAS\Repository\ctrl(), getAssignmentsFromQuery(), getMessageCollection(), ILIAS\Repository\int(), showMessages(), and viewCompletedCourses().

Referenced by executeCommand().

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

◆ confirmedRemoveUsers()

ilObjStudyProgrammeMembersGUI::confirmedRemoveUsers ( )
protected

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

867 : void
868 {
869 $pgs_ids = $this->getPostPrgsIds();
870 $not_removed = array();
871 foreach ($pgs_ids as $idx => $pgs_id) {
872 try {
873 $this->removeAssignment($pgs_id);
874 } catch (ilException $e) {
875 $not_removed[] = $pgs_id;
876 }
877 }
878 if (count($not_removed) === count($pgs_ids)) {
879 $this->showInfoMessage("remove_users_not_possible");
880 } elseif (count($not_removed) > 0) {
881 $this->showSuccessMessage("remove_users_partial_success");
882 } else {
883 $this->showSuccessMessage("remove_users_success");
884 }
885 $this->ctrl->redirect($this, "view");
886 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showInfoMessage(string $lng_var)
Shows ilUtil failed message.
removeAssignment(PRGProgressId $pgs_id)
Remove user.
showSuccessMessage(string $lng_var)
Shows ilUtil success message.

References Vendor\Package\$e, ILIAS\Repository\ctrl(), getPostPrgsIds(), removeAssignment(), showInfoMessage(), and showSuccessMessage().

Referenced by executeCommand().

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

◆ confirmedUpdateFromCurrentPlan()

ilObjStudyProgrammeMembersGUI::confirmedUpdateFromCurrentPlan ( )

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

651 {
652 $pgs_ids = $this->getPostPrgsIds();
653 $msgs = $this->getMessageCollection('msg_update_from_settings');
654 foreach ($pgs_ids as $idx => $pgs_id) {
655 if (!$this->mayCurrentUserEditProgressForUser($pgs_id->getUsrId())) {
656 $msgs->add(false, 'no_permission_to_update_plan_of_user', (string) $pgs_id);
657 continue;
658 } else {
659 $msgs->add(true, '', (string) $pgs_id);
660 }
661
662 $this->object->updatePlanFromRepository(
663 $pgs_id->getAssignmentId(),
664 $this->user->getId(),
665 $msgs
666 );
667 }
668 $this->showMessages($msgs);
669 $this->ctrl->redirect($this, "view");
670 }

References ILIAS\Repository\ctrl(), getMessageCollection(), getPostPrgsIds(), mayCurrentUserEditProgressForUser(), and showMessages().

Referenced by executeCommand().

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

◆ confirmRemoveUsers()

ilObjStudyProgrammeMembersGUI::confirmRemoveUsers ( array  $progress_ids)
protected

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

849 : string
850 {
851 $this->confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
852 $this->confirmation_gui->setHeaderText($this->lng->txt('confirm_to_remove_selected_assignments'));
853 $this->confirmation_gui->setConfirm($this->lng->txt('prg_remove_user'), 'confirmedRemoveUsers');
854 $this->confirmation_gui->setCancel($this->lng->txt('cancel'), 'view');
855
856 foreach ($progress_ids as $progress_id) {
857 $user_name = ilObjUser::_lookupFullname($progress_id->getUsrId());
858 $this->confirmation_gui->addItem(
859 self::F_SELECTED_PROGRESS_IDS . '[]',
860 (string) $progress_id,
861 $user_name
862 );
863 }
864 return $this->confirmation_gui->getHTML();
865 }
static _lookupFullname(int $a_user_id)

References ilObjUser\_lookupFullname(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by removeUser(), and removeUserMulti().

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

◆ executeCommand()

ilObjStudyProgrammeMembersGUI::executeCommand ( )

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

133 : void
134 {
135 $cmd = $this->ctrl->getCmd();
136 $next_class = $this->ctrl->getNextClass($this);
137
138 if ($cmd === "" || $cmd === null) {
139 $cmd = $this->getDefaultCommand();
140 }
141
142 switch ($next_class) {
143 case "ilstudyprogrammerepositorysearchgui":
144 $this->repository_search_gui->setCallback($this, "addUsers");
145 $this->ctrl->setReturn($this, "view");
146 $this->ctrl->forwardCommand($this->repository_search_gui);
147 break;
148 case "ilobjstudyprogrammeindividualplangui":
149 $this->individual_plan_gui->setParentGUI($this);
150 $this->individual_plan_gui->setRefId($this->ref_id);
151 $this->ctrl->forwardCommand($this->individual_plan_gui);
152 break;
153 case "ilstudyprogrammemailmembersearchgui":
154 $this->tabs->clearTargets();
155 $this->tabs->setBackTarget(
156 $this->lng->txt('btn_back'),
157 $this->ctrl->getLinkTarget($this, $this->getDefaultCommand())
158 );
160 $mail_search = $dic['ilStudyProgrammeMailMemberSearchGUI'];
161 $mail_search->setAssignments($this->getAssignmentsById());
162 $mail_search->setBackTarget(
163 $this->ctrl->getLinkTarget($this, $this->getDefaultCommand())
164 );
165 $this->ctrl->forwardCommand($mail_search);
166 break;
167 case "ilstudyprogrammechangeexpiredategui":
168 $this->tabs->clearTargets();
169 $this->tabs->setBackTarget(
170 $this->lng->txt('btn_back'),
171 $this->ctrl->getLinkTarget($this, $this->getDefaultCommand())
172 );
174 $gui = $dic['ilStudyProgrammeChangeExpireDateGUI'];
175 $gui->setRefId($this->ref_id);
176 $gui->setProgressIds($this->getGetPrgsIds());
177 $this->ctrl->forwardCommand($gui);
178 break;
179 case "ilstudyprogrammechangedeadlinegui":
180 $this->tabs->clearTargets();
181 $this->tabs->setBackTarget(
182 $this->lng->txt('btn_back'),
183 $this->ctrl->getLinkTarget($this, $this->getDefaultCommand())
184 );
186 $gui = $dic['ilStudyProgrammeChangeDeadlineGUI'];
187 $gui->setRefId($this->ref_id);
188 $gui->setProgressIds($this->getGetPrgsIds());
189 $this->ctrl->forwardCommand($gui);
190 break;
191 case false:
192 switch ($cmd) {
193 case "view":
194 case "markAccredited":
195 case "markAccreditedMulti":
196 case "unmarkAccredited":
197 case "unmarkAccreditedMulti":
198 case "removeUser":
199 case "removeUserMulti":
200 case "markNotRelevantMulti":
201 case "markRelevant":
202 case "markRelevantMulti":
203 case "updateFromCurrentPlan":
204 case "updateFromCurrentPlanMulti":
205 case "acknowledgeCourses":
206 case "acknowledgeCoursesMulti":
207 case "applyFilter":
208 case "resetFilter":
209 case "changeDeadline":
210 case "changeDeadlineMulti":
211 case "changeExpireDate":
212 case "changeExpireDateMulti":
213 $cont = $this->$cmd();
214 $this->tpl->setContent($cont);
215 break;
216 case "confirmedRemoveUsers":
217 $this->confirmedRemoveUsers();
218 break;
219 case "confirmedUpdateFromCurrentPlan":
221 break;
222 case "confirmedAcknowledgeCourses":
224 break;
225 case "confirmedAcknowledgeAllCourses":
227 break;
228
229 case "mailUserMulti":
230 $this->mailToSelectedUsers();
231 break;
232 case "markNotRelevant":
233 $this->markRelevant();
234 break;
235
236 default:
237 throw new ilException("ilObjStudyProgrammeMembersGUI: Command not supported: $cmd");
238 }
239 break;
240 default:
241 throw new ilException(
242 "ilObjStudyProgrammeMembersGUI: Can't forward to next class $next_class"
243 );
244 }
245 }
static specificDicFor(ilObjStudyProgramme $prg)
$dic
Definition: result.php:32

References $dic, confirmedAcknowledgeAllCourses(), confirmedAcknowledgeCourses(), confirmedRemoveUsers(), confirmedUpdateFromCurrentPlan(), ILIAS\Repository\ctrl(), ilStudyProgrammeDIC\dic(), getAssignmentsById(), getDefaultCommand(), getGetPrgsIds(), ILIAS\Repository\lng(), mailToSelectedUsers(), markRelevant(), ilStudyProgrammeDIC\specificDicFor(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ getAddableUsers()

ilObjStudyProgrammeMembersGUI::getAddableUsers ( array  $users)
protected
Parameters
int[]$users

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

472 : array
473 {
474 $to_add = $this->permissions->filterUserIds(
475 $users,
477 );
478
479 $cnt_not_added = count($users) - count($to_add);
480 if ($cnt_not_added > 0) {
481 $this->tpl->setOnScreenMessage(
482 "info",
483 sprintf(
484 $this->lng->txt('could_not_add_users_no_permissons'),
485 $cnt_not_added
486 ),
487 true
488 );
489 }
490 return $to_add;
491 }

References ILIAS\Repository\lng(), and ilOrgUnitOperation\OP_MANAGE_MEMBERS.

Referenced by addUsers().

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

◆ getAssignmentsById()

ilObjStudyProgrammeMembersGUI::getAssignmentsById ( )
protected

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

252 : array
253 {
254 return $this->assignment_db->getAllForNodeIsContained($this->object->getId());
255 }

References ILIAS\Repository\object().

Referenced by executeCommand(), and mailToSelectedUsers().

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

◆ getAssignmentsFromQuery()

ilObjStudyProgrammeMembersGUI::getAssignmentsFromQuery ( )
protected
Returns
ilPRGAssignment[]

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

697 : array
698 {
699 $ass_ids = $this->http_wrapper->query()->retrieve(
700 'ass_ids',
701 $this->refinery->custom()->transformation(fn ($ids) => explode(',', $ids))
702 );
703 $prg = $this->getStudyProgramme();
704 $assignments = array_map(
705 fn ($ass_id) => $this->assignment_db->get((int) $ass_id),
706 $ass_ids
707 );
708
709 $assignments = array_filter(
710 $assignments,
711 fn ($ass) => $ass->getRootId() === $prg->getId()
712 );
713 return $assignments;
714 }

References getStudyProgramme(), and ILIAS\Repository\refinery().

Referenced by confirmedAcknowledgeAllCourses(), and confirmedAcknowledgeCourses().

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

◆ getDefaultCommand()

ilObjStudyProgrammeMembersGUI::getDefaultCommand ( )
protected

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

247 : string
248 {
249 return self::DEFAULT_CMD;
250 }

References DEFAULT_CMD.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getGetPrgsIds()

ilObjStudyProgrammeMembersGUI::getGetPrgsIds ( )
protected

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

311 : array
312 {
313 $prgrs_ids = $_GET['prgrs_ids'];
314 $ids = [];
315 if (!is_null($prgrs_ids)) {
316 foreach (explode(',', $prgrs_ids) as $id) {
318 };
319 }
320 return $ids;
321 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static createFromString(string $id)
$_GET['client_id']
Definition: saml1-acs.php:21

References $_GET, $id, and PRGProgressId\createFromString().

Referenced by executeCommand().

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

◆ getLinkTargetForAction()

ilObjStudyProgrammeMembersGUI::getLinkTargetForAction ( string  $action,
string  $prgrs_id,
int  $ass_id 
)

Get the link target for an action on user progress.

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

970 : string
971 {
972 switch ($action) {
974 $target_name = "markAccredited";
975 break;
977 $target_name = "unmarkAccredited";
978 break;
980 return $this->individual_plan_gui->getLinkTargetView($ass_id);
982 $target_name = "removeUser";
983 break;
985 $target_name = "markNotRelevant";
986 break;
988 $target_name = "markRelevant";
989 break;
991 $target_name = "updateFromCurrentPlan";
992 break;
994 $target_name = "acknowledgeCourses";
995 break;
997 $target_name = "changeDeadline";
998 break;
1000 $target_name = "changeExpireDate";
1001 break;
1002 default:
1003 throw new ilException("Unknown action: $action");
1004 }
1005
1006 $this->ctrl->setParameter($this, "prgrs_id", $prgrs_id);
1007 $link = $this->ctrl->getLinkTarget($this, $target_name);
1008 $this->ctrl->setParameter($this, "prgrs_id", null);
1009 return $link;
1010 }

References ACTION_ACKNOWLEDGE_COURSES, ACTION_CHANGE_DEADLINE, ACTION_CHANGE_EXPIRE_DATE, ACTION_MARK_ACCREDITED, ACTION_MARK_RELEVANT, ACTION_REMOVE_USER, ACTION_SHOW_INDIVIDUAL_PLAN, ACTION_UNMARK_ACCREDITED, ACTION_UNMARK_RELEVANT, ACTION_UPDATE_FROM_CURRENT_PLAN, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getMembersTableGUI()

ilObjStudyProgrammeMembersGUI::getMembersTableGUI ( )
protected

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

258 {
259 $prg_id = ilObject::_lookupObjId($this->ref_id);
262 $prg_id,
263 $this->ref_id,
264 $this,
265 $this->permissions,
266 $this->data_factory,
267 $dic['ui.factory'],
268 $dic['ui.renderer'],
269 $dic['ilStudyProgrammeUserTable'],
270 $dic['filter.assignment'],
271 $this->user,
272 "view",
273 ""
274 );
275 return $table;
276 }
static _lookupObjId(int $ref_id)

References $dic, ilObject\_lookupObjId(), ilStudyProgrammeDIC\specificDicFor(), and ILIAS\Repository\user().

Referenced by applyFilter(), resetFilter(), and view().

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

◆ getMessageCollection()

ilObjStudyProgrammeMembersGUI::getMessageCollection ( string  $topic)
protected

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

1021 {
1022 return $this->messages->getMessageCollection($topic);
1023 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by confirmedAcknowledgeAllCourses(), confirmedAcknowledgeCourses(), confirmedUpdateFromCurrentPlan(), markAccredited(), markAccreditedMulti(), markNotRelevant(), markNotRelevantMulti(), markRelevant(), markRelevantMulti(), unmarkAccredited(), and unmarkAccreditedMulti().

+ Here is the caller graph for this function:

◆ getPostPrgsIds()

ilObjStudyProgrammeMembersGUI::getPostPrgsIds ( )
protected
Returns
PRGProgressId[]

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

281 : array
282 {
283 if ($this->http_wrapper->post()->has(self::F_COMMAND_OPTION_ALL)) {
284 $pgs_ids = $this->http_wrapper->post()->retrieve(
285 self::F_ALL_PROGRESS_IDS,
286 $this->refinery->custom()->transformation(
287 fn ($ids) => explode(',', $ids)
288 )
289 );
290 } else {
291 $pgs_ids = $this->http_wrapper->post()->retrieve(
292 self::F_SELECTED_PROGRESS_IDS,
293 $this->refinery->custom()->transformation(fn ($ids) => $ids)
294 );
295 }
296 if ($pgs_ids === null) {
297 $this->showInfoMessage("no_user_selected");
298 $this->ctrl->redirect($this, "view");
299 }
300 if (is_string($pgs_ids)) {
301 $pgs_ids = [$pgs_ids];
302 }
303
304 $r = [];
305 foreach ($pgs_ids as $pgs_id) {
306 $r[] = PRGProgressId::createFromString($pgs_id);
307 }
308 return $r;
309 }

References PRGProgressId\createFromString(), ILIAS\Repository\ctrl(), ILIAS\Repository\refinery(), and showInfoMessage().

Referenced by acknowledgeCoursesMulti(), changeDeadlineMulti(), changeExpireDateMulti(), confirmedRemoveUsers(), confirmedUpdateFromCurrentPlan(), mailToSelectedUsers(), 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

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

324 {
325 if (!$_GET["prgrs_id"]) {
326 throw new ilException("Expected 'prgrs_id'");
327 }
328 return PRGProgressId::createFromString($_GET["prgrs_id"]);
329 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $_GET, and PRGProgressId\createFromString().

Referenced by acknowledgeCourses(), changeDeadline(), changeExpireDate(), markAccredited(), markNotRelevant(), markRelevant(), removeUser(), unmarkAccredited(), and updateFromCurrentPlan().

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

◆ getStudyProgramme()

ilObjStudyProgrammeMembersGUI::getStudyProgramme ( int  $ref_id = null)

◆ initMailToMemberButton()

ilObjStudyProgrammeMembersGUI::initMailToMemberButton ( ilToolbarGUI  $toolbar,
bool  $separator = false 
)
protected

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

940 : void
941 {
942 if ($separator) {
944 }
945
947 $this->lng->txt('mail_assignments'),
948 $this->ctrl->getLinkTargetByClass(
949 'ilStudyProgrammeMailMemberSearchGUI',
950 'showSelectableUsers'
951 )
952 );
953 }
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')

References $toolbar, ilToolbarGUI\addButton(), ilToolbarGUI\addSeparator(), and ILIAS\Repository\lng().

Referenced by view().

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

◆ initSearchGUI()

ilObjStudyProgrammeMembersGUI::initSearchGUI ( )
protected

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

927 : void
928 {
930 $this,
931 $this->toolbar,
932 array(
933 "auto_complete_name" => $this->lng->txt("user"),
934 "submit_name" => $this->lng->txt("add"),
935 "add_search" => true
936 )
937 );
938 }
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(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

Referenced by view().

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

◆ mailToSelectedUsers()

ilObjStudyProgrammeMembersGUI::mailToSelectedUsers ( )
protected

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

1030 : void
1031 {
1033 $gui = $dic['ilStudyProgrammeMailMemberSearchGUI'];
1034
1035 $selected = $this->getPostPrgsIds();
1036 $selected_ids = array_map(
1037 fn ($id) => $id->getAssignmentId(),
1038 $selected
1039 );
1040
1041 $assignments = array_filter(
1042 $this->getAssignmentsById(),
1043 fn ($ass) => in_array($ass->getId(), $selected_ids)
1044 );
1045 $gui->setAssignments($assignments);
1046 $this->tabs->clearTargets();
1047 $this->tabs->setBackTarget(
1048 $this->lng->txt('btn_back'),
1049 $this->ctrl->getLinkTarget($this, $this->getDefaultCommand())
1050 );
1051 $this->ctrl->forwardCommand($gui);
1052 }

References $dic, $id, ILIAS\Repository\ctrl(), getAssignmentsById(), getPostPrgsIds(), ILIAS\Repository\lng(), ilStudyProgrammeDIC\specificDicFor(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

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

◆ markAccredited()

ilObjStudyProgrammeMembersGUI::markAccredited ( )
protected

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

493 : void
494 {
495 $prgrs_id = $this->getPrgrsId();
496 $msgs = $this->getMessageCollection('msg_mark_accredited');
497 $this->markAccreditedByProgressId($prgrs_id, $msgs);
498 $this->showMessages($msgs);
499 $this->ctrl->redirect($this, "view");
500 }
markAccreditedByProgressId(PRGProgressId $prgrs_id, ilPRGMessageCollection $msgs)

References ILIAS\Repository\ctrl(), getMessageCollection(), getPrgrsId(), markAccreditedByProgressId(), and showMessages().

+ Here is the call graph for this function:

◆ markAccreditedByProgressId()

ilObjStudyProgrammeMembersGUI::markAccreditedByProgressId ( PRGProgressId  $prgrs_id,
ilPRGMessageCollection  $msgs 
)
protected

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

513 : void
514 {
515 $usr_id = $prgrs_id->getUsrId();
516 if (!$this->mayCurrentUserEditProgressForUser($usr_id)) {
517 $msgs->add(false, 'No permission to edit progress of user', (string) $prgrs_id);
518 } else {
519 $programme = $this->getStudyProgramme();
520 $programme->markAccredited($prgrs_id->getAssignmentId(), $this->user->getId(), $msgs);
521 }
522 }
add(bool $success, string $message, string $record_identitifer)

References ilPRGMessageCollection\add(), PRGProgressId\getAssignmentId(), getStudyProgramme(), PRGProgressId\getUsrId(), and mayCurrentUserEditProgressForUser().

Referenced by markAccredited(), and markAccreditedMulti().

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

◆ markAccreditedMulti()

ilObjStudyProgrammeMembersGUI::markAccreditedMulti ( )
protected

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

502 : void
503 {
504 $prgrs_ids = $this->getPostPrgsIds();
505 $msgs = $this->getMessageCollection('msg_mark_accredited');
506 foreach ($prgrs_ids as $key => $prgrs_id) {
507 $this->markAccreditedByProgressId($prgrs_id, $msgs);
508 }
509 $this->showMessages($msgs);
510 $this->ctrl->redirect($this, "view");
511 }
string $key
Consumer key/client ID value.
Definition: System.php:193

References ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\ctrl(), getMessageCollection(), getPostPrgsIds(), markAccreditedByProgressId(), and showMessages().

+ Here is the call graph for this function:

◆ markNotRelevant()

ilObjStudyProgrammeMembersGUI::markNotRelevant ( )

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

585 : void
586 {
587 $prgrs_id = $this->getPrgrsId();
588 $msgs = $this->getMessageCollection('msg_mark_not_relevant');
589 $programme = $this->getStudyProgramme();
590 if (!$this->mayCurrentUserEditProgressForUser($prgrs_id->getUsrId())) {
591 $msgs->add(false, 'No permission to edit progress of user', (string) $prgrs_id);
592 } else {
593 $programme->markNotRelevant($prgrs_id->getAssignmentId(), $this->user->getId(), $msgs);
594 }
595 $this->showMessages($msgs);
596 $this->ctrl->redirect($this, "view");
597 }

References ILIAS\Repository\ctrl(), getMessageCollection(), getPrgrsId(), getStudyProgramme(), mayCurrentUserEditProgressForUser(), and showMessages().

+ Here is the call graph for this function:

◆ markNotRelevantMulti()

ilObjStudyProgrammeMembersGUI::markNotRelevantMulti ( )

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

599 : void
600 {
601 $prgrs_ids = $this->getPostPrgsIds();
602 $msgs = $this->getMessageCollection('msg_mark_not_relevant');
603 $programme = $this->getStudyProgramme();
604 foreach ($prgrs_ids as $key => $prgrs_id) {
605 if (!$this->mayCurrentUserEditProgressForUser($prgrs_id->getUsrId())) {
606 $msgs->add(false, 'No permission to edit progress of user', (string) $prgrs_id);
607 } else {
608 $programme->markNotRelevant($prgrs_id->getAssignmentId(), $this->user->getId(), $msgs);
609 }
610 }
611 $this->showMessages($msgs);
612 $this->ctrl->redirect($this, "view");
613 }

References ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\ctrl(), getMessageCollection(), getPostPrgsIds(), getStudyProgramme(), mayCurrentUserEditProgressForUser(), and showMessages().

+ Here is the call graph for this function:

◆ markRelevant()

ilObjStudyProgrammeMembersGUI::markRelevant ( )

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

555 : void
556 {
557 $prgrs_id = $this->getPrgrsId();
558 $msgs = $this->getMessageCollection('msg_mark_relevant');
559 $programme = $this->getStudyProgramme();
560 if (!$this->mayCurrentUserEditProgressForUser($prgrs_id->getUsrId())) {
561 $msgs->add(false, "No permission to edit progress of user", (string) $prgrs_id);
562 } else {
563 $programme->markRelevant($prgrs_id->getAssignmentId(), $this->user->getId(), $msgs);
564 }
565 $this->showMessages($msgs);
566 $this->ctrl->redirect($this, "view");
567 }

References ILIAS\Repository\ctrl(), getMessageCollection(), getPrgrsId(), getStudyProgramme(), mayCurrentUserEditProgressForUser(), and showMessages().

Referenced by executeCommand().

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

◆ markRelevantMulti()

ilObjStudyProgrammeMembersGUI::markRelevantMulti ( )

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

569 : void
570 {
571 $prgrs_ids = $this->getPostPrgsIds();
572 $msgs = $this->getMessageCollection('msg_mark_relevant');
573 $programme = $this->getStudyProgramme();
574 foreach ($prgrs_ids as $key => $prgrs_id) {
575 if (!$this->mayCurrentUserEditProgressForUser($prgrs_id->getUsrId())) {
576 $msgs->add(false, 'No permission to edit progress of user', (string) $prgrs_id);
577 } else {
578 $programme->markRelevant($prgrs_id->getAssignmentId(), $this->user->getId(), $msgs);
579 }
580 }
581 $this->showMessages($msgs);
582 $this->ctrl->redirect($this, "view");
583 }

References ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\ctrl(), getMessageCollection(), getPostPrgsIds(), getStudyProgramme(), mayCurrentUserEditProgressForUser(), and showMessages().

+ Here is the call graph for this function:

◆ mayCurrentUserEditProgressForUser()

ilObjStudyProgrammeMembersGUI::mayCurrentUserEditProgressForUser ( int  $usr_id)
protected

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

1012 : bool
1013 {
1014 return in_array(
1015 $usr_id,
1016 $this->permissions->getUserIdsSusceptibleTo(ilOrgUnitOperation::OP_EDIT_INDIVIDUAL_PLAN)
1017 );
1018 }

References ilOrgUnitOperation\OP_EDIT_INDIVIDUAL_PLAN.

Referenced by confirmedUpdateFromCurrentPlan(), markAccreditedByProgressId(), markNotRelevant(), markNotRelevantMulti(), markRelevant(), markRelevantMulti(), and unmarkAccreditedByProgressId().

+ Here is the caller graph for this function:

◆ removeAssignment()

ilObjStudyProgrammeMembersGUI::removeAssignment ( PRGProgressId  $pgs_id)
protected

Remove user.

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

891 : void
892 {
893 if (!in_array(
894 $pgs_id->getUsrId(),
895 $this->permissions->getUserIdsSusceptibleTo(ilOrgUnitOperation::OP_MANAGE_MEMBERS)
896 )) {
898 'No permission to manage membership of user'
899 );
900 }
901
902 $ass = $this->assignment_db->get($pgs_id->getAssignmentId());
903 $prg_ref_id = ilObjStudyProgramme::getRefIdFor($ass->getRootId());
904 if ($prg_ref_id !== $this->ref_id) {
905 throw new ilException("Can only remove users from the node they where assigned to.");
906 }
907 $prg = ilObjStudyProgramme::getInstanceByRefId($prg_ref_id);
908 $prg->removeAssignment($ass);
909 }
static getRefIdFor(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References PRGProgressId\getAssignmentId(), ilObjStudyProgramme\getInstanceByRefId(), ilObjStudyProgramme\getRefIdFor(), PRGProgressId\getUsrId(), and ilOrgUnitOperation\OP_MANAGE_MEMBERS.

Referenced by confirmedRemoveUsers().

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

◆ removeUser()

ilObjStudyProgrammeMembersGUI::removeUser ( )

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

837 : string
838 {
839 $prgrs_id = $this->getPrgrsId();
840 return $this->confirmRemoveUsers([$prgrs_id]);
841 }

References confirmRemoveUsers(), and getPrgrsId().

+ Here is the call graph for this function:

◆ removeUserMulti()

ilObjStudyProgrammeMembersGUI::removeUserMulti ( )
protected

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

843 : string
844 {
845 $pgs_ids = $this->getPostPrgsIds();
846 return $this->confirmRemoveUsers($pgs_ids);
847 }

References confirmRemoveUsers(), and getPostPrgsIds().

+ Here is the call graph for this function:

◆ resetFilter()

ilObjStudyProgrammeMembersGUI::resetFilter ( )

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

356 : void
357 {
358 $table = $this->getMembersTableGUI();
359 $table->resetOffset();
360 $table->resetFilter();
361 $this->ctrl->redirect($this, "view");
362 }

References ILIAS\Repository\ctrl(), and getMembersTableGUI().

+ Here is the call graph for this function:

◆ setParentGUI()

ilObjStudyProgrammeMembersGUI::setParentGUI ( ilObjectGUI  $a_parent_gui)

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

121 : void
122 {
123 $this->parent_gui = $a_parent_gui;
124 }

◆ setRefId()

ilObjStudyProgrammeMembersGUI::setRefId ( int  $ref_id)

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

126 : void
127 {
128 $this->ref_id = $ref_id;
130 $this->permissions = ilStudyProgrammeDIC::specificDicFor($this->object)['permissionhelper'];
131 }

References $ref_id, ilObjStudyProgramme\getInstanceByRefId(), and ilStudyProgrammeDIC\specificDicFor().

+ Here is the call graph for this function:

◆ showInfoMessage()

ilObjStudyProgrammeMembersGUI::showInfoMessage ( string  $lng_var)
protected

Shows ilUtil failed message.

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

922 : void
923 {
924 $this->tpl->setOnScreenMessage("info", $this->lng->txt("prg_$lng_var"), true);
925 }

References ILIAS\Repository\lng().

Referenced by confirmedRemoveUsers(), and getPostPrgsIds().

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

◆ showMessages()

ilObjStudyProgrammeMembersGUI::showMessages ( ilPRGMessageCollection  $msg)
protected

◆ showSuccessMessage()

ilObjStudyProgrammeMembersGUI::showSuccessMessage ( string  $lng_var)
protected

Shows ilUtil success message.

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

914 : void
915 {
916 $this->tpl->setOnScreenMessage("success", $this->lng->txt("prg_$lng_var"), true);
917 }

References ILIAS\Repository\lng().

Referenced by confirmedRemoveUsers().

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

◆ unmarkAccredited()

ilObjStudyProgrammeMembersGUI::unmarkAccredited ( )
protected

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

524 : void
525 {
526 $prgrs_id = $this->getPrgrsId();
527 $msgs = $this->getMessageCollection('msg_unmark_accredited');
528 $this->unmarkAccreditedByProgressId($prgrs_id, $msgs);
529 $this->showMessages($msgs);
530 $this->ctrl->redirect($this, "view");
531 }
unmarkAccreditedByProgressId(PRGProgressId $prgrs_id, ilPRGMessageCollection $msgs)

References ILIAS\Repository\ctrl(), getMessageCollection(), getPrgrsId(), showMessages(), and unmarkAccreditedByProgressId().

+ Here is the call graph for this function:

◆ unmarkAccreditedByProgressId()

ilObjStudyProgrammeMembersGUI::unmarkAccreditedByProgressId ( PRGProgressId  $prgrs_id,
ilPRGMessageCollection  $msgs 
)
protected

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

544 : void
545 {
546 $usr_id = $prgrs_id->getUsrId();
547 if (!$this->mayCurrentUserEditProgressForUser($usr_id)) {
548 $msgs->add(false, 'No permission to edit progress of user', (string) $prgrs_id);
549 } else {
550 $programme = $this->getStudyProgramme();
551 $programme->unmarkAccredited($prgrs_id->getAssignmentId(), $this->user->getId(), $msgs);
552 }
553 }

References ilPRGMessageCollection\add(), PRGProgressId\getAssignmentId(), getStudyProgramme(), PRGProgressId\getUsrId(), and mayCurrentUserEditProgressForUser().

Referenced by unmarkAccredited(), and unmarkAccreditedMulti().

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

◆ unmarkAccreditedMulti()

ilObjStudyProgrammeMembersGUI::unmarkAccreditedMulti ( )

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

533 : void
534 {
535 $prgrs_ids = $this->getPostPrgsIds();
536 $msgs = $this->getMessageCollection('msg_unmark_accredited');
537 foreach ($prgrs_ids as $key => $prgrs_id) {
538 $this->unmarkAccreditedByProgressId($prgrs_id, $msgs);
539 }
540 $this->showMessages($msgs);
541 $this->ctrl->redirect($this, "view");
542 }

References ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\ctrl(), getMessageCollection(), getPostPrgsIds(), showMessages(), and unmarkAccreditedByProgressId().

+ Here is the call graph for this function:

◆ updateFromCurrentPlan()

ilObjStudyProgrammeMembersGUI::updateFromCurrentPlan ( )

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

615 : string
616 {
617 $this->confirmation_gui->setFormAction($this->ctrl->getFormAction($this, 'confirmUpdateFromCurrentPlan'));
618 $this->confirmation_gui->setHeaderText($this->lng->txt('header_update_current_plan'));
619 $this->confirmation_gui->setConfirm($this->lng->txt('confirm'), 'confirmedUpdateFromCurrentPlan');
620 $this->confirmation_gui->setCancel($this->lng->txt('cancel'), 'view');
621
622 $prgs_id = $this->getPrgrsId();
623 $user_name = ilObjUser::_lookupFullname($prgs_id->getUsrId());
624 $this->confirmation_gui->addItem(
625 self::F_SELECTED_PROGRESS_ID,
626 (string) $prgs_id,
627 $user_name
628 );
629 return $this->confirmation_gui->getHTML();
630 }

References ilObjUser\_lookupFullname(), ILIAS\Repository\ctrl(), getPrgrsId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ updateFromCurrentPlanMulti()

ilObjStudyProgrammeMembersGUI::updateFromCurrentPlanMulti ( )

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

632 : string
633 {
634 $this->confirmation_gui->setFormAction($this->ctrl->getFormAction($this, 'confirmUpdateFromCurrentPlan'));
635 $this->confirmation_gui->setHeaderText($this->lng->txt('header_update_current_plan'));
636 $this->confirmation_gui->setConfirm($this->lng->txt('confirm'), 'confirmedUpdateFromCurrentPlan');
637 $this->confirmation_gui->setCancel($this->lng->txt('cancel'), 'view');
638
639 foreach ($this->getPostPrgsIds() as $progress_id) {
640 $user_name = ilObjUser::_lookupFullname($progress_id->getUsrId());
641 $this->confirmation_gui->addItem(
642 self::F_SELECTED_PROGRESS_IDS . '[]',
643 (string) $progress_id,
644 $user_name
645 );
646 }
647 return $this->confirmation_gui->getHTML();
648 }

References ilObjUser\_lookupFullname(), ILIAS\Repository\ctrl(), getPostPrgsIds(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ view()

ilObjStudyProgrammeMembersGUI::view ( )
protected

Shows table with all members of the SP.

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

334 : string
335 {
336 if ($this->getStudyProgramme()->isActive() && $this->permissions->may(ilOrgUnitOperation::OP_MANAGE_MEMBERS)) {
337 $this->initSearchGUI();
338 $this->initMailToMemberButton($this->toolbar, true);
339 }
340
341 if (!$this->getStudyProgramme()->isActive()) {
342 $this->tpl->setOnScreenMessage("info", $this->lng->txt("prg_no_members_not_active"));
343 }
344 $table = $this->getMembersTableGUI();
345 return $table->getHTML();
346 }
initMailToMemberButton(ilToolbarGUI $toolbar, bool $separator=false)

References getMembersTableGUI(), getStudyProgramme(), initMailToMemberButton(), initSearchGUI(), ILIAS\Repository\lng(), ilOrgUnitOperation\OP_MANAGE_MEMBERS, and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ viewCompletedCourses()

ilObjStudyProgrammeMembersGUI::viewCompletedCourses ( array  $assignments)

Shows list of completed courses for each assignment.

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

407 : Form
408 {
409 $prg = $this->getStudyProgramme();
410 $completed_courses = [];
411 $ass_ids = [];
412 foreach ($assignments as $ass) {
413 $ass_ids[] = $ass->getId();
414 $completed_crss = $prg->getCompletedCourses($ass->getUserId());
415
416 $label = sprintf(
417 "%s (%s)",
418 $ass->getUserInformation()->getFullname(),
419 $ass->getId()
420 );
421 $options = [];
422 foreach($completed_crss as $opt) {
423 $options[implode(';', [$ass->getId(), $opt['prg_obj_id'],$opt['crs_id']])] = $opt['title'];
424 }
425
426 $completed_courses[] = $this->ui_factory->input()->field()->multiselect($label, $options);
427 }
428
429 $form_action = $this->ctrl->getFormAction($this, 'confirmedAcknowledgeCourses')
430 . '&ass_ids=' . implode(',', $ass_ids);
431
432 $form = $this->ui_factory->input()->container()->form()->standard(
433 $form_action,
434 [
435 $this->ui_factory->input()->field()->section(
436 $completed_courses,
437 $this->lng->txt("prg_acknowledge_completed_courses")
438 )
439 ]
440 )->withAdditionalTransformation(
441 $this->refinery->custom()->transformation(
442 function ($values) {
443 $values = array_merge(...array_filter(array_shift($values)));
444 return array_map(
445 fn ($entry) => explode(';', $entry),
446 $values
447 );
448 }
449 )
450 );
451
452 $this->toolbar->addComponent(
453 $this->ui_factory->link()->standard(
454 $this->lng->txt('prg_cancel_acknowledge_completed_courses'),
455 $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD)
456 )
457 );
458 $this->toolbar->addComponent(
459 $this->ui_factory->link()->standard(
460 $this->lng->txt('prg_acknowledge_all_completed_courses'),
461 $this->ctrl->getLinkTarget($this, 'confirmedAcknowledgeAllCourses')
462 . '&ass_ids=' . implode(',', $ass_ids)
463 )
464 );
465
466 return $form;
467 }
static return function(ContainerConfigurator $containerConfigurator)
Definition: basic_rector.php:9

References ILIAS\Repository\ctrl(), function, getStudyProgramme(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\toolbar().

Referenced by acknowledgeCourses(), acknowledgeCoursesMulti(), and confirmedAcknowledgeCourses().

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

Field Documentation

◆ $assignment_db

ilPRGAssignmentDBRepository ilObjStudyProgrammeMembersGUI::$assignment_db
protected

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

Referenced by __construct().

◆ $confirmation_gui

ilConfirmationGUI ilObjStudyProgrammeMembersGUI::$confirmation_gui
protected

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

Referenced by __construct().

◆ $ctrl

ilCtrl ilObjStudyProgrammeMembersGUI::$ctrl
protected

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

◆ $data_factory

Factory ilObjStudyProgrammeMembersGUI::$data_factory
protected

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

Referenced by __construct().

◆ $http_wrapper

ILIAS HTTP Wrapper WrapperFactory ilObjStudyProgrammeMembersGUI::$http_wrapper
protected

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

Referenced by __construct().

◆ $individual_plan_gui

ilObjStudyProgrammeIndividualPlanGUI ilObjStudyProgrammeMembersGUI::$individual_plan_gui
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilObjStudyProgrammeMembersGUI::$lng
protected

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

Referenced by __construct().

◆ $messages

ilPRGMessagePrinter ilObjStudyProgrammeMembersGUI::$messages
protected

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

Referenced by __construct().

◆ $object

ilObjStudyProgramme ilObjStudyProgrammeMembersGUI::$object
protected

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

◆ $parent_gui

ilObjectGUI ilObjStudyProgrammeMembersGUI::$parent_gui
protected

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

◆ $permissions

ilPRGPermissionsHelper ilObjStudyProgrammeMembersGUI::$permissions
protected

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

◆ $ref_id

int ilObjStudyProgrammeMembersGUI::$ref_id
protected

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

Referenced by getStudyProgramme(), and setRefId().

◆ $refinery

ILIAS Refinery Factory ilObjStudyProgrammeMembersGUI::$refinery
protected

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

Referenced by __construct().

◆ $repository_search_gui

ilStudyProgrammeRepositorySearchGUI ilObjStudyProgrammeMembersGUI::$repository_search_gui
protected

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

Referenced by __construct().

◆ $request

GuzzleHttp Psr7 ServerRequest ilObjStudyProgrammeMembersGUI::$request
protected

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

Referenced by __construct().

◆ $tabs

ilTabsGUI ilObjStudyProgrammeMembersGUI::$tabs
protected

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

Referenced by __construct().

◆ $toolbar

ilToolbarGUI ilObjStudyProgrammeMembersGUI::$toolbar
protected

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

Referenced by initMailToMemberButton().

◆ $tpl

ilGlobalTemplateInterface ilObjStudyProgrammeMembersGUI::$tpl
protected

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

Referenced by __construct().

◆ $ui_factory

ILIAS UI Factory ilObjStudyProgrammeMembersGUI::$ui_factory
protected

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

Referenced by __construct().

◆ $ui_renderer

ILIAS UI Renderer ilObjStudyProgrammeMembersGUI::$ui_renderer
protected

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

Referenced by __construct().

◆ $user

ilObjUser ilObjStudyProgrammeMembersGUI::$user
protected

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

Referenced by __construct().

◆ ACTION_ACKNOWLEDGE_COURSES

const ilObjStudyProgrammeMembersGUI::ACTION_ACKNOWLEDGE_COURSES = "acknowledge_completed_courses"

◆ ACTION_CHANGE_DEADLINE

const ilObjStudyProgrammeMembersGUI::ACTION_CHANGE_DEADLINE = "change_deadline"

◆ ACTION_CHANGE_EXPIRE_DATE

const ilObjStudyProgrammeMembersGUI::ACTION_CHANGE_EXPIRE_DATE = "change_expire_date"

◆ ACTION_MARK_ACCREDITED

const ilObjStudyProgrammeMembersGUI::ACTION_MARK_ACCREDITED = "mark_accredited"

◆ ACTION_MARK_RELEVANT

const ilObjStudyProgrammeMembersGUI::ACTION_MARK_RELEVANT = "mark_relevant"

◆ ACTION_REMOVE_USER

const ilObjStudyProgrammeMembersGUI::ACTION_REMOVE_USER = "remove_user"

◆ ACTION_SHOW_INDIVIDUAL_PLAN

const ilObjStudyProgrammeMembersGUI::ACTION_SHOW_INDIVIDUAL_PLAN = "show_individual_plan"

◆ ACTION_UNMARK_ACCREDITED

const ilObjStudyProgrammeMembersGUI::ACTION_UNMARK_ACCREDITED = "unmark_accredited"

◆ ACTION_UNMARK_RELEVANT

const ilObjStudyProgrammeMembersGUI::ACTION_UNMARK_RELEVANT = "unmark_relevant"

◆ ACTION_UPDATE_FROM_CURRENT_PLAN

const ilObjStudyProgrammeMembersGUI::ACTION_UPDATE_FROM_CURRENT_PLAN = "update_from_current_plan"

◆ DEFAULT_CMD

const ilObjStudyProgrammeMembersGUI::DEFAULT_CMD = "view"
private

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

Referenced by getDefaultCommand().

◆ F_ALL_PROGRESS_IDS

const ilObjStudyProgrammeMembersGUI::F_ALL_PROGRESS_IDS = 'all_progress_ids'

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

◆ F_COMMAND_OPTION_ALL

const ilObjStudyProgrammeMembersGUI::F_COMMAND_OPTION_ALL = 'select_cmd_all'

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

◆ F_SELECTED_PROGRESS_ID

const ilObjStudyProgrammeMembersGUI::F_SELECTED_PROGRESS_ID = 'prgs_id'

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

◆ F_SELECTED_PROGRESS_IDS

const ilObjStudyProgrammeMembersGUI::F_SELECTED_PROGRESS_IDS = 'prgs_ids'

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

◆ F_SELECTED_USER_IDS

const ilObjStudyProgrammeMembersGUI::F_SELECTED_USER_IDS = 'usrids'

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


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