3declare(strict_types=1);
68 $this->data = array_filter(
71 $this->iass_access->mayEditMembers()
72 || $this->iass_access->mayGradeUser($record->id())
73 || $this->iass_access->mayViewUser($record->id())
82 public function render(array $view_constrols,
int $offset = 0,
int $limit =
null): string
84 $ptable = $this->factory->table()->presentation(
97 ->withContent($ui->
listing()->descriptive($this->getContent($record)))
98 ->withFurtherFieldsHeadline($this->txt(
"iass_further_field_headline"))
99 ->withFurtherFields($this->getFurtherFields($record))
100 ->withAction($this->getAction($record, $ui));
104 $data = array_slice($this->data, $offset, $limit);
105 return $this->renderer->render($ptable->withData(
$data));
121 if (!$this->iass_access->mayViewUser($record->
id()) && !$this->iass_access->mayGradeUser($record->
id())) {
137 (!$this->iass_access->mayViewUser($record->
id()) && !$this->iass_access->mayGradeUser($record->
id()))
139 (!$record->
finalized() && $finalized_only)
146 $this->getGradedByInformation($record->
examinerId()),
153 if (is_null($graded_by_id)) {
158 return [$this->
txt(
'iass_graded_by') .
":" => $this->
txt(
"user_deleted")];
163 return [$this->
txt(
'iass_graded_by') .
":" => $full_name];
167 $this->
txt(
'iass_graded_by') .
":" => $this->
getProfileLink($full_name, $graded_by_id)
173 if (is_null($changed_by_id)) {
177 $changed_date_str =
"";
178 if (!is_null($change_date)) {
179 $changed_date_str = $this->date_formatter->format($this->current_user, $change_date);
184 return [$this->
txt(
'iass_changed_by') => $full_name .
' ' . $changed_date_str];
188 $this->
txt(
'iass_changed_by') => $this->
getProfileLink($full_name, $changed_by_id) .
' ' . $changed_date_str
202 && !$this->checkAmendable($record->
finalized())
203 && !$this->iass_access->mayViewUser($record->
id())
204 && !$this->iass_access->mayGradeUser($record->
id())
209 $usr_id = $record->
id();
212 !$this->iass_access->mayViewUser($usr_id)
214 && $examiner_id !== $this->current_user_id
224 $this->checkDownloadFile($usr_id, $file_name)
225 ? $this->getFileDownloadLink($usr_id)
237 if (!$this->iass_access->mayViewUser($record->
id()) && !$this->iass_access->mayGradeUser($record->
id())) {
242 $record->
LPStatus() ? [$this->txt(
"grading") .
":" => $this->getEntryForStatus($record->
LPStatus())] : [],
243 $this->getImportantInfos($record,
false),
244 $this->getLocationInfos(
261 $usr_id = $record->
id();
265 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', $usr_id);
267 if ($this->
checkEditable($finalized, $usr_id, $examiner_id)) {
268 $target = $this->
ctrl->getLinkTargetByClass(ilIndividualAssessmentMemberGUI::class,
'edit');
269 $items[] = $ui_factory->
button()->shy($this->
txt(
'iass_usr_edit'), $target);
273 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMembersGUI',
'usr_id', $usr_id);
274 $target = $this->
ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMembersGUI',
'removeUserConfirmation');
275 $items[] = $ui_factory->
button()->shy($this->
txt(
'iass_usr_remove'), $target);
276 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMembersGUI',
'usr_id',
null);
280 $target = $this->
ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'amend');
281 $items[] = $ui_factory->
button()->shy($this->
txt(
'iass_usr_amend'), $target);
285 $target = $this->
ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'downloadFile');
286 $items[] = $ui_factory->
button()->shy($this->
txt(
'iass_usr_download_attachment'), $target);
288 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id',
null);
290 return $ui_factory->
dropdown()->standard($items)->withLabel($this->
txt(
"actions"));
296 protected function getStatus(
bool $finalized,
int $status,
int $examiner_id =
null): string
302 if (!$finalized && !is_null($examiner_id)) {
303 return $this->
txt(
'iass_assessment_not_completed');
316 if (is_null($event_time)) {
319 $event_time_str = $this->date_formatter->format($this->current_user, $event_time,
true);
320 return [$this->
txt(
"iass_event_time") .
": " => $event_time_str];
328 if (is_null($user_id)) {
333 return $name_fields[
"lastname"] .
", " . $name_fields[
"firstname"] .
" [" . $name_fields[
"login"] .
"]";
338 $back_url = $this->
ctrl->getLinkTarget($this->parent,
"view");
339 $this->
ctrl->setParameterByClass(
'ilpublicuserprofilegui',
'user_id', $user_id);
340 $this->
ctrl->setParameterByClass(
'ilpublicuserprofilegui',
"back_url", rawurlencode($back_url));
341 $link = $this->
ctrl->getLinkTargetByClass(
'ilpublicuserprofilegui',
'getHTML');
342 $link = $this->factory->link()->standard($full_name, $link);
344 return $this->renderer->render($link);
351 ($user->getPref(
'public_profile') ==
'y') ||
352 $user->getPref(
'public_profile') ==
'g'
365 int $examiner_id =
null
375 return [$this->
txt(
"iass_location") .
": " =>
$location];
385 if (is_null($record_note)) {
389 return [$this->txt(
"iass_record") => $record_note];
399 if (is_null($internal_note)) {
403 return [$this->txt(
"iass_internal_note") => $internal_note];
411 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', $usr_id);
412 $target = $this->
ctrl->getLinkTargetByClass(
413 'ilIndividualAssessmentMemberGUI',
416 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id',
null);
417 $link = $this->factory->link()->standard($this->txt(
"iass_download"), $target);
420 $this->txt(
"iass_file") => $this->renderer->render($link)
431 return $this->txt(
'iass_status_pending');
433 return $this->txt(
'iass_status_completed');
435 return $this->txt(
'iass_status_failed');
444 protected function mayViewLocation(
bool $finalized,
int $usr_id,
int $examiner_id =
null): bool
447 $this->checkEditable($finalized, $usr_id, $examiner_id) ||
448 $this->checkAmendable($finalized) ||
449 $this->iass_access->mayViewUser($usr_id)
456 protected function checkEditable(
bool $finalized,
int $usr_id,
int $examiner_id =
null): bool
464 $this->iass_access->mayGradeUser($usr_id)
466 $this->wasEditedByViewer($examiner_id)
476 ($this->iass_access->isSystemAdmin() && $finalized) ||
477 ($finalized && $this->iass_access->mayAmendAllUsers())
490 if (($this->iass_access->isSystemAdmin() && !$finalized) || (!$finalized && $this->iass_access->mayEditMembers())) {
502 if ((!is_null($file_name) && $file_name !==
'')
503 && ($this->iass_access->isSystemAdmin() || $this->userMayDownloadAttachment($usr_id))
513 return $this->iass_access->mayViewUser($usr_id) || $this->iass_access->mayGradeUser($usr_id);
518 return $examiner_id === $this->current_user_id ||
null === $examiner_id;
521 protected function txt(
string $code): string
523 return $this->
lng->txt($code);
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
For the purpose of streamlining the grading and learning-process status definition outside of tests,...
checkAmendable(bool $finalized)
Check the current user has amended permission on record.
getGradedByInformation(?int $graded_by_id)
setData(array $data)
Set data to show in table.
getProfileLink(string $full_name, int $user_id)
checkDownloadFile(int $usr_id, string $file_name=null)
Check the current user is allowed to download the record file.
getContent(ilIndividualAssessmentMember $record)
Return all content elements for each row.
__construct(ilIndividualAssessmentMembersGUI $parent, ilLanguage $lng, ilCtrl $ctrl, IndividualAssessmentAccessHandler $iass_access, Factory $factory, Renderer $renderer, ilObjUser $current_user, ilIndividualAssessmentDateFormatter $date_formatter)
getGradedInformation(?DateTimeImmutable $event_time)
Returns information about the grading.
wasEditedByViewer(int $examiner_id=null)
userMayDownloadAttachment(int $usr_id)
IndividualAssessmentAccessHandler $iass_access
getChangedByInformation(?int $changed_by_id, ?DateTimeImmutable $change_date)
ilIndividualAssessmentMembersGUI $parent
getAction(ilIndividualAssessmentMember $record, Factory $ui_factory)
Return the ui control with executable actions.
hasPublicProfile(int $examiner_id)
mayViewLocation(bool $finalized, int $usr_id, int $examiner_id=null)
Check user may view the location.
getFullNameFor(int $user_id=null)
Returns login of examiner.
getLocationInfos(bool $finalized, int $usr_id, string $location=null, int $examiner_id=null)
Returns the location of assessment.
getSubheadline(ilIndividualAssessmentMember $record)
Returns the sub headline for each row.
getEntryForStatus(int $a_status)
Get text for lp status.
render(array $view_constrols, int $offset=0, int $limit=null)
Renders the presentation table.
checkEditable(bool $finalized, int $usr_id, int $examiner_id=null)
Check the current user has edit permission on record.
checkUserRemoveable(bool $finalized)
Check the current user is allowed to remove the user.
getHeadline(ilIndividualAssessmentMember $record)
Returns the headline for each row.
getFurtherFields(ilIndividualAssessmentMember $record)
Returns all information needed for further information for each row.
ilIndividualAssessmentDateFormatter $date_formatter
getImportantInfos(ilIndividualAssessmentMember $record, bool $finalized_only=true)
Returns all information needed for important row.
getFileDownloadLink(int $usr_id)
Get the link for download of file.
getInternalRecordNote(string $internal_note=null)
Returns information out of internal record note.
getRecordNote(string $record_note)
Returns information out of record note.
getStatus(bool $finalized, int $status, int $examiner_id=null)
Returns readable status.
static _lookupName(int $a_user_id)
lookup user name
static userExists(array $a_usr_ids=array())
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This describes commonalities between all types of Dropdowns.
This describes a Row used in Presentation Table.
withHeadline(string $headline)
Get a row like this with the given headline.
This is how the factory for UI elements looks.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...