5declare(strict_types=1);
7require_once
'Modules/IndividualAssessment/classes/Members/class.ilIndividualAssessmentMembersStorageDB.php';
8require_once
'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
9require_once
'Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
10require_once
'Services/Tracking/classes/class.ilLPStatus.php';
34 $this->parent = $parent;
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(
79 ->withHeadline($headline)
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));
138 $this->getProfileLink(self::GRADED, $this->getFullNameFor($examiner_id), $examiner_id),
153 && !$this->checkAmendable($record->
finalized())
154 && !$this->userMayViewGrades()
155 && !$this->userMayEditGrades()
160 $usr_id = (int) $record->
id();
166 $this->checkDownloadFile($usr_id, $file_name)
167 ? $this->getFileDownloadLink($usr_id, $file_name)
188 $this->getExaminerId($record),
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,
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
433 $this->checkEditable($finalized, $examiner_id, $usr_id)
434 || $this->checkAmendable($finalized)
435 || $this->userMayViewGrades()
442 protected function checkEditable(
bool $finalized,
int $examiner_id =
null,
int $usr_id) : bool
445 ($this->userIsSystemAdmin() && !$finalized)
446 || (!$finalized && $this->userMayEditGradesOf($usr_id) && $this->wasEditedByViewer($examiner_id))
460 ($this->userIsSystemAdmin() && $finalized)
461 || ($finalized && $this->userMayAmendGrades())
474 if (($this->userIsSystemAdmin() && !$finalized) || (!$finalized && $this->userMayEditMembers())) {
486 if ((!is_null($file_name) && $file_name !==
'')
487 && ($this->userIsSystemAdmin() || $this->userMayDownloadAttachment($usr_id))
497 return $this->userMayViewGrades() || $this->userMayEditGrades() || $this->userMayEditGradesOf($usr_id);
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);
An exception for terminatinating execution or to throw for unit testing.
This class provides processing control methods.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
Deal with ilias rbac-system
Edit the record of a user, set LP.
examinerId()
Get the user id of the examiner.
lastname()
Get the examinee lastname corresponding to this membership.
finalized()
Is this membership allready finalized?
place()
Get place where ia was held.
eventTime()
Get date when ia was.
LPStatus()
Get the LP-status corresponding to this membership.
id()
Get the user id corresponding to this membership.
fileName()
Get the name of the uploaded file.
changerId()
Get the user id of the changer.
firstname()
Get the examinee firstname corresponding to this membership.
For the purpose of streamlining the grading and learning-process status definition outside of tests,...
checkAmendable(bool $finalized)
Check the current user has amend permission on record.
__construct(ilIndividualAssessmentMembersGUI $parent, ilLanguage $lng, ilCtrl $ctrl, ilIndividualAssessmentAccessHandler $iass_access, Factory $factory, Renderer $renderer, int $current_user_id)
setData(array $data)
Set data to show in table.
importantInfos(ilIndividualAssessmentMember $record)
Returns all informations needed for important row.
getExaminerId(ilIndividualAssessmentMember $record)
Returns the examnier id from record.
viewLocation(bool $finalized, int $examiner_id=null, int $usr_id)
Check user may view the location.
checkDownloadFile(int $usr_id, string $file_name=null)
Check the current user is allowed to download the record file.
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.
getProfileLink(string $case, string $examiner, int $examiner_id)
getAction(ilIndividualAssessmentMember $record, $ui_factory)
Return the ui control with executable actions.
getLocationInfos(string $location=null, bool $finalized, int $examiner_id=null, int $usr_id)
Returns the location of assessment.
wasEditedByViewer(int $examiner_id=null)
userMayDownloadAttachment(int $usr_id)
userMayEditGradesOf(int $usr_id)
hasPublicProfile(int $examiner_id)
getFileDownloadLink(int $usr_id, $file_name)
Get the link for download of file.
getFullNameFor(int $user_id=null)
Returns login of examinier.
getSubheadline(ilIndividualAssessmentMember $record)
Returns the subheadline 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.
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 informations needed for further informations for each row.
getGradedInformations(ilDate $event_time)
Returns informations about the grading.
getInternalRecordNote(string $internal_note=null)
Returns inforamtions out of internal record note.
getRecordNote(string $record_note)
Returns inforamtions out of record note.
getChangerId(ilIndividualAssessmentMember $record)
getStatus(bool $finalized, int $status, int $examiner_id=null)
Returns readable status.
const LP_ASSESSMENT_NOT_COMPLETED
static _lookupName($a_user_id)
lookup user name
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
This describes commonalities between all types of Dropdowns.
This describes a Row used in Presentation Table.
This is how the factory for UI elements looks.
An entity that renders components to a string output.