ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilUserLPTableGUI.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
15{
16 function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
17 {
18 global $ilCtrl, $lng, $ilAccess, $lng, $rbacsystem;
19
20 $this->ref_id = $a_ref_id;
21 $this->setId("admusrlp");
22
23 parent::__construct($a_parent_obj, $a_parent_cmd);
24 // $this->setTitle($this->lng->txt("obj_usr"));
25
26 $this->addColumn($this->lng->txt("login"), "login");
27 $this->addColumn($this->lng->txt("firstname"), "firstname");
28 $this->addColumn($this->lng->txt("lastname"), "lastname");
29 $this->addColumn($this->lng->txt("online_time"), "online_time");
30 $this->addColumn($this->lng->txt("last_login"), "last_login");
31 $this->setExternalSorting(true);
32 $this->setExternalSegmentation(true);
33
34 $this->setFormAction($ilCtrl->getFormAction($this->parent_obj));
35
36 $this->setRowTemplate("tpl.user_list_lp_row.html", "Services/User");
37
38 $this->setDefaultOrderField("login");
39 $this->setDefaultOrderDirection("asc");
40
41 $this->setExportFormats(array(self::EXPORT_EXCEL));
42
43 $this->getItems();
44 }
45
46 function getItems()
47 {
49
50 include_once("./Services/User/classes/class.ilUserQuery.php");
56 null,
57 null,
58 null,
59 null,
60 null,
61 null,
62 null,
63 null,
64 array("online_time"),
65 null,
66 null
67 );
68
69 if (count($usr_data["set"]) == 0 && $this->getOffset() > 0)
70 {
71 $this->resetOffset();
77 null,
78 null,
79 null,
80 null,
81 null,
82 null,
83 null,
84 null,
85 array("online_time"),
86 null,
87 null
88 );
89 }
90
91 $this->setMaxCount($usr_data["cnt"]);
92 $this->setData($usr_data["set"]);
93
94 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
96 }
97
98 protected function fillRow($user)
99 {
100 global $ilCtrl;
101
102 if ($this->lp_active)
103 {
104 $ilCtrl->setParameterByClass("illearningprogressgui", "ref_id", $this->ref_id);
105 $ilCtrl->setParameterByClass("illearningprogressgui", "obj_id", $user["usr_id"]);
106 $link = $ilCtrl->getLinkTargetByClass(array("ilobjusergui",'illearningprogressgui'), "");
107
108 $this->tpl->setCurrentBlock("login_link");
109 $this->tpl->setVariable("HREF_LOGIN", $link);
110 $this->tpl->setVariable("VAL_LOGIN", $user["login"]);
111 $this->tpl->parseCurrentBlock();
112
113 }
114 else
115 {
116 $this->tpl->setCurrentBlock("login_plain");
117 $this->tpl->setVariable("VAL_LOGIN_PLAIN", $user["login"]);
118 $this->tpl->parseCurrentBlock();
119 }
120
121 $this->tpl->setVariable("VAL_FIRSTNAME", $user["firstname"]);
122 $this->tpl->setVariable("VAL_LASTNAME", $user["lastname"]);
123 $this->tpl->setVariable("VAL_ONLINE_TIME",
124 ilFormat::_secondsToShortString($user["online_time"]));
125 $this->tpl->setVariable("VAL_LAST_LOGIN",
126 ilDatePresentation::formatDate(new ilDateTime($user["last_login"], IL_CAL_DATETIME)));
127 }
128
129 protected function fillRowExcel($a_worksheet, &$a_row, $a_set)
130 {
131 $a_worksheet->write($a_row, 0, $a_set["login"]);
132 $a_worksheet->write($a_row, 1, $a_set["firstname"]);
133 $a_worksheet->write($a_row, 2, $a_set["lastname"]);
134 $a_worksheet->write($a_row, 3,
135 ilFormat::_secondsToShortString($a_set["online_time"]));
136 $a_worksheet->write($a_row, 4,
137 ilDatePresentation::formatDate(new ilDateTime($a_set["last_login"], IL_CAL_DATETIME)));
138 }
139}
140
141?>
const IL_CAL_DATETIME
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
_secondsToShortString($seconds)
converts seconds to string: Long: 7 days 4 hour(s) ...
static _enabledLearningProgress()
check wether learing progress is enabled or not
Class ilTable2GUI.
setExternalSorting($a_val)
Set external sorting.
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.
setExportFormats(array $formats)
Set available export formats.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
setData($a_data)
set table data @access public
getLimit()
Get limit.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
resetOffset($a_in_determination=false)
Reset offset.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
getOffset()
Get offset.
setExternalSegmentation($a_val)
Set external segmentation.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
getOrderDirection()
Get order direction.
setMaxCount($a_max_count)
set max.
Learning progress account list for user administration.
fillRow($user)
Standard Version of Fill Row.
fillRowExcel($a_worksheet, &$a_row, $a_set)
Excel Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
Constructor.
static getUserListData($a_order_field, $a_order_dir, $a_offset, $a_limit, $a_string_filter="", $a_activation_filter="", $a_last_login_filter=null, $a_limited_access_filter=false, $a_no_courses_filter=false, $a_course_group_filter=0, $a_role_filter=0, $a_user_folder_filter=null, $a_additional_fields='', $a_user_filter=null, $a_first_letter="")
Get data for user administration list.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40