ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
12 {
13  protected $submission; // [ilExSubmission]
14 
18  public function __construct($a_parent_obj, $a_parent_cmd, ilExSubmission $a_submission)
19  {
20  global $DIC;
21 
22  $this->ctrl = $DIC->ctrl();
23  $this->lng = $DIC->language();
24  $ilCtrl = $DIC->ctrl();
25  $lng = $DIC->language();
26 
27  $this->submission = $a_submission;
28 
29  parent::__construct($a_parent_obj, $a_parent_cmd);
30  $this->setData($this->submission->getFiles());
31  $this->setTitle($this->lng->txt("already_delivered_files") . " - " .
32  $this->submission->getAssignment()->getTitle());
33  $this->setLimit(9999);
34 
35  $this->addColumn($this->lng->txt(""), "", "1", 1);
36  $this->addColumn($this->lng->txt("filename"), "filetitle");
37 
38  if ($this->submission->getAssignment()->getAssignmentType()->usesTeams() &&
39  $this->submission->getAssignment()->getAssignmentType()->usesFileUpload()) {
40  // #11957
41  $this->lng->loadLanguageModule("file");
42  $this->addColumn($this->lng->txt("file_uploaded_by"));
43  }
44 
45  $this->addColumn($this->lng->txt("date"), "timestamp14");
46 
47  if ($this->submission->getAssignment()->getExtendedDeadline()) {
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  $this->addMultiCommand("confirmDeleteDelivered", $lng->txt("delete"));
62  }
63  }
64 
68  protected function fillRow($file)
69  {
71 
72  $this->tpl->setVariable("FILE_ID", $file["returned_id"]);
73  $this->tpl->setVariable("DELIVERED_FILE", htmlentities($file["filetitle"]));
74 
75  $date = new ilDateTime($file['timestamp14'], IL_CAL_TIMESTAMP);
76  $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
77 
78  if ($this->submission->getAssignment()->getAssignmentType()->usesTeams() &&
79  $this->submission->getAssignment()->getAssignmentType()->usesFileUpload()) {
80  $this->tpl->setVariable(
81  "DELIVERED_OWNER",
82  ilUserUtil::getNamePresentation($file["owner_id"])
83  );
84  }
85 
86  if ($this->submission->getAssignment()->getExtendedDeadline()) {
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 }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
__construct($a_parent_obj, $a_parent_cmd, ilExSubmission $a_submission)
Constructor.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
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.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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
__construct(Container $dic, ilPlugin $plugin)
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.
$DIC
Definition: xapitoken.php:46
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
setEnableHeader($a_enableheader)
Set Enable Header.
$url
const IL_CAL_TIMESTAMP
setEnableTitle($a_enabletitle)
Set Enable Title.
setLimit($a_limit=0, $a_default_limit=0)