ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilExAssignmentTeamLogTableGUI.php
Go to the documentation of this file.
1 <?php
2 
26 {
28 
29  public function __construct(
30  object $a_parent_obj,
31  string $a_parent_cmd,
32  ilExAssignmentTeam $a_team
33  ) {
34  $this->team = $a_team;
35 
36  parent::__construct($a_parent_obj, $a_parent_cmd);
37 
39 
40  $this->setTitle($this->lng->txt("exc_team_log"));
41 
42  $this->addColumn($this->lng->txt("date"), "tstamp");
43  $this->addColumn($this->lng->txt("user"), "user");
44  $this->addColumn($this->lng->txt("details"), "details");
45 
46  $this->setDefaultOrderField("tstamp");
47  $this->setDefaultOrderDirection("desc");
48 
49  $this->setRowTemplate("tpl.exc_team_log_row.html", "components/ILIAS/Exercise");
50  $this->setFormAction($ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
51 
52  $this->getItems();
53  }
54 
55  protected function getItems(): void
56  {
57  $data = array();
58 
59  foreach ($this->team->getLog() as $item) {
60  $mess = "";
61  switch ($item["action"]) {
63  $mess = "create_team";
64  break;
65 
67  $mess = "add_member";
68  break;
69 
71  $mess = "remove_member";
72  break;
73 
75  $mess = "add_file";
76  break;
77 
79  $mess = "remove_file";
80  break;
81  }
82 
83  $details = $this->lng->txt("exc_team_log_" . $mess);
84  if ($item["details"]) {
85  $details = sprintf($details, $item["details"]);
86  }
87 
88  $data[] = array(
89  "tstamp" => $item["tstamp"],
90  "user" => ilObjUser::_lookupFullname($item["user_id"]),
91  "details" => $details
92  );
93  }
94 
95  $this->setData($data);
96  }
97 
101  protected function fillRow(array $a_set): void
102  {
103  $date = ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX));
104 
105  $this->tpl->setVariable("TSTAMP", $date);
106  $this->tpl->setVariable("TXT_USER", $a_set["user"]);
107  $this->tpl->setVariable("TXT_DETAILS", htmlspecialchars($a_set["details"]));
108  }
109 }
setData(array $a_data)
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_form_action, bool $a_multipart=false)
static _lookupFullname(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, ilExAssignmentTeam $a_team)
const IL_CAL_UNIX
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)