5 declare(strict_types=1);
7 require_once
'Modules/IndividualAssessment/classes/Members/class.ilIndividualAssessmentMembersStorageDB.php';
8 require_once
'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
9 require_once
'Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
10 require_once
'Services/Tracking/classes/class.ilLPStatus.php';
31 $this->parent = $parent;
34 $this->iass_access = $iass_access;
36 $this->renderer = $renderer;
37 $this->current_user_id = $current_user_id;
57 public function render(array $view_constrols,
int $offset = 0,
int $limit = null) : string
59 $ptable = $this->factory->table()->presentation(
73 $action = $this->
getAction($record, $ui_factory);
77 ->withSubheadline($subheadline)
78 ->withImportantFields($important_infos)
79 ->withContent($ui_factory->
listing()->descriptive($content))
80 ->withFurtherFieldsHeadline($this->
txt(
"iass_further_field_headline"))
81 ->withFurtherFields($further_fields)
82 ->withAction($action);
88 $data = array_slice($this->data, $offset, $limit);
89 return $this->renderer->render($ptable->withData(
$data));
137 if (is_null($graded_by_id)) {
143 return [$this->
txt(
'iass_graded_by') => $full_name];
153 if (is_null($changed_by_id)) {
157 $changed_date_str =
"";
158 if (!is_null($change_date)) {
165 return [$this->
txt(
'iass_changed_by') => $full_name .
' ' . $changed_date_str];
169 $this->
txt(
'iass_changed_by') => $this->
getProfileLink($full_name, $changed_by_id) .
' ' . $changed_date_str
190 $usr_id = (int) $record->
id();
232 $usr_id = (int) $record->
id();
236 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', $usr_id);
238 if ($this->
checkEditable($finalized, $examiner_id, $usr_id)) {
239 $target = $this->ctrl->getLinkTargetByClass(ilIndividualAssessmentMemberGUI::class,
'edit');
240 $items[] = $ui_factory->button()->shy($this->
txt(
'iass_usr_edit'), $target);
244 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMembersGUI',
'usr_id', $usr_id);
245 $target = $this->ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMembersGUI',
'removeUserConfirmation');
246 $items[] = $ui_factory->button()->shy($this->
txt(
'iass_usr_remove'), $target);
247 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMembersGUI',
'usr_id', null);
251 $target = $this->ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'amend');
252 $items[] = $ui_factory->button()->shy($this->
txt(
'iass_usr_amend'), $target);
256 $target = $this->ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'downloadFile');
257 $items[] = $ui_factory->button()->shy($this->
txt(
'iass_usr_download_attachment'), $target);
259 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', null);
261 $action = $ui_factory->dropdown()->standard($items)->withLabel($this->
txt(
"actions"));
268 protected function getStatus(
bool $finalized,
int $status,
int $examiner_id = null) : string
274 if (!$finalized && !is_null($examiner_id)) {
275 return $this->
txt(
'iass_assessment_not_completed');
288 $event_time_str =
"";
289 if (!is_null($event_time)) {
294 $this->
txt(
"iass_event_time") .
": " => $event_time_str
305 if (is_null($user_id)) {
310 $name = $name_fields[
"lastname"] .
", " . $name_fields[
"firstname"] .
" [" . $name_fields[
"login"] .
"]";
317 $back_url = $this->ctrl->getLinkTarget($this->parent,
"view");
318 $this->ctrl->setParameterByClass(
'ilpublicuserprofilegui',
'user_id', $user_id);
319 $this->ctrl->setParameterByClass(
'ilpublicuserprofilegui',
"back_url", rawurlencode($back_url));
320 $link = $this->ctrl->getLinkTargetByClass(
'ilpublicuserprofilegui',
'getHTML');
321 $link = $this->factory->link()->standard($full_name, $link);
323 return $this->renderer->render($link);
330 ($user->getPref(
'public_profile') ==
'y') ||
331 $user->getPref(
'public_profile') ==
'g' 343 int $examiner_id = null,
346 if (!$this->
viewLocation($finalized, $examiner_id, $usr_id)) {
367 $this->
txt(
"iass_record") => $record_note
378 if (is_null($internal_note)) {
383 $this->
txt(
"iass_internal_note") => $internal_note
392 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', $usr_id);
394 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', null);
395 $link = $this->factory->link()->standard($this->
txt(
"iass_download"), $target);
398 $this->
txt(
"iass_file") => $this->renderer->render($link)
409 return $this->
txt(
'iass_status_pending');
412 return $this->
txt(
'iass_status_completed');
415 return $this->
txt(
'iass_status_failed');
425 protected function viewLocation(
bool $finalized,
int $examiner_id = null,
int $usr_id) : bool
437 protected function checkEditable(
bool $finalized,
int $examiner_id = null,
int $usr_id) : bool
481 if ((!is_null($file_name) && $file_name !==
'')
497 return $this->iass_access->mayViewUser();
502 return $this->iass_access->mayGradeUser();
507 return $this->iass_access->mayAmendGradeUser();
512 return $this->iass_access->mayEditMembers();
517 return $this->iass_access->isSystemAdmin();
522 return $this->iass_access->mayGradeUserById($usr_id);
527 return $examiner_id === $this->current_user_id || null === $examiner_id;
530 protected function txt(
string $code) : string
532 return $this->lng->txt($code);
userMayDownloadAttachment(int $usr_id)
getLocationInfos(string $location=null, bool $finalized, int $examiner_id=null, int $usr_id)
Returns the location of assessment.
static _lookupName($a_user_id)
lookup user name
__construct(ilIndividualAssessmentMembersGUI $parent, ilLanguage $lng, ilCtrl $ctrl, IndividualAssessmentAccessHandler $iass_access, Factory $factory, Renderer $renderer, int $current_user_id)
An entity that renders components to a string output.
This class provides processing control methods.
render(array $view_constrols, int $offset=0, int $limit=null)
Renders the presentation table.
getRecordNote(string $record_note)
Returns inforamtions out of record note.
getEntryForStatus(int $a_status)
Get text for lp status.
checkEditable(bool $finalized, int $examiner_id=null, int $usr_id)
Check the current user has edit permission on record.
getContent(ilIndividualAssessmentMember $record)
Return all content elements for each row.
listing()
description: purpose: > Listings are used to structure itemised textual information.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
getSubheadline(ilIndividualAssessmentMember $record)
Returns the subheadline for each row.
Mechanic regarding the access controll and roles of an objcet goes here.
checkAmendable(bool $finalized)
Check the current user has amend permission on record.
This describes commonalities between all types of Dropdowns.
getInternalRecordNote(string $internal_note=null)
Returns inforamtions out of internal record note.
userMayEditGradesOf(int $usr_id)
getAction(ilIndividualAssessmentMember $record, $ui_factory)
Return the ui control with executable actions.
This is how the factory for UI elements looks.
getFileDownloadLink(int $usr_id, $file_name)
Get the link for download of file.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getFullNameFor(int $user_id=null)
Returns login of examinier.
getProfileLink(string $full_name, int $user_id)
This describes a Row used in Presentation Table.
Edit the record of a user, set LP.
hasPublicProfile(int $examiner_id)
withHeadline($headline)
Get a row like this with the given headline.
getGradedInformations(?DateTimeImmutable $event_time)
Returns informations about the grading.
viewLocation(bool $finalized, int $examiner_id=null, int $usr_id)
Check user may view the location.
getChangedByInformation(?int $changed_by_id, ?DateTime $change_date)
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...
wasEditedByViewer(int $examiner_id=null)
getGradedByInformation(?int $graded_by_id)
checkDownloadFile(int $usr_id, string $file_name=null)
Check the current user is allowed to download the record file.
checkUserRemoveable(bool $finalized)
Check the current user is allowed to remove the user.
getFurtherFields(ilIndividualAssessmentMember $record)
Returns all informations needed for further informations for each row.
getHeadline(ilIndividualAssessmentMember $record)
Returns the headline for each row.
importantInfos(ilIndividualAssessmentMember $record)
Returns all informations needed for important row.
setData(array $data)
Set data to show in table.