ILIAS  Release_4_1_x_branch Revision 61804
 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"));
39  $this->addColumn($this->lng->txt("date"));
40 
41  $this->setEnableHeader(true);
42  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
43  $this->setRowTemplate("tpl.delivered_file_row.html", "Modules/Exercise");
44  $this->disable("footer");
45  $this->setEnableTitle(true);
46 
47  if (mktime() < $this->ass->getDeadline())
48  {
49  $this->addMultiCommand("confirmDeleteDelivered", $lng->txt("delete"));
50  }
51  $this->addMultiCommand("download", $lng->txt("download"));
52  }
53 
60  function getDeliveredFiles()
61  {
62  global $ilUser;
63 
64  $files = ilExAssignment::getDeliveredFiles($this->exc_id, $this->ass_id,
65  $ilUser->getId());
66  return $files;
67  }
68 
72  protected function fillRow($file)
73  {
74  global $lng;
75 
76  $this->tpl->setVariable("FILE_ID", $file["returned_id"]);
77  $this->tpl->setVariable("DELIVERED_FILE", $file["filetitle"]);
78  $date = new ilDateTime($file['timestamp14'],IL_CAL_TIMESTAMP);
79  $this->tpl->setVariable("DELIVERED_DATE", ilDatePresentation::formatDate($date));
80  }
81 
82 }
83 
84 ?>