ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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 
4 include_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 
71  function getDeliveredFiles()
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 ?>