26 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
27 include_once
'./Services/Tracking/classes/class.ilLMStatistics.php';
46 $q =
"SELECT obj_id, type,title FROM object_data WHERE type ='lm' and obj_id=".$ilDB->quote($this->obj_id ,
'integer');
50 $LehrmodulID[$Lehrmodulanz] =
$row[0];
51 $rLehrmodulID[
$row[0]] = $Lehrmodulanz;
52 $LehrmodulName[$Lehrmodulanz] = $row[2];
55 $_SESSION[
"il_track_rlm_id"] = $rLehrmodulID;
56 $_SESSION[
"il_track_lm_name"] = $LehrmodulName;
58 $q =
"SELECT obj_id,title,type,lm_id FROM lm_data WHERE type='pg'";
61 $LMSeitenanz[$rLehrmodulID[
$row[3]]]++;
64 $year = array (2004, 2005, 2006, 2007, 2008, 2009, 2010);
65 $month = array (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
66 $day = array (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
68 $tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"Services/Tracking/templates/default/tpl.lm_statistics_settings.html");
71 $tpl->setVariable(
"SEARCH_ACTION", $this->ctrl->getLinkTargetByClass(
'illmstatisticsgui',
''));
72 $tpl->setVariable(
"TXT_TRACKING_DATA", $lng->txt(
"tracking_data"));
73 $tpl->setVariable(
"TXT_TIME_SEGMENT", $lng->txt(
"time_segment"));
74 $tpl->setVariable(
"TXT_STATISTIC", $lng->txt(
"statistic"));
75 $tpl->setVariable(
"TXT_STATISTIC_H", $lng->txt(
"stats_pages_statisics"));
76 $tpl->setVariable(
"TXT_STATISTIC_D", $lng->txt(
"stats_chapter_statisics"));
77 $tpl->setVariable(
"TXT_STATISTIC_O", $lng->txt(
"stats_sessions_statisics"));
78 $tpl->setVariable(
"TXT_STATISTIC_U", $lng->txt(
"stats_navigation"));
79 $tpl->setVariable(
"TXT_USER_LANGUAGE", $lng->txt(
"user_language"));
80 $tpl->setVariable(
"TXT_LM", $lng->txt(
"lm"));
81 $tpl->setVariable(
"TXT_SHOW_TR_DATA", $lng->txt(
"query_data"));
82 $tpl->setVariable(
"TXT_SHOW_TR_DATA2", $lng->txt(
"stats_new_selection"));
83 $tpl->setVariable(
"TXT_TRACKED_OBJECTS", $lng->txt(
"tracked_objects"));
84 $tpl->setVariable(
"TXT_TRACKED_USER", $lng->txt(
"stats_tracked_user"));
87 $tpl->setVariable(
"TXT_ALLE", $lng->txt(
"stats_all"));
88 $tpl->setVariable(
"TXT_AUSWAHL", $lng->txt(
"stats_choice"));
101 $languages = $lng->getInstalledLanguages();
103 $tpl->setCurrentBlock(
"lm_selection");
104 $_SESSION[
"il_track_lm"] = $this->obj_id;
105 $tpl->setVariable(
"LM_ID", $LehrmodulID[1]);
106 $tpl->setVariable(
"LM_DESC", substr($LehrmodulName[1], 0, 40).
" (S:".$LMSeitenanz[1].
")");
107 $tpl->parseCurrentBlock();
109 if (
$_SESSION[
"il_track_stat2"] ==
"choice") {
110 $tpl->setVariable(
"CHC_CHK",
" checked=\"1\" ");
113 $tpl->setVariable(
"ALL_CHK",
" checked=\"1\" ");
116 $user_IDs =
$_SESSION[
"userSelected_stat"];
119 $tpl->setCurrentBlock(
"user_selection");
121 if (count($user_IDs) > 0) {
122 foreach (
$_SESSION[
"userSelected_stat"] as $result_id) {
123 $tpl->setVariable(
"USER1", $result_id);
124 $tpl->setVariable(
"USER2", $result_id);
127 $tpl->setCurrentBlock(
"user_selection");
128 $tpl->setVariable(
"USER1",
"Alle");
129 $tpl->setVariable(
"USER2",
"Alle");
132 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
135 $tpl->setVariable (
"DISABLED",
"disabled");
136 $tpl->setVariable(
"ALL_CHK",
" checked=\"1\" ");
137 $tpl->setVariable(
"CHC_CHK",
"");
139 $tpl->setVariable(
"INFO1", $lng->txt(stats_current).
": ".count(
$_SESSION[
"userSelected_stat"]).
" ".$lng->txt(
"stats_user_selected"));
142 $tpl->parseCurrentBlock();
145 foreach ($year as
$key) {
146 $tpl->setCurrentBlock(
"fromyear_selection");
147 $tpl->setVariable(
"YEARFR", $key);
148 $tpl->setVariable(
"YEARF", $key);
149 if (
$_SESSION[
"il_track_yearf"] == $key) {
150 $tpl->setVariable(
"YEARF_SEL",
" selected=\"1\" ");
152 $tpl->parseCurrentBlock();
154 foreach ($month as $key) {
155 $tpl->setCurrentBlock(
"frommonth_selection");
156 $tpl->setVariable(
"MONTHFR", $key);
157 $tpl->setVariable(
"MONTHF", $key);
158 if (
$_SESSION[
"il_track_monthf"] == $key) {
159 $tpl->setVariable(
"MONTHF_SEL",
" selected=\"1\" ");
161 $tpl->parseCurrentBlock();
163 foreach ($day as $key) {
164 $tpl->setCurrentBlock(
"fromday_selection");
165 $tpl->setVariable(
"DAYFR", $key);
166 $tpl->setVariable(
"DAYF", $key);
167 if (
$_SESSION[
"il_track_dayf"] == $key) {
168 $tpl->setVariable(
"DAYF_SEL",
" selected=\"1\" ");
170 $tpl->parseCurrentBlock();
173 foreach ($day as $key) {
174 $tpl->setCurrentBlock(
"today_selection");
175 $tpl->setVariable(
"DAYTO", $key);
176 $tpl->setVariable(
"DAYT", $key);
177 if (
$_SESSION[
"il_track_dayt"] == $key) {
178 $tpl->setVariable(
"DAYT_SEL",
" selected=\"1\" ");
180 $tpl->parseCurrentBlock();
182 foreach ($month as $key) {
183 $tpl->setCurrentBlock(
"tomonth_selection");
184 $tpl->setVariable(
"MONTHTO", $key);
185 $tpl->setVariable(
"MONTHT", $key);
186 if (
$_SESSION[
"il_track_montht"] == $key) {
187 $tpl->setVariable(
"MONTHT_SEL",
" selected=\"1\" ");
189 $tpl->parseCurrentBlock();
191 foreach ($year as $key) {
192 $tpl->setCurrentBlock(
"toyear_selection");
193 $tpl->setVariable(
"YEARTO", $key);
194 $tpl->setVariable(
"YEART", $key);
195 if (
$_SESSION[
"il_track_yeart"] == $key) {
196 $tpl->setVariable(
"YEART_SEL",
" selected=\"1\" ");
198 $tpl->parseCurrentBlock();
201 $tpl->setCurrentBlock(
"language_selection");
202 $tpl->setVariable(
"LANG", $lng->txt(
"any_language"));
203 $tpl->setVariable(
"LANGSHORT",
"0");
204 $tpl->parseCurrentBlock();
205 foreach ($languages as $lang_key) {
206 $tpl->setCurrentBlock(
"language_selection");
207 $tpl->setVariable(
"LANG", $lng->txt(
"lang_".$lang_key));
208 $tpl->setVariable(
"LANGSHORT", $lang_key);
209 if (
$_SESSION[
"il_track_language"] == $lang_key) {
210 $tpl->setVariable(
"LANG_SEL",
" selected=\"1\" ");
212 $tpl->parseCurrentBlock();
216 $tpl->setVariable(
"D_CHK",
" checked=\"1\" ");
219 $tpl->setVariable(
"H_CHK",
" checked=\"1\" ");
222 $tpl->setVariable(
"O_CHK",
" checked=\"1\" ");
225 $tpl->setVariable(
"U_CHK",
" checked=\"1\" ");
234 require_once
"./Services/Tracking/classes/class.ilLMStatistics.php";
236 if (
$_POST[
"stat"] ==
'u') {
237 $this->lm_statistics->outputApplet();
239 $this->lm_statistics->outputHTML();
249 $this->lng->loadLanguageModule(
'search');
252 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
253 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
256 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_members_search.html");
258 $this->tpl->setVariable(
"F_ACTION", $this->ctrl->getFormAction($this));
259 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR", $this->lng->txt(
"grp_search_members"));
260 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM", $this->lng->txt(
"search_search_term"));
261 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"grp_search_str"] ?
$_SESSION[
"grp_search_str"] :
"");
262 $this->tpl->setVariable(
"SEARCH_FOR", $this->lng->txt(
"exc_search_for"));
263 $this->tpl->setVariable(
"SEARCH_ROW_TXT_USER", $this->lng->txt(
"exc_users"));
264 $this->tpl->setVariable(
"SEARCH_ROW_TXT_ROLE", $this->lng->txt(
"exc_roles"));
265 $this->tpl->setVariable(
"SEARCH_ROW_TXT_GROUP", $this->lng->txt(
"exc_groups"));
266 $this->tpl->setVariable(
"BTN2_VALUE", $this->lng->txt(
"cancel"));
267 $this->tpl->setVariable(
"BTN1_VALUE", $this->lng->txt(
"search"));
269 $usr = (
$_POST[
"search_for"] ==
"usr" ||
$_POST[
"search_for"] ==
"") ? 1 : 0;
270 $grp = (
$_POST[
"search_for"] ==
"grp") ? 1 : 0;
271 $role = (
$_POST[
"search_for"] ==
"role") ? 1 : 0;
280 $return_location =
"members";
290 global $rbacsystem, $tree;
296 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
297 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
300 if (!isset (
$_POST[
"search_for"]) or !isset (
$_POST[
"search_str"])) {
314 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
315 $this->
__showButton(
"searchUserForm", $this->lng->txt(
"grp_new_search"));
318 $f_result = array ();
320 switch (
$_POST[
"search_for"]) {
327 $user_ids[$counter] = $user[
"id"];
330 $f_result[$counter][] = $tmp_obj->getLogin();
331 $f_result[$counter][] = $tmp_obj->getFirstname();
332 $f_result[$counter][] = $tmp_obj->getLastname();
345 if ($role[
"id"] == ANONYMOUS_ROLE_ID) {
354 if ($tmp_obj->getCountMembers() == 0) {
358 $role_ids[$counter] = $role[
"id"];
361 $f_result[$counter][] = array ($tmp_obj->getTitle(), $tmp_obj->getDescription());
362 $f_result[$counter][] = $tmp_obj->getCountMembers();
374 if (!$tree->isInTree($group[
"id"])) {
383 if ($tmp_obj->getId() == $this->
object->getId()) {
387 $grp_ids[$counter] = $group[
"id"];
390 $f_result[$counter][] = array ($tmp_obj->getTitle(), $tmp_obj->getDescription());
391 $f_result[$counter][] = $tmp_obj->getCountMembers();
397 if (!count($f_result)) {
399 $this->searchUserFormObject();
412 function __search($a_search_string, $a_search_for) {
413 include_once (
"classes/class.ilSearch.php");
415 $this->lng->loadLanguageModule(
"content");
417 $search->setPerformUpdate(
false);
419 $search->setCombination(
"and");
420 $search->setSearchFor(array (0 => $a_search_for));
421 $search->setSearchType(
'new');
423 if ($search->validate($message))
425 $search->performSearch();
430 $this->ctrl->redirect($this,
"searchUserForm");
433 return $search->getResultByType($a_search_for);
437 $return_to =
"searchUserForm";
439 if ($a_cmd ==
"listUsersRole" or $a_cmd ==
"listUsersGroup") {
440 $return_to =
"search";
444 $tpl = & $tbl->getTemplateObject();
447 $tpl->setCurrentBlock(
"tbl_form_header");
448 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
449 $tpl->parseCurrentBlock();
451 $tpl->setCurrentBlock(
"tbl_action_btn");
452 $tpl->setVariable(
"BTN_NAME", $return_to);
453 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"back"));
454 $tpl->parseCurrentBlock();
456 $tpl->setCurrentBlock(
"tbl_action_btn");
457 $tpl->setVariable(
"BTN_NAME",
"addUser");
458 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"add"));
459 $tpl->parseCurrentBlock();
461 if (!empty ($a_user_ids)) {
463 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
464 $tpl->setVariable(
"JS_VARNAME",
"user");
466 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
467 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
468 $tpl->parseCurrentBlock();
471 $tpl->setCurrentBlock(
"tbl_action_row");
472 $tpl->setVariable(
"COLUMN_COUNTS", 5);
474 $tpl->parseCurrentBlock();
476 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr_b.gif", $this->lng->txt(
"grp_header_edit_members"));
477 $tbl->setHeaderNames(array (
"", $this->lng->txt(
"username"), $this->lng->txt(
"firstname"), $this->lng->txt(
"lastname"), $this->lng->txt(
"last_visit")));
478 $tbl->setHeaderVars(array (
"",
"login",
"firstname",
"lastname",
"last_visit"), array (
"ref_id" => $this->ref_id,
"cmd" => $a_cmd,
"cmdClass" =>
"ilobjgroupgui",
"cmdNode" =>
$_GET[
"cmdNode"]));
480 $tbl->setColumnWidth(array (
"",
"33%",
"33%",
"33%"));
485 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE", $tbl->tpl->get());
492 $tpl = & $tbl->getTemplateObject();
494 $tpl->setCurrentBlock(
"tbl_form_header");
495 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
496 $tpl->parseCurrentBlock();
498 $tpl->setCurrentBlock(
"tbl_action_btn");
499 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
500 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"back"));
501 $tpl->parseCurrentBlock();
503 $tpl->setCurrentBlock(
"tbl_action_btn");
504 $tpl->setVariable(
"BTN_NAME",
"listUsersRole");
505 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"grp_list_users"));
506 $tpl->parseCurrentBlock();
508 if (!empty ($a_role_ids)) {
510 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
511 $tpl->setVariable(
"JS_VARNAME",
"role");
513 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
514 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
515 $tpl->parseCurrentBlock();
518 $tpl->setCurrentBlock(
"tbl_action_row");
519 $tpl->setVariable(
"COLUMN_COUNTS", 5);
521 $tpl->parseCurrentBlock();
523 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr_b.gif", $this->lng->txt(
"grp_header_edit_members"));
524 $tbl->setHeaderNames(array (
"", $this->lng->txt(
"obj_role"), $this->lng->txt(
"grp_count_members")));
525 $tbl->setHeaderVars(array (
"",
"title",
"nr_members"), array (
"ref_id" => $this->ref_id,
"cmd" =>
"search",
"cmdClass" =>
"ilobjgroupgui",
"cmdNode" =>
$_GET[
"cmdNode"]));
527 $tbl->setColumnWidth(array (
"",
"80%",
"19%"));
532 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE", $tbl->tpl->get());
546 case "clipboardObject":
547 $offset =
$_GET[
"offset"];
548 $order =
$_GET[
"sort_by"];
549 $direction =
$_GET[
"sort_order"];
550 $tbl->disable(
"footer");
554 $offset =
$_GET[
"offset"];
555 $order =
$_GET[
"sort_by"];
556 $direction =
$_GET[
"sort_order"];
560 $tbl->setOrderColumn($order);
561 $tbl->setOrderDirection($direction);
562 $tbl->setOffset($offset);
563 $tbl->setLimit(
$_GET[
"limit"]);
564 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
565 $tbl->setData($result_set);
570 $tpl = & $tbl->getTemplateObject();
572 $tpl->setCurrentBlock(
"tbl_form_header");
573 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
574 $tpl->parseCurrentBlock();
576 $tpl->setCurrentBlock(
"tbl_action_btn");
577 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
578 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"back"));
579 $tpl->parseCurrentBlock();
581 $tpl->setCurrentBlock(
"tbl_action_btn");
582 $tpl->setVariable(
"BTN_NAME",
"listUsersGroup");
583 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"grp_list_users"));
584 $tpl->parseCurrentBlock();
586 if (!empty ($a_grp_ids)) {
588 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
589 $tpl->setVariable(
"JS_VARNAME",
"group");
591 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
592 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
593 $tpl->parseCurrentBlock();
596 $tpl->setCurrentBlock(
"tbl_action_row");
597 $tpl->setVariable(
"COLUMN_COUNTS", 5);
599 $tpl->parseCurrentBlock();
601 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr_b.gif", $this->lng->txt(
"grp_header_edit_members"));
602 $tbl->setHeaderNames(array (
"", $this->lng->txt(
"obj_grp"), $this->lng->txt(
"grp_count_members")));
603 $tbl->setHeaderVars(array (
"",
"title",
"nr_members"), array (
"ref_id" => $this->ref_id,
"cmd" =>
"search",
"cmdClass" =>
"ilobjgroupgui",
"cmdNode" =>
$_GET[
"cmdNode"]));
605 $tbl->setColumnWidth(array (
"",
"80%",
"19%"));
610 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE", $tbl->tpl->get());
615 global $rbacsystem, $rbacreview;
620 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
621 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
624 if (!is_array(
$_POST[
"role"])) {
626 $this->searchObject();
631 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
632 $this->
__showButton(
"searchUserForm", $this->lng->txt(
"grp_new_search"));
636 foreach (
$_POST[
"role"] as $role_id) {
637 $members = array_merge($rbacreview->assignedUsers($role_id), $members);
640 $members = array_unique($members);
644 $f_result = array ();
645 foreach ($members as
$user) {
650 if (!$tmp_obj->active) {
654 $user_ids[$counter] =
$user;
657 $f_result[$counter][] = $tmp_obj->getLogin();
658 $f_result[$counter][] = $tmp_obj->getLastname();
659 $f_result[$counter][] = $tmp_obj->getFirstname();
671 global $rbacsystem, $rbacreview, $tree;
676 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
677 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
680 if (!is_array(
$_POST[
"group"])) {
682 $this->searchObject();
687 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
688 $this->
__showButton(
"searchUserForm", $this->lng->txt(
"grp_new_search"));
692 foreach (
$_POST[
"group"] as $group_id) {
693 if (!$tree->isInTree($group_id)) {
700 $members = array_merge($tmp_obj->getGroupMemberIds(), $members);
705 $members = array_unique($members);
709 $f_result = array ();
710 foreach ($members as
$user) {
715 $user_ids[$counter] =
$user;
718 $f_result[$counter][] = $tmp_obj->getLogin();
719 $f_result[$counter][] = $tmp_obj->getLastname();
720 $f_result[$counter][] = $tmp_obj->getFirstname();
733 $user_ids =
$_POST[
"user"];
735 if (empty ($user_ids[0])) {
738 $this->ilErr->raiseError($this->lng->txt(
"no_checkbox"), $this->ilErr->MESSAGE);
752 if (isset(
$_POST[
"cmd"][
"searchUserForm"]))
754 $cmd =
"searchUserForm";
757 $cmd =
"outputStatistics";
758 }
else switch ($this->ctrl->getNextClass()) {