ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilLPListOfObjectsGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
6include_once './Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
7include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
8include_once 'Services/Search/classes/class.ilUserFilterGUI.php';
9
23{
24 var $details_id = 0;
25 var $details_type = '';
27
28 function ilLPListOfObjectsGUI($a_mode,$a_ref_id)
29 {
30 global $ilUser,$ilObjDataCache;
31
32 parent::ilLearningProgressBaseGUI($a_mode,$a_ref_id);
33
34 // Set item id for details
35 $this->__initDetails((int) $_REQUEST['details_id']);
36 }
40 function &executeCommand()
41 {
42 global $ilUser;
43
44 $this->ctrl->setReturn($this, "");
45
46 switch($this->ctrl->getNextClass())
47 {
48 case 'iltruserobjectspropstablegui':
49 $user_id = (int)$_GET["user_id"];
50 $this->ctrl->setParameter($this, "user_id", $user_id);
51
52 $this->ctrl->setParameter($this, "details_id", $this->details_id);
53
54 include_once("./Services/Tracking/classes/repository_statistics/class.ilTrUserObjectsPropsTableGUI.php");
55 $table_gui = new ilTrUserObjectsPropsTableGUI($this, "userDetails",
56 $user_id, $this->details_obj_id, $this->details_id);
57 $this->ctrl->forwardCommand($table_gui);
58 break;
59
60 case 'iltrsummarytablegui':
61 $cmd = "showObjectSummary";
62 if(!$this->details_id)
63 {
64 $this->details_id = ROOT_FOLDER_ID;
65 $cmd = "show";
66 }
67 include_once './Services/Tracking/classes/repository_statistics/class.ilTrSummaryTableGUI.php';
68 $table_gui = new ilTrSummaryTableGUI($this, $cmd, $this->details_id);
69 $this->ctrl->forwardCommand($table_gui);
70 break;
71
72 case 'iltrmatrixtablegui':
73 include_once './Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php';
74 $table_gui = new ilTrMatrixTableGUI($this, "showUserObjectMatrix", $this->details_id);
75 $this->ctrl->forwardCommand($table_gui);
76 break;
77
78 case 'iltrobjectuserspropstablegui':
79 $this->ctrl->setParameter($this, "details_id", $this->details_id);
80
81 include_once './Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php';
82 $table_gui = new ilTrObjectUsersPropsTableGUI($this, "details", $this->details_obj_id, $this->details_id);
83 $this->ctrl->forwardCommand($table_gui);
84 break;
85
86 default:
87 $cmd = $this->__getDefaultCommand();
88 $this->$cmd();
89 }
90
91 return true;
92 }
93
94 function updateUser()
95 {
96 global $rbacsystem;
97
98 if(isset($_GET["userdetails_id"]))
99 {
100 $parent = $this->details_id;
101 $this->__initDetails((int)$_GET["userdetails_id"]);
102 }
103
104 if(!$rbacsystem->checkAccess('edit_learning_progress', $this->details_id))
105 {
106 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
107 $this->ctrl->returnToParent($this);
108 }
109
110 $this->__updateUser($_REQUEST['user_id'], $this->details_obj_id);
111 ilUtil::sendSuccess($this->lng->txt('trac_update_edit_user'), true);
112
113 $this->ctrl->setParameter($this, "details_id", $this->details_id); // #15043
114
115 // #14993
116 if(!isset($_GET["userdetails_id"]))
117 {
118 $this->ctrl->redirect($this, "details");
119 }
120 else
121 {
122 $this->ctrl->setParameter($this, "userdetails_id", (int)$_GET["userdetails_id"]);
123 $this->ctrl->redirect($this, "userdetails");
124 }
125 }
126
127 function editUser()
128 {
129 global $ilObjDataCache, $rbacsystem;
130
131 $parent_id = $this->details_id;
132 if(isset($_GET["userdetails_id"]))
133 {
134 $this->__initDetails((int)$_GET["userdetails_id"]);
135 $sub_id = $this->details_id;
136 $cancel = "userdetails";
137 }
138 else
139 {
140 $sub_id = NULL;
141 $cancel = "details";
142 }
143
144 if(!$rbacsystem->checkAccess('edit_learning_progress', $this->details_id))
145 {
146 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
147 $this->ctrl->returnToParent($this);
148 }
149
150 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
151 $info = new ilInfoScreenGUI($this);
152 $info->setFormAction($this->ctrl->getFormAction($this));
153 $this->__showObjectDetails($info, $this->details_obj_id);
154 $this->__appendUserInfo($info, (int)$_GET['user_id']);
155 // $this->__appendLPDetails($info,$this->details_obj_id,(int)$_GET['user_id']);
156
157 $this->tpl->setVariable("ADM_CONTENT", $this->__showEditUser((int)$_GET['user_id'], $parent_id, $cancel, $sub_id)."<br />".$info->getHTML());
158 }
159
160 function details()
161 {
162 global $ilToolbar;
163
164 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_loo.html','Services/Tracking');
165
166 // Show back button
167 if($this->getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP or
168 $this->getMode() == self::LP_CONTEXT_ADMINISTRATION)
169 {
170 $print_view = false;
171
172 $ilToolbar->addButton($this->lng->txt('trac_view_list'),
173 $this->ctrl->getLinkTarget($this,'show'));
174 }
175 else
176 {
177 /*
178 $print_view = (bool)$_GET['prt'];
179 if(!$print_view)
180 {
181 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
182 $this->ctrl->setParameter($this, 'prt', 1);
183 $ilToolbar->addButton($this->lng->txt('print_view'),$this->ctrl->getLinkTarget($this,'details'), '_blank');
184 $this->ctrl->setParameter($this, 'prt', '');
185 }
186 */
187 }
188
189 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
190 $info = new ilInfoScreenGUI($this);
191 $info->setFormAction($this->ctrl->getFormAction($this));
192 if($this->__showObjectDetails($info, $this->details_obj_id))
193 {
194 $this->tpl->setCurrentBlock("info");
195 $this->tpl->setVariable("INFO_TABLE",$info->getHTML());
196 $this->tpl->parseCurrentBlock();
197 }
198
199 $this->__showUsersList($print_view);
200 }
201
202 function __showUsersList($a_print_view = false)
203 {
204 if($this->isAnonymized())
205 {
206 ilUtil::sendFailure($this->lng->txt('permission_denied'));
207 return;
208 }
209
210 $this->ctrl->setParameter($this, "details_id", $this->details_id);
211
212 include_once "Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php";
213 $gui = new ilTrObjectUsersPropsTableGUI($this, "details", $this->details_obj_id, $this->details_id, $a_print_view);
214
215 $this->tpl->setVariable("LP_OBJECTS", $gui->getHTML());
216 $this->tpl->setVariable("LEGEND", $this->__getLegendHTML());
217
218 /*
219 if($a_print_view)
220 {
221 echo $this->tpl->get("DEFAULT", false, false, false, false, false, false);
222 exit();
223 }
224 */
225 }
226
227 function userDetails()
228 {
229 global $ilObjDataCache, $ilToolbar;
230
231 if($this->isAnonymized())
232 {
233 ilUtil::sendFailure($this->lng->txt('permission_denied'));
234 return;
235 }
236
237 $this->ctrl->setParameter($this, "details_id", $this->details_id);
238
239 $print_view = (bool)$_GET['prt'];
240 if(!$print_view)
241 {
242 // Show back button
243 $ilToolbar->addButton($this->lng->txt('trac_view_list'), $this->ctrl->getLinkTarget($this,'details'));
244 }
245
246 $user_id = (int)$_GET["user_id"];
247 $this->ctrl->setParameter($this, "user_id", $user_id);
248
249 /*
250 if(!$print_view)
251 {
252 $this->ctrl->setParameter($this, 'prt', 1);
253 $ilToolbar->addButton($this->lng->txt('print_view'),$this->ctrl->getLinkTarget($this,'userDetails'), '_blank');
254 $this->ctrl->setParameter($this, 'prt', '');
255 };
256 */
257
258 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_loo.html','Services/Tracking');
259
260 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
261 $info = new ilInfoScreenGUI($this);
262 $info->setFormAction($this->ctrl->getFormAction($this));
263 $this->__showObjectDetails($info, $this->details_obj_id);
264 $this->__appendUserInfo($info, $user_id);
265 // $this->__appendLPDetails($info,$this->details_obj_id,$user_id);
266 $this->tpl->setVariable("INFO_TABLE",$info->getHTML());
267
268 include_once("./Services/Tracking/classes/repository_statistics/class.ilTrUserObjectsPropsTableGUI.php");
269 $table = new ilTrUserObjectsPropsTableGUI($this, "userDetails", $user_id,
270 $this->details_obj_id, $this->details_id, $print_view);
271 $this->tpl->setVariable('LP_OBJECTS', $table->getHTML());
272 $this->tpl->setVariable('LEGEND', $this->__getLegendHTML());
273
274 /*
275 if($print_view)
276 {
277 echo $this->tpl->get("DEFAULT", false, false, false, false, false, false);
278 exit();
279 }
280 */
281 }
282
283 function show()
284 {
285 // Clear table offset
286 $this->ctrl->saveParameter($this,'offset',0);
287
288 // Show only detail of current repository item if called from repository
289 switch($this->getMode())
290 {
292 $this->__initDetails($this->getRefId());
293 $this->details();
294 return true;
295 }
296
297 $this->__listObjects();
298 }
299
300 function __listObjects()
301 {
302 global $ilUser,$ilObjDataCache;
303
304 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_list_objects.html','Services/Tracking');
305
306 include_once("./Services/Tracking/classes/repository_statistics/class.ilTrSummaryTableGUI.php");
307 $lp_table = new ilTrSummaryTableGUI($this, "", ROOT_FOLDER_ID);
308
309 $this->tpl->setVariable("LP_OBJECTS", $lp_table->getHTML());
310 $this->tpl->setVariable('LEGEND', $this->__getLegendHTML());
311 }
312
313 function __initDetails($a_details_id)
314 {
315 global $ilObjDataCache;
316
317 if(!$a_details_id)
318 {
319 $a_details_id = $this->getRefId();
320 }
321 if($a_details_id)
322 {
323 $_GET['details_id'] = $a_details_id;
324 $this->details_id = $a_details_id;
325 $this->details_obj_id = $ilObjDataCache->lookupObjId($this->details_id);
326 $this->details_type = $ilObjDataCache->lookupType($this->details_obj_id);
327
328 include_once 'Services/Object/classes/class.ilObjectLP.php';
329 $olp = ilObjectLP::getInstance($this->details_obj_id);
330 $this->details_mode = $olp->getCurrentMode();
331 }
332 }
333
338 {
339 global $tpl, $ilToolbar;
340
341 /*
342 $print_view = (bool)$_GET['prt'];
343 if(!$print_view)
344 {
345 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
346 $this->ctrl->setParameter($this, 'prt', 1);
347 $ilToolbar->addButton($this->lng->txt('print_view'),$this->ctrl->getLinkTarget($this,'showObjectSummary'), '_blank');
348 $this->ctrl->setParameter($this, 'prt', '');
349 }
350 */
351
352 include_once("./Services/Tracking/classes/repository_statistics/class.ilTrSummaryTableGUI.php");
353 $table = new ilTrSummaryTableGUI($this, "showObjectSummary", $this->getRefId(), $print_view);
354 if(!$print_view)
355 {
356 $tpl->setContent($table->getHTML());
357 }
358 else
359 {
360 $tpl->setVariable("ADM_CONTENT", $table->getHTML());
361 echo $tpl->get("DEFAULT", false, false, false, false, false, false);
362 exit();
363 }
364 }
365
370 {
371 global $tpl;
372
373 if($this->isAnonymized())
374 {
375 ilUtil::sendFailure($this->lng->txt('permission_denied'));
376 return;
377 }
378
379
380 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lp_loo.html','Services/Tracking');
381
382 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
383 $info = new ilInfoScreenGUI($this);
384 $info->setFormAction($this->ctrl->getFormAction($this));
385 if($this->__showObjectDetails($info, $this->details_obj_id))
386 {
387 $this->tpl->setCurrentBlock("info");
388 $this->tpl->setVariable("INFO_TABLE",$info->getHTML());
389 $this->tpl->parseCurrentBlock();
390 }
391
392 include_once("./Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php");
393 $table = new ilTrMatrixTableGUI($this, "showUserObjectMatrix", $this->getRefId());
394 $this->tpl->setVariable('LP_OBJECTS', $table->getHTML());
395 $this->tpl->setVariable('LEGEND', $this->__getLegendHTML());
396 }
397}
398?>
$_GET["client_id"]
Class ilInfoScreenGUI.
showObjectSummary()
Show object-based summarized tracking data.
__showUsersList($a_print_view=false)
ilLPListOfObjectsGUI($a_mode, $a_ref_id)
showUserObjectMatrix()
Show object user matrix.
__showObjectDetails(&$info, $item_id=0, $add_section=true)
show details about current object.
__showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
static getInstance($a_obj_id)
Learning progress table: One object, rows: users, columns: properties Example: A course,...
Build table list for objects of given user.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: login.php:54
$cmd
Definition: sahs_server.php:35
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
global $ilUser
Definition: imgupload.php:15