19 declare(strict_types=1);
58 $this->current_user_id = $current_user->
getId();
66 public function setData(array $data): void
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(
98 ->withFurtherFieldsHeadline($this->
txt(
"iass_further_field_headline"))
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)
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];
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
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)
237 if (!$this->iass_access->mayViewUser($record->
id()) && !$this->iass_access->mayGradeUser($record->
id())) {
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];
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');
449 $this->iass_access->mayViewUser($usr_id)
464 $this->iass_access->mayGradeUser($usr_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 !==
'')
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);
userMayDownloadAttachment(int $usr_id)
getChangedByInformation(?int $changed_by_id, ?DateTimeImmutable $change_date)
getGradedInformation(?DateTimeImmutable $event_time)
Returns information about the grading.
dropdown()
description: purpose: > Dropdowns reveal a list of interactions that change the system’s status or ...
getAction(ilIndividualAssessmentMember $record, Factory $ui_factory)
Return the ui control with executable actions.
mayViewLocation(bool $finalized, int $usr_id, ?int $examiner_id=null)
Check user may view the location.
getRecordNote(string $record_note)
Returns information out of record note.
wasEditedByViewer(?int $examiner_id=null)
getEntryForStatus(int $a_status)
Get text for lp status.
static _lookupName(int $a_user_id)
lookup user name
getContent(ilIndividualAssessmentMember $record)
Return all content elements for each row.
listing()
description: purpose: > Listings are used to structure itemised textual information.
render(array $view_constrols, int $offset=0, ?int $limit=null)
Renders the presentation table.
getSubheadline(ilIndividualAssessmentMember $record)
Returns the sub headline for each row.
Mechanic regarding the access control and roles of an objet goes here.
checkAmendable(bool $finalized)
Check the current user has amended permission on record.
This describes commonalities between all types of Dropdowns.
getImportantInfos(ilIndividualAssessmentMember $record, bool $finalized_only=true)
Returns all information needed for important row.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilIndividualAssessmentDateFormatter $date_formatter
__construct(ilIndividualAssessmentMembersGUI $parent, ilLanguage $lng, ilCtrl $ctrl, IndividualAssessmentAccessHandler $iass_access, Factory $factory, Renderer $renderer, ilObjUser $current_user, ilIndividualAssessmentDateFormatter $date_formatter)
static userExists(array $a_usr_ids=[])
This is how the factory for UI elements looks.
checkDownloadFile(int $usr_id, ?string $file_name=null)
Check the current user is allowed to download the record file.
withHeadline(string $headline)
Get a row like this with the given headline.
ilIndividualAssessmentMembersGUI $parent
getLocationInfos(bool $finalized, int $usr_id, ?string $location=null, ?int $examiner_id=null)
Returns the location of assessment.
getProfileLink(string $full_name, int $user_id)
This describes a Row used in Presentation Table.
Edit the record of a user, set LP.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
checkEditable(bool $finalized, int $usr_id, ?int $examiner_id=null)
Check the current user has edit permission on record.
hasPublicProfile(int $examiner_id)
button()
description: purpose: > Buttons trigger interactions that change the system’s or view's status...
IndividualAssessmentAccessHandler $iass_access
getInternalRecordNote(?string $internal_note=null)
Returns information out of internal record note.
getFileDownloadLink(int $usr_id)
Get the link for download of file.
getStatus(bool $finalized, int $status, ?int $examiner_id=null)
Returns readable status.
For the purpose of streamlining the grading and learning-process status definition outside of tests...
getGradedByInformation(?int $graded_by_id)
getFullNameFor(?int $user_id=null)
Returns login of examiner.
checkUserRemoveable(bool $finalized)
Check the current user is allowed to remove the user.
getFurtherFields(ilIndividualAssessmentMember $record)
Returns all information needed for further information for each row.
getHeadline(ilIndividualAssessmentMember $record)
Returns the headline for each row.
setData(array $data)
Set data to show in table.