ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilLPObjectStatisticsAdminTableGUI.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/Tracking/classes/class.ilLPTableBaseGUI.php");
5 
16 {
20  public function __construct($a_parent_obj, $a_parent_cmd)
21  {
22  global $DIC;
23 
24  $ilCtrl = $DIC['ilCtrl'];
25  $lng = $DIC['lng'];
26 
27  $this->setId("lpobjstattbl");
28 
29  parent::__construct($a_parent_obj, $a_parent_cmd);
30 
31  $this->addColumn("", "", "1", true);
32  $this->addColumn($lng->txt("month"), "month");
33  $this->addColumn($lng->txt("count"), "count");
34 
35  $this->setTitle($this->lng->txt("trac_object_stat_admin"));
36 
37  // $this->setSelectAllCheckbox("item_id");
38  $this->addMultiCommand("confirmDeleteData", $lng->txt("trac_delete_data"));
39 
40  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
41  $this->setRowTemplate("tpl.lp_object_statistics_admin_row.html", "Services/Tracking");
42  $this->setEnableHeader(true);
43  $this->setEnableNumInfo(true);
44  $this->setEnableTitle(true);
45  $this->setDefaultOrderField("month");
46  $this->setDefaultOrderDirection("desc");
47 
48  $this->getItems();
49  }
50 
51  public function getItems()
52  {
53  include_once "Services/Tracking/classes/class.ilTrQuery.php";
55 
56  // #11855
57  foreach ($data as $idx => $item) {
58  $data[$idx]["id"] = $item["month"];
59 
60  $data[$idx]["month"] = substr($item["month"], 0, 4) .
61  "-" . str_pad(substr($item["month"], 5), 2, "0", STR_PAD_LEFT);
62  }
63 
64  $this->setData($data);
65  }
66 
70  protected function fillRow($a_set)
71  {
72  global $DIC;
73 
74  $lng = $DIC['lng'];
75 
76  $caption = $lng->txt("month_" . substr($a_set["month"], 5, 2) . "_long") .
77  " " . substr($a_set["month"], 0, 4);
78 
79  $this->tpl->setVariable("ID", $a_set["id"]);
80  $this->tpl->setVariable("MONTH", $caption);
81  $this->tpl->setVariable("COUNT", $a_set["count"]);
82  }
83 }
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
global $DIC
Definition: saml.php:7
static getObjectStatisticsMonthlySummary()
setEnableNumInfo($a_val)
Set enable num info.
setId($a_val)
Set id.
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.
TableGUI class for learning progress.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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.
setEnableHeader($a_enableheader)
Set Enable Header.
setEnableTitle($a_enabletitle)
Set Enable Title.