19declare(strict_types=1);
76 ILIAS\
HTTP\Wrapper\WrapperFactory $wrapper,
92 $this->request_wrapper = $wrapper->query();
93 $this->post_wrapper = $wrapper->post();
101 if (!$this->iass_access->mayEditMembers()
102 && !$this->iass_access->mayGradeAnyUser()
103 && !$this->iass_access->mayViewAnyUser()
104 && !$this->iass_access->mayAmendAllUsers()
108 $cmd = $this->
ctrl->getCmd();
109 $next_class = $this->
ctrl->getNextClass();
110 $this->
ctrl->saveParameterByClass(
"ilIndividualAssessmentMembersGUI", self::F_STATUS);
111 $this->tpl->setPermanentLink(
"iass", $this->ref_id);
113 switch ($next_class) {
114 case "ilrepositorysearchgui":
116 $rep_search->setCallback($this,
"addUsersFromSearch");
117 $rep_search->addUserAccessFilterCallable(
118 function ($a_user_ids) {
122 $this->
ctrl->forwardCommand($rep_search);
124 case "ilindividualassessmentmembergui":
125 $this->
tabs->clearTargets();
126 $this->
tabs->setBackTarget(
127 $this->
lng->txt(
'back'),
128 $this->ctrl->getLinkTargetByClass(self::class,
'view')
130 $this->
ctrl->forwardCommand($this->member_gui);
144 if ($this->request_wrapper->retrieve(
'failure', $r->byTrying([$r->kindlyTo()->bool(), $r->always(
false)]))) {
145 $this->tpl->setOnScreenMessage(
"failure", $this->
txt(
'iass_add_user_failure'));
147 $this->tpl->setOnScreenMessage(
"success", $this->
txt(
'iass_add_user_success'));
152 protected function view(): void
154 if ($this->iass_access->mayEditMembers()) {
155 $search_params = [
'crs',
'grp'];
156 $container_id = $this->
object->getParentContainerIdByType($this->ref_id, $search_params);
157 if ($container_id !== 0) {
162 'auto_complete_name' => $this->
txt(
'user'),
163 'submit_name' => $this->
txt(
'add'),
164 'add_search' =>
true,
165 'add_from_container' => $container_id
173 'auto_complete_name' => $this->
txt(
'user'),
174 'submit_name' => $this->
txt(
'add'),
188 $this->date_formatter
194 if ($sort ===
null) {
198 $entries = $this->
object->loadMembersAsSingleObjects($filter, $sort);
199 $table->setData($entries);
202 $output = $table->render($view_controls);
204 $this->tpl->setContent($output);
212 if (!empty($user_ids)) {
216 $this->tpl->setOnScreenMessage(
"info", $this->
txt(
"search_no_selection"),
true);
217 $this->
ctrl->redirect($this,
'view');
227 if (!$this->iass_access->mayEditMembers()) {
233 if (count($user_ids) === 0) {
238 if (!$members->userAllreadyMember(
$user)) {
239 $members = $members->withAdditionalUser(
$user);
244 $members->updateStorageAndRBAC($iass->membersStorage(), $iass->accessHandler());
246 $this->
ctrl->setParameter($this,
'failure', $failure);
247 $this->
ctrl->redirect($this,
'addedUsers');
255 if (!$this->iass_access->mayEditMembers()) {
258 $usr_id = $this->request_wrapper->retrieve(
"usr_id", $this->
refinery->kindlyTo()->int());
259 $message = $this->
lng->txt(
'iass_remove_user_qst');
261 $this->
ctrl->setParameterByClass(self::class,
'usr_id', $usr_id);
262 $remove = $this->
ctrl->getFormAction($this,
'removeUser');
263 $cancel = $this->
ctrl->getFormAction($this,
'view');
264 $this->
ctrl->clearParameterByClass(self::class,
'usr_id');
267 $this->
factory->button()->standard($this->
lng->txt(
'remove'), $remove),
268 $this->
factory->button()->standard($this->
lng->txt(
'cancel'), $cancel)
270 $message_box = $this->
factory->messageBox()->confirmation($message)->withButtons($buttons);
271 $this->tpl->setContent($this->
renderer->render($message_box));
279 if (!$this->iass_access->mayEditMembers()) {
282 $usr_id = $this->request_wrapper->retrieve(
"usr_id", $this->
refinery->kindlyTo()->int());
285 ->withoutPresentUser(
new ilObjUser($usr_id))
286 ->updateStorageAndRBAC($iass->membersStorage(), $iass->accessHandler());
288 $this->tpl->setOnScreenMessage(
"success", $this->
txt(
"iass_user_removed"),
true);
289 $this->
ctrl->redirect($this,
'view');
299 $vc_factory = $this->
factory->viewControl();
310 $vc = $vc_factory->mode(
315 if ($this->request_wrapper->has(self::F_STATUS)) {
317 $this->request_wrapper->retrieve(
319 $this->refinery->kindlyTo()->string()
329 $target = $this->
ctrl->getLinkTargetByClass(
"ilIndividualAssessmentMembersGUI",
"view");
330 return $vc_factory->sortation(
334 ->withTargetURL($target, self::F_SORT);
346 if ($this->iass_access->mayViewAnyUser()) {
347 $ret[$this->
txt(
"iass_filter_not_started")] =
349 $ret[$this->
txt(
"iass_filter_not_finalized")] =
351 $ret[$this->
txt(
"iass_filter_finalized")] =
353 $ret[$this->
txt(
"iass_filter_failed")] =
366 return $this->
txt(
"iass_filter_not_started");
368 return $this->
txt(
"iass_filter_not_finalized");
370 return $this->
txt(
"iass_filter_finalized");
372 return $this->
txt(
"iass_filter_failed");
374 return $this->
txt(
"iass_filter_all");
383 $this->
ctrl->setParameterByClass(
"ilIndividualAssessmentMembersGUI", self::F_SORT, $this->
getSortValue());
384 $this->
ctrl->setParameterByClass(
"ilIndividualAssessmentMembersGUI", self::F_STATUS, $value);
385 $link = $this->
ctrl->getLinkTargetByClass(
"ilIndividualAssessmentMembersGUI",
"view");
386 $this->
ctrl->setParameterByClass(
"ilIndividualAssessmentMembersGUI", self::F_STATUS,
null);
388 $this->
ctrl->setParameterByClass(
"ilIndividualAssessmentMembersGUI", self::F_SORT,
null);
396 $this->request_wrapper->has(self::F_STATUS) &&
397 $this->request_wrapper->retrieve(self::F_STATUS, $this->refinery->kindlyTo()->string()) !=
"" &&
399 $this->request_wrapper->retrieve(self::F_STATUS, $this->refinery->kindlyTo()->string()),
408 return $this->request_wrapper->retrieve(self::F_STATUS, $this->
refinery->kindlyTo()->string());
417 self::S_NAME_ASC => $this->
txt(
"iass_sort_name_asc"),
418 self::S_NAME_DESC => $this->
txt(
"iass_sort_name_desc"),
419 self::S_EXAMINER_ASC => $this->
txt(
"iass_sort_examiner_login_asc"),
420 self::S_EXAMINER_DESC => $this->
txt(
"iass_sort_examiner_login_desc"),
421 self::S_CHANGETIME_ASC => $this->
txt(
"iass_sort_changetime_asc"),
422 self::S_CHANGETIME_DESC => $this->
txt(
"iass_sort_changetime_desc")
429 $this->request_wrapper->has(self::F_SORT) &&
430 $this->request_wrapper->retrieve(self::F_SORT, $this->refinery->kindlyTo()->string()) !=
"" &&
432 $this->request_wrapper->retrieve(self::F_SORT, $this->refinery->kindlyTo()->string()),
436 self::S_EXAMINER_ASC,
437 self::S_EXAMINER_DESC,
438 self::S_CHANGETIME_ASC,
439 self::S_CHANGETIME_DESC
443 return $this->request_wrapper->retrieve(self::F_SORT, $this->
refinery->kindlyTo()->string());
451 $this->error_object->raiseError($this->
txt(
"msg_no_perm_read"), $this->error_object->WARNING);
454 protected function txt(
string $code): string
456 return $this->
lng->txt($code);
Builds a Color from either hex- or rgb values.
Class ArrayBasedRequestWrapper.
Class ilCtrl provides processing control methods.
Error Handling & global info handling.
static updateLPStatusByIds(int $iass_id, array $usr_ids)
For the purpose of streamlining the grading and learning-process status definition outside of tests,...
IndividualAssessmentAccessHandler $iass_access
ilErrorHandling $error_object
__construct(ilObjIndividualAssessment $object, ilCtrl $ctrl, ilGlobalPageTemplate $tpl, ilLanguage $lng, ilToolbarGUI $toolbar, ilObjUser $user, ilTabsGUI $tabs, IndividualAssessmentAccessHandler $iass_access, UI\Factory $factory, UI\Renderer $renderer, ilErrorHandling $error_object, ilIndividualAssessmentMemberGUI $member_gui, ILIAS\Refinery\Factory $refinery, ILIAS\HTTP\Wrapper\WrapperFactory $wrapper, ilIndividualAssessmentDateFormatter $date_formatter)
ilGlobalPageTemplate $tpl
getActiveLabelForModeByFilter($filter)
ilIndividualAssessmentDateFormatter $date_formatter
ILIAS Refinery Factory $refinery
removeUser()
Remove users from corresponding iass-object.
getLinkForStatusFilter($value)
addUsers(array $user_ids)
Add users to corresponding iass-object.
getModeControl(ViewControl\Factory $vc_factory)
removeUserConfirmation()
Display confirmation form for user might be removed.
getSortationControl(ViewControl\Factory $vc_factory)
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
addUsersFromSearch(array $user_ids)
ilIndividualAssessmentMemberGUI $member_gui
ILIAS HTTP Wrapper ArrayBasedRequestWrapper $post_wrapper
ilObjIndividualAssessment $object
const LP_ASSESSMENT_NOT_COMPLETED
For the purpose of streamlining the grading and learning-process status definition outside of tests,...
loadMembers()
Get the members object associated with this.
static fillAutoCompleteToolbar(object $parent_object, ?ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface RequestWrapper.
This describes a Mode Control.
withActive(string $label)
set the currently active/engaged Button by label.
This describes a Sortation Control.
An entity that renders components to a string output.
Mechanic regarding the access control and roles of an objet goes here.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.