19declare(strict_types=1);
69 $this->data = array_filter(
72 $this->iass_access->mayEditMembers()
73 || $this->iass_access->mayGradeUser($record->id())
74 || $this->iass_access->mayViewUser($record->id())
83 public function render(array $view_constrols,
int $offset = 0, ?
int $limit =
null): string
85 $ptable = $this->
factory->table()->presentation(
98 ->withContent($ui->
listing()->descriptive($this->getContent($record)))
99 ->withFurtherFieldsHeadline($this->txt(
"iass_further_field_headline"))
100 ->withFurtherFields($this->getFurtherFields($record))
101 ->withAction($this->getAction($record, $ui));
105 $data = array_slice($this->data, $offset, $limit);
122 if (!$this->iass_access->mayViewUser($record->
id()) && !$this->iass_access->mayGradeUser($record->
id())) {
138 (!$this->iass_access->mayViewUser($record->
id()) && !$this->iass_access->mayGradeUser($record->
id()))
140 (!$record->
finalized() && $finalized_only)
147 $this->getGradedByInformation($record->
examinerId()),
154 if (is_null($graded_by_id)) {
159 return [$this->
txt(
'iass_graded_by') => $this->
txt(
"user_deleted")];
164 return [$this->
txt(
'iass_graded_by') => $full_name];
174 if (is_null($changed_by_id)) {
178 $changed_date_str =
"";
179 if (!is_null($change_date)) {
180 $changed_date_str = $this->date_formatter->format($this->current_user, $change_date);
185 return [$this->
txt(
'iass_changed_by') => $full_name .
' ' . $changed_date_str];
189 $this->
txt(
'iass_changed_by') => $this->
getProfileLink($full_name, $changed_by_id) .
' ' . $changed_date_str
203 && !$this->checkAmendable($record->
finalized())
204 && !$this->iass_access->mayViewUser($record->
id())
205 && !$this->iass_access->mayGradeUser($record->
id())
210 $usr_id = $record->
id();
213 !$this->iass_access->mayViewUser($usr_id)
215 && $examiner_id !== $this->current_user_id
225 $this->checkDownloadFile($usr_id, $file_name)
226 ? $this->getFileDownloadLink($usr_id)
238 if (!$this->iass_access->mayViewUser($record->
id()) && !$this->iass_access->mayGradeUser($record->
id())) {
243 $record->
LPStatus() ? [$this->txt(
"grading") .
":" => $this->getEntryForStatus($record->
LPStatus())] : [],
244 $this->getImportantInfos($record,
false),
245 $this->getLocationInfos(
262 $usr_id = $record->
id();
266 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', $usr_id);
268 if ($this->
checkEditable($finalized, $usr_id, $examiner_id)) {
269 $target = $this->
ctrl->getLinkTargetByClass(ilIndividualAssessmentMemberGUI::class,
'edit');
270 $items[] = $ui_factory->
button()->shy($this->
txt(
'iass_usr_edit'), $target);
274 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMembersGUI',
'usr_id', $usr_id);
275 $target = $this->
ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMembersGUI',
'removeUserConfirmation');
276 $items[] = $ui_factory->
button()->shy($this->
txt(
'iass_usr_remove'), $target);
277 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMembersGUI',
'usr_id',
null);
281 $target = $this->
ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'amend');
282 $items[] = $ui_factory->
button()->shy($this->
txt(
'iass_usr_amend'), $target);
286 $target = $this->
ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'downloadFile');
287 $items[] = $ui_factory->
button()->shy($this->
txt(
'iass_usr_download_attachment'), $target);
289 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id',
null);
291 return $ui_factory->
dropdown()->standard($items)->withLabel($this->
txt(
"actions"));
297 protected function getStatus(
bool $finalized,
int $status, ?
int $examiner_id =
null): string
303 if (!$finalized && !is_null($examiner_id)) {
304 return $this->
txt(
'iass_assessment_not_completed');
317 if (is_null($event_time)) {
320 $event_time_str = $this->date_formatter->format($this->current_user, $event_time,
true);
321 return [$this->
txt(
"iass_event_time") => $event_time_str];
334 return $name_fields[
"lastname"] .
", " . $name_fields[
"firstname"] .
" [" . $name_fields[
"login"] .
"]";
339 $back_url = $this->
ctrl->getLinkTarget($this->parent,
"view");
340 $this->
ctrl->setParameterByClass(PublicProfileGUI::class,
'user_id',
$user_id);
341 $this->
ctrl->setParameterByClass(PublicProfileGUI::class,
"back_url", rawurlencode($back_url));
342 $link = $this->
ctrl->getLinkTargetByClass(PublicProfileGUI::class,
'getHTML');
343 $link = $this->
factory->link()->standard($full_name, $link);
345 return $this->
renderer->render($link);
352 ($user->getPref(
'public_profile') ==
'y') ||
353 $user->getPref(
'public_profile') ==
'g'
366 ?
int $examiner_id =
null
376 return [$this->
txt(
"iass_location") .
": " =>
$location];
386 if (is_null($record_note)) {
390 return [$this->txt(
"iass_record") => $record_note];
400 if (is_null($internal_note)) {
404 return [$this->txt(
"iass_internal_note") => $internal_note];
412 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', $usr_id);
413 $target = $this->
ctrl->getLinkTargetByClass(
414 'ilIndividualAssessmentMemberGUI',
417 $this->
ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id',
null);
418 $link = $this->
factory->link()->standard($this->txt(
"iass_download"), $target);
421 $this->txt(
"iass_file") => $this->
renderer->render($link)
432 return $this->txt(
'iass_status_pending');
434 return $this->txt(
'iass_status_completed');
436 return $this->txt(
'iass_status_failed');
445 protected function mayViewLocation(
bool $finalized,
int $usr_id, ?
int $examiner_id =
null): bool
448 $this->checkEditable($finalized, $usr_id, $examiner_id) ||
449 $this->checkAmendable($finalized) ||
450 $this->iass_access->mayViewUser($usr_id)
457 protected function checkEditable(
bool $finalized,
int $usr_id, ?
int $examiner_id =
null): bool
465 $this->iass_access->mayGradeUser($usr_id)
467 $this->wasEditedByViewer($examiner_id)
477 ($this->iass_access->isSystemAdmin() && $finalized) ||
478 ($finalized && $this->iass_access->mayAmendAllUsers())
491 if (($this->iass_access->isSystemAdmin() && !$finalized) || (!$finalized && $this->iass_access->mayEditMembers())) {
503 if ((!is_null($file_name) && $file_name !==
'')
504 && ($this->iass_access->isSystemAdmin() || $this->userMayDownloadAttachment($usr_id))
514 return $this->iass_access->mayViewUser($usr_id) || $this->iass_access->mayGradeUser($usr_id);
519 return $examiner_id === $this->current_user_id ||
null === $examiner_id;
522 protected function txt(
string $code): string
524 return $this->
lng->txt($code);
Builds a Color from either hex- or rgb values.
GUI class for public user profile presentation.
Class ilCtrl provides processing control methods.
Edit the record of a user, set LP.
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.
render(array $view_constrols, int $offset=0, ?int $limit=null)
Renders the presentation table.
getLocationInfos(bool $finalized, int $usr_id, ?string $location=null, ?int $examiner_id=null)
Returns the location of assessment.
getGradedByInformation(?int $graded_by_id)
setData(array $data)
Set data to show in table.
getProfileLink(string $full_name, int $user_id)
getContent(ilIndividualAssessmentMember $record)
Return all content elements for each row.
mayViewLocation(bool $finalized, int $usr_id, ?int $examiner_id=null)
Check user may view the location.
__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.
userMayDownloadAttachment(int $usr_id)
IndividualAssessmentAccessHandler $iass_access
checkDownloadFile(int $usr_id, ?string $file_name=null)
Check the current user is allowed to download the record file.
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)
getStatus(bool $finalized, int $status, ?int $examiner_id=null)
Returns readable status.
getFullNameFor(?int $user_id=null)
Returns login of examiner.
getSubheadline(ilIndividualAssessmentMember $record)
Returns the sub headline for each row.
getEntryForStatus(int $a_status)
Get text for lp status.
wasEditedByViewer(?int $examiner_id=null)
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.
getRecordNote(string $record_note)
Returns information out of record note.
checkEditable(bool $finalized, int $usr_id, ?int $examiner_id=null)
Check the current user has edit permission on record.
getInternalRecordNote(?string $internal_note=null)
Returns information out of internal record note.
static userExists(array $a_usr_ids=[])
static _lookupName(int $a_user_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
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.
Mechanic regarding the access control and roles of an objet goes here.
if(!file_exists('../ilias.ini.php'))