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=".$this->obj_id;
47 $result = $ilias->db->query($q);
48 while ($row =
$result->fetchRow()) {
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'";
59 $result = $ilias->db->query($q);
60 while ($row =
$result->fetchRow()) {
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\" ");
218 elseif (
$_SESSION[
"il_track_stat"] ==
"h") {
219 $tpl->setVariable(
"H_CHK",
" checked=\"1\" ");
221 elseif (
$_SESSION[
"il_track_stat"] ==
"o") {
222 $tpl->setVariable(
"O_CHK",
" checked=\"1\" ");
224 elseif (
$_SESSION[
"il_track_stat"] ==
"u") {
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";
291 global $rbacsystem, $tree;
293 $_SESSION[
"grp_search_str"] = $_POST[
"search_str"] = $_POST[
"search_str"] ? $_POST[
"search_str"] :
$_SESSION[
"grp_search_str"];
294 $_SESSION[
"grp_search_for"] = $_POST[
"search_for"] = $_POST[
"search_for"] ? $_POST[
"search_for"] :
$_SESSION[
"grp_search_for"];
297 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
298 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
301 if (!isset ($_POST[
"search_for"]) or !isset ($_POST[
"search_str"])) {
315 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
316 $this->
__showButton(
"searchUserForm", $this->lng->txt(
"grp_new_search"));
319 $f_result = array ();
321 switch ($_POST[
"search_for"]) {
328 $user_ids[$counter] = $user[
"id"];
331 $f_result[$counter][] = $tmp_obj->getLogin();
332 $f_result[$counter][] = $tmp_obj->getFirstname();
333 $f_result[$counter][] = $tmp_obj->getLastname();
346 if ($role[
"id"] == ANONYMOUS_ROLE_ID) {
355 if ($tmp_obj->getCountMembers() == 0) {
359 $role_ids[$counter] = $role[
"id"];
362 $f_result[$counter][] = array ($tmp_obj->getTitle(), $tmp_obj->getDescription());
363 $f_result[$counter][] = $tmp_obj->getCountMembers();
375 if (!$tree->isInTree($group[
"id"])) {
384 if ($tmp_obj->getId() == $this->
object->getId()) {
388 $grp_ids[$counter] = $group[
"id"];
391 $f_result[$counter][] = array ($tmp_obj->getTitle(), $tmp_obj->getDescription());
392 $f_result[$counter][] = $tmp_obj->getCountMembers();
398 if (!count($f_result)) {
400 $this->searchUserFormObject();
414 function __search($a_search_string, $a_search_for) {
415 include_once (
"classes/class.ilSearch.php");
417 $this->lng->loadLanguageModule(
"content");
419 $search->setPerformUpdate(
false);
421 $search->setCombination(
"and");
422 $search->setSearchFor(array (0 => $a_search_for));
423 $search->setSearchType(
'new');
425 if ($search->validate($message)) {
426 $search->performSearch();
429 $this->ctrl->redirect($this,
"searchUserForm");
432 return $search->getResultByType($a_search_for);
436 $return_to =
"searchUserForm";
438 if ($a_cmd ==
"listUsersRole" or $a_cmd ==
"listUsersGroup") {
439 $return_to =
"search";
443 $tpl = & $tbl->getTemplateObject();
446 $tpl->setCurrentBlock(
"tbl_form_header");
447 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
448 $tpl->parseCurrentBlock();
450 $tpl->setCurrentBlock(
"tbl_action_btn");
451 $tpl->setVariable(
"BTN_NAME", $return_to);
452 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"back"));
453 $tpl->parseCurrentBlock();
455 $tpl->setCurrentBlock(
"tbl_action_btn");
456 $tpl->setVariable(
"BTN_NAME",
"addUser");
457 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"add"));
458 $tpl->parseCurrentBlock();
460 if (!empty ($a_user_ids)) {
462 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
463 $tpl->setVariable(
"JS_VARNAME",
"user");
465 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
466 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
467 $tpl->parseCurrentBlock();
470 $tpl->setCurrentBlock(
"tbl_action_row");
471 $tpl->setVariable(
"COLUMN_COUNTS", 5);
473 $tpl->parseCurrentBlock();
475 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr_b.gif", $this->lng->txt(
"grp_header_edit_members"));
476 $tbl->setHeaderNames(array (
"", $this->lng->txt(
"username"), $this->lng->txt(
"firstname"), $this->lng->txt(
"lastname"), $this->lng->txt(
"last_visit")));
477 $tbl->setHeaderVars(array (
"",
"login",
"firstname",
"lastname",
"last_visit"), array (
"ref_id" => $this->ref_id,
"cmd" => $a_cmd,
"cmdClass" =>
"ilobjgroupgui",
"cmdNode" =>
$_GET[
"cmdNode"]));
479 $tbl->setColumnWidth(array (
"",
"33%",
"33%",
"33%"));
484 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE", $tbl->tpl->get());
491 $tpl = & $tbl->getTemplateObject();
493 $tpl->setCurrentBlock(
"tbl_form_header");
494 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
495 $tpl->parseCurrentBlock();
497 $tpl->setCurrentBlock(
"tbl_action_btn");
498 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
499 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"back"));
500 $tpl->parseCurrentBlock();
502 $tpl->setCurrentBlock(
"tbl_action_btn");
503 $tpl->setVariable(
"BTN_NAME",
"listUsersRole");
504 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"grp_list_users"));
505 $tpl->parseCurrentBlock();
507 if (!empty ($a_role_ids)) {
509 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
510 $tpl->setVariable(
"JS_VARNAME",
"role");
512 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
513 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
514 $tpl->parseCurrentBlock();
517 $tpl->setCurrentBlock(
"tbl_action_row");
518 $tpl->setVariable(
"COLUMN_COUNTS", 5);
520 $tpl->parseCurrentBlock();
522 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr_b.gif", $this->lng->txt(
"grp_header_edit_members"));
523 $tbl->setHeaderNames(array (
"", $this->lng->txt(
"obj_role"), $this->lng->txt(
"grp_count_members")));
524 $tbl->setHeaderVars(array (
"",
"title",
"nr_members"), array (
"ref_id" => $this->ref_id,
"cmd" =>
"search",
"cmdClass" =>
"ilobjgroupgui",
"cmdNode" =>
$_GET[
"cmdNode"]));
526 $tbl->setColumnWidth(array (
"",
"80%",
"19%"));
531 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE", $tbl->tpl->get());
545 case "clipboardObject":
546 $offset =
$_GET[
"offset"];
547 $order =
$_GET[
"sort_by"];
548 $direction =
$_GET[
"sort_order"];
549 $tbl->disable(
"footer");
553 $offset =
$_GET[
"offset"];
554 $order =
$_GET[
"sort_by"];
555 $direction =
$_GET[
"sort_order"];
559 $tbl->setOrderColumn($order);
560 $tbl->setOrderDirection($direction);
561 $tbl->setOffset($offset);
562 $tbl->setLimit(
$_GET[
"limit"]);
563 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
564 $tbl->setData($result_set);
569 $tpl = & $tbl->getTemplateObject();
571 $tpl->setCurrentBlock(
"tbl_form_header");
572 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
573 $tpl->parseCurrentBlock();
575 $tpl->setCurrentBlock(
"tbl_action_btn");
576 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
577 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"back"));
578 $tpl->parseCurrentBlock();
580 $tpl->setCurrentBlock(
"tbl_action_btn");
581 $tpl->setVariable(
"BTN_NAME",
"listUsersGroup");
582 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"grp_list_users"));
583 $tpl->parseCurrentBlock();
585 if (!empty ($a_grp_ids)) {
587 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
588 $tpl->setVariable(
"JS_VARNAME",
"group");
590 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
591 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
592 $tpl->parseCurrentBlock();
595 $tpl->setCurrentBlock(
"tbl_action_row");
596 $tpl->setVariable(
"COLUMN_COUNTS", 5);
598 $tpl->parseCurrentBlock();
600 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr_b.gif", $this->lng->txt(
"grp_header_edit_members"));
601 $tbl->setHeaderNames(array (
"", $this->lng->txt(
"obj_grp"), $this->lng->txt(
"grp_count_members")));
602 $tbl->setHeaderVars(array (
"",
"title",
"nr_members"), array (
"ref_id" => $this->ref_id,
"cmd" =>
"search",
"cmdClass" =>
"ilobjgroupgui",
"cmdNode" =>
$_GET[
"cmdNode"]));
604 $tbl->setColumnWidth(array (
"",
"80%",
"19%"));
609 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE", $tbl->tpl->get());
614 global $rbacsystem, $rbacreview;
616 $_SESSION[
"grp_role"] = $_POST[
"role"] = $_POST[
"role"] ? $_POST[
"role"] :
$_SESSION[
"grp_role"];
619 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
620 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
623 if (!is_array($_POST[
"role"])) {
625 $this->searchObject();
630 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
631 $this->
__showButton(
"searchUserForm", $this->lng->txt(
"grp_new_search"));
635 foreach ($_POST[
"role"] as $role_id) {
636 $members = array_merge($rbacreview->assignedUsers($role_id), $members);
639 $members = array_unique($members);
643 $f_result = array ();
644 foreach ($members as
$user) {
649 if (!$tmp_obj->active) {
653 $user_ids[$counter] =
$user;
656 $f_result[$counter][] = $tmp_obj->getLogin();
657 $f_result[$counter][] = $tmp_obj->getLastname();
658 $f_result[$counter][] = $tmp_obj->getFirstname();
670 global $rbacsystem, $rbacreview, $tree;
672 $_SESSION[
"grp_group"] = $_POST[
"group"] = $_POST[
"group"] ? $_POST[
"group"] :
$_SESSION[
"grp_group"];
675 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
676 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
679 if (!is_array($_POST[
"group"])) {
681 $this->searchObject();
686 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
687 $this->
__showButton(
"searchUserForm", $this->lng->txt(
"grp_new_search"));
691 foreach ($_POST[
"group"] as $group_id) {
692 if (!$tree->isInTree($group_id)) {
699 $members = array_merge($tmp_obj->getGroupMemberIds(), $members);
704 $members = array_unique($members);
708 $f_result = array ();
709 foreach ($members as
$user) {
714 $user_ids[$counter] =
$user;
717 $f_result[$counter][] = $tmp_obj->getLogin();
718 $f_result[$counter][] = $tmp_obj->getLastname();
719 $f_result[$counter][] = $tmp_obj->getFirstname();
732 $user_ids = $_POST[
"user"];
734 if (empty ($user_ids[0])) {
737 $this->ilErr->raiseError($this->lng->txt(
"no_checkbox"), $this->ilErr->MESSAGE);
742 $_SESSION[
"userSelected_stat"] = $_POST[
"user"];
751 if (isset($_POST[
"cmd"][
"searchUserForm"]))
753 $cmd =
"searchUserForm";
754 } elseif (isset($_POST[
"cmd"][
"outputStatistics"]))
756 $cmd =
"outputStatistics";
757 }
else switch ($this->ctrl->getNextClass()) {