ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilExcDeliveredFilesTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Table/classes/class.ilTable2GUI.php");
5
15{
16 protected $submission; // [ilExSubmission]
17
21 public function __construct($a_parent_obj, $a_parent_cmd, ilExSubmission $a_submission)
22 {
23 global $DIC;
24
25 $this->ctrl = $DIC->ctrl();
26 $this->lng = $DIC->language();
27 $ilCtrl = $DIC->ctrl();
28 $lng = $DIC->language();
29
30 $this->submission = $a_submission;
31
32 parent::__construct($a_parent_obj, $a_parent_cmd);
33 $this->setData($this->submission->getFiles());
34 $this->setTitle($this->lng->txt("already_delivered_files") . " - " .
35 $this->submission->getAssignment()->getTitle());
36 $this->setLimit(9999);
37
38 $this->addColumn($this->lng->txt(""), "", "1", 1);
39 $this->addColumn($this->lng->txt("filename"), "filetitle");
40
41 if ($this->submission->getAssignment()->getAssignmentType()->usesTeams() &&
42 $this->submission->getAssignment()->getAssignmentType()->usesFileUpload()) {
43 // #11957
44 $this->lng->loadLanguageModule("file");
45 $this->addColumn($this->lng->txt("file_uploaded_by"));
46 include_once "Services/User/classes/class.ilUserUtil.php";
47 }
48
49 $this->addColumn($this->lng->txt("date"), "timestamp14");
50
51 if ($this->submission->getAssignment()->getExtendedDeadline()) {
52 $this->addColumn($this->lng->txt("exc_late_submission"), "late");
53 }
54
55 $this->addColumn($this->lng->txt("action"));
56 $this->setDefaultOrderField("filetitle");
57
58 $this->setEnableHeader(true);
59 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
60 $this->setRowTemplate("tpl.delivered_file_row.html", "Modules/Exercise");
61 $this->disable("footer");
62 $this->setEnableTitle(true);
63
64 if ($this->submission->canSubmit()) {
65 $this->addMultiCommand("confirmDeleteDelivered", $lng->txt("delete"));
66 }
67 }
68
72 protected function fillRow($file)
73 {
75
76 $this->tpl->setVariable("FILE_ID", $file["returned_id"]);
77 $this->tpl->setVariable("DELIVERED_FILE", $file["filetitle"]);
78
79 $date = new ilDateTime($file['timestamp14'], IL_CAL_TIMESTAMP);
80 $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
81
82 if ($this->submission->getAssignment()->getAssignmentType()->usesTeams() &&
83 $this->submission->getAssignment()->getAssignmentType()->usesFileUpload()) {
84 $this->tpl->setVariable(
85 "DELIVERED_OWNER",
86 ilUserUtil::getNamePresentation($file["owner_id"])
87 );
88 }
89
90 if ($this->submission->getAssignment()->getExtendedDeadline()) {
91 $this->tpl->setVariable("DELIVERED_LATE", ($file["late"])
92 ? '<span class="warning">' . $this->lng->txt("yes") . '</span>'
93 : $this->lng->txt("no"));
94 }
95
96 // #16164 - download
97 $ilCtrl->setParameter($this->getParentObject(), "delivered", $file["returned_id"]);
98 $url = $ilCtrl->getLinkTarget($this->getParentObject(), "download");
99 $ilCtrl->setParameter($this->getParentObject(), "delivered", "");
100 $this->tpl->setVariable("ACTION_TXT", $this->lng->txt("download"));
101 $this->tpl->setVariable("ACTION_URL", $url);
102 }
103}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_TIMESTAMP
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Exercise submission //TODO: This class has to much static methods related to delivered "files".
__construct($a_parent_obj, $a_parent_cmd, ilExSubmission $a_submission)
Constructor.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
global $ilCtrl
Definition: ilias.php:18
$url
global $DIC
Definition: saml.php:7