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';
37 $this->iass_access = $iass_access;
39 $this->renderer = $renderer;
40 $this->current_user_id = $current_user_id;
60 public function render(array $view_constrols,
int $offset = 0,
int $limit = null) : string
62 $ptable = $this->factory->table()->presentation(
80 ->withSubheadline($subheadline)
81 ->withImportantFields($important_infos)
82 ->withContent($ui_factory->
listing()->descriptive($content))
83 ->withFurtherFieldsHeadline($this->
txt(
"iass_further_field_headline"))
84 ->withFurtherFields($further_fields)
91 $data = array_slice($this->
data, $offset, $limit);
92 return $this->renderer->render($ptable->withData(
$data));
160 $usr_id = (int) $record->
id();
202 $usr_id = (int) $record->
id();
206 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', $usr_id);
208 if ($this->
checkEditable($finalized, $examiner_id, $usr_id)) {
209 $target = $this->ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'edit');
210 $items[] = $ui_factory->button()->shy($this->
txt(
'iass_usr_edit'),
$target);
214 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMembersGUI',
'usr_id', $usr_id);
215 $target = $this->ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMembersGUI',
'removeUserConfirmation');
216 $items[] = $ui_factory->button()->shy($this->
txt(
'iass_usr_remove'),
$target);
217 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMembersGUI',
'usr_id', null);
221 $target = $this->ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'amend');
222 $items[] = $ui_factory->button()->shy($this->
txt(
'iass_usr_amend'),
$target);
226 $target = $this->ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'downloadAttachment');
227 $items[] = $ui_factory->button()->shy($this->
txt(
'iass_usr_download_attachment'),
$target);
229 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', null);
231 $action = $ui_factory->dropdown()->standard($items)->withLabel($this->
txt(
"actions"));
238 protected function getStatus(
bool $finalized,
int $status,
int $examiner_id = null) : string
244 if (!$finalized && !is_null($examinerId)) {
270 if (is_null($user_id)) {
275 $name = $name_fields[
"lastname"] .
", " . $name_fields[
"firstname"] .
" [" . $name_fields[
"login"] .
"]";
280 protected function getProfileLink(
string $case,
string $examiner,
int $examiner_id)
282 if ($examiner ===
"") {
288 $this->
txt(
"iass_" . $case .
"_by") => $examiner
292 $back_url = $this->ctrl->getLinkTarget($this->
parent,
"view");
293 $this->ctrl->setParameterByClass(
'ilpublicuserprofilegui',
'user_id', $examiner_id);
294 $this->ctrl->setParameterByClass(
'ilpublicuserprofilegui',
"back_url", rawurlencode($back_url));
295 $link = $this->ctrl->getLinkTargetByClass(
'ilpublicuserprofilegui',
'getHTML');
296 $link = $this->factory->link()->standard($examiner, $link);
299 $this->
txt(
"iass_" . $case .
"_by") => $this->renderer->render($link)
307 (
$user->getPref(
'public_profile') ==
'y') ||
308 $user->getPref(
'public_profile') ==
'g' 320 int $examiner_id = null,
323 if (!$this->
viewLocation($finalized, $examiner_id, $usr_id)) {
344 $this->
txt(
"iass_record") => $record_note
355 if (is_null($internal_note)) {
360 $this->
txt(
"iass_internal_note") => $internal_note
369 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', $usr_id);
370 $target = $this->ctrl->getLinkTargetByClass(
'ilIndividualAssessmentMemberGUI',
'downloadAttachment');
371 $this->ctrl->setParameterByClass(
'ilIndividualAssessmentMemberGUI',
'usr_id', null);
372 $link = $this->factory->link()->standard($this->
txt(
"iass_download"),
$target);
375 $this->
txt(
"iass_file") => $this->renderer->render($link)
386 return $this->
txt(
'iass_status_pending');
389 return $this->
txt(
'iass_status_completed');
392 return $this->
txt(
'iass_status_failed');
395 return $this->
txt(
'iass_assessment_not_completed');
409 if (is_null($examiner_id)) {
413 return (
int) $examiner_id;
420 if (is_null($changer_id)) {
424 return (
int) $changer_id;
430 protected function viewLocation(
bool $finalized,
int $examiner_id = null,
int $usr_id) : bool
442 protected function checkEditable(
bool $finalized,
int $examiner_id = null,
int $usr_id) : bool
486 if ((!is_null($file_name) && $file_name !==
'')
502 return $this->iass_access->mayViewUser();
507 return $this->iass_access->mayGradeUser();
512 return $this->iass_access->mayAmendGradeUser();
517 return $this->iass_access->mayEditMembers();
522 return $this->iass_access->isSystemAdmin();
527 return $this->iass_access->mayGradeUserById($usr_id);
532 return $examiner_id === $this->current_user_id || null === $examiner_id;
537 return $this->lng->txt($code);
userMayDownloadAttachment(int $usr_id)
Deal with ilias rbac-system
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
getExaminerId(ilIndividualAssessmentMember $record)
Returns the examnier id from record.
An entity that renders components to a string output.
getChangerId(ilIndividualAssessmentMember $record)
This class provides processing control methods.
render(array $view_constrols, int $offset=0, int $limit=null)
Renders the presentation table.
examinerId()
Get the user id of the examiner.
getRecordNote(string $record_note)
Returns inforamtions out of record note.
getEntryForStatus(int $a_status)
Get text for lp status.
eventTime()
Get date when ia was.
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.
__construct(ilIndividualAssessmentMembersGUI $parent, ilLanguage $lng, ilCtrl $ctrl, ilIndividualAssessmentAccessHandler $iass_access, Factory $factory, Renderer $renderer, int $current_user_id)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
finalized()
Is this membership allready finalized?
changerId()
Get the user id of the changer.
getSubheadline(ilIndividualAssessmentMember $record)
Returns the subheadline for each row.
checkAmendable(bool $finalized)
Check the current user has amend permission on record.
This describes commonalities between all types of Dropdowns.
getGradedInformations(ilDate $event_time)
Returns informations about the grading.
getInternalRecordNote(string $internal_note=null)
Returns inforamtions out of internal record note.
firstname()
Get the examinee firstname corresponding to this membership.
const LP_ASSESSMENT_NOT_COMPLETED
getProfileLink(string $case, string $examiner, int $examiner_id)
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.
lastname()
Get the examinee lastname corresponding to this membership.
getFileDownloadLink(int $usr_id, $file_name)
Get the link for download of file.
place()
Get place where ia was held.
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.
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.
viewLocation(bool $finalized, int $examiner_id=null, int $usr_id)
Check user may view the location.
fileName()
Get the name of the uploaded file.
getStatus(bool $finalized, int $status, int $examiner_id=null)
Returns readable status.
id()
Get the user id corresponding to this membership.
For the purpose of streamlining the grading and learning-process status definition outside of tests...
wasEditedByViewer(int $examiner_id=null)
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.
LPStatus()
Get the LP-status corresponding to this membership.
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.