26 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
27 include_once
'./Services/Tracking/classes/class.ilLPObjSettings.php';
28 include_once
'./Services/Tracking/classes/class.ilLMStatistics.php';
47 $q =
"SELECT obj_id, type,title FROM object_data WHERE type ='lm' and obj_id=".$ilDB->quote($this->obj_id ,
'integer');
48 $result = $ilias->db->query($q);
51 $LehrmodulID[$Lehrmodulanz] =
$row[0];
52 $rLehrmodulID[
$row[0]] = $Lehrmodulanz;
53 $LehrmodulName[$Lehrmodulanz] = $row[2];
56 $_SESSION[
"il_track_rlm_id"] = $rLehrmodulID;
57 $_SESSION[
"il_track_lm_name"] = $LehrmodulName;
59 $q =
"SELECT obj_id,title,type,lm_id FROM lm_data WHERE type='pg'";
60 $result = $ilias->db->query($q);
62 $LMSeitenanz[$rLehrmodulID[
$row[3]]]++;
65 $year = range(2004, date(
"Y"));
66 $month = range(1, 12);
69 $tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_statistics_settings.html",
"Services/Tracking");
72 $tpl->setVariable(
"SEARCH_ACTION", $this->ctrl->getLinkTargetByClass(
'illmstatisticsgui',
''));
73 $tpl->setVariable(
"TXT_TRACKING_DATA", $lng->txt(
"tracking_data"));
74 $tpl->setVariable(
"TXT_TIME_SEGMENT", $lng->txt(
"time_segment"));
75 $tpl->setVariable(
"TXT_STATISTIC", $lng->txt(
"statistic"));
76 $tpl->setVariable(
"TXT_STATISTIC_H", $lng->txt(
"stats_pages_statisics"));
77 $tpl->setVariable(
"TXT_STATISTIC_D", $lng->txt(
"stats_chapter_statisics"));
78 $tpl->setVariable(
"TXT_STATISTIC_O", $lng->txt(
"stats_sessions_statisics"));
79 $tpl->setVariable(
"TXT_STATISTIC_U", $lng->txt(
"stats_navigation"));
80 $tpl->setVariable(
"TXT_USER_LANGUAGE", $lng->txt(
"user_language"));
81 $tpl->setVariable(
"TXT_LM", $lng->txt(
"lm"));
82 $tpl->setVariable(
"TXT_SHOW_TR_DATA", $lng->txt(
"query_data"));
83 $tpl->setVariable(
"TXT_SHOW_TR_DATA2", $lng->txt(
"stats_new_selection"));
84 $tpl->setVariable(
"TXT_TRACKED_OBJECTS", $lng->txt(
"tracked_objects"));
85 $tpl->setVariable(
"TXT_TRACKED_USER", $lng->txt(
"stats_tracked_user"));
88 $tpl->setVariable(
"TXT_ALLE", $lng->txt(
"stats_all"));
89 $tpl->setVariable(
"TXT_AUSWAHL", $lng->txt(
"stats_choice"));
102 $languages = $lng->getInstalledLanguages();
104 $tpl->setCurrentBlock(
"lm_selection");
105 $_SESSION[
"il_track_lm"] = $this->obj_id;
106 $tpl->setVariable(
"LM_ID", $LehrmodulID[1]);
107 $tpl->setVariable(
"LM_DESC", substr($LehrmodulName[1], 0, 40).
" (S:".$LMSeitenanz[1].
")");
108 $tpl->parseCurrentBlock();
110 if (
$_SESSION[
"il_track_stat2"] ==
"choice") {
111 $tpl->setVariable(
"CHC_CHK",
" checked=\"1\" ");
114 $tpl->setVariable(
"ALL_CHK",
" checked=\"1\" ");
117 $user_IDs =
$_SESSION[
"userSelected_stat"];
120 $tpl->setCurrentBlock(
"user_selection");
122 if (count($user_IDs) > 0) {
123 foreach (
$_SESSION[
"userSelected_stat"] as $result_id) {
124 $tpl->setVariable(
"USER1", $result_id);
125 $tpl->setVariable(
"USER2", $result_id);
128 $tpl->setCurrentBlock(
"user_selection");
129 $tpl->setVariable(
"USER1",
"Alle");
130 $tpl->setVariable(
"USER2",
"Alle");
133 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
136 $tpl->setVariable (
"DISABLED",
"disabled");
137 $tpl->setVariable(
"ALL_CHK",
" checked=\"1\" ");
138 $tpl->setVariable(
"CHC_CHK",
"");
140 $tpl->setVariable(
"INFO1", $lng->txt(stats_current).
": ".count(
$_SESSION[
"userSelected_stat"]).
" ".$lng->txt(
"stats_user_selected"));
143 $tpl->parseCurrentBlock();
146 foreach ($year as $key) {
147 $tpl->setCurrentBlock(
"fromyear_selection");
148 $tpl->setVariable(
"YEARFR", $key);
149 $tpl->setVariable(
"YEARF", $key);
150 if (
$_SESSION[
"il_track_yearf"] == $key) {
151 $tpl->setVariable(
"YEARF_SEL",
" selected=\"1\" ");
153 $tpl->parseCurrentBlock();
155 foreach ($month as $key) {
156 $tpl->setCurrentBlock(
"frommonth_selection");
157 $tpl->setVariable(
"MONTHFR", $key);
158 $tpl->setVariable(
"MONTHF", $key);
159 if (
$_SESSION[
"il_track_monthf"] == $key) {
160 $tpl->setVariable(
"MONTHF_SEL",
" selected=\"1\" ");
162 $tpl->parseCurrentBlock();
164 foreach ($day as $key) {
165 $tpl->setCurrentBlock(
"fromday_selection");
166 $tpl->setVariable(
"DAYFR", $key);
167 $tpl->setVariable(
"DAYF", $key);
168 if (
$_SESSION[
"il_track_dayf"] == $key) {
169 $tpl->setVariable(
"DAYF_SEL",
" selected=\"1\" ");
171 $tpl->parseCurrentBlock();
174 foreach ($day as $key) {
175 $tpl->setCurrentBlock(
"today_selection");
176 $tpl->setVariable(
"DAYTO", $key);
177 $tpl->setVariable(
"DAYT", $key);
178 if (
$_SESSION[
"il_track_dayt"] == $key) {
179 $tpl->setVariable(
"DAYT_SEL",
" selected=\"1\" ");
181 $tpl->parseCurrentBlock();
183 foreach ($month as $key) {
184 $tpl->setCurrentBlock(
"tomonth_selection");
185 $tpl->setVariable(
"MONTHTO", $key);
186 $tpl->setVariable(
"MONTHT", $key);
187 if (
$_SESSION[
"il_track_montht"] == $key) {
188 $tpl->setVariable(
"MONTHT_SEL",
" selected=\"1\" ");
190 $tpl->parseCurrentBlock();
192 foreach ($year as $key) {
193 $tpl->setCurrentBlock(
"toyear_selection");
194 $tpl->setVariable(
"YEARTO", $key);
195 $tpl->setVariable(
"YEART", $key);
196 if (
$_SESSION[
"il_track_yeart"] == $key) {
197 $tpl->setVariable(
"YEART_SEL",
" selected=\"1\" ");
199 $tpl->parseCurrentBlock();
202 $tpl->setCurrentBlock(
"language_selection");
203 $tpl->setVariable(
"LANG", $lng->txt(
"any_language"));
204 $tpl->setVariable(
"LANGSHORT",
"0");
205 $tpl->parseCurrentBlock();
206 $lng->loadLanguageModule(
"meta");
207 foreach ($languages as $lang_key) {
208 $tpl->setCurrentBlock(
"language_selection");
209 $tpl->setVariable(
"LANG", $lng->txt(
"meta_l_".$lang_key));
210 $tpl->setVariable(
"LANGSHORT", $lang_key);
211 if (
$_SESSION[
"il_track_language"] == $lang_key) {
212 $tpl->setVariable(
"LANG_SEL",
" selected=\"1\" ");
214 $tpl->parseCurrentBlock();
218 $tpl->setVariable(
"D_CHK",
" checked=\"1\" ");
220 elseif (
$_SESSION[
"il_track_stat"] ==
"h") {
221 $tpl->setVariable(
"H_CHK",
" checked=\"1\" ");
223 elseif (
$_SESSION[
"il_track_stat"] ==
"o") {
224 $tpl->setVariable(
"O_CHK",
" checked=\"1\" ");
226 elseif (
$_SESSION[
"il_track_stat"] ==
"u") {
227 $tpl->setVariable(
"U_CHK",
" checked=\"1\" ");
236 require_once
"./Services/Tracking/classes/class.ilLMStatistics.php";
238 if (
$_POST[
"stat"] ==
'u') {
239 $this->lm_statistics->outputApplet();
241 $this->lm_statistics->outputHTML();
251 $this->lng->loadLanguageModule(
'search');
254 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
255 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
258 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_members_search.html",
261 $this->tpl->setVariable(
"F_ACTION", $this->ctrl->getFormAction($this));
262 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR", $this->lng->txt(
"grp_search_members"));
263 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM", $this->lng->txt(
"search_search_term"));
264 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"grp_search_str"] ?
$_SESSION[
"grp_search_str"] :
"");
265 $this->tpl->setVariable(
"SEARCH_FOR", $this->lng->txt(
"exc_search_for"));
266 $this->tpl->setVariable(
"SEARCH_ROW_TXT_USER", $this->lng->txt(
"exc_users"));
267 $this->tpl->setVariable(
"SEARCH_ROW_TXT_ROLE", $this->lng->txt(
"exc_roles"));
268 $this->tpl->setVariable(
"SEARCH_ROW_TXT_GROUP", $this->lng->txt(
"exc_groups"));
269 $this->tpl->setVariable(
"BTN2_VALUE", $this->lng->txt(
"cancel"));
270 $this->tpl->setVariable(
"BTN1_VALUE", $this->lng->txt(
"search"));
272 $usr = (
$_POST[
"search_for"] ==
"usr" ||
$_POST[
"search_for"] ==
"") ? 1 : 0;
273 $grp = (
$_POST[
"search_for"] ==
"grp") ? 1 : 0;
274 $role = (
$_POST[
"search_for"] ==
"role") ? 1 : 0;
283 $return_location =
"members";
293 global $rbacsystem, $tree;
299 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
300 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
303 if (!isset (
$_POST[
"search_for"]) or !isset (
$_POST[
"search_str"])) {
317 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html",
319 $this->
__showButton(
"searchUserForm", $this->lng->txt(
"grp_new_search"));
322 $f_result = array ();
324 switch (
$_POST[
"search_for"]) {
331 $user_ids[$counter] = $user[
"id"];
334 $f_result[$counter][] = $tmp_obj->getLogin();
335 $f_result[$counter][] = $tmp_obj->getFirstname();
336 $f_result[$counter][] = $tmp_obj->getLastname();
349 if ($role[
"id"] == ANONYMOUS_ROLE_ID) {
358 if ($tmp_obj->getCountMembers() == 0) {
362 $role_ids[$counter] = $role[
"id"];
365 $f_result[$counter][] = array ($tmp_obj->getTitle(), $tmp_obj->getDescription());
366 $f_result[$counter][] = $tmp_obj->getCountMembers();
378 if (!$tree->isInTree($group[
"id"])) {
387 if ($tmp_obj->getId() == $this->
object->getId()) {
391 $grp_ids[$counter] = $group[
"id"];
394 $f_result[$counter][] = array ($tmp_obj->getTitle(), $tmp_obj->getDescription());
395 $f_result[$counter][] = $tmp_obj->getCountMembers();
401 if (!count($f_result)) {
403 $this->searchUserFormObject();
416 function __search($a_search_string, $a_search_for) {
417 include_once (
"./Services/Search/classes/class.ilSearch.php");
419 $this->lng->loadLanguageModule(
"content");
421 $search->setPerformUpdate(
false);
423 $search->setCombination(
"and");
424 $search->setSearchFor(array (0 => $a_search_for));
425 $search->setSearchType(
'new');
427 if ($search->validate($message))
429 $search->performSearch();
434 $this->ctrl->redirect($this,
"searchUserForm");
437 return $search->getResultByType($a_search_for);
441 $return_to =
"searchUserForm";
443 if ($a_cmd ==
"listUsersRole" or $a_cmd ==
"listUsersGroup") {
444 $return_to =
"search";
448 $tpl = & $tbl->getTemplateObject();
451 $tpl->setCurrentBlock(
"tbl_form_header");
452 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
453 $tpl->parseCurrentBlock();
455 $tpl->setCurrentBlock(
"tbl_action_btn");
456 $tpl->setVariable(
"BTN_NAME", $return_to);
457 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"back"));
458 $tpl->parseCurrentBlock();
460 $tpl->setCurrentBlock(
"tbl_action_btn");
461 $tpl->setVariable(
"BTN_NAME",
"addUser");
462 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"add"));
463 $tpl->parseCurrentBlock();
465 if (!empty ($a_user_ids)) {
467 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
468 $tpl->setVariable(
"JS_VARNAME",
"user");
470 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
471 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
472 $tpl->parseCurrentBlock();
475 $tpl->setCurrentBlock(
"tbl_action_row");
476 $tpl->setVariable(
"COLUMN_COUNTS", 5);
478 $tpl->parseCurrentBlock();
480 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr_b.png", $this->lng->txt(
"grp_header_edit_members"));
481 $tbl->setHeaderNames(array (
"", $this->lng->txt(
"username"), $this->lng->txt(
"firstname"), $this->lng->txt(
"lastname"), $this->lng->txt(
"last_visit")));
482 $tbl->setHeaderVars(array (
"",
"login",
"firstname",
"lastname",
"last_visit"), array (
"ref_id" => $this->ref_id,
"cmd" => $a_cmd,
"cmdClass" =>
"ilobjgroupgui",
"cmdNode" =>
$_GET[
"cmdNode"]));
484 $tbl->setColumnWidth(array (
"",
"33%",
"33%",
"33%"));
489 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE", $tbl->tpl->get());
496 $tpl = & $tbl->getTemplateObject();
498 $tpl->setCurrentBlock(
"tbl_form_header");
499 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
500 $tpl->parseCurrentBlock();
502 $tpl->setCurrentBlock(
"tbl_action_btn");
503 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
504 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"back"));
505 $tpl->parseCurrentBlock();
507 $tpl->setCurrentBlock(
"tbl_action_btn");
508 $tpl->setVariable(
"BTN_NAME",
"listUsersRole");
509 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"grp_list_users"));
510 $tpl->parseCurrentBlock();
512 if (!empty ($a_role_ids)) {
514 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
515 $tpl->setVariable(
"JS_VARNAME",
"role");
517 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
518 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
519 $tpl->parseCurrentBlock();
522 $tpl->setCurrentBlock(
"tbl_action_row");
523 $tpl->setVariable(
"COLUMN_COUNTS", 5);
525 $tpl->parseCurrentBlock();
527 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr_b.png", $this->lng->txt(
"grp_header_edit_members"));
528 $tbl->setHeaderNames(array (
"", $this->lng->txt(
"obj_role"), $this->lng->txt(
"grp_count_members")));
529 $tbl->setHeaderVars(array (
"",
"title",
"nr_members"), array (
"ref_id" => $this->ref_id,
"cmd" =>
"search",
"cmdClass" =>
"ilobjgroupgui",
"cmdNode" =>
$_GET[
"cmdNode"]));
531 $tbl->setColumnWidth(array (
"",
"80%",
"19%"));
536 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE", $tbl->tpl->get());
550 case "clipboardObject":
551 $offset =
$_GET[
"offset"];
552 $order =
$_GET[
"sort_by"];
553 $direction =
$_GET[
"sort_order"];
554 $tbl->disable(
"footer");
558 $offset =
$_GET[
"offset"];
559 $order =
$_GET[
"sort_by"];
560 $direction =
$_GET[
"sort_order"];
564 $tbl->setOrderColumn($order);
565 $tbl->setOrderDirection($direction);
566 $tbl->setOffset($offset);
567 $tbl->setLimit(
$_GET[
"limit"]);
568 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
569 $tbl->setData($result_set);
574 $tpl = & $tbl->getTemplateObject();
576 $tpl->setCurrentBlock(
"tbl_form_header");
577 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
578 $tpl->parseCurrentBlock();
580 $tpl->setCurrentBlock(
"tbl_action_btn");
581 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
582 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"back"));
583 $tpl->parseCurrentBlock();
585 $tpl->setCurrentBlock(
"tbl_action_btn");
586 $tpl->setVariable(
"BTN_NAME",
"listUsersGroup");
587 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"grp_list_users"));
588 $tpl->parseCurrentBlock();
590 if (!empty ($a_grp_ids)) {
592 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
593 $tpl->setVariable(
"JS_VARNAME",
"group");
595 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
596 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
597 $tpl->parseCurrentBlock();
600 $tpl->setCurrentBlock(
"tbl_action_row");
601 $tpl->setVariable(
"COLUMN_COUNTS", 5);
603 $tpl->parseCurrentBlock();
605 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr_b.png", $this->lng->txt(
"grp_header_edit_members"));
606 $tbl->setHeaderNames(array (
"", $this->lng->txt(
"obj_grp"), $this->lng->txt(
"grp_count_members")));
607 $tbl->setHeaderVars(array (
"",
"title",
"nr_members"), array (
"ref_id" => $this->ref_id,
"cmd" =>
"search",
"cmdClass" =>
"ilobjgroupgui",
"cmdNode" =>
$_GET[
"cmdNode"]));
609 $tbl->setColumnWidth(array (
"",
"80%",
"19%"));
614 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE", $tbl->tpl->get());
619 global $rbacsystem, $rbacreview;
624 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
625 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
628 if (!is_array(
$_POST[
"role"])) {
630 $this->searchObject();
635 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html",
637 $this->
__showButton(
"searchUserForm", $this->lng->txt(
"grp_new_search"));
641 foreach (
$_POST[
"role"] as $role_id) {
642 $members = array_merge($rbacreview->assignedUsers($role_id), $members);
645 $members = array_unique($members);
649 $f_result = array ();
650 foreach ($members as $user) {
655 if (!$tmp_obj->active) {
659 $user_ids[$counter] = $user;
662 $f_result[$counter][] = $tmp_obj->getLogin();
663 $f_result[$counter][] = $tmp_obj->getLastname();
664 $f_result[$counter][] = $tmp_obj->getFirstname();
676 global $rbacsystem, $rbacreview, $tree;
681 if (!$rbacsystem->checkAccess(
"write", $this->ref_id)) {
682 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
685 if (!is_array(
$_POST[
"group"])) {
687 $this->searchObject();
692 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html",
694 $this->
__showButton(
"searchUserForm", $this->lng->txt(
"grp_new_search"));
698 foreach (
$_POST[
"group"] as $group_id) {
699 if (!$tree->isInTree($group_id)) {
706 $members = array_merge($tmp_obj->getGroupMemberIds(), $members);
711 $members = array_unique($members);
715 $f_result = array ();
716 foreach ($members as $user) {
721 $user_ids[$counter] = $user;
724 $f_result[$counter][] = $tmp_obj->getLogin();
725 $f_result[$counter][] = $tmp_obj->getLastname();
726 $f_result[$counter][] = $tmp_obj->getFirstname();
739 $user_ids =
$_POST[
"user"];
741 if (empty ($user_ids[0])) {
744 $this->ilErr->raiseError($this->lng->txt(
"no_checkbox"), $this->ilErr->MESSAGE);
758 if (isset(
$_POST[
"cmd"][
"searchUserForm"]))
760 $cmd =
"searchUserForm";
761 } elseif (isset(
$_POST[
"cmd"][
"outputStatistics"]))
763 $cmd =
"outputStatistics";
764 }
else switch ($this->ctrl->getNextClass()) {