ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilExcDeliveredFilesTableGUI.php
Go to the documentation of this file.
1 <?php
2 
25 {
27 
28  public function __construct(
29  object $a_parent_obj,
30  string $a_parent_cmd,
31  ilExSubmission $a_submission
32  ) {
33  $this->submission = $a_submission;
34 
35  parent::__construct($a_parent_obj, $a_parent_cmd);
36 
37  $ilCtrl = $this->ctrl;
38  $lng = $this->lng;
39 
40  $this->setData($this->submission->getFiles());
41  $this->setTitle(
42  $this->lng->txt("already_delivered_files") . " - " .
43  $this->submission->getAssignment()->getTitle()
44  );
45  $this->setLimit(9999);
46 
47  $this->addColumn($this->lng->txt(""), "", "1", 1);
48  $this->addColumn($this->lng->txt("filename"), "filetitle");
49 
50  if ($this->submission->getAssignment()->getAssignmentType()->usesTeams() &&
51  $this->submission->getAssignment()->getAssignmentType()->usesFileUpload()) {
52  // #11957
53  $this->lng->loadLanguageModule("file");
54  $this->addColumn($this->lng->txt("file_uploaded_by"));
55  }
56 
57  $this->addColumn($this->lng->txt("date"), "timestamp14");
58 
59  if ($this->submission->getAssignment()->getExtendedDeadline()) {
60  $this->addColumn($this->lng->txt("exc_late_submission"), "late");
61  }
62 
63  $this->addColumn($this->lng->txt("action"));
64  $this->setDefaultOrderField("filetitle");
65 
66  $this->setEnableHeader(true);
67  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
68  $this->setRowTemplate("tpl.delivered_file_row.html", "Modules/Exercise");
69  $this->disable("footer");
70  $this->setEnableTitle(true);
71 
72  if ($this->submission->canSubmit()) {
73  $this->addMultiCommand("confirmDeleteDelivered", $lng->txt("delete"));
74  }
75  }
76 
80  protected function fillRow(array $a_set): void
81  {
82  $ilCtrl = $this->ctrl;
83 
84  $this->tpl->setVariable("FILE_ID", $a_set["returned_id"]);
85  $this->tpl->setVariable("DELIVERED_FILE", htmlentities($a_set["filetitle"]));
86 
87  $date = new ilDateTime($a_set['timestamp14'], IL_CAL_TIMESTAMP);
88  $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
89 
90  if ($this->submission->getAssignment()->getAssignmentType()->usesTeams() &&
91  $this->submission->getAssignment()->getAssignmentType()->usesFileUpload()) {
92  $this->tpl->setVariable(
93  "DELIVERED_OWNER",
94  ilUserUtil::getNamePresentation($a_set["owner_id"])
95  );
96  }
97 
98  if ($this->submission->getAssignment()->getExtendedDeadline()) {
99  $this->tpl->setVariable("DELIVERED_LATE", ($a_set["late"])
100  ? '<span class="warning">' . $this->lng->txt("yes") . '</span>'
101  : $this->lng->txt("no"));
102  }
103 
104  // #16164 - download
105  $ilCtrl->setParameter($this->getParentObject(), "delivered", $a_set["returned_id"]);
106  $url = $ilCtrl->getLinkTarget($this->getParentObject(), "download");
107  $ilCtrl->setParameter($this->getParentObject(), "delivered", "");
108  $this->tpl->setVariable("ACTION_TXT", $this->lng->txt("download"));
109  $this->tpl->setVariable("ACTION_URL", $url);
110  }
111 }
setData(array $a_data)
__construct(object $a_parent_obj, string $a_parent_cmd, ilExSubmission $a_submission)
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="ilpublicuserprofilegui")
Default behaviour is:
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...
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
ilLanguage $lng
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
disable(string $a_module_name)
$url
const IL_CAL_TIMESTAMP
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addMultiCommand(string $a_cmd, string $a_text)
setEnableHeader(bool $a_enableheader)