ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
20 function __construct($a_parent_obj, $a_parent_cmd, $a_exc, $a_ass_id)
21 {
22 global $ilCtrl, $lng, $ilAccess, $lng;
23
24 $this->exercise = $a_exc;
25 $this->ass_id = $a_ass_id; // assignment id
26 $this->exc_id = $a_exc->getId();
27
28 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
29 $this->ass = new ilExAssignment($this->ass_id);
30
31 parent::__construct($a_parent_obj, $a_parent_cmd);
32 $this->setData($this->getDeliveredFiles());
33 $this->setTitle($this->lng->txt("already_delivered_files")." - ".
34 $this->ass->getTitle());
35 $this->setLimit(9999);
36
37 $this->addColumn($this->lng->txt(""), "", "1", 1);
38 $this->addColumn($this->lng->txt("filename"), "filetitle");
39
40 if($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM)
41 {
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 $this->setDefaultOrderField("filetitle");
51
52 $this->setEnableHeader(true);
53 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
54 $this->setRowTemplate("tpl.delivered_file_row.html", "Modules/Exercise");
55 $this->disable("footer");
56 $this->setEnableTitle(true);
57
58 if (mktime() < $this->ass->getDeadline() || ($this->ass->getDeadline() == 0))
59 {
60 $this->addMultiCommand("confirmDeleteDelivered", $lng->txt("delete"));
61 }
62 $this->addMultiCommand("download", $lng->txt("download"));
63 }
64
72 {
73 global $ilUser;
74
75 $files = ilExAssignment::getDeliveredFiles($this->exc_id, $this->ass_id,
76 $ilUser->getId());
77 return $files;
78 }
79
83 protected function fillRow($file)
84 {
85 global $lng;
86
87 $this->tpl->setVariable("FILE_ID", $file["returned_id"]);
88 $this->tpl->setVariable("DELIVERED_FILE", $file["filetitle"]);
89
90 $date = new ilDateTime($file['timestamp14'],IL_CAL_TIMESTAMP);
91 $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
92
93 if($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM)
94 {
95 $this->tpl->setVariable("DELIVERED_OWNER",
97 }
98 }
99
100}
101
102?>
print $file
const IL_CAL_TIMESTAMP
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
Exercise assignment.
getDeliveredFiles($a_exc_id, $a_ass_id, $a_user_id, $a_filter_empty_filename=false)
was: getDeliveredFiles($a_member_id)
__construct($a_parent_obj, $a_parent_cmd, $a_exc, $a_ass_id)
Constructor.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
setEnableHeader($a_enableheader)
Set Enable Header.
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.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
setLimit($a_limit=0, $a_default_limit=0)
set max.
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)
Default behaviour is:
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15