ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilIndividualAssessmentMemberGUI Class Reference
+ Inheritance diagram for ilIndividualAssessmentMemberGUI:
+ Collaboration diagram for ilIndividualAssessmentMemberGUI:

Public Member Functions

 __construct (protected ilCtrl $ctrl, protected ilLanguage $lng, protected ilGlobalPageTemplate $tpl, protected ilObjUser $user, protected Input\Factory $input_factory, protected MessageBox\Factory $messagebox_factory, protected Button\Factory $button_factory, protected Link\Factory $link_factory, protected Refinery\Factory $refinery_factory, protected Data\Factory $data_factory, protected Renderer $renderer, protected ServerRequest $request, protected ilIndividualAssessmentPrimitiveInternalNotificator $notificator, protected ilToolbarGUI $toolbar, protected ilObjIndividualAssessment $object, protected ilErrorHandling $error_object, protected ILIAS\Refinery\Factory $refinery, protected ILIAS\HTTP\Wrapper\RequestWrapper $request_wrapper, protected ilIndividualAssessmentDateFormatter $date_formatter, protected IRSS $irss, protected ilIndividualAssessmentGradingStakeholder $stakeholder,)
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 setObject (ilObjIndividualAssessment $object)
 
 setParentGUI (ilIndividualAssessmentMembersGUI $parent_gui)
 
 getParentGUI ()
 
 handleAccessViolation ()
 
- Public Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 getFileRemovalURL ()
 @inheritDoc More...
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 supportsChunkedUploads ()
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getFileRemovalURL ()
 
 getExistingFileInfoURL ()
 
 getInfoForExistingFiles (array $file_ids)
 
 getInfoResult (string $identifier)
 
 supportsChunkedUploads ()
 

Data Fields

const CMD_VIEW = 'view'
 
const CMD_EDIT = 'edit'
 
const CMD_UPDATE = 'update'
 
const CMD_FINALIZE = 'finalize'
 
const CMD_FINALIZE_CONFIRMATION = 'finalizeConfirmation'
 
const CMD_AMEND = 'amend'
 
const CMD_SAVE_AMEND = "saveAmend"
 
const CMD_DOWNLOAD_FILE = "downloadFile"
 
- Data Fields inherited from ILIAS\UI\Component\Input\Field\UploadHandler
const DEFAULT_FILE_ID_PARAMETER = 'file_id'
 

Protected Member Functions

 view ()
 
 edit ()
 
 amend ()
 
 getFormActionForCommand (string $cmd)
 
 downloadFile ()
 
 saveAmend ()
 
 buildForm (string $form_action, bool $may_be_edited, bool $amend=false)
 
 finalize ()
 
 finalizeConfirmation ()
 
 saveMember (ilIndividualAssessmentUserGrading $grading, bool $keep_examiner=false, bool $amend=false)
 
 getPossibleLPStates ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 
 redirect (string $cmd)
 
 getObject ()
 
 getAccessHandler ()
 
 getExaminee ()
 
 getMember ()
 
 setToolbar ()
 
 mayBeEdited ()
 
 mayBeViewed ()
 
 mayBeAmended ()
 
 userMayGrade ()
 
 userMayView ()
 
 userMayAmend ()
 
 targetWasEditedByOtherUser (ilIndividualAssessmentMember $member)
 
 isFinalized ()
 
- Protected Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 readChunkedInformation ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 

Protected Attributes

ilIndividualAssessmentAccessHandler $iass_access = null
 
- Protected Attributes inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
const CMD_UPLOAD = 'upload'
 
const CMD_REMOVE = 'remove'
 
const CMD_INFO = 'info'
 
HttpServices $http
 
ilCtrl $ctrl
 
FileUpload $upload
 
bool $is_chunked = false
 
int $chunk_index = 0
 
int $amount_of_chunks = 0
 
string $chunk_id = null
 
int $chunk_total_size = 0
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentMemberGUI::__construct ( protected ilCtrl  $ctrl,
protected ilLanguage  $lng,
protected ilGlobalPageTemplate  $tpl,
protected ilObjUser  $user,
protected Input\Factory  $input_factory,
protected MessageBox\Factory  $messagebox_factory,
protected Button\Factory  $button_factory,
protected Link\Factory  $link_factory,
protected Refinery\Factory  $refinery_factory,
protected Data\Factory  $data_factory,
protected Renderer  $renderer,
protected ServerRequest  $request,
protected ilIndividualAssessmentPrimitiveInternalNotificator  $notificator,
protected ilToolbarGUI  $toolbar,
protected ilObjIndividualAssessment  $object,
protected ilErrorHandling  $error_object,
protected ILIAS\Refinery\Factory  $refinery,
protected ILIAS\HTTP\Wrapper\RequestWrapper  $request_wrapper,
protected ilIndividualAssessmentDateFormatter  $date_formatter,
protected IRSS  $irss,
protected ilIndividualAssessmentGradingStakeholder  $stakeholder 
)

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

72 {
74 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ amend()

ilIndividualAssessmentMemberGUI::amend ( )
protected

Definition at line 154 of file class.ilIndividualAssessmentMemberGUI.php.

154 : void
155 {
156 if (!$this->mayBeAmended()) {
157 $this->handleAccessViolation();
158 return;
159 }
160
161 $this->setToolbar();
162 $form = $this->buildForm($this->getFormActionForCommand(self::CMD_SAVE_AMEND), true, true);
163 $form->withSubmitLabel($this->lng->txt("save_amend"));
164 $this->tpl->setContent($this->renderer->render($form));
165 }
renderer()
buildForm(string $form_action, bool $may_be_edited, bool $amend=false)

References buildForm(), getFormActionForCommand(), handleAccessViolation(), ILIAS\Repository\lng(), mayBeAmended(), renderer(), and setToolbar().

+ Here is the call graph for this function:

◆ buildForm()

ilIndividualAssessmentMemberGUI::buildForm ( string  $form_action,
bool  $may_be_edited,
bool  $amend = false 
)
protected

Definition at line 211 of file class.ilIndividualAssessmentMemberGUI.php.

216 $section = $this->getMember()->getGrading()->toFormInput(
217 $this->input_factory->field(),
218 $this->data_factory,
219 $this->lng,
220 $this->refinery_factory,
221 $this,
222 $this->user->getDateFormat(),
223 $this->getObject()->getSettings()->getRecordTemplate(),
224 $this->getPossibleLPStates(),
225 $may_be_edited,
226 $this->getObject()->getSettings()->isEventTimePlaceRequired(),
227 $this->getObject()->getSettings()->isFileRequired(),
228 $amend
229 );
230
231 $form = $this->input_factory->container()->form()->standard($form_action, [$section]);
232 return $form->withAdditionalTransformation(
233 $this->refinery_factory->custom()->transformation(
234 function ($values) use ($amend) {
235 return array_shift($values);
236 }
237 )
238 );
239 }
This describes commonalities between all forms.
Definition: Form.php:33

Referenced by amend(), edit(), and view().

+ Here is the caller graph for this function:

◆ downloadFile()

ilIndividualAssessmentMemberGUI::downloadFile ( )
protected

Definition at line 176 of file class.ilIndividualAssessmentMemberGUI.php.

176 : void
177 {
178 $identifier = $this->getMember()->getGrading()->getFile();
179 $resource_id = $this->irss->manage()->find($identifier);
180 if ($resource_id) {
181 $this->irss->consume()->download($resource_id)->run();
182 }
183 }

References getMember().

+ Here is the call graph for this function:

◆ edit()

ilIndividualAssessmentMemberGUI::edit ( )
protected

Definition at line 111 of file class.ilIndividualAssessmentMemberGUI.php.

111 : void
112 {
113 if (!$this->mayBeEdited()) {
114 $this->handleAccessViolation();
115 return;
116 }
117
118 $this->setToolbar();
119 $form = $this->buildForm($this->getFormActionForCommand(self::CMD_UPDATE), true);
120 $this->tpl->setContent($this->renderer->render($form));
121 }

References buildForm(), getFormActionForCommand(), handleAccessViolation(), mayBeEdited(), renderer(), and setToolbar().

+ Here is the call graph for this function:

◆ executeCommand()

ilIndividualAssessmentMemberGUI::executeCommand ( )

Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented.

The Implementation MUST make sure, the Upload and the Removal Command are handled correctly

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

76 : void
77 {
78 $cmd = $this->ctrl->getCmd();
79
80 switch ($cmd) {
81 case self::CMD_VIEW:
83 case self::CMD_EDIT:
86 case self::CMD_AMEND:
89 $this->$cmd();
90 break;
91 case AbstractCtrlAwareUploadHandler::CMD_UPLOAD:
92 case AbstractCtrlAwareUploadHandler::CMD_REMOVE:
93 case AbstractCtrlAwareUploadHandler::CMD_INFO:
94 parent::executeCommand();
95 break;
96 default:
97 throw new LogicException("Unknown command $cmd");
98 }
99 }

References CMD_AMEND, CMD_DOWNLOAD_FILE, CMD_EDIT, CMD_FINALIZE, CMD_FINALIZE_CONFIRMATION, CMD_SAVE_AMEND, CMD_UPDATE, CMD_VIEW, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ finalize()

ilIndividualAssessmentMemberGUI::finalize ( )
protected

Definition at line 241 of file class.ilIndividualAssessmentMemberGUI.php.

241 : void
242 {
243 if (!$this->mayBeEdited()) {
244 $this->handleAccessViolation();
245 return;
246 }
247
248 $member = $this->getMember();
249 if (!$member->mayBeFinalized()) {
250 $this->tpl->setOnScreenMessage("failure", $this->lng->txt('iass_may_not_finalize'), true);
251 $this->redirect('edit');
252 return;
253 }
254
255 try {
256 $grading = $member->getGrading()->withFinalized(true);
257 $member = $member->withGrading($grading);
258 $this->getObject()->membersStorage()->updateMember($member);
260 $this->tpl->setOnScreenMessage("failure", $e->getMessage(), true);
261 $this->redirect('edit');
262 return;
263 }
264
265 if ($this->object->isActiveLP()) {
267 }
268
269 try {
270 $member->maybeSendNotification($this->notificator);
271 $this->ctrl->redirectByClass(ilIndividualAssessmentMembersGUI::class, 'view');
273 $this->tpl->setOnScreenMessage("failure", $e->getMessage(), true);
274 $this->redirect('edit');
275 return;
276 }
277
278 $this->tpl->setOnScreenMessage("success", $this->lng->txt('iass_membership_finalized'), true);
279 $this->redirect('view');
280 }
static updateLPStatusOfMember(ilIndividualAssessmentMember $member)

References Vendor\Package\$e, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

+ Here is the call graph for this function:

◆ finalizeConfirmation()

ilIndividualAssessmentMemberGUI::finalizeConfirmation ( )
protected

Definition at line 282 of file class.ilIndividualAssessmentMemberGUI.php.

282 : void
283 {
284 if (!$this->mayBeEdited()) {
285 $this->handleAccessViolation();
286 return;
287 }
288
289 $message = $this->lng->txt('iass_finalize_user_qst');
290 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
291 $finalize = $this->ctrl->getFormActionByClass(self::class, self::CMD_FINALIZE);
292 $cancel = $this->ctrl->getFormActionByClass(self::class, self::CMD_EDIT);
293 $this->ctrl->clearParameterByClass(self::class, 'usr_id');
294
295 $buttons = [
296 $this->button_factory->standard($this->lng->txt('iass_confirm_finalize'), $finalize),
297 $this->button_factory->standard($this->lng->txt('iass_cancel'), $cancel)
298 ];
299
300 $message_box = $this->messagebox_factory->confirmation($message)->withButtons($buttons);
301
302 $this->tpl->setContent($this->renderer->render($message_box));
303 }
$message
Definition: xapiexit.php:31

References $message, ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ILIAS\Repository\lng(), and renderer().

+ Here is the call graph for this function:

◆ getAccessHandler()

ilIndividualAssessmentMemberGUI::getAccessHandler ( )
protected

Definition at line 456 of file class.ilIndividualAssessmentMemberGUI.php.

457 {
458 if (is_null($this->iass_access)) {
459 $this->iass_access = $this->getObject()->accessHandler();
460 }
461 return $this->iass_access;
462 }
ilIndividualAssessmentAccessHandler $iass_access

◆ getExaminee()

ilIndividualAssessmentMemberGUI::getExaminee ( )
protected

Definition at line 464 of file class.ilIndividualAssessmentMemberGUI.php.

464 : ilObjUser
465 {
466 return new ilObjUser($this->request_wrapper->retrieve('usr_id', $this->refinery->kindlyTo()->int()));
467 }
User class.

Referenced by getFormActionForCommand().

+ Here is the caller graph for this function:

◆ getExistingFileInfoURL()

ilIndividualAssessmentMemberGUI::getExistingFileInfoURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 421 of file class.ilIndividualAssessmentMemberGUI.php.

421 : string
422 {
423 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
424 $link = $this->ctrl->getLinkTarget($this, self::CMD_INFO);
425 $this->ctrl->setParameter($this, 'usr_id', null);
426
427 return $link;
428 }

References ILIAS\Repository\ctrl(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ getFileIdentifierParameterName()

ilIndividualAssessmentMemberGUI::getFileIdentifierParameterName ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

407 : string
408 {
409 return 'iass';
410 }

◆ getFormActionForCommand()

ilIndividualAssessmentMemberGUI::getFormActionForCommand ( string  $cmd)
protected

Definition at line 167 of file class.ilIndividualAssessmentMemberGUI.php.

167 : string
168 {
169 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
170 $action = $this->ctrl->getFormAction($this, $cmd);
171 $this->ctrl->clearParameterByClass(self::class, 'usr_id');
172
173 return $action;
174 }

References ILIAS\Repository\ctrl(), getExaminee(), and ILIAS\Survey\Mode\getId().

Referenced by amend(), and edit().

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

◆ getInfoForExistingFiles()

ilIndividualAssessmentMemberGUI::getInfoForExistingFiles ( array  $file_ids)
Parameters
array$file_ids
Returns
BasicFileInfoResult[]

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 387 of file class.ilIndividualAssessmentMemberGUI.php.

387 : array
388 {
389 $file_ids = array_filter($file_ids, fn($id) => $id !== "");
390 return array_map(function ($id) {
391 $resource_id = $this->irss->manage()->find($identifier);
392 if (!$resource_id) {
393 return null;
394 }
395 $resource = $this->irss->manage()->getResource($resource_id);
396 $info = $resource->getCurrentRevision()->getInformation();
397 return new BasicFileInfoResult(
399 $id,
400 $info->getTitle(),
401 $info->getSize(),
402 $info->getMimeType()
403 );
404 }, $file_ids);
405 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$info
Definition: entry_point.php:21

References $id, and $info.

◆ getInfoResult()

ilIndividualAssessmentMemberGUI::getInfoResult ( string  $identifier)
Returns
null|FileInfoResult for the file with the given identifier or null if the file does not exist.

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

370 {
371 $resource_id = $this->irss->manage()->find($identifier);
372 if (!$resource_id) {
373 return null;
374 }
375 $resource = $this->irss->manage()->getResource($resource_id);
376 $info = $resource->getCurrentRevision()->getInformation();
377
378 return new BasicFileInfoResult(
380 $identifier,
381 $info->getTitle(),
382 $info->getSize(),
383 $info->getMimeType()
384 );
385 }

References $info.

◆ getMember()

ilIndividualAssessmentMemberGUI::getMember ( )
protected

Definition at line 469 of file class.ilIndividualAssessmentMemberGUI.php.

470 {
471 return $this->getObject()->membersStorage()->loadMember(
472 $this->getObject(),
473 $this->getExaminee()
474 );
475 }
Edit the record of a user, set LP.

Referenced by downloadFile(), and saveAmend().

+ Here is the caller graph for this function:

◆ getObject()

ilIndividualAssessmentMemberGUI::getObject ( )
protected

Definition at line 441 of file class.ilIndividualAssessmentMemberGUI.php.

442 {
443 return $this->object;
444 }
For the purpose of streamlining the grading and learning-process status definition outside of tests,...

Referenced by saveAmend().

+ Here is the caller graph for this function:

◆ getParentGUI()

ilIndividualAssessmentMemberGUI::getParentGUI ( )

Definition at line 451 of file class.ilIndividualAssessmentMemberGUI.php.

452 {
453 return $this->parent_gui;
454 }
For the purpose of streamlining the grading and learning-process status definition outside of tests,...

◆ getPossibleLPStates()

ilIndividualAssessmentMemberGUI::getPossibleLPStates ( )
protected

◆ getRemoveResult()

ilIndividualAssessmentMemberGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 354 of file class.ilIndividualAssessmentMemberGUI.php.

355 {
356 $resource_id = $this->irss->manage()->find($identifier);
357 if ($resource_id) {
358 $this->irss->manage()->remove($resource_id, $this->stakeholder);
359 $status = HandlerResult::STATUS_OK;
360 $message = $this->lng->txt('iass_file_deleted');
361 } else {
362 $status = HandlerResult::STATUS_FAILED;
363 $identifier = '';
364 $message = 'no resource to delete';
365 }
366 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
367 }

References $message, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getUploadResult()

ilIndividualAssessmentMemberGUI::getUploadResult ( )
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 333 of file class.ilIndividualAssessmentMemberGUI.php.

334 {
335 $this->upload->process();
336 $array = $this->upload->getResults();
337 $result = end($array);
338
339 if ($result instanceof UploadResult && $result->isOK()) {
340
341 $resource_id = $this->irss->manage()->upload($result, $this->stakeholder);
342 $identifier = $resource_id->serialize();
343 $status = HandlerResult::STATUS_OK;
344 $message = 'Upload ok';
345 } else {
346 $status = HandlerResult::STATUS_FAILED;
347 $identifier = '';
348 $message = $result->getStatus()->getMessage();
349 }
350
351 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
352 }

References $message, ILIAS\FileUpload\DTO\UploadResult\isOK(), and ILIAS\Repository\upload().

+ Here is the call graph for this function:

◆ getUploadURL()

ilIndividualAssessmentMemberGUI::getUploadURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 412 of file class.ilIndividualAssessmentMemberGUI.php.

412 : string
413 {
414 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
415 $link = $this->ctrl->getLinkTarget($this, self::CMD_UPLOAD);
416 $this->ctrl->setParameter($this, 'usr_id', null);
417
418 return $link;
419 }

References ILIAS\Repository\ctrl(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ handleAccessViolation()

ilIndividualAssessmentMemberGUI::handleAccessViolation ( )

Definition at line 541 of file class.ilIndividualAssessmentMemberGUI.php.

541 : void
542 {
543 $this->error_object->raiseError($this->lng->txt("msg_no_perm_read"), $this->error_object->WARNING);
544 }

References ILIAS\Repository\lng().

Referenced by amend(), edit(), saveAmend(), and view().

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

◆ isFinalized()

ilIndividualAssessmentMemberGUI::isFinalized ( )
protected

Definition at line 536 of file class.ilIndividualAssessmentMemberGUI.php.

536 : bool
537 {
538 return $this->getMember()->finalized();
539 }

◆ mayBeAmended()

ilIndividualAssessmentMemberGUI::mayBeAmended ( )
protected

Definition at line 505 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by amend(), and saveAmend().

+ Here is the caller graph for this function:

◆ mayBeEdited()

ilIndividualAssessmentMemberGUI::mayBeEdited ( )
protected

Definition at line 492 of file class.ilIndividualAssessmentMemberGUI.php.

492 : bool
493 {
494 return $this->getAccessHandler()->isSystemAdmin() || (!$this->isFinalized() && $this->userMayGrade());
495 }

Referenced by edit().

+ Here is the caller graph for this function:

◆ mayBeViewed()

ilIndividualAssessmentMemberGUI::mayBeViewed ( )
protected

Definition at line 497 of file class.ilIndividualAssessmentMemberGUI.php.

497 : bool
498 {
499 return
500 $this->getAccessHandler()->isSystemAdmin() ||
501 ($this->isFinalized() && ($this->userMayGrade() || $this->userMayView()))
502 ;
503 }

Referenced by view().

+ Here is the caller graph for this function:

◆ redirect()

ilIndividualAssessmentMemberGUI::redirect ( string  $cmd)
protected

Definition at line 430 of file class.ilIndividualAssessmentMemberGUI.php.

430 : void
431 {
432 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
433 $this->ctrl->redirect($this, $cmd);
434 }

References ILIAS\Repository\ctrl(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ saveAmend()

ilIndividualAssessmentMemberGUI::saveAmend ( )
protected

Definition at line 185 of file class.ilIndividualAssessmentMemberGUI.php.

185 : void
186 {
187 if (!$this->mayBeAmended()) {
188 $this->handleAccessViolation();
189 return;
190 }
191
192 $form = $this
193 ->buildForm($this->ctrl->getFormAction($this, self::CMD_AMEND), true, true)
194 ->withRequest($this->request)
195 ;
196
197 $grading = $form->getData();
198
199 if (!is_null($grading)) {
200 $this->saveMember($grading, true, true);
201
202 if ($this->getObject()->isActiveLP()) {
204 }
205
206 $this->tpl->setOnScreenMessage("success", $this->lng->txt('iass_amend_saved'), true);
207 $this->ctrl->redirectByClass(ilIndividualAssessmentMembersGUI::class, 'view');
208 }
209 }
saveMember(ilIndividualAssessmentUserGrading $grading, bool $keep_examiner=false, bool $amend=false)

References ILIAS\Repository\ctrl(), getMember(), getObject(), handleAccessViolation(), ILIAS\Repository\lng(), mayBeAmended(), saveMember(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

+ Here is the call graph for this function:

◆ saveMember()

ilIndividualAssessmentMemberGUI::saveMember ( ilIndividualAssessmentUserGrading  $grading,
bool  $keep_examiner = false,
bool  $amend = false 
)
protected

Definition at line 305 of file class.ilIndividualAssessmentMemberGUI.php.

309 : void {
310 $member = $this->getMember()
311 ->withGrading($grading)
312 ;
313
314 if ($amend) {
315 $member = $member->withChangerId($this->user->getId());
316 }
317
318 if (!$keep_examiner) {
319 $member = $member->withExaminerId($this->user->getId());
320 }
321 $this->getObject()->membersStorage()->updateMember($member);
322 }

References ILIAS\Repository\user().

Referenced by saveAmend().

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

◆ setObject()

ilIndividualAssessmentMemberGUI::setObject ( ilObjIndividualAssessment  $object)

Definition at line 436 of file class.ilIndividualAssessmentMemberGUI.php.

436 : void
437 {
438 $this->object = $object;
439 }

◆ setParentGUI()

ilIndividualAssessmentMemberGUI::setParentGUI ( ilIndividualAssessmentMembersGUI  $parent_gui)

Definition at line 446 of file class.ilIndividualAssessmentMemberGUI.php.

446 : void
447 {
448 $this->parent_gui = $parent_gui;
449 }

◆ setToolbar()

ilIndividualAssessmentMemberGUI::setToolbar ( )
protected

Definition at line 477 of file class.ilIndividualAssessmentMemberGUI.php.

477 : void
478 {
479 $member = $this->getMember();
480 if ($member->fileName() != '') {
481 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
482 $url = $this->ctrl->getLinkTarget($this, self::CMD_DOWNLOAD_FILE, "", false, true);
483 $this->ctrl->setParameter($this, 'usr_id', null);
484 $btn = $this->link_factory->standard(
485 $this->lng->txt('download_assessment_paper'),
486 $url
487 );
488 $this->toolbar->addComponent($btn);
489 }
490 }
$url
Definition: shib_logout.php:68

References $url, ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

Referenced by amend(), and edit().

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

◆ targetWasEditedByOtherUser()

ilIndividualAssessmentMemberGUI::targetWasEditedByOtherUser ( ilIndividualAssessmentMember  $member)
protected

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

528 : bool
529 {
530 return
531 (int) $member->examinerId() !== $this->user->getId() &&
532 0 !== (int) $member->examinerId()
533 ;
534 }

References ilIndividualAssessmentMember\examinerId(), ILIAS\Repository\int(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ userMayAmend()

ilIndividualAssessmentMemberGUI::userMayAmend ( )
protected

Definition at line 523 of file class.ilIndividualAssessmentMemberGUI.php.

523 : bool
524 {
525 return $this->getAccessHandler()->mayAmendAllUsers();
526 }

◆ userMayGrade()

ilIndividualAssessmentMemberGUI::userMayGrade ( )
protected

Definition at line 510 of file class.ilIndividualAssessmentMemberGUI.php.

510 : bool
511 {
512 return
513 $this->getAccessHandler()->isSystemAdmin() ||
514 (!$this->targetWasEditedByOtherUser($this->getMember()) && $this->getAccessHandler()->mayGradeUser($this->getMember()->id()))
515 ;
516 }
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)

◆ userMayView()

ilIndividualAssessmentMemberGUI::userMayView ( )
protected

Definition at line 518 of file class.ilIndividualAssessmentMemberGUI.php.

518 : bool
519 {
520 return $this->getAccessHandler()->mayViewUser($this->getMember()->id());
521 }

◆ view()

ilIndividualAssessmentMemberGUI::view ( )
protected

Definition at line 101 of file class.ilIndividualAssessmentMemberGUI.php.

101 : void
102 {
103 if (!$this->mayBeViewed()) {
104 $this->handleAccessViolation();
105 return;
106 }
107 $form = $this->buildForm('', false);
108 $this->tpl->setContent($this->renderer->render($form));
109 }

References buildForm(), handleAccessViolation(), mayBeViewed(), and renderer().

+ Here is the call graph for this function:

Field Documentation

◆ $iass_access

ilIndividualAssessmentAccessHandler ilIndividualAssessmentMemberGUI::$iass_access = null
protected

Definition at line 48 of file class.ilIndividualAssessmentMemberGUI.php.

◆ CMD_AMEND

const ilIndividualAssessmentMemberGUI::CMD_AMEND = 'amend'

Definition at line 44 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_DOWNLOAD_FILE

const ilIndividualAssessmentMemberGUI::CMD_DOWNLOAD_FILE = "downloadFile"

◆ CMD_EDIT

const ilIndividualAssessmentMemberGUI::CMD_EDIT = 'edit'

Definition at line 40 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_FINALIZE

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE = 'finalize'

Definition at line 42 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_FINALIZE_CONFIRMATION

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE_CONFIRMATION = 'finalizeConfirmation'

Definition at line 43 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_SAVE_AMEND

const ilIndividualAssessmentMemberGUI::CMD_SAVE_AMEND = "saveAmend"

Definition at line 45 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_UPDATE

const ilIndividualAssessmentMemberGUI::CMD_UPDATE = 'update'

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

Referenced by executeCommand().

◆ CMD_VIEW

const ilIndividualAssessmentMemberGUI::CMD_VIEW = 'view'

Definition at line 39 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().


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