ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
11{
12 protected $team; // [ilExAssignmentTeam]
13
21 public function __construct($a_parent_obj, $a_parent_cmd, ilExAssignmentTeam $a_team)
22 {
23 global $DIC;
24
25 $this->ctrl = $DIC->ctrl();
26 $ilCtrl = $DIC->ctrl();
27
28 $this->team = $a_team;
29
30 parent::__construct($a_parent_obj, $a_parent_cmd);
31
32 $this->setTitle($this->lng->txt("exc_team_log"));
33
34 $this->addColumn($this->lng->txt("date"), "tstamp");
35 $this->addColumn($this->lng->txt("user"), "user");
36 $this->addColumn($this->lng->txt("details"), "details");
37
38 $this->setDefaultOrderField("tstamp");
39 $this->setDefaultOrderDirection("desc");
40
41 $this->setRowTemplate("tpl.exc_team_log_row.html", "Modules/Exercise");
42 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
43
44 $this->getItems();
45 }
46
50 protected function getItems()
51 {
52 $data = array();
53
54 foreach ($this->team->getLog() as $item) {
55 ;
56 switch ($item["action"]) {
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 $details = sprintf($details, $item["details"]);
81 }
82
83 $data[] = array(
84 "tstamp" => $item["tstamp"],
85 "user" => ilObjUser::_lookupFullname($item["user_id"]),
86 "details" => $details
87 );
88 }
89
90 $this->setData($data);
91 }
92
98 protected function fillRow($a_set)
99 {
100 $date = ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX));
101
102 $this->tpl->setVariable("TSTAMP", $date);
103 $this->tpl->setVariable("TXT_USER", $a_set["user"]);
104 $this->tpl->setVariable("TXT_DETAILS", $a_set["details"]);
105 }
106}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
__construct($a_parent_obj, $a_parent_cmd, ilExAssignmentTeam $a_team)
Constructor.
Exercise assignment team.
static _lookupFullname($a_user_id)
Lookup Full Name.
Class ilTable2GUI.
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.
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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46