ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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; // [ilExAssignmentTeam]
15 
23  public function __construct($a_parent_obj, $a_parent_cmd, ilExAssignmentTeam $a_team)
24  {
25  global $DIC;
26 
27  $this->ctrl = $DIC->ctrl();
28  $ilCtrl = $DIC->ctrl();
29 
30  $this->team = $a_team;
31 
32  parent::__construct($a_parent_obj, $a_parent_cmd);
33 
34  $this->setTitle($this->lng->txt("exc_team_log"));
35 
36  $this->addColumn($this->lng->txt("date"), "tstamp");
37  $this->addColumn($this->lng->txt("user"), "user");
38  $this->addColumn($this->lng->txt("details"), "details");
39 
40  $this->setDefaultOrderField("tstamp");
41  $this->setDefaultOrderDirection("desc");
42 
43  $this->setRowTemplate("tpl.exc_team_log_row.html", "Modules/Exercise");
44  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
45 
46  $this->getItems();
47  }
48 
52  protected function getItems()
53  {
54  $data = array();
55 
56  foreach ($this->team->getLog() as $item) {
57  ;
58  switch ($item["action"]) {
60  $mess = "create_team";
61  break;
62 
64  $mess = "add_member";
65  break;
66 
68  $mess = "remove_member";
69  break;
70 
72  $mess = "add_file";
73  break;
74 
76  $mess = "remove_file";
77  break;
78  }
79 
80  $details = $this->lng->txt("exc_team_log_" . $mess);
81  if ($item["details"]) {
82  $details = sprintf($details, $item["details"]);
83  }
84 
85  $data[] = array(
86  "tstamp" => $item["tstamp"],
87  "user" => ilObjUser::_lookupFullname($item["user_id"]),
88  "details" => $details
89  );
90  }
91 
92  $this->setData($data);
93  }
94 
100  protected function fillRow($a_set)
101  {
102  $date = ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX));
103 
104  $this->tpl->setVariable("TSTAMP", $date);
105  $this->tpl->setVariable("TXT_USER", $a_set["user"]);
106  $this->tpl->setVariable("TXT_DETAILS", $a_set["details"]);
107  }
108 }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
global $DIC
Definition: saml.php:7
static _lookupFullname($a_user_id)
Lookup Full Name.
Exercise assignment team.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
__construct($a_parent_obj, $a_parent_cmd, ilExAssignmentTeam $a_team)
Constructor.
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.
Date and time handling
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.