ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 include_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()->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
42  // #11957
43  $this->lng->loadLanguageModule("file");
44  $this->addColumn($this->lng->txt("file_uploaded_by"));
45  include_once "Services/User/classes/class.ilUserUtil.php";
46  }
47 
48  $this->addColumn($this->lng->txt("date"), "timestamp14");
49 
50  if ($this->submission->getAssignment()->getExtendedDeadline()) {
51  $this->addColumn($this->lng->txt("exc_late_submission"), "late");
52  }
53 
54  $this->addColumn($this->lng->txt("action"));
55  $this->setDefaultOrderField("filetitle");
56 
57  $this->setEnableHeader(true);
58  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
59  $this->setRowTemplate("tpl.delivered_file_row.html", "Modules/Exercise");
60  $this->disable("footer");
61  $this->setEnableTitle(true);
62 
63  if ($this->submission->canSubmit()) {
64  $this->addMultiCommand("confirmDeleteDelivered", $lng->txt("delete"));
65  }
66  }
67 
71  protected function fillRow($file)
72  {
74 
75  $this->tpl->setVariable("FILE_ID", $file["returned_id"]);
76  $this->tpl->setVariable("DELIVERED_FILE", $file["filetitle"]);
77 
78  $date = new ilDateTime($file['timestamp14'], IL_CAL_TIMESTAMP);
79  $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
80 
81  if ($this->submission->getAssignment()->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
82  $this->tpl->setVariable(
83  "DELIVERED_OWNER",
85  );
86  }
87 
88  if ($this->submission->getAssignment()->getExtendedDeadline()) {
89  $this->tpl->setVariable("DELIVERED_LATE", ($file["late"])
90  ? '<span class="warning">' . $this->lng->txt("yes") . '</span>'
91  : $this->lng->txt("no"));
92  }
93 
94  // #16164 - download
95  $ilCtrl->setParameter($this->getParentObject(), "delivered", $file["returned_id"]);
96  $url = $ilCtrl->getLinkTarget($this->getParentObject(), "download");
97  $ilCtrl->setParameter($this->getParentObject(), "delivered", "");
98  $this->tpl->setVariable("ACTION_TXT", $this->lng->txt("download"));
99  $this->tpl->setVariable("ACTION_URL", $url);
100  }
101 }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
global $DIC
Definition: saml.php:7
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
__construct($a_parent_obj, $a_parent_cmd, ilExSubmission $a_submission)
Constructor.
getParentObject()
Get parent object.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
Date and time handling
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:
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
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.
Exercise submission.
setEnableHeader($a_enableheader)
Set Enable Header.
$url
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
const IL_CAL_TIMESTAMP
setEnableTitle($a_enabletitle)
Set Enable Title.
setLimit($a_limit=0, $a_default_limit=0)