ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilExAssignmentTeamLogTableGUI.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 
13 {
14  protected $team_id; // [int]
15 
23  public function __construct($a_parent_obj, $a_parent_cmd, $a_team_id)
24  {
25  global $ilCtrl;
26 
27  $this->team_id = $a_team_id;
28 
29  parent::__construct($a_parent_obj, $a_parent_cmd);
30 
31  $this->setTitle($this->lng->txt("exc_team_log"));
32 
33  $this->addColumn($this->lng->txt("date"), "tstamp");
34  $this->addColumn($this->lng->txt("user"), "user");
35  $this->addColumn($this->lng->txt("details"), "details");
36 
37  $this->setDefaultOrderField("tstamp");
38  $this->setDefaultOrderDirection("desc");
39 
40  $this->setRowTemplate("tpl.exc_team_log_row.html", "Modules/Exercise");
41  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
42 
43  $this->getItems();
44  }
45 
49  protected function getItems()
50  {
51  $data = array();
52 
53  foreach(ilExAssignment::getTeamLog($this->team_id) as $item)
54  {;
55  switch($item["action"])
56  {
58  $mess = "create_team";
59  break;
60 
62  $mess = "add_member";
63  break;
64 
66  $mess = "remove_member";
67  break;
68 
70  $mess = "add_file";
71  break;
72 
74  $mess = "remove_file";
75  break;
76  }
77 
78  $details = $this->lng->txt("exc_team_log_".$mess);
79  if($item["details"])
80  {
81  $details = sprintf($details, $item["details"]);
82  }
83 
84  $data[] = array(
85  "tstamp" => $item["tstamp"],
86  "user" => ilObjUser::_lookupFullname($item["user_id"]),
87  "details" => $details
88  );
89  }
90 
91  $this->setData($data);
92  }
93 
99  protected function fillRow($a_set)
100  {
101  $date = ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX));
102 
103  $this->tpl->setVariable("TSTAMP", $date);
104  $this->tpl->setVariable("TXT_USER", $a_set["user"]);
105  $this->tpl->setVariable("TXT_DETAILS", $a_set["details"]);
106  }
107 }
108 
109 ?>