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';
 
   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));
 
  128            $this->getGradedByInformation($record->
examinerId()),
 
  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
 
  183            && !$this->checkAmendable($record->
finalized())
 
  184            && !$this->userMayViewGrades()
 
  185            && !$this->userMayEditGrades()
 
  190        $usr_id = (int) $record->
id();
 
  196            $this->checkDownloadFile($usr_id, $file_name)
 
  197                ? $this->getFileDownloadLink($usr_id, $file_name)
 
  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,
 
  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
 
  428            $this->checkEditable($finalized, $examiner_id, $usr_id)
 
  429            || $this->checkAmendable($finalized)
 
  430            || $this->userMayViewGrades()
 
  437    protected function checkEditable(
bool $finalized, 
int $examiner_id = 
null, 
int $usr_id) : bool
 
  440            ($this->userIsSystemAdmin() && !$finalized)
 
  441            || (!$finalized && $this->userMayEditGradesOf($usr_id) && $this->wasEditedByViewer($examiner_id))
 
  455            ($this->userIsSystemAdmin() && $finalized)
 
  456            || ($finalized && $this->userMayAmendGrades())
 
  469        if (($this->userIsSystemAdmin() && !$finalized) || (!$finalized && $this->userMayEditMembers())) {
 
  481        if ((!is_null($file_name) && $file_name !== 
'')
 
  482            && ($this->userIsSystemAdmin() || $this->userMayDownloadAttachment($usr_id))
 
  492        return $this->userMayViewGrades() || $this->userMayEditGrades() || $this->userMayEditGradesOf($usr_id);
 
  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);
 
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.
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 amend permission on record.
getGradedByInformation(?int $graded_by_id)
setData(array $data)
Set data to show in table.
importantInfos(ilIndividualAssessmentMember $record)
Returns all informations needed for important row.
getProfileLink(string $full_name, int $user_id)
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.
getChangedByInformation(?int $changed_by_id, ?DateTime $change_date)
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)
__construct(ilIndividualAssessmentMembersGUI $parent, ilLanguage $lng, ilCtrl $ctrl, IndividualAssessmentAccessHandler $iass_access, Factory $factory, Renderer $renderer, int $current_user_id)
userMayEditGradesOf(int $usr_id)
hasPublicProfile(int $examiner_id)
getGradedInformations(?DateTimeImmutable $event_time)
Returns informations about the grading.
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.
getInternalRecordNote(string $internal_note=null)
Returns inforamtions out of internal record note.
getRecordNote(string $record_note)
Returns inforamtions out of record note.
getStatus(bool $finalized, int $status, int $examiner_id=null)
Returns readable status.
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.
withHeadline($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 controll and roles of an objcet goes here.