ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilExcDeliveredFilesTableGUI.php
Go to the documentation of this file.
1<?php
2
20
27{
29
30 public function __construct(
31 object $a_parent_obj,
32 string $a_parent_cmd,
33 ilExSubmission $a_submission
34 ) {
35 global $DIC;
36
37 $this->submission = $a_submission;
38 $subm = $DIC->exercise()->internal()->domain()->submission(
39 $this->submission->getAssignment()->getId()
40 );
41
42 parent::__construct($a_parent_obj, $a_parent_cmd);
43
44 $ilCtrl = $this->ctrl;
46
47 $data = [];
48 foreach ($subm->getSubmissionsOfUser($a_submission->getUserId()) as $s) {
49 $data[] = [
50 "submission" => $s
51 ];
52 }
53 $this->setData($data);
54 $this->setTitle(
55 $this->lng->txt("already_delivered_files") . " - " .
56 $this->submission->getAssignment()->getTitle()
57 );
58 $this->setLimit(9999);
59
60 $this->addColumn($this->lng->txt(""), "", "1", 1);
61 $this->addColumn($this->lng->txt("filename"), "filetitle");
62
63 if ($this->submission->getAssignment()->getAssignmentType()->usesTeams() &&
64 $this->submission->getAssignment()->getAssignmentType()->usesFileUpload()) {
65 // #11957
66 $this->lng->loadLanguageModule("file");
67 $this->addColumn($this->lng->txt("file_uploaded_by"));
68 }
69
70 $this->addColumn($this->lng->txt("date"), "timestamp14");
71
72 if ($this->submission->getAssignment()->getExtendedDeadline()) {
73 $this->addColumn($this->lng->txt("exc_late_submission"), "late");
74 }
75
76 $this->addColumn($this->lng->txt("action"));
77 $this->setDefaultOrderField("filetitle");
78
79 $this->setEnableHeader(true);
80 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
81 $this->setRowTemplate("tpl.delivered_file_row.html", "components/ILIAS/Exercise");
82 $this->disable("footer");
83 $this->setEnableTitle(true);
84
85 if ($this->submission->canSubmit()) {
86 $this->addMultiCommand("confirmDeleteDelivered", $lng->txt("delete"));
87 }
88 }
89
93 protected function fillRow(array $a_set): void
94 {
95 $ilCtrl = $this->ctrl;
96
98 $sub = $a_set["submission"];
99
100 $this->tpl->setVariable("FILE_ID", $sub->getId());
101 $this->tpl->setVariable("DELIVERED_FILE", htmlentities($sub->getTitle()));
102
103 $date = new ilDateTime($sub->getTimestamp14(), IL_CAL_TIMESTAMP);
104 $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
105
106 if ($this->submission->getAssignment()->getAssignmentType()->usesTeams() &&
107 $this->submission->getAssignment()->getAssignmentType()->usesFileUpload()) {
108 $this->tpl->setVariable(
109 "DELIVERED_OWNER",
110 ilUserUtil::getNamePresentation($sub->getUserId())
111 );
112 }
113
114 if ($this->submission->getAssignment()->getExtendedDeadline()) {
115 $this->tpl->setVariable("DELIVERED_LATE", ($sub->getLate())
116 ? '<span class="warning">' . $this->lng->txt("yes") . '</span>'
117 : $this->lng->txt("no"));
118 }
119
120 // #16164 - download
121 $ilCtrl->setParameter($this->getParentObject(), "delivered", $sub->getId());
122 $url = $ilCtrl->getLinkTarget($this->getParentObject(), "download");
123 $ilCtrl->setParameter($this->getParentObject(), "delivered", "");
124 $this->tpl->setVariable("ACTION_TXT", $this->lng->txt("download"));
125 $this->tpl->setVariable("ACTION_URL", $url);
126 }
127}
const IL_CAL_TIMESTAMP
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
Exercise submission //TODO: This class has many static methods related to delivered "files".
__construct(object $a_parent_obj, string $a_parent_cmd, ilExSubmission $a_submission)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableTitle(bool $a_enabletitle)
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
fillRow(array $a_set)
Standard Version of Fill Row.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
ilLanguage $lng
disable(string $a_module_name)
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26
$url
Definition: shib_logout.php:68