ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  function __construct($a_parent_obj, $a_parent_cmd, ilExSubmission $a_submission)
22  {
23  global $ilCtrl, $lng;
24 
25  $this->submission = $a_submission;
26 
27  parent::__construct($a_parent_obj, $a_parent_cmd);
28  $this->setData($this->submission->getFiles());
29  $this->setTitle($this->lng->txt("already_delivered_files")." - ".
30  $this->submission->getAssignment()->getTitle());
31  $this->setLimit(9999);
32 
33  $this->addColumn($this->lng->txt(""), "", "1", 1);
34  $this->addColumn($this->lng->txt("filename"), "filetitle");
35 
36  if($this->submission->getAssignment()->getType() == ilExAssignment::TYPE_UPLOAD_TEAM)
37  {
38  // #11957
39  $this->lng->loadLanguageModule("file");
40  $this->addColumn($this->lng->txt("file_uploaded_by"));
41  include_once "Services/User/classes/class.ilUserUtil.php";
42  }
43 
44  $this->addColumn($this->lng->txt("date"), "timestamp14");
45 
46  if($this->submission->getAssignment()->getExtendedDeadline())
47  {
48  $this->addColumn($this->lng->txt("exc_late_submission"), "late");
49  }
50 
51  $this->addColumn($this->lng->txt("action"));
52  $this->setDefaultOrderField("filetitle");
53 
54  $this->setEnableHeader(true);
55  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
56  $this->setRowTemplate("tpl.delivered_file_row.html", "Modules/Exercise");
57  $this->disable("footer");
58  $this->setEnableTitle(true);
59 
60  if ($this->submission->canSubmit())
61  {
62  $this->addMultiCommand("confirmDeleteDelivered", $lng->txt("delete"));
63  }
64  }
65 
69  protected function fillRow($file)
70  {
71  global $ilCtrl;
72 
73  $this->tpl->setVariable("FILE_ID", $file["returned_id"]);
74  $this->tpl->setVariable("DELIVERED_FILE", $file["filetitle"]);
75 
76  $date = new ilDateTime($file['timestamp14'],IL_CAL_TIMESTAMP);
77  $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
78 
79  if($this->submission->getAssignment()->getType() == ilExAssignment::TYPE_UPLOAD_TEAM)
80  {
81  $this->tpl->setVariable("DELIVERED_OWNER",
83  }
84 
85  if($this->submission->getAssignment()->getExtendedDeadline())
86  {
87  $this->tpl->setVariable("DELIVERED_LATE", ($file["late"])
88  ? '<span class="warning">'.$this->lng->txt("yes").'</span>'
89  : $this->lng->txt("no"));
90  }
91 
92  // #16164 - download
93  $ilCtrl->setParameter($this->getParentObject(), "delivered", $file["returned_id"]);
94  $url = $ilCtrl->getLinkTarget($this->getParentObject(), "download");
95  $ilCtrl->setParameter($this->getParentObject(), "delivered", "");
96  $this->tpl->setVariable("ACTION_TXT", $this->lng->txt("download"));
97  $this->tpl->setVariable("ACTION_URL", $url);
98 
99  }
100 
101 }
102 
103 ?>
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
$url
Definition: shib_logout.php:72
__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.
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)
Default behaviour is:
Class ilTable2GUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
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
global $lng
Definition: privfeed.php:17
Exercise submission.
setEnableHeader($a_enableheader)
Set Enable Header.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
const IL_CAL_TIMESTAMP
setEnableTitle($a_enabletitle)
Set Enable Title.
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.
setLimit($a_limit=0, $a_default_limit=0)