ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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 ?>
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
__construct($a_parent_obj, $a_parent_cmd, $a_team_id)
Constructor.
static getTeamLog($a_team_id)
Get all log entries for team.
const IL_CAL_UNIX
_lookupFullname($a_user_id)
Lookup Full Name.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
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.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.