ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
4include_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 $ilCtrl;
26
27 $this->team = $a_team;
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($this->team->getLog() 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?>
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
__construct($a_parent_obj, $a_parent_cmd, ilExAssignmentTeam $a_team)
Constructor.
Exercise assignment team.
_lookupFullname($a_user_id)
Lookup Full Name.
Class ilTable2GUI.
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.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
global $ilCtrl
Definition: ilias.php:18