5 require_once
"./Services/Container/classes/class.ilContainerGUI.php";
38 $this->ctrl->saveParameter($this,array(
"ref_id",
"cmdClass"));
43 $this->lng->loadLanguageModule(
'crs');
45 $this->SEARCH_USER = 1;
46 $this->SEARCH_GROUP = 2;
47 $this->SEARCH_COURSE = 3;
55 case "deleteSubscribers":
59 case "addSubscribers":
60 $this->addSubscribers();
63 case "addFromWaitingList":
64 $this->addFromWaitingList();
67 case "removeFromWaitingList":
86 if(isset(
$_POST[
'btn_pressed'][
'deleteMembers']))
90 elseif(
$_POST[
'btn_pressed'][
'sendMailToSelectedUsers'])
102 if(isset(
$_GET[
'member_id']))
108 $_POST[
'member'] = array_unique(array_merge((array)
$_POST[
'members'],
109 (array) $_POST[
'tutors'],
110 (array) $_POST[
'admins'],
111 (array) $_POST[
'waiting'],
112 (array) $_POST[
'subscribers'],
113 (array) $_POST[
'roles']
118 if (!count(
$_POST[
"member"]))
128 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
133 'rcp_to' => implode(
',',$rcps),
148 #ilUtil::sendSuccess($this->lng->txt("action_aborted"),true);
162 $part->updateNotification($ilUser->getId(), 1);
169 $this->ctrl->setCmd(
"view");
187 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
189 $this->ctrl->setCmdClass(get_class($course_content_obj));
190 $this->ctrl->setCmd(
'editUserTimings');
191 $this->ctrl->forwardCommand($course_content_obj);
202 global $rbacsystem, $ilUser,
$ilCtrl;
212 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
219 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
223 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
225 $this->
object->getRefId(),
'crs');
229 include_once(
'Services/Membership/classes/class.ilMemberAgreementGUI.php');
230 $this->ctrl->setReturn($this,
'view_content');
232 $this->ctrl->setCmdClass(get_class($agreement));
233 $this->ctrl->forwardCommand($agreement);
255 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
258 $this->ctrl->setCmdClass(get_class($course_content_obj));
259 $this->ctrl->forwardCommand($course_content_obj);
277 $this->ctrl->setCmd(
"showSummary");
278 $this->ctrl->setCmdClass(
"ilinfoscreengui");
292 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
295 $this->tabs_gui->setTabActive(
'info_short');
297 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
298 include_once
'Modules/Course/classes/class.ilCourseFile.php';
303 $info->enablePrivateNotes();
304 $info->enableFeedback();
306 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
308 $info->enableNewsEditing();
311 if(strlen($this->object->getImportantInformation()) or
312 strlen($this->object->getSyllabus()) or
315 $info->addSection($this->lng->txt(
'crs_general_informations'));
318 if(strlen($this->object->getImportantInformation()))
320 $info->addProperty($this->lng->txt(
'crs_important_info'),
324 if(strlen($this->object->getSyllabus()))
326 $info->addProperty($this->lng->txt(
'crs_syllabus'), nl2br(
332 $tpl =
new ilTemplate(
'tpl.event_info_file.html',
true,
true,
'Modules/Course');
336 $tpl->setCurrentBlock(
"files");
337 $this->ctrl->setParameter($this,
'file_id',$file->getFileId());
338 $tpl->setVariable(
"DOWN_LINK",$this->ctrl->getLinkTarget($this,
'sendfile'));
339 $tpl->setVariable(
"DOWN_NAME",$file->getFileName());
340 $tpl->setVariable(
"DOWN_INFO_TXT",$this->lng->txt(
'crs_file_size_info'));
341 $tpl->setVariable(
"DOWN_SIZE",$file->getFileSize());
342 $tpl->setVariable(
"TXT_BYTES",$this->lng->txt(
'bytes'));
343 $tpl->parseCurrentBlock();
345 $info->addProperty($this->lng->txt(
'crs_file_download'),
349 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
352 $record_gui->parse();
355 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
358 if($this->object->hasContactData())
360 $info->addSection($this->lng->txt(
"crs_contact"));
362 if(strlen($this->object->getContactName()))
364 $info->addProperty($this->lng->txt(
"crs_contact_name"),
365 $this->
object->getContactName());
367 if(strlen($this->object->getContactResponsibility()))
369 $info->addProperty($this->lng->txt(
"crs_contact_responsibility"),
370 $this->
object->getContactResponsibility());
372 if(strlen($this->object->getContactPhone()))
374 $info->addProperty($this->lng->txt(
"crs_contact_phone"),
375 $this->
object->getContactPhone());
377 if($this->object->getContactEmail())
379 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
380 $emails = split(
",",$this->object->getContactEmail());
381 foreach ($emails as $email) {
382 $email = trim($email);
383 $etpl =
new ilTemplate(
"tpl.crs_contact_email.html",
true,
true ,
'Modules/Course');
386 $etpl->setVariable(
"CONTACT_EMAIL", $email);
387 $mailString .= $etpl->get().
"<br />";
389 $info->addProperty($this->lng->txt(
"crs_contact_email"), $mailString);
391 if(strlen($this->object->getContactConsultation()))
393 $info->addProperty($this->lng->txt(
"crs_contact_consultation"),
394 nl2br($this->object->getContactConsultation()));
399 $info->addSection($this->lng->txt(
"access"));
400 $info->showLDAPRoleGroupMappingInfo();
403 if($this->object->getOfflineStatus())
405 $info->addProperty($this->lng->txt(
'crs_visibility'),
406 $this->lng->txt(
'crs_visibility_unvisible'));
408 elseif($this->object->getActivationUnlimitedStatus())
410 $info->addProperty($this->lng->txt(
"crs_visibility"),
411 $this->lng->txt(
'crs_unlimited'));
415 $info->addProperty($this->lng->txt(
'crs_visibility'),
421 switch($this->object->getSubscriptionLimitationType())
424 $txt = $this->lng->txt(
"crs_info_reg_deactivated");
428 switch($this->object->getSubscriptionType())
431 $txt = $this->lng->txt(
"crs_info_reg_confirmation");
434 $txt = $this->lng->txt(
"crs_info_reg_direct");
437 $txt = $this->lng->txt(
"crs_info_reg_password");
443 $info->addProperty($this->lng->txt(
"crs_info_reg"),$txt);
448 if($this->object->getSubscriptionUnlimitedStatus())
450 $info->addProperty($this->lng->txt(
"crs_reg_until"),
451 $this->lng->txt(
'crs_unlimited'));
453 elseif($this->object->getSubscriptionStart() < time())
455 $info->addProperty($this->lng->txt(
"crs_reg_until"),
456 $this->lng->txt(
'crs_to').
' '.
459 elseif($this->object->getSubscriptionStart() > time())
461 $info->addProperty($this->lng->txt(
"crs_reg_until"),
462 $this->lng->txt(
'crs_from').
' '.
465 if ($this->object->isSubscriptionMembershipLimited())
467 include_once
'./Services/Membership/classes/class.ilParticipants.php';
469 $this->lng->txt(
"mem_free_places"),
482 $info->addProperty($this->lng->txt(
"crs_archive"),
489 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
492 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
495 include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
499 $this->lng->loadLanguageModule(
'ps');
500 $info->addSection($this->lng->txt(
'crs_user_agreement_info'));
501 $info->addProperty($this->lng->txt(
'ps_export_data'),$field_info->exportableFieldsToInfoString());
505 $info->addProperty($this->lng->txt(
'ps_crs_user_fields'),$fields);
509 $info->enableLearningProgress(
true);
512 $this->ctrl->forwardCommand($info);
522 $ilUser->setPref(
"grpcrs_ntf_".$this->ref_id, (
bool)
$_REQUEST[
"crs_ntf"]);
523 $ilUser->writePrefs();
526 $this->ctrl->redirect($this,
"");
536 global
$tpl, $ilToolbar;
541 $this->tabs_gui->setTabActive(
'settings');
542 $this->tabs_gui->setSubTabActive(
'crs_start_objects');
544 $ilToolbar->addButton($this->lng->txt(
'crs_add_starter'),
545 $this->ctrl->getLinkTarget($this,
'selectStarter'));
547 include_once
'./Modules/Course/classes/class.ilCourseStartObjectsTableGUI.php';
549 $tpl->setContent($table->getHTML());
556 if(!count(
$_POST[
'starter']))
563 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
565 $cgui->setFormAction($this->ctrl->getFormAction($this));
566 $cgui->setHeaderText($this->lng->txt(
"crs_starter_delete_sure"));
567 $cgui->setCancel($this->lng->txt(
"cancel"),
"listStructure");
568 $cgui->setConfirm($this->lng->txt(
"delete"),
"deleteStarter");
571 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
572 $crs_start =&
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
574 foreach(
$_POST[
'starter'] as $starter_id)
576 $ref_id = $crs_start[$starter_id][
"item_ref_id"];
579 $cgui->addItem(
"starter[]", $starter_id,
$title);
582 $this->tpl->setContent($cgui->getHTML());
594 if(!count(
$_POST[
'starter']))
600 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
601 $crs_start =&
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
602 foreach(
$_POST[
'starter'] as $starter_id)
604 $crs_start->
delete((
int)$starter_id);
621 $this->tabs_gui->clearTargets();
622 $this->tabs_gui->setBackTarget($this->lng->txt(
'back'),
623 $this->ctrl->getLinkTarget($this,
'listStructure'));
625 include_once
'./Modules/Course/classes/class.ilCourseStartObjectsTableGUI.php';
628 $tpl->setContent($table->getHTML());
637 if(!count(
$_POST[
'starter']))
645 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
646 $crs_start =&
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
648 foreach(
$_POST[
'starter'] as $item_ref_id)
650 if(!$crs_start->exists($item_ref_id))
653 $crs_start->
add($item_ref_id);
680 include_once
'Modules/Course/classes/class.ilCourseFile.php';
692 $this->tabs_gui->setTabActive(
'settings');
693 $this->tabs_gui->setSubTabActive(
'crs_info_settings');
696 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.edit_info.html',
'Modules/Course');
697 $this->tpl->setVariable(
'INFO_TABLE',$form->getHTML());
706 $table_data[
'id'] = $file->getFileId();
707 $table_data[
'filename'] = $file->getFileName();
708 $table_data[
'filetype'] = $file->getFileType();
709 $table_data[
'filesize'] = $file->getFileSize();
711 $rows[] = $table_data;
714 include_once(
"./Modules/Course/classes/class.ilCourseInfoFileTableGUI.php");
716 $table_gui->setTitle($this->lng->txt(
"crs_info_download"));
717 $table_gui->setData($rows);
718 $table_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
719 $table_gui->addMultiCommand(
"confirmDeleteInfoFiles", $this->lng->txt(
"delete"));
720 $table_gui->setSelectAllCheckbox(
"file_id");
721 $this->tpl->setVariable(
'INFO_FILE_TABLE',$table_gui->getHTML());
736 if(!count(
$_POST[
'file_id']))
744 $this->tabs_gui->setTabActive(
'settings');
745 $this->tabs_gui->setSubTabActive(
'crs_info_settings');
747 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
751 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteInfoFiles"));
752 $c_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
753 $c_gui->setCancel($this->lng->txt(
"cancel"),
"editInfo");
754 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteInfoFiles");
757 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
758 foreach(
$_POST[
"file_id"] as $file_id)
761 $c_gui->addItem(
"file_id[]", $file_id,
$file->getFileName());
764 $this->tpl->setContent($c_gui->getHTML());
775 if(!count(
$_POST[
'file_id']))
781 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
783 foreach(
$_POST[
'file_id'] as $file_id)
786 if($this->object->getId() ==
$file->getCourseId())
805 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
807 $form->setFormAction($this->ctrl->getFormAction($this,
'updateInfo'));
808 $form->setMultipart(
true);
809 $form->setTitle($this->lng->txt(
'crs_general_info'));
810 $form->addCommandButton(
'updateInfo',$this->lng->txt(
'save'));
811 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
814 $area->
setValue($this->object->getImportantInformation());
817 $form->addItem($area);
820 $area->
setValue($this->object->getSyllabus());
823 $form->addItem($area);
826 $section->setTitle($this->lng->txt(
'crs_info_download'));
830 $file->enableFileNameSelection(
'file_name');
831 $form->addItem(
$file);
834 $section->setTitle($this->lng->txt(
'crs_contact'));
837 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_name'),
'contact_name');
838 $text->
setValue($this->object->getContactName());
840 $text->setMaxLength(70);
841 $form->addItem($text);
843 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_responsibility'),
'contact_responsibility');
844 $text->
setValue($this->object->getContactResponsibility());
846 $text->setMaxLength(70);
847 $form->addItem($text);
849 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_phone'),
'contact_phone');
850 $text->
setValue($this->object->getContactPhone());
852 $text->setMaxLength(40);
853 $form->addItem($text);
855 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_email'),
'contact_email');
856 $text->
setValue($this->object->getContactEmail());
857 $text->setInfo($this->lng->txt(
'crs_contact_email_info'));
859 $text->setMaxLength(255);
860 $form->addItem($text);
862 $area =
new ilTextAreaInputGUI($this->lng->txt(
'crs_contact_consultation'),
'contact_consultation');
863 $area->
setValue($this->object->getContactConsultation());
866 $form->addItem($area);
868 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
871 $record_gui->parse();
882 include_once
'Modules/Course/classes/class.ilCourseFile.php';
884 $file_obj->setCourseId($this->object->getId());
885 $file_obj->setFileName(strlen(
$_POST[
'file_name']) ?
887 $_FILES[
'file'][
'name']);
888 $file_obj->setFileSize($_FILES[
'file'][
'size']);
889 $file_obj->setFileType($_FILES[
'file'][
'type']);
890 $file_obj->setTemporaryName($_FILES[
'file'][
'tmp_name']);
891 $file_obj->setErrorCode($_FILES[
'file'][
'error']);
901 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
903 'crs',$this->object->getId());
907 $ilErr->setMessage(
'');
908 $file_obj->validate();
909 $this->
object->validateInfoSettings();
911 if(strlen($ilErr->getMessage()))
917 $this->
object->update();
919 $record_gui->saveValues();
921 $this->
object->updateECSContent();
933 $activation_start = $this->
loadDate(
'activation_start');
934 $activation_end = $this->
loadDate(
'activation_end');
935 $subscription_start = $this->
loadDate(
'subscription_start');
936 $subscription_end = $this->
loadDate(
'subscription_end');
937 $archive_start = $this->
loadDate(
'archive_start');
938 $archive_end = $this->
loadDate(
'archive_end');
940 $this->
object->setActivationType((
int)
$_POST[
'activation_type']);
941 $this->
object->setActivationStart($activation_start->get(
IL_CAL_UNIX));
942 $this->
object->setActivationEnd($activation_end->get(
IL_CAL_UNIX));
943 $this->
object->setSubscriptionLimitationType((
int) $_POST[
'subscription_limitation_type']);
944 $this->
object->setSubscriptionType((
int) $_POST[
'subscription_type']);
946 $this->
object->setSubscriptionStart($subscription_start->get(
IL_CAL_UNIX));
947 $this->
object->setSubscriptionEnd($subscription_end->get(
IL_CAL_UNIX));
948 $this->
object->enableSubscriptionMembershipLimitation((
int) $_POST[
'subscription_membership_limitation']);
949 $this->
object->setSubscriptionMaxMembers((
int) $_POST[
'subscription_max']);
950 $this->
object->enableRegistrationAccessCode((
int) $_POST[
'reg_code_enabled']);
952 $this->
object->enableWaitingList((
int) $_POST[
'waiting_list']);
953 #$this->object->setSubscriptionNotify((int) $_POST['subscription_notification']);
954 $this->
object->setViewMode((
int) $_POST[
'view_mode']);
962 $this->
object->setOrderType((
int) $_POST[
'order_type']);
964 $this->
object->setArchiveStart($archive_start->get(
IL_CAL_UNIX));
965 $this->
object->setArchiveEnd($archive_end->get(
IL_CAL_UNIX));
966 $this->
object->setArchiveType($_POST[
'archive_type']);
967 $this->
object->setAboStatus((
int) $_POST[
'abo']);
968 $this->
object->setShowMembers((
int) $_POST[
'show_members']);
970 $this->
object->enableSessionLimit((
int) $_POST[
'sl']);
971 $this->
object->setNumberOfPreviousSessions(is_numeric($_POST[
'sp']) ? (
int) $_POST[
'sp'] : -1 );
972 $this->
object->setNumberOfnextSessions(is_numeric($_POST[
'sn']) ? (
int) $_POST[
'sn'] : -1 );
974 $this->
object->setAutoNotiDisabled($_POST[
'deact_auto_noti'] == 1 ?
true :
false);
976 if($this->object->validate())
978 $this->
object->update();
981 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1013 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
1021 foreach((array)
$_POST[
'ecs_sid'] as $sid_mid)
1023 $tmp = explode(
'_',$sid_mid);
1024 $mids[$tmp[0]][] = $tmp[1];
1029 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
1030 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
1037 if(!
$_POST[
'ecs_export'])
1041 if(!count($mids[$server_id]))
1045 $this->
object->handleECSSettings(
1052 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
1053 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1056 $export =
new ilECSExport($settings->getServerId(), $this->
object->getId());
1057 if($export->isExported())
1059 $rbacadmin->grantPermission(
1060 $settings->getGlobalRole(),
1062 $this->
object->getRefId()
1067 $rbacadmin->revokePermission(
1068 $this->object->getRefId(),
1069 $settings->getGlobalRole()
1100 $this->tabs_gui->setSubTabActive(
'crs_settings');
1112 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1113 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
1116 $form->setTitle($this->lng->txt(
'crs_edit'));
1119 $form->addCommandButton(
'update',$this->lng->txt(
'save'));
1120 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1122 $form->setFormAction($this->ctrl->getFormAction($this,
'update'));
1126 $title->setSubmitFormOnEnter(
true);
1127 $title->setValue($this->object->getTitle());
1129 $title->setMaxLength(128);
1130 $title->setRequired(
true);
1135 $desc->
setValue($this->object->getLongDescription());
1138 $form->addItem($desc);
1145 $act_type->
setValue($this->object->getActivationType());
1148 $opt->
setInfo($this->lng->txt(
'crs_availability_unvisible_info'));
1149 $act_type->addOption($opt);
1152 $opt->
setInfo($this->lng->txt(
'crs_availability_limitless_info'));
1153 $act_type->addOption($opt);
1156 $opt->
setInfo($this->lng->txt(
'crs_availability_until_info'));
1159 #$start->setMode(ilDateTimeInputGUI::MODE_INPUT);
1163 $opt->addSubItem($start);
1166 #$end->setMode(ilDateTimeInputGUI::MODE_INPUT);
1170 $opt->addSubItem($end);
1172 $act_type->addOption($opt);
1174 $form->addItem($act_type);
1177 $section->setTitle($this->lng->txt(
'crs_reg'));
1180 $reg_type =
new ilRadioGroupInputGUI($this->lng->txt(
'crs_reg_period'),
'subscription_limitation_type');
1181 $reg_type->
setValue($this->object->getSubscriptionLimitationType());
1184 $opt->
setInfo($this->lng->txt(
'crs_registration_deactivated'));
1185 $reg_type->addOption($opt);
1188 $opt->
setInfo($this->lng->txt(
'crs_reg_unlim_info'));
1189 $reg_type->addOption($opt);
1192 $opt->
setInfo($this->lng->txt(
'crs_reg_lim_info'));
1198 $opt->addSubItem($start);
1204 $opt->addSubItem($end);
1206 $reg_type->addOption($opt);
1208 $form->addItem($reg_type);
1212 $reg_proc =
new ilRadioGroupInputGUI($this->lng->txt(
'crs_registration_type'),
'subscription_type');
1213 $reg_proc->
setValue($this->object->getSubscriptionType());
1214 $reg_proc->setInfo($this->lng->txt(
'crs_reg_type_info'));
1217 $reg_proc->addOption($opt);
1220 $reg_proc->addOption($opt);
1225 $pass->setSubmitFormOnEnter(
true);
1227 $pass->setMaxLength(12);
1228 $pass->
setValue($this->object->getSubscriptionPassword());
1230 $opt->addSubItem($pass);
1231 $reg_proc->addOption($opt);
1233 $form->addItem($reg_proc);
1237 $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
1238 $reg_code->setValue(1);
1239 $reg_code->setInfo($this->lng->txt(
'crs_reg_code_enabled_info'));
1240 $reg_code->setOptionTitle($this->lng->txt(
'crs_reg_code'));
1248 #$link = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_link'));
1250 if(!$this->object->getRegistrationAccessCode())
1252 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1256 $reg_link->setValue($this->object->getRegistrationAccessCode());
1257 $form->addItem($reg_link);
1261 include_once
'./classes/class.ilLink.php';
1262 $val =
ilLink::_getLink($this->object->getRefId(),$this->
object->getType(),array(),
'_rcode'.$this->object->getRegistrationAccessCode());
1263 $link->setHTML(
'<font class="small">'.$val.
'</font>');
1264 $reg_code->addSubItem($link);
1266 $form->addItem($reg_code);
1270 $lim =
new ilCheckboxInputGUI($this->lng->txt(
'crs_subscription_max_members_short'),
'subscription_membership_limitation');
1272 $lim->setOptionTitle($this->lng->txt(
'crs_subscription_max_members'));
1273 $lim->setChecked($this->object->isSubscriptionMembershipLimited());
1276 $max->setSubmitFormOnEnter(
true);
1278 $max->setMaxLength(4);
1279 $max->setValue($this->object->getSubscriptionMaxMembers() ? $this->
object->getSubscriptionMaxMembers() :
'');
1280 $max->setTitle($this->lng->txt(
'members').
':');
1281 $max->setInfo($this->lng->txt(
'crs_reg_max_info'));
1283 $lim->addSubItem($max);
1286 $wait->setOptionTitle($this->lng->txt(
'crs_waiting_list'));
1287 $wait->setChecked($this->object->enabledWaitingList());
1288 $wait->setInfo($this->lng->txt(
'crs_wait_info'));
1289 $lim->addSubItem($wait);
1291 $form->addItem($lim);
1293 $not =
new ilCheckboxInputGUI($this->lng->txt(
'crs_deact_auto_noti'),
'deact_auto_noti');
1295 $not->setInfo($this->lng->txt(
'crs_deact_auto_noti_info'));
1296 $not->setChecked( $this->object->getAutoNotiDisabled() );
1297 $form->addItem($not);
1300 $pres->setTitle($this->lng->txt(
'crs_view_mode'));
1302 $form->addItem($pres);
1306 $view_type->
setValue($this->object->getViewMode());
1309 $opts->
setInfo($this->lng->txt(
'cntr_view_info_sessions'));
1310 $view_type->addOption($opts);
1315 $sess->setChecked($this->object->isSessionLimitEnabled());
1316 $sess->setInfo($this->lng->txt(
'sess_limit_info'));
1319 #$prev->setSubmitFormOnEnter(true);
1321 $prev->setValue($this->object->getNumberOfPreviousSessions() == -1 ?
1323 $this->
object->getNumberOfPreviousSessions()
1326 $prev->setMaxLength(3);
1327 $sess->addSubItem($prev);
1330 #$next->setSubmitFormOnEnter(true);
1332 $next->setValue($this->object->getNumberOfNextSessions() == -1 ?
1334 $this->
object->getNumberOfnextSessions()
1337 $next->setMaxLength(3);
1338 $sess->addSubItem($next);
1340 $opts->addSubItem(
$sess);
1346 $optsi->
setInfo($this->lng->txt(
'cntr_view_info_simple'));
1347 $view_type->addOption($optsi);
1350 $optbt->
setInfo($this->lng->txt(
'cntr_view_info_by_type'));
1351 $view_type->addOption($optbt);
1354 $opto->
setInfo($this->lng->txt(
'crs_view_info_objective'));
1355 $view_type->addOption($opto);
1358 $optt->
setInfo($this->lng->txt(
'crs_view_info_timing'));
1359 $view_type->addOption($optt);
1384 $form->addItem($view_type);
1388 $sort->
setValue($this->object->getOrderType());
1391 $opt->
setInfo($this->lng->txt(
'crs_sort_title_info'));
1392 $sort->addOption($opt);
1395 $opt->
setInfo($this->lng->txt(
'crs_sort_manual_info'));
1396 $sort->addOption($opt);
1399 $opt->
setInfo($this->lng->txt(
'crs_sort_timing_info'));
1400 $sort->addOption($opt);
1403 $form->addItem($sort);
1406 $further->setTitle($this->lng->txt(
'crs_further_settings'));
1407 $form->addItem($further);
1409 $desk =
new ilCheckboxInputGUI($this->lng->txt(
'crs_add_remove_from_desktop'),
'abo');
1410 $desk->
setChecked($this->object->getAboStatus());
1411 $desk->setInfo($this->lng->txt(
'crs_add_remove_from_desktop_info'));
1412 $form->addItem($desk);
1415 $mem->
setChecked($this->object->getShowMembers());
1416 $mem->setInfo($this->lng->txt(
'crs_show_members_info'));
1417 $form->addItem($mem);
1438 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
1445 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
1446 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
1454 $GLOBALS[
'lng']->loadLanguageModule(
'ecs');
1458 $ecs->setTitle($this->lng->txt(
'ecs_export'));
1466 $off =
new ilRadioOption($this->lng->txt(
'ecs_export_disabled'),0);
1467 $exp->addOption($off);
1468 $on =
new ilRadioOption($this->lng->txt(
'ecs_export_enabled'),1);
1469 $exp->addOption($on);
1479 $receivers = array();
1482 $exp =
new ilECSExport($sid, $this->object->getId());
1486 include_once
'./Services/WebServices/ECS/classes/class.ilECSEContentReader.php';
1488 $econtent_reader->read(
true);
1489 $details = $econtent_reader->getEContentDetails();
1492 foreach($details->getReceivers() as $mid)
1494 $receivers[] = $sid.
'_'.$mid;
1496 #$owner = $details->getFirstSender();
1501 $ilLog->write(__METHOD__.
': Error connecting to ECS server. '.$exc->getMessage());
1505 $ilLog->write(__METHOD__.
': Error parsing ECS query: '.$exc->getMessage());
1509 $publish_for->
setValue($receivers);
1511 foreach($exportablePart as $pInfo)
1513 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
1517 $partSetting->getCommunityName().
': '.$partSetting->getTitle(),
1520 $com->
setValue($pInfo[
'sid'].
'_'.$pInfo[
'mid']);
1521 $publish_for->addOption($com);
1523 $on->addSubItem($publish_for);
1538 $this->tabs_gui->setTabActive(
'settings');
1545 $tpl->setContent($a_form->getHTML());
1550 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1552 $form->setFormAction($this->ctrl->getFormAction($this));
1557 $form->addCommandButton(
'updateCourseIcons', $this->lng->txt(
'save'));
1564 include_once
'Modules/Course/classes/class.ilCourseFile.php';
1578 if($form->checkInput())
1581 if ($this->ilias->getSetting(
"custom_icons"))
1583 if(
$_POST[
"cont_big_icon_delete"])
1585 $this->
object->removeBigIcon();
1587 if(
$_POST[
"cont_small_icon_delete"])
1589 $this->
object->removeSmallIcon();
1591 if(
$_POST[
"cont_tiny_icon_delete"])
1593 $this->
object->removeTinyIcon();
1595 $this->
object->saveIcons($_FILES[
"cont_big_icon"][
'tmp_name'],
1596 $_FILES[
"cont_small_icon"][
'tmp_name'], $_FILES[
"cont_tiny_icon"][
'tmp_name']);
1600 $this->ctrl->redirect($this,
"editCourseIcons");
1603 $form->setValuesByPost();
1613 global $rbacsystem,$ilUser,$ilAccess;
1618 $this->tabs_gui->addSubTabTarget(
"crs_settings",
1619 $this->ctrl->getLinkTarget($this,
'edit'),
1620 "edit", get_class($this));
1622 $this->tabs_gui->addSubTabTarget(
"crs_info_settings",
1623 $this->ctrl->getLinkTarget($this,
'editInfo'),
1624 "editInfo", get_class($this));
1626 $this->tabs_gui->addSubTabTarget(
"preconditions",
1627 $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerInterface',
'listConditions'),
1628 "",
"ilConditionHandlerInterface");
1629 $this->tabs_gui->addSubTabTarget(
"crs_start_objects",
1630 $this->ctrl->getLinkTarget($this,
'listStructure'),
1631 "listStructure", get_class($this));
1632 $this->tabs_gui->addSubTabTarget(
'groupings',
1633 $this->ctrl->getLinkTargetByClass(
'ilobjcoursegroupinggui',
'listGroupings'),
1638 if ($this->ilias->getSetting(
"custom_icons"))
1640 $this->tabs_gui->addSubTabTarget(
"icon_settings",
1641 $this->ctrl->getLinkTarget($this,
'editCourseIcons'),
1642 "editCourseIcons", get_class($this));
1646 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1649 $this->tabs_gui->addSubTabTarget(
"crs_map_settings",
1650 $this->ctrl->getLinkTarget($this,
'editMapSettings'),
1651 "editMapSettings", get_class($this));
1655 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1656 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1660 $this->tabs_gui->addSubTabTarget(
'crs_custom_user_fields',
1661 $this->ctrl->getLinkTargetByClass(
'ilobjectcustomuserfieldsgui'),
1663 'ilobjectcustomuserfieldsgui');
1667 case "item_activation":
1668 $this->tabs_gui->addSubTabTarget(
"activation",
1669 $this->ctrl->getLinkTargetByClass(
'ilCourseItemAdministrationGUI',
'edit'),
1670 "edit", get_class($this));
1671 $this->ctrl->setParameterByClass(
'ilconditionhandlerinterface',
'item_id',(
int)
$_GET[
'item_id']);
1672 $this->tabs_gui->addSubTabTarget(
"preconditions",
1673 $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerInterface',
'listConditions'),
1674 "",
"ilConditionHandlerInterface");
1678 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1680 $this->tabs_gui->addSubTabTarget(
"crs_member_administration",
1681 $this->ctrl->getLinkTarget($this,
'members'),
1682 "members", get_class($this));
1684 $this->tabs_gui->addSubTabTarget(
"crs_members_groups",
1685 $this->ctrl->getLinkTargetByClass(
"ilCourseParticipantsGroupsGUI",
"show"),
1686 "",
"ilCourseParticipantsGroupsGUI");
1688 $this->tabs_gui->addSubTabTarget(
"crs_members_gallery",
1689 $this->ctrl->getLinkTarget($this,
'membersGallery'),
1690 "membersGallery", get_class($this));
1693 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1696 $this->tabs_gui->addSubTabTarget(
"crs_members_map",
1697 $this->ctrl->getLinkTarget($this,
'membersMap'),
1698 "membersMap", get_class($this));
1702 include_once
'Services/Mail/classes/class.ilMail.php';
1703 $mail =&
new ilMail($ilUser->getId());
1704 if($rbacsystem->checkAccess(
'mail_visible',$mail->getMailObjectReferenceId()))
1706 $this->tabs_gui->addSubTabTarget(
"mail_members",
1707 $this->ctrl->getLinkTarget($this,
'mailMembers'),
1708 "mailMembers", get_class($this));
1711 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1713 $this->tabs_gui->addSubTabTarget(
"events",
1714 $this->ctrl->getLinkTargetByClass(
'ilsessionoverviewgui',
'listSessions'),
1715 "",
'ilsessionoverviewgui');
1718 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
1721 $this->tabs_gui->addSubTabTarget(
'export_members',
1722 $this->ctrl->getLinkTargetByClass(
'ilmemberexportgui',
'show'),
1723 "",
'ilmemberexportgui');
1739 $this->
object->removeSmallIcon();
1740 $this->ctrl->redirect($this,
'editCourseIcons');
1750 $this->
object->removeBigIcon();
1751 $this->ctrl->redirect($this,
'editCourseIcons');
1762 $this->
object->removeTinyIcon();
1763 $this->ctrl->redirect($this,
'editCourseIcons');
1772 global $rbacadmin, $ilUser;
1774 $a_new_object->getMemberObject()->add($ilUser->getId(),
IL_CRS_ADMIN);
1775 $a_new_object->getMemberObject()->updateNotification($ilUser->getId(),1);
1779 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1787 $this->ctrl->setParameter($this,
"ref_id", $a_new_object->
getRefId());
1789 $this->ctrl->getLinkTarget($this,
"edit",
"",
false,
false)));
1806 if(!count(
$_POST[
'archives']))
1809 $this->archiveObject();
1813 if(count(
$_POST[
'archives']) > 1)
1816 $this->archiveObject();
1821 $this->
object->initCourseArchiveObject();
1823 $abs_path = $this->
object->archives_obj->getArchiveFile((
int)
$_POST[
'archives'][0]);
1824 $basename = basename($abs_path);
1839 if(isset(
$_GET[
'admin_hide']))
1841 $ilUser->writePref(
'crs_admin_hide',(
int)
$_GET[
'admin_hide']);
1843 if(isset(
$_GET[
'tutor_hide']))
1845 $ilUser->writePref(
'crs_tutor_hide',(
int)
$_GET[
'tutor_hide']);
1847 if(isset(
$_GET[
'member_hide']))
1849 $ilUser->writePref(
'crs_member_hide',(
int)
$_GET[
'member_hide']);
1851 if(isset(
$_GET[
'subscriber_hide']))
1853 $ilUser->writePref(
'crs_subscriber_hide',(
int)
$_GET[
'subscriber_hide']);
1855 if(isset(
$_GET[
'wait_hide']))
1857 $ilUser->writePref(
'crs_wait_hide',(
int)
$_GET[
'wait_hide']);
1859 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
1862 if(isset(
$_GET[
'role_hide_'.$role_id]))
1864 $ilUser->writePref(
'crs_role_hide_'.$role_id,(
int)
$_GET[
'role_hide_'.$role_id]);
1871 if($this->show_tracking)
1873 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
1879 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1882 if($privacy->enabledCourseAccessTimes())
1884 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
1888 foreach((array) $ids as
$usr_id)
1891 $tmp_data[
'firstname'] = $name[
'firstname'];
1892 $tmp_data[
'lastname'] = $name[
'lastname'];
1894 $tmp_data[
'passed'] = $this->
object->getMembersObject()->hasPassed(
$usr_id) ? 1 : 0;
1895 $tmp_data[
'notification'] = $this->
object->getMembersObject()->isNotificationEnabled(
$usr_id) ? 1 : 0;
1896 $tmp_data[
'blocked'] = $this->
object->getMembersObject()->isBlocked(
$usr_id) ? 1 : 0;
1897 $tmp_data[
'usr_id'] =
$usr_id;
1899 if($this->show_tracking)
1901 if(in_array(
$usr_id,$completed))
1905 elseif(in_array(
$usr_id,$in_progress))
1919 if($privacy->enabledCourseAccessTimes())
1923 $tmp_data[
'access_ut'] = $progress[
$usr_id][
'ts'];
1928 $tmp_data[
'access_ut'] = 0;
1929 $tmp_data[
'access_time'] = $this->lng->txt(
'no_date');
1932 $members[
$usr_id] = $tmp_data;
1934 return $members ? $members : array();
1948 global $ilUser, $rbacsystem, $ilToolbar,
$lng,
$ilCtrl,
$tpl, $rbacreview;
1950 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
1951 include_once(
'./Modules/Course/classes/class.ilCourseParticipantsTableGUI.php');
1952 include_once
'./Services/Tracking/classes/class.ilObjUserTracking.php';
1953 include_once(
'./Services/Tracking/classes/class.ilLPObjSettings.php');
1956 if(isset(
$_GET[
'member_table_nav']))
1966 include_once(
'./Modules/Course/classes/class.ilCourseItems.php');
1971 $this->tabs_gui->setTabActive(
'members');
1972 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
1974 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_edit_members.html',
'Modules/Course');
1975 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
1978 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
1983 'auto_complete_name' => $lng->txt(
'user'),
1984 'user_type' => array(
1989 'submit_name' => $lng->txt(
'add')
1994 $ilToolbar->addSeparator();
1997 $ilToolbar->addButton($this->lng->txt(
"crs_search_users"),
1998 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
2001 $ilToolbar->addSeparator();
2004 $ilToolbar->addButton($this->lng->txt(
"crs_print_list"),
2005 $this->ctrl->getLinkTarget($this,
'printMembers'),
"_blank");
2011 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2013 if(count($wait = $waiting_list->getAllUsers()))
2015 include_once(
'./Services/Membership/classes/class.ilWaitingListTableGUI.php');
2016 if($ilUser->getPref(
'crs_wait_hide'))
2019 $this->ctrl->setParameter($this,
'wait_hide',0);
2020 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2021 $this->lng->txt(
'show'),
2024 $this->ctrl->clearParameters($this);
2029 $this->ctrl->setParameter($this,
'wait_hide',1);
2030 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2031 $this->lng->txt(
'hide'),
2034 $this->ctrl->clearParameters($this);
2036 $table_gui->setUsers($wait);
2037 $table_gui->setTitle($this->lng->txt(
'crs_waiting_list'),
'icon_usr.gif',$this->lng->txt(
'crs_waiting_list'));
2038 $this->tpl->setVariable(
'TABLE_WAIT',$table_gui->getHTML());
2044 include_once(
'./Services/Membership/classes/class.ilSubscriberTableGUI.php');
2045 if($ilUser->getPref(
'crs_subscriber_hide'))
2048 $this->ctrl->setParameter($this,
'subscriber_hide',0);
2049 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2050 $this->lng->txt(
'show'),
2053 $this->ctrl->clearParameters($this);
2058 $this->ctrl->setParameter($this,
'subscriber_hide',1);
2059 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2060 $this->lng->txt(
'hide'),
2063 $this->ctrl->clearParameters($this);
2065 $table_gui->readSubscriberData();
2066 $table_gui->setTitle($this->lng->txt(
'group_new_registrations'),
'icon_usr.gif',$this->lng->txt(
'group_new_registrations'));
2067 $this->tpl->setVariable(
'TABLE_SUB',$table_gui->getHTML());
2072 if($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultAdminRole())))
2076 $showEditLink = $rbacsystem->checkAccess(
"edit_permission", $this->object->getRefId());
2077 if($ilUser->getPref(
'crs_admin_hide'))
2084 $this->timings_enabled,
2086 $this->object->getDefaultAdminRole()
2088 $this->ctrl->setParameter($this,
'admin_hide',0);
2090 $this->lng->txt(
'show'),
2093 $this->ctrl->clearParameters($this);
2102 $this->timings_enabled,
2104 $this->object->getDefaultAdminRole()
2106 $this->ctrl->setParameter($this,
'admin_hide',1);
2108 $this->lng->txt(
'hide'),
2111 $this->ctrl->clearParameters($this);
2113 $table_gui->setTitle($this->lng->txt(
'crs_administrators'),
'icon_usr.gif',$this->lng->txt(
'crs_administrators'));
2114 $table_gui->parse();
2115 $this->tpl->setVariable(
'ADMINS',$table_gui->getHTML());
2117 if($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultTutorRole())))
2119 if($ilUser->getPref(
'crs_tutor_hide'))
2126 $this->timings_enabled,
2128 $this->object->getDefaultTutorRole()
2130 $this->ctrl->setParameter($this,
'tutor_hide',0);
2132 $this->lng->txt(
'show'),
2135 $this->ctrl->clearParameters($this);
2144 $this->timings_enabled,
2146 $this->object->getDefaultTutorRole()
2148 $this->ctrl->setParameter($this,
'tutor_hide',1);
2150 $this->lng->txt(
'hide'),
2153 $this->ctrl->clearParameters($this);
2155 $table_gui->setTitle($this->lng->txt(
'crs_tutors'),
'icon_usr.gif',$this->lng->txt(
'crs_tutors'));
2156 $table_gui->parse();
2157 $this->tpl->setVariable(
'TUTORS',$table_gui->getHTML());
2159 if($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultMemberRole())))
2161 if($ilUser->getPref(
'crs_member_hide'))
2167 $this->show_tracking,
2168 $this->timings_enabled,
2170 $this->object->getDefaultMemberRole()
2173 $this->ctrl->setParameter($this,
'member_hide',0);
2175 $this->lng->txt(
'show'),
2178 $this->ctrl->clearParameters($this);
2186 $this->show_tracking,
2187 $this->timings_enabled,
2189 $this->object->getDefaultMemberRole()
2191 $this->ctrl->setParameter($this,
'member_hide',1);
2193 $this->lng->txt(
'hide'),
2196 $this->ctrl->clearParameters($this);
2198 $table_gui->setTitle($this->lng->txt(
'crs_members'),
'icon_usr.gif',$this->lng->txt(
'crs_members'));
2199 $table_gui->parse();
2200 $this->tpl->setCurrentBlock(
'member_block');
2201 $this->tpl->setVariable(
'MEMBERS',$table_gui->getHTML());
2202 $this->tpl->parseCurrentBlock();
2208 if(!(
$GLOBALS[
'rbacreview']->getNumberOfAssignedUsers(array($role_id))))
2212 if($ilUser->getPref(
'crs_role_hide_'.$role_id))
2218 $this->show_tracking,
2219 $this->timings_enabled,
2223 $this->ctrl->setParameter($this,
'role_hide_'.$role_id,0);
2224 $table_gui->addHeaderCommand(
2225 $this->ctrl->getLinkTarget($this,
'members'),
2226 $this->lng->txt(
'show'),
2230 $this->ctrl->clearParameters($this);
2238 $this->show_tracking,
2239 $this->timings_enabled,
2243 $this->ctrl->setParameter($this,
'role_hide_'.$role_id,1);
2244 $table_gui->addHeaderCommand(
2245 $this->ctrl->getLinkTarget($this,
'members'),
2246 $this->lng->txt(
'hide'),
2250 $this->ctrl->clearParameters($this);
2254 $table_gui->parse();
2255 $this->tpl->setCurrentBlock(
'member_block');
2256 $this->tpl->setVariable(
'MEMBERS',$table_gui->getHTML());
2257 $this->tpl->parseCurrentBlock();
2261 $this->tpl->setVariable(
'TXT_SELECTED_USER',$this->lng->txt(
'crs_selected_users'));
2262 $this->tpl->setVariable(
'BTN_FOOTER_EDIT',$this->lng->txt(
'edit'));
2263 $this->tpl->setVariable(
'BTN_FOOTER_VAL',$this->lng->txt(
'remove'));
2264 $this->tpl->setVariable(
'BTN_FOOTER_MAIL',$this->lng->txt(
'crs_mem_send_mail'));
2282 $visible_members = array_intersect(array_unique((array)
$_POST[
'visible_member_ids']),$this->object->getMembersObject()->getAdmins());
2283 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2284 $notification = is_array($_POST[
'notification']) ? $_POST[
'notification'] : array();
2300 $visible_members = array_intersect(array_unique((array)
$_POST[
'visible_member_ids']),$this->object->getMembersObject()->getTutors());
2301 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2302 $notification = is_array($_POST[
'notification']) ? $_POST[
'notification'] : array();
2318 $visible_members = array_intersect(array_unique((array)
$_POST[
'visible_member_ids']),$this->object->getMembersObject()->getMembers());
2319 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2320 $blocked = is_array($_POST[
'blocked']) ? $_POST[
'blocked'] : array();
2335 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
2340 $users = array_merge($users,$rbacreview->assignedUsers($role_id));
2343 $passed = is_array(
$_POST[
'passed']) ?
$_POST[
'passed'] : array();
2344 $blocked = is_array(
$_POST[
'blocked']) ?
$_POST[
'blocked'] : array();
2351 global $ilAccess,
$ilErr,$ilUser,$rbacadmin;
2353 foreach($visible_members as $member_id)
2355 $this->
object->getMembersObject()->updatePassed($member_id,in_array($member_id,$passed));
2359 $this->
object->getMembersObject()->updateNotification($member_id,in_array($member_id,$notification));
2360 $this->
object->getMembersObject()->updateBlocked($member_id,
false);
2364 if($this->object->getMembersObject()->isBlocked($member_id) and !in_array($member_id,$blocked))
2366 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_UNBLOCK_MEMBER,$member_id);
2368 if(!$this->object->getMembersObject()->isBlocked($member_id) and in_array($member_id,$blocked))
2370 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_BLOCK_MEMBER,$member_id);
2372 $this->
object->getMembersObject()->updateNotification($member_id,
false);
2373 $this->
object->getMembersObject()->updateBlocked($member_id,in_array($member_id,$blocked));
2387 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
2389 $this->
object->initWaitingList();
2390 if($this->object->waiting_list_obj->getCountUsers())
2393 $f_result = array();
2394 foreach($this->object->waiting_list_obj->getAllUsers() as $waiting_data)
2399 $waiting_list_ids[] = $waiting_data[
'usr_id'];
2403 $this->
object->getId()) as $course_data)
2406 if($course_data[
'id'] != $this->object->getId() and
2407 $tmp_members->isGroupingMember($tmp_obj->getId(),$course_data[
'unique']))
2409 $message .= (
'<br /><font class="alert">'.$this->lng->txt(
'crs_member_of').
' ');
2415 $f_result[$counter][] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname().$message;
2416 $f_result[$counter][] = $tmp_obj->getLogin();
2437 $_POST[
'members'] = array((
int)
$_GET[
'member_id']);
2453 $participants = array_unique(array_merge((array)
$_POST[
'admins'],(array) $_POST[
'tutors'],(array) $_POST[
'members'], (array) $_POST[
'roles']));
2455 if(!count($participants))
2463 $this->tabs_gui->setTabActive(
'members');
2464 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
2466 include_once(
'./Modules/Course/classes/class.ilCourseEditParticipantsTableGUI.php');
2468 $table_gui->setTitle($this->lng->txt(
'crs_header_edit_members'),
'icon_usr.gif',$this->lng->txt(
'crs_header_edit_members'));
2471 $this->tpl->setContent($table_gui->getHTML());
2484 global $rbacsystem, $rbacreview;
2488 if(!count(
$_POST[
'participants']))
2495 $notifications =
$_POST[
'notification'] ?
$_POST[
'notification'] : array();
2496 $passed =
$_POST[
'passed'] ?
$_POST[
'passed'] : array();
2497 $blocked =
$_POST[
'blocked'] ?
$_POST[
'blocked'] : array();
2500 $hasEditPermissionAccess = $rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId());
2504 $assignableLocalCourseRoles = array();
2505 $courseAdminRoleId = $this->
object->getDefaultAdminRole();
2506 foreach ($this->object->getLocalCourseRoles(
false) as
$title => $role_id)
2508 $assignableLocalCourseRoles[$role_id] =
$title;
2514 $memberIsCourseAdmin = $rbacreview->isAssigned($usr_id, $courseAdminRoleId);
2519 if (! $hasEditPermissionAccess && $memberIsCourseAdmin &&
2520 ! in_array($courseAdminRoleId,
$_POST[
'roles'][$usr_id])
2527 foreach ((array)
$_POST[
'roles'][$usr_id] as $role_id)
2529 if(!array_key_exists($role_id, $assignableLocalCourseRoles))
2535 if(!$hasEditPermissionAccess &&
2536 $role_id == $courseAdminRoleId &&
2537 !$memberIsCourseAdmin)
2549 if(!isset(
$_POST[
'roles'][$admin_id]))
2554 if(in_array($courseAdminRoleId,
$_POST[
'roles'][$admin_id]))
2564 $_POST[
'members'] = $_POST[
'participants'];
2569 foreach(
$_POST[
'participants'] as $usr_id)
2571 $this->
object->getMembersObject()->updateRoleAssignments($usr_id,(array)
$_POST[
'roles'][$usr_id]);
2574 $this->
object->getMembersObject()->updateNotification($usr_id,0);
2575 if(($this->object->getMembersObject()->isTutor($usr_id) or $this->
object->getMembersObject()->isAdmin($usr_id)) and in_array($usr_id,$notifications))
2577 $this->
object->getMembersObject()->updateNotification($usr_id,1);
2580 $this->
object->getMembersObject()->updateBlocked($usr_id,0);
2581 if((!$this->object->getMembersObject()->isAdmin($usr_id) and !$this->
object->getMembersObject()->isTutor($usr_id)) and in_array($usr_id,$blocked))
2583 $this->
object->getMembersObject()->updateBlocked($usr_id,1);
2585 $this->
object->getMembersObject()->updatePassed($usr_id,in_array($usr_id,$passed));
2586 $this->
object->getMembersObject()->sendNotification(
2587 $this->object->getMembersObject()->NOTIFY_STATUS_CHANGED,
2606 if(!isset(
$_GET[
"member_id"]) or !$this->object->getMembersObject()->isAssigned((
int)
$_GET[
"member_id"]))
2608 $this->ilias->raiseError($this->lng->txt(
"crs_no_valid_member_id_given"),$this->ilias->error_obj->MESSAGE);
2613 $passed = $this->
object->getMembersObject()->hasPassed((
int) $_GET[
'member_id']);
2614 $notify = $this->
object->getMembersObject()->isNotificationEnabled((
int) $_GET[
'member_id']);
2615 $blocked = $this->
object->getMembersObject()->isBlocked((
int) $_GET[
'member_id']);
2617 $this->
object->getMembersObject()->updateRoleAssignments((
int) $_GET[
'member_id'],
$_POST[
'roles']);
2618 $this->
object->getMembersObject()->updatePassed((
int) $_GET[
'member_id'],(
int)
$_POST[
'passed']);
2619 $this->
object->getMembersObject()->updateNotification((
int) $_GET[
'member_id'],(
int) $_POST[
'notification']);
2620 $this->
object->getMembersObject()->updateBlocked((
int) $_GET[
'member_id'],(
int) $_POST[
'blocked']);
2622 if($passed != $this->object->getMembersObject()->hasPassed((
int) $_GET[
'member_id']) or
2623 $notify != $this->
object->getMembersObject()->isNotificationEnabled((
int) $_GET[
'member_id']) or
2624 $blocked != $this->
object->getMembersObject()->isBlocked((
int) $_GET[
'member_id']))
2626 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_STATUS_CHANGED,(int) $_GET[
'member_id']);
2648 if(!count($a_usr_ids))
2655 foreach($a_usr_ids as $user_id)
2661 if($this->object->getMembersObject()->isAssigned($user_id))
2668 $this->
object->getMembersObject()->add($user_id,
IL_CRS_MEMBER);
2671 $this->
object->getMembersObject()->add($user_id,
IL_CRS_TUTOR);
2674 $this->
object->getMembersObject()->add($user_id,
IL_CRS_ADMIN);
2678 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_ACCEPT_USER,$user_id);
2680 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
2690 unset(
$_SESSION[
'crs_usr_search_result']);
2693 $this->ctrl->redirect($this,
'members');
2705 if(!count(
$_POST[
"waiting"]))
2712 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2716 foreach(
$_POST[
"waiting"] as $user_id)
2722 if($this->object->getMembersObject()->isAssigned($user_id))
2726 $this->
object->getMembersObject()->add($user_id,
IL_CRS_MEMBER);
2727 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_ACCEPT_USER,$user_id);
2730 include_once(
'./Modules/Forum/classes/class.ilForumNotification.php');
2761 if(!count(
$_POST[
'waiting']))
2768 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2771 foreach(
$_POST[
"waiting"] as $user_id)
2774 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER,$user_id);
2795 if(!is_array(
$_SESSION[
"crs_delete_waiting_list_ids"]))
2803 $this->
object->initWaitingList();
2806 $this->
object->waiting_list_obj->removeFromList($usr_id);
2817 global $rbacsystem,
$ilErr;
2822 if(!is_array(
$_POST[
"subscribers"]))
2830 if(!$this->object->getMembersObject()->assignSubscribers(
$_POST[
"subscribers"]))
2840 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_ACCEPT_SUBSCRIBER,
$usr_id);
2842 include_once(
'./Modules/Forum/classes/class.ilForumNotification.php');
2858 if($this->object->isSubscriptionMembershipLimited() and $this->
object->getSubscriptionMaxMembers() and
2859 $this->
object->getSubscriptionMaxMembers() <= $this->
object->getMembersObject()->getCountMembers())
2866 if($number = $this->object->getMembersObject()->autoFillSubscribers())
2884 $this->tabs_gui->setTabActive(
'members');
2894 if(!is_array(
$_POST[
"subscriber"]) or !count(
$_POST[
"subscriber"]))
2904 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_editMembers.html",
'Modules/Course');
2910 $f_result = array();
2912 foreach(
$_POST[
"subscriber"] as $member_id)
2914 $member_data = $this->
object->getMembersObject()->getSubscriberData($member_id);
2919 $f_result[$counter][] = $tmp_obj->getLogin();
2920 $f_result[$counter][] = $tmp_obj->getFirstname();
2921 $f_result[$counter][] = $tmp_obj->getLastname();
2935 $this->tabs_gui->setTabActive(
'members');
2945 if(!is_array(
$_POST[
"waiting_list"]) or !count(
$_POST[
"waiting_list"]))
2955 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_editMembers.html",
'Modules/Course');
2956 $this->
object->initWaitingList();
2962 $f_result = array();
2964 foreach(
$_POST[
"waiting_list"] as $wait_id)
2966 $user_data =& $this->
object->waiting_list_obj->getUser($wait_id);
2970 $f_result[$counter][] = $tmp_obj->getLogin();
2971 $f_result[$counter][] = $tmp_obj->getFirstname();
2972 $f_result[$counter][] = $tmp_obj->getLastname();
2973 #$f_result[$counter][] = strftime("%Y-%m-%d %R",$user_data["time"]);
2989 if($this->object->getMembersObject()->isLastAdmin($ilUser->getId()))
2997 $this->tabs_gui->setTabActive(
'crs_unsubscribe');
2999 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_unsubscribe_sure.html",
'Modules/Course');
3002 $this->tpl->setVariable(
"UNSUB_FORMACTION",$this->ctrl->getFormAction($this));
3003 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
3004 $this->tpl->setVariable(
"CMD_SUBMIT",
'performUnsubscribe');
3005 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"crs_unsubscribe"));
3013 global $rbacsystem,$ilAccess;
3024 $this->tabs_gui->setTabActive(
'crs_unsubscribe');
3025 #$this->setSubTabs('members');
3028 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_unsubscribe_sure.html",
'Modules/Course');
3031 $this->tpl->setVariable(
"UNSUB_FORMACTION",$this->ctrl->getFormAction($this));
3032 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
3033 $this->tpl->setVariable(
"CMD_SUBMIT",
'performUnsubscribe');
3034 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"crs_unsubscribe"));
3041 global $rbacsystem,$ilUser;
3045 $this->
object->getMembersObject()->delete($this->ilias->account->getId());
3046 $this->
object->getMembersObject()->sendUnsubscribeNotificationToAdmins($this->ilias->account->getId());
3047 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_UNSUBSCRIBE,$ilUser->getId());
3049 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
3054 ilUtil::redirect(
"repository.php?ref_id=".$this->tree->getParentId($this->ref_id));
3069 $this->tabs_gui->setTabActive(
'members');
3070 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
3072 $participants = array_merge((array)
$_POST[
'admins'],(array) $_POST[
'tutors'], (array) $_POST[
'members'], (array) $_POST[
'roles']);
3082 if(!$this->object->getMemberObject()->checkLastAdmin($participants))
3091 if(!$ilAccess->checkAccess(
'edit_permission',
'',$this->object->getRefId()))
3093 foreach ($participants as
$usr_id)
3096 if($part->isAdmin())
3106 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
3108 $confirm->setFormAction($this->ctrl->getFormAction($this,
'deleteMembers'));
3109 $confirm->setHeaderText($this->lng->txt(
'crs_header_delete_members'));
3110 $confirm->setConfirm($this->lng->txt(
'confirm'),
'removeMembers');
3111 $confirm->setCancel($this->lng->txt(
'cancel'),
'members');
3113 foreach($participants as
$usr_id)
3117 $confirm->addItem(
'participants[]',
3119 $name[
'lastname'].
', '.$name[
'firstname'].
' ['.$name[
'login'].
']',
3123 $this->tpl->setContent($confirm->getHTML());
3129 global $rbacreview, $rbacsystem;
3133 if(!is_array(
$_POST[
"participants"]) or !count(
$_POST[
"participants"]))
3143 if (! $rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId()))
3146 $courseAdminRoleId = null;
3147 foreach ($this->object->getLocalCourseRoles(
false) as
$title => $role_id)
3149 if (substr($title, 0, 12) ==
'il_crs_admin')
3151 $courseAdminRoleId = $role_id;
3157 if ($rbacreview->isAssigned($usr_id, $courseAdminRoleId))
3166 if(!$this->object->getMembersObject()->deleteParticipants(
$_POST[
"participants"]))
3175 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
3180 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_DISMISS_MEMBER,
$usr_id);
3196 if(!
$_POST[
'subscribers'])
3203 if(!$this->object->getMembersObject()->deleteSubscribers(
$_POST[
"subscribers"]))
3213 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER,
$usr_id);
3227 global $rbacsystem,$ilAccess,$ilUser,
$lng;
3229 $this->ctrl->setParameter($this,
"ref_id",$this->ref_id);
3231 if($ilAccess->checkAccess(
'read',
'',$this->ref_id))
3233 $tabs_gui->addTab(
'view_content', $lng->txt(
"content"),
3234 $this->ctrl->getLinkTarget($this,
''));
3237 if ($ilAccess->checkAccess(
'visible',
'',$this->ref_id))
3244 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilinfoscreengui"
3245 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
3248 $tabs_gui->addTarget(
"info_short",
3249 $this->ctrl->getLinkTargetByClass(
3250 array(
"ilobjcoursegui",
"ilinfoscreengui"),
"showSummary"),
3252 "",
"", $force_active);
3254 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3256 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilconditionhandlerinterface"
3257 &&
$_GET[
"item_id"] ==
"")
3260 $tabs_gui->addTarget(
"settings",
3261 $this->ctrl->getLinkTarget($this,
"edit"),
3262 array(
"edit",
"editMapSettings",
"editCourseIcons",
"listStructure"),
"",
"", $force_active);
3269 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3271 $tabs_gui->addTarget(
"members",
3272 $this->ctrl->getLinkTarget($this,
"members"),
3276 elseif ($this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_ENABLED &&
3279 $tabs_gui->addTarget(
"members",
3280 $this->ctrl->getLinkTarget($this,
"membersGallery"),
3286 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
3289 $tabs_gui->addTarget(
'learning_progress',
3290 $this->ctrl->getLinkTargetByClass(array(
'ilobjcoursegui',
'illearningprogressgui'),
''),
3292 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
3297 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3299 include_once(
'./Modules/Course/classes/class.ilCourseObjective.php');
3302 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilcourseobjectivesgui")
3305 $tabs_gui->addTarget(
"crs_objectives",
3306 $this->ctrl->getLinkTarget($this,
"listObjectives"),
3308 get_class($this),
"", $force_active);
3313 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
3314 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->ref_id)
3317 $tabs_gui->addTarget(
"licenses",
3318 $this->ctrl->getLinkTargetByClass(
'illicenseoverviewgui',
''),
3319 "",
"illicenseoverviewgui");
3323 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3325 $tabs_gui->addTarget(
"meta_data",
3326 $this->ctrl->getLinkTargetByClass(array(
'ilobjcoursegui',
'ilmdeditorgui'),
'listSection'),
3331 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
3333 $tabs_gui->addTarget(
3335 $this->ctrl->getLinkTargetByClass(
'ilexportgui',
''),
3341 if ($ilAccess->checkAccess(
'edit_permission',
'',$this->ref_id))
3343 $tabs_gui->addTarget(
"perm_settings",
3344 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
3345 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
3348 if ($this->ctrl->getTargetScript() ==
"adm_object.php")
3350 $tabs_gui->addTarget(
"show_owner",
3351 $this->ctrl->getLinkTarget($this,
"owner"),
"owner", get_class($this));
3353 if ($this->tree->getSavedNodeData($this->ref_id))
3355 $tabs_gui->addTarget(
"trash",
3356 $this->ctrl->getLinkTarget($this,
"trash"),
"trash", get_class($this));
3360 if($ilAccess->checkAccess(
'join',
'',$this->ref_id)
3361 and !$this->
object->getMemberObject()->isAssigned())
3363 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
3368 $this->lng->txt(
'membership_leave'),
3369 $this->ctrl->getLinkTargetByClass(
'ilcourseregistrationgui',
'show',
'')
3376 $tabs_gui->addTarget(
"join",
3377 $this->ctrl->getLinkTargetByClass(
'ilcourseregistrationgui',
"show"),
3382 if($ilAccess->checkAccess(
'leave',
'',$this->object->getRefId())
3383 and $this->object->getMemberObject()->isMember())
3385 $tabs_gui->addTarget(
"crs_unsubscribe",
3386 $this->ctrl->getLinkTarget($this,
"unsubscribe"),
3395 foreach($a_members as $member_id)
3398 $member_data = $this->
object->getMembersObject()->getSubscriberData($member_id);
3402 $print_member[$member_id][
'login'] = $tmp_obj->getLogin();
3403 $print_member[$member_id][
'name'] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();
3425 global $ilAccess,
$lng;
3427 $lng->loadLanguageModule(
'trac');
3429 #$is_admin = (bool) $ilAccess->checkAccess("write",'',$this->object->getRefId());
3432 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3435 if($privacy->enabledCourseAccessTimes())
3437 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
3441 if($this->show_tracking)
3443 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
3450 foreach($a_members as $member_id)
3455 $print_member[$member_id][
'login'] = $tmp_obj->getLogin();
3456 $print_member[$member_id][
'name'] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();
3458 if($this->object->getMembersObject()->isAdmin($member_id))
3460 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_admin");
3462 elseif($this->object->getMembersObject()->isTutor($member_id))
3464 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_tutor");
3466 elseif($this->object->getMembersObject()->isMember($member_id))
3468 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_member");
3470 if($this->object->getMembersObject()->isAdmin($member_id) or $this->
object->getMembersObject()->isTutor($member_id))
3472 if($this->object->getMembersObject()->isNotificationEnabled($member_id))
3474 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_notify");
3478 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_no_notify");
3483 if($this->object->getMembersObject()->isBlocked($member_id))
3485 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_blocked");
3489 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_unblocked");
3495 $print_member[$member_id][
'passed'] = $this->
object->getMembersObject()->hasPassed($member_id) ?
3496 $this->lng->txt(
'crs_member_passed') :
3497 $this->lng->txt(
'crs_member_not_passed');
3500 if($privacy->enabledCourseAccessTimes())
3502 if(isset($progress[$member_id][
'ts']) and $progress[$member_id][
'ts'])
3510 $print_member[$member_id][
'access'] = $this->lng->txt(
'no_date');
3513 if($this->show_tracking)
3515 if(in_array($member_id,$completed))
3519 elseif(in_array($member_id,$in_progress))
3523 elseif(in_array($member_id,
$failed))
3554 case 'notification':
3570 $tpl =
new ilTemplate(
'tpl.crs_members_print.html',
true,
true,
'Modules/Course');
3572 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3574 if($privacy->enabledCourseAccessTimes())
3576 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
3580 include_once
'./Services/Tracking/classes/class.ilObjUserTracking.php';
3581 include_once(
'./Services/Tracking/classes/class.ilLPObjSettings.php');
3588 if(count($members = $this->object->getMembersObject()->getParticipants()))
3592 foreach($members as $member_data)
3594 if($this->show_tracking)
3596 $tpl->setCurrentBlock(
'progress_row');
3597 $tpl->setVariable(
'VAL_PROGRESS',$member_data[
'progress']);
3598 $tpl->parseCurrentBlock();
3601 if($privacy->enabledCourseAccessTimes())
3603 $tpl->setCurrentBlock(
'access_row');
3604 $tpl->setVariable(
'VAL_ACCESS',$member_data[
'access']);
3605 $tpl->parseCurrentBlock();
3607 $tpl->setCurrentBlock(
"members_row");
3608 $tpl->setVariable(
"LOGIN",$member_data[
'login']);
3609 $tpl->setVariable(
"NAME",$member_data[
'name']);
3610 $tpl->setVariable(
"ROLE",$member_data[
'role']);
3611 $tpl->setVariable(
"STATUS",$member_data[
'status']);
3612 $tpl->setVariable(
"PASSED",$member_data[
'passed']);
3616 $tpl->setVariable(
"STATUS",$member_data[
'status']);
3617 $tpl->setVariable(
"PASSED",$member_data[
'passed']);
3619 $tpl->parseCurrentBlock();
3622 $tpl->setCurrentBlock(
"members");
3624 $tpl->setVariable(
"MEMBERS_IMG_ALT",$this->lng->txt(
'crs_header_members'));
3625 $tpl->setVariable(
"MEMBERS_TABLE_HEADER",$this->lng->txt(
'crs_members_table'));
3626 $tpl->setVariable(
"TXT_LOGIN",$this->lng->txt(
'username'));
3627 $tpl->setVariable(
"TXT_NAME",$this->lng->txt(
'name'));
3628 $tpl->setVariable(
"TXT_ROLE",$this->lng->txt(
'crs_role'));
3630 if($this->show_tracking)
3632 $tpl->setCurrentBlock(
'progress');
3633 $tpl->setVariable(
'TXT_PROGRESS',$this->lng->txt(
'learning_progress'));
3634 $tpl->parseCurrentBlock();
3637 if($privacy->enabledCourseAccessTimes())
3639 $tpl->setCurrentBlock(
'access');
3640 $tpl->setVariable(
'TXT_ACCESS',$this->lng->txt(
'last_access'));
3641 $tpl->parseCurrentBlock();
3647 $tpl->setVariable(
"TXT_STATUS",$this->lng->txt(
'crs_status'));
3648 $tpl->setVariable(
"TXT_PASSED",$this->lng->txt(
'crs_passed'));
3651 $tpl->parseCurrentBlock();
3655 if(count($members = $this->object->getMembersObject()->getSubscribers()))
3658 foreach($members as $member_data)
3660 $tpl->setCurrentBlock(
"subscribers_row");
3661 $tpl->setVariable(
"SLOGIN",$member_data[
'login']);
3662 $tpl->setVariable(
"SNAME",$member_data[
'name']);
3663 $tpl->setVariable(
"STIME",$member_data[
"time"]);
3664 $tpl->parseCurrentBlock();
3667 $tpl->setCurrentBlock(
"subscribers");
3669 $tpl->setVariable(
"SUBSCRIBERS_IMG_ALT",$this->lng->txt(
'crs_subscribers'));
3670 $tpl->setVariable(
"SUBSCRIBERS_TABLE_HEADER",$this->lng->txt(
'crs_subscribers'));
3671 $tpl->setVariable(
"TXT_SLOGIN",$this->lng->txt(
'username'));
3672 $tpl->setVariable(
"TXT_SNAME",$this->lng->txt(
'name'));
3673 $tpl->setVariable(
"TXT_STIME",$this->lng->txt(
'crs_time'));
3674 $tpl->parseCurrentBlock();
3678 $tpl->setVariable(
"TITLE",$this->lng->txt(
'crs_members_print_title'));
3681 $headline = $this->lng->txt(
'obj_crs').
': '.$this->
object->getTitle().
3684 $tpl->setVariable(
"HEADLINE",$headline);
3697 global $rbacsystem,
$ilErr, $ilAccess, $ilUser;
3699 $is_admin = (bool) $ilAccess->checkAccess(
"write",
"", $this->object->getRefId());
3702 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_DISABLED)
3704 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
3708 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_members_gallery.html',
'Modules/Course');
3711 $this->tabs_gui->setTabActive(
'members');
3712 $this->tabs_gui->setSubTabActive(
'crs_members_gallery');
3715 if(count($members = $this->object->getMembersObject()->getParticipants()))
3717 $ordered_members = array();
3719 foreach($members as $member_id)
3729 array_push($ordered_members,array(
"id" => $member_id,
3730 "login" => $usr_obj->getLogin(),
3731 "lastname" => $usr_obj->getLastName(),
3732 "firstname" => $usr_obj->getFirstName(),
3733 "sortlastname" => strtoupper($usr_obj->getLastName()).strtoupper($usr_obj->getFirstName()),
3734 "usr_obj" => $usr_obj));
3739 foreach($ordered_members as $member)
3741 $usr_obj = $member[
"usr_obj"];
3743 if(!$usr_obj->getActive())
3748 $public_profile = in_array($usr_obj->getPref(
"public_profile"), array(
"y",
"g")) ?
"y" :
"";
3751 $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user", $member[
"id"]);
3752 $profile_target = $this->ctrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML");
3755 $file = $usr_obj->getPersonalPicturePath(
"xsmall");
3757 if($this->object->getMembersObject()->isAdmin($member[
"id"]) or $this->
object->getMembersObject()->isTutor($member[
"id"]))
3759 if ($public_profile ==
"y")
3761 $this->tpl->setCurrentBlock(
"tutor_linked");
3762 $this->tpl->setVariable(
"LINK_PROFILE", $profile_target);
3763 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3764 $this->tpl->parseCurrentBlock();
3768 $this->tpl->setCurrentBlock(
"tutor_not_linked");
3769 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3770 $this->tpl->parseCurrentBlock();
3772 $this->tpl->setCurrentBlock(
"tutor");
3776 if ($public_profile ==
"y")
3778 $this->tpl->setCurrentBlock(
"member_linked");
3779 $this->tpl->setVariable(
"LINK_PROFILE", $profile_target);
3780 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3781 $this->tpl->parseCurrentBlock();
3785 $this->tpl->setCurrentBlock(
"member_not_linked");
3786 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3787 $this->tpl->parseCurrentBlock();
3789 $this->tpl->setCurrentBlock(
"member");
3793 if ($public_profile ==
"y")
3795 $this->tpl->setVariable(
"FIRSTNAME", $member[
"firstname"]);
3796 $this->tpl->setVariable(
"LASTNAME", $member[
"lastname"]);
3798 $this->tpl->setVariable(
"LOGIN", $member[
"login"]);
3799 $this->tpl->parseCurrentBlock();
3802 $this->tpl->setCurrentBlock(
"members");
3803 $this->tpl->setVariable(
"MEMBERS_TABLE_HEADER",$this->lng->txt(
'crs_members_title'));
3804 $this->tpl->parseCurrentBlock();
3808 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'crs_members_print_title'));
3811 $headline = $this->
object->getTitle().
"<br/>".$this->
object->getDescription();
3813 $this->tpl->setVariable(
"HEADLINE",$headline);
3822 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3833 $offset =
$_GET[
"update_members"] ?
$_GET[
"offset"] : 0;
3834 $order =
$_GET[
"update_members"] ?
$_GET[
"sort_by"] :
'login';
3835 $direction =
$_GET[
"update_members"] ?
$_GET[
"sort_order"] :
'';
3839 $offset =
$_GET[
"update_subscribers"] ?
$_GET[
"offset"] : 0;
3840 $order =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_by"] :
'sub_time';
3841 $direction =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_order"] :
'';
3845 $offset =
$_GET[
"offset"];
3846 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3847 $direction =
$_GET[
"sort_order"];
3851 $offset =
$_GET[
"offset"];
3852 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3853 $direction =
$_GET[
"sort_order"];
3857 $offset =
$_GET[
"offset"];
3859 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
3861 $_GET[
"sort_by"] =
"login";
3863 $order =
$_GET[
"sort_by"];
3864 $direction =
$_GET[
"sort_order"];
3868 $tbl->setOrderColumn($order);
3869 $tbl->setOrderDirection($direction);
3870 $tbl->setOffset($offset);
3871 $tbl->setLimit(
$_GET[
"limit"]);
3872 $tbl->setMaxCount(count($result_set));
3873 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3874 $tbl->setData($result_set);
3881 $tpl =& $tbl->getTemplateObject();
3883 $tpl->setCurrentBlock(
"tbl_form_header");
3884 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3885 $tpl->parseCurrentBlock();
3886 $tpl->setCurrentBlock(
"tbl_action_btn");
3887 $tpl->setVariable(
"BTN_NAME",
"cancelMember");
3888 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
3889 $tpl->parseCurrentBlock();
3890 $tpl->setCurrentBlock(
"tbl_action_btn");
3891 $tpl->setVariable(
"BTN_NAME",
"performRemoveFromWaitingList");
3892 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
3893 $tpl->parseCurrentBlock();
3894 $tpl->setCurrentBlock(
"tbl_action_row");
3895 $tpl->setVariable(
"COLUMN_COUNTS",4);
3897 $tpl->parseCurrentBlock();
3899 $tbl->setTitle($this->lng->txt(
"crs_header_remove_from_waiting_list"),
"icon_usr_b.gif",
3900 $this->lng->txt(
"crs_header_remove_from_waiting_list"));
3901 $tbl->setHeaderNames(array($this->lng->txt(
"username"),
3902 $this->lng->txt(
"firstname"),
3903 $this->lng->txt(
"lastname"),
3904 $this->lng->txt(
"crs_time")));
3905 $tbl->setHeaderVars(array(
"login",
3909 array(
"ref_id" => $this->object->getRefId(),
3911 "cmdClass" =>
"ilobjcoursegui",
3912 "cmdNode" =>
$_GET[
"cmdNode"]));
3914 $tbl->setColumnWidth(array(
"25%",
"25%",
"25%",
"25%"));
3919 $this->tpl->setVariable(
"EDIT_MEMBER_TABLE",$tbl->tpl->get());
3927 $tpl =& $tbl->getTemplateObject();
3929 $tpl->setCurrentBlock(
"tbl_form_header");
3930 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3931 $tpl->parseCurrentBlock();
3932 $tpl->setCurrentBlock(
"tbl_action_btn");
3933 $tpl->setVariable(
"BTN_NAME",
"removeSubscribers");
3934 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
3935 $tpl->parseCurrentBlock();
3936 $tpl->setCurrentBlock(
"tbl_action_btn");
3937 $tpl->setVariable(
"BTN_NAME",
"cancelMember");
3938 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
3939 $tpl->parseCurrentBlock();
3940 $tpl->setCurrentBlock(
"tbl_action_row");
3941 $tpl->setVariable(
"COLUMN_COUNTS",4);
3943 $tpl->parseCurrentBlock();
3945 $tbl->setTitle($this->lng->txt(
"crs_header_delete_subscribers"),
"icon_usr_b.gif",$this->lng->txt(
"crs_header_delete_members"));
3946 $tbl->setHeaderNames(array($this->lng->txt(
"username"),
3947 $this->lng->txt(
"firstname"),
3948 $this->lng->txt(
"lastname"),
3949 $this->lng->txt(
"crs_time")));
3950 $tbl->setHeaderVars(array(
"login",
3954 array(
"ref_id" => $this->object->getRefId(),
3956 "cmdClass" =>
"ilobjcoursegui",
3957 "cmdNode" =>
$_GET[
"cmdNode"]));
3959 $tbl->setColumnWidth(array(
"25%",
"25%",
"25%",
"25%"));
3964 $this->tpl->setVariable(
"EDIT_MEMBER_TABLE",$tbl->tpl->get());
3973 $actions = array(
"addFromWaitingList" => $this->lng->txt(
"crs_add_subscribers"),
3974 "removeFromWaitingList" => $this->lng->txt(
"crs_delete_from_waiting_list"));
3977 $tpl =& $tbl->getTemplateObject();
3979 $tbl->enable(
'select_all');
3980 $tbl->setFormName(
"wait_form");
3981 $tbl->setSelectAllCheckbox(
"waiting_list");
3985 $tpl->setCurrentBlock(
"tbl_action_row");
3987 $tpl->setVariable(
"COLUMN_COUNTS",5);
3991 $tpl->setCurrentBlock(
"tbl_action_select");
3993 $tpl->setVariable(
"BTN_NAME",
"gateway");
3994 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"execute"));
3995 $tpl->parseCurrentBlock();
3997 $tpl->setCurrentBlock(
"tbl_action_row");
3998 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
3999 $tpl->parseCurrentBlock();
4002 $tbl->setTitle($this->lng->txt(
"crs_waiting_list"),
"icon_usr.gif",$this->lng->txt(
"crs_waiting_list"));
4003 $tbl->setHeaderNames(array(
'',
4004 $this->lng->txt(
"name"),
4005 $this->lng->txt(
"login"),
4006 $this->lng->txt(
"crs_time")));
4007 $tbl->setHeaderVars(array(
"",
4011 array(
"ref_id" => $this->object->getRefId(),
4013 "update_subscribers" => 1,
4014 "cmdClass" =>
"ilobjcoursegui",
4015 "cmdNode" =>
$_GET[
"cmdNode"]));
4016 $tbl->setColumnWidth(array(
'1%'));
4021 $this->tpl->setCurrentBlock(
'sub_wait_table');
4022 $this->tpl->setVariable(
'SUB_WAIT_NAME',
'wait_form');
4023 $this->tpl->setVariable(
'SUB_WAIT_FORMACTION',$this->ctrl->getFormAction($this));
4024 $this->tpl->setVariable(
"SUB_WAIT_TABLE_CONTENT",$tbl->tpl->get());
4025 $this->tpl->parseCurrentBlock();
4037 for($i=0;$i<=60;$i++)
4039 $days[$i] = $i < 10 ?
"0".$i : $i;
4044 for($i=0;$i<24;$i++)
4046 $days[$i] = $i < 10 ?
"0".$i : $i;
4051 for($i=1;$i<32;$i++)
4053 $days[$i] = $i < 10 ?
"0".$i : $i;
4058 for($i=1;$i<13;$i++)
4060 $month[$i] = $i < 10 ?
"0".$i : $i;
4065 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
4075 return mktime($a_time_arr[
"hour"],
4076 $a_time_arr[
"minute"],
4077 $a_time_arr[
"second"],
4078 $a_time_arr[
"month"],
4080 $a_time_arr[
"year"]);
4084 unset(
$_SESSION[
"crs_delete_member_ids"]);
4085 unset(
$_SESSION[
"crs_delete_subscriber_ids"]);
4095 global $rbacreview,
$ilErr, $ilAccess, $ilObjDataCache,
$ilias;
4096 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
4098 $this->lng->loadLanguageModule(
'mail');
4099 if(!isset(
$_GET[
'returned_from_mail']))
4104 $is_admin = (bool) $ilAccess->checkAccess(
"write",
"", $this->object->getRefId());
4107 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_DISABLED)
4109 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
4113 $this->tabs_gui->setTabActive(
'members');
4114 $this->tabs_gui->setSubTabActive(
'mail_members');
4116 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.mail_members.html',
'Services/Contact');
4119 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
4121 $this->tpl->setVariable(
"SELECT_ACTION",
'ilias.php?baseClass=ilmailgui&view=my_courses&search_crs='.$this->object->getId());
4122 $this->tpl->setVariable(
"MAIL_SELECTED",$this->lng->txt(
'send_mail_selected'));
4123 $this->tpl->setVariable(
"MAIL_MEMBERS",$this->lng->txt(
'send_mail_members'));
4124 $this->tpl->setVariable(
"MAIL_TUTOR",$this->lng->txt(
'send_mail_tutors'));
4125 $this->tpl->setVariable(
"MAIL_ADMIN",$this->lng->txt(
'send_mail_admins'));
4127 $this->tpl->setVariable(
"OK",$this->lng->txt(
'next'));
4130 $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
4131 $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder[
'ref_id'],
false);
4134 $sorted_role_ids = array();
4136 foreach($role_ids as $role_id)
4141 $sorted_role_ids[2] = $role_id;
4145 $sorted_role_ids[1] = $role_id;
4149 $sorted_role_ids[0] = $role_id;
4153 $sorted_role_ids[$counter++] = $role_id;
4158 ksort($sorted_role_ids,SORT_NUMERIC);
4159 foreach ((array) $sorted_role_ids as $role_id)
4161 $this->tpl->setCurrentBlock(
"mailbox_row");
4162 $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
4166 if(count($ids_for_role_title) >= 2)
4168 $ilias->setSetting(
'pear_mail_enable', 1);
4172 htmlspecialchars($role_addr)
4177 $this->tpl->setVariable(
"MAILBOX",$role_addr);
4182 $this->tpl->setVariable(
"MAILBOX",
ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)).
" (" . $role_addr .
")");
4185 $this->tpl->parseCurrentBlock();
4191 global $rbacsystem,$ilUser,$ilAccess,
$ilErr,$ilTabs,$ilNavigationHistory,
$ilCtrl;
4193 $next_class = $this->ctrl->getNextClass($this);
4194 $cmd = $this->ctrl->getCmd();
4200 $ilAccess->checkAccess(
'read',
'',
$_GET[
'ref_id']))
4202 $ilNavigationHistory->addItem(
$_GET[
'ref_id'],
4203 'repository.php?cmd=frameset&ref_id='.
$_GET[
'ref_id'],
'crs');
4208 if(IS_PAYMENT_ENABLED)
4210 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
4213 $ilTabs->setTabActive(
'info_short');
4215 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
4216 $this->ctrl->setReturn($this,
'');
4218 $this->ctrl->forwardCommand($pp_gui);
4226 case "ilinfoscreengui":
4230 case 'ilmdeditorgui':
4231 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
4233 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
4236 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
4238 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
4239 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
4241 $this->ctrl->forwardCommand($md_gui);
4242 $this->tabs_gui->setTabActive(
'meta_data');
4245 case 'ilcourseregistrationgui':
4246 $this->ctrl->setReturn($this,
'');
4247 $this->tabs_gui->setTabActive(
'join');
4248 include_once(
'./Modules/Course/classes/class.ilCourseRegistrationGUI.php');
4250 $this->ctrl->forwardCommand($registration);
4253 case 'ilobjectcustomuserfieldsgui':
4254 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
4258 $this->tabs_gui->setTabActive(
'settings');
4259 $this->ctrl->forwardCommand($cdf_gui);
4262 case "ilcourseobjectivesgui":
4263 include_once
'./Modules/Course/classes/class.ilCourseObjectivesGUI.php';
4265 $this->ctrl->setReturn($this,
"");
4267 $ret =& $this->ctrl->forwardCommand($reg_gui);
4270 case 'ilobjcoursegroupinggui':
4271 include_once
'./Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
4273 $this->ctrl->setReturn($this,
'edit');
4276 $this->ctrl->forwardCommand($crs_grp_gui);
4277 $this->tabs_gui->setTabActive(
'settings');
4278 $this->tabs_gui->setSubTabActive(
'groupings');
4282 $this->tabs_gui->setTabActive(
'none');
4292 case "ilconditionhandlerinterface":
4293 include_once
'./Services/AccessControl/classes/class.ilConditionHandlerInterface.php';
4296 if($_GET[
'item_id'])
4298 $this->ctrl->saveParameter($this,
'item_id',$_GET[
'item_id']);
4299 $this->tabs_gui->setTabActive(
'content');
4303 $this->ctrl->forwardCommand($new_gui);
4308 $this->tabs_gui->setTabActive(
'settings');
4311 $this->ctrl->forwardCommand($new_gui);
4315 case "illearningprogressgui":
4316 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
4319 $this->object->getRefId(),
4320 $_GET[
'user_id'] ? $_GET[
'user_id'] : $ilUser->getId());
4321 $this->ctrl->forwardCommand($new_gui);
4322 $this->tabs_gui->setTabActive(
'learning_progress');
4325 case 'illicenseoverviewgui':
4326 include_once(
"./Services/License/classes/class.ilLicenseOverviewGUI.php");
4328 $ret =& $this->ctrl->forwardCommand($license_gui);
4329 $this->tabs_gui->setTabActive(
'licenses');
4332 case 'ilpermissiongui':
4333 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
4334 $this->tabs_gui->setTabActive(
'perm_settings');
4336 $ret =& $this->ctrl->forwardCommand($perm_gui);
4339 case 'ilrepositorysearchgui':
4340 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
4342 $rep_search->setCallback($this,
4343 'assignMembersObject',
4354 $this->ctrl->setReturn($this,
'members');
4355 $ret =& $this->ctrl->forwardCommand($rep_search);
4357 $this->tabs_gui->setTabActive(
'members');
4358 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
4361 case 'ilcoursecontentinterface':
4363 $this->initCourseContentInterface();
4364 $this->cci_obj->cci_setContainer($this);
4366 $this->ctrl->forwardCommand($this->cci_obj);
4368 $this->tabs_gui->setTabActive(
'content');
4371 case 'ilcoursecontentgui':
4372 $this->ctrl->setReturn($this,
'members');
4373 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
4375 $this->ctrl->forwardCommand($course_content_obj);
4378 case 'ilpublicuserprofilegui':
4379 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
4382 $this->tabs_gui->setTabActive(
'members');
4383 $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this,
"membersGallery"));
4384 $this->tabs_gui->setSubTabActive(
'crs_members_gallery');
4385 $html = $this->ctrl->forwardCommand($profile_gui);
4386 $this->tpl->setVariable(
"ADM_CONTENT", $html);
4389 case 'ilmemberexportgui':
4390 include_once(
'./Services/Membership/classes/Export/class.ilMemberExportGUI.php');
4393 $this->tabs_gui->setTabActive(
'members');
4394 $this->tabs_gui->setSubTabActive(
'export_members');
4396 $this->ctrl->forwardCommand($export);
4399 case 'ilmemberagreementgui':
4400 include_once(
'Services/Membership/classes/class.ilMemberAgreementGUI.php');
4401 $this->ctrl->setReturn($this,
'');
4403 $this->ctrl->forwardCommand($agreement);
4406 case 'ilsessionoverviewgui':
4407 include_once(
'./Modules/Session/classes/class.ilSessionOverviewGUI.php');
4410 $this->tabs_gui->setTabActive(
'members');
4411 $this->tabs_gui->setSubTabActive(
'events');
4413 $this->ctrl->forwardCommand($overview);
4416 case 'ilcourseitemadministrationgui':
4417 include_once
'Modules/Course/classes/class.ilCourseItemAdministrationGUI.php';
4418 $this->tabs_gui->clearSubTabs();
4419 $this->ctrl->setReturn($this,
'view');
4421 $this->ctrl->forwardCommand($item_adm_gui);
4425 case "ilpageobjectgui":
4429 $this->tpl->setContent($ret);
4433 case 'ilobjectcopygui':
4434 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
4436 $cp->setType(
'crs');
4437 $this->ctrl->forwardCommand($cp);
4440 case "ilobjstylesheetgui":
4444 case 'ilcourseparticipantsgroupsgui':
4445 include_once
'./Modules/Course/classes/class.ilCourseParticipantsGroupsGUI.php';
4449 $this->tabs_gui->setTabActive(
'members');
4450 $this->ctrl->forwardCommand($cmg_gui);
4454 $this->tabs_gui->setTabActive(
'export');
4455 include_once
'./Services/Export/classes/class.ilExportGUI.php';
4457 $exp->addFormat(
'xml');
4458 $this->ctrl->forwardCommand($exp);
4461 case "ilcommonactiondispatchergui":
4462 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
4464 $this->ctrl->forwardCommand($gui);
4467 case 'ildidactictemplategui':
4468 $this->ctrl->setReturn($this,
'edit');
4469 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
4471 $this->ctrl->forwardCommand($did);
4476 if(!$this->creation_mode)
4486 if( !$this->creation_mode
4487 &&
$cmd !=
'infoScreen'
4488 &&
$cmd !=
'sendfile'
4489 &&
$cmd !=
'unsubscribe'
4490 &&
$cmd !=
'performUnsubscribe'
4491 && !$ilAccess->checkAccess(
"read",
'',$this->object->getRefId())
4493 ||
$cmd ==
'subscribe')
4495 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
4496 if($rbacsystem->checkAccess(
'join',$this->object->getRefId()) &&
4499 include_once(
'./Modules/Course/classes/class.ilCourseRegistrationGUI.php');
4500 $this->ctrl->redirectByClass(
"ilCourseRegistrationGUI");
4509 if(
$cmd ==
'listObjectives')
4511 include_once
'./Modules/Course/classes/class.ilCourseObjectivesGUI.php';
4513 $this->ctrl->setReturn($this,
"");
4515 $ret =& $this->ctrl->forwardCommand($obj_gui);
4519 if((!$this->creation_mode)&&(!$rbacsystem->checkAccess(
"write",$this->object->getRefId())))
4521 $this->ctrl->setReturn($this,
'view');
4522 include_once(
'Services/Feedback/classes/class.ilFeedbackGUI.php');
4524 $feedbackGUI->handleRequiredFeedback($this->object->getRefId());
4556 global $ilUser,$ilAccess;
4558 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
4564 if(!$this->object->getMemberObject()->isAssigned())
4569 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
4575 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
4576 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
4586 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
4606 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
4610 $buffer = $lic_set->get(
"license_warning");
4612 include_once(
"./Services/License/classes/class.ilLicense.php");
4614 foreach ($licensed_items as $item)
4616 $license =&
new ilLicense($item[
'obj_id']);
4617 $remaining = $license->getRemainingLicenses();
4618 if ($remaining <= $buffer)
4620 $lng->loadlanguageModule(
"license");
4621 ilUtil::sendInfo(sprintf($this->lng->txt(
"course_licenses_rare"), $remaining), $a_keep);
4631 return array(
"ilCourseRegisterGUI",
'ilConditionHandlerInterface');
4637 $this->initCourseContentInterface();
4638 $this->cci_obj->cci_setContainer($this);
4639 $this->cci_obj->cci_objectives();
4645 $this->tabs_gui->setTabActive(
'edit_content');
4647 $this->initCourseContentInterface();
4648 $this->cci_obj->cci_setContainer($this);
4649 $this->cci_obj->cci_view();
4655 $this->initCourseContentInterface();
4656 $this->cci_obj->cci_setContainer($this);
4657 $this->cci_obj->cci_objectives_ask_reset();
4665 include_once
'./Modules/Course/classes/class.ilCourseObjectiveResult.php';
4668 $tmp_obj_res->
reset($this->object->getId());
4672 $this->initCourseContentInterface();
4673 $this->cci_obj->cci_setContainer($this);
4674 $this->cci_obj->cci_objectives();
4681 include_once
'./Services/AccessControl/classes/class.ilConditionHandlerInterface.php';
4683 if(!is_object($this->chi_obj))
4685 if(
$_GET[
'item_id'])
4688 $this->ctrl->saveParameter($this,
'item_id',
$_GET[
'item_id']);
4702 switch ($this->ctrl->getCmd())
4705 #$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""));
4717 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
4718 if(substr($a_add,0,5) ==
'rcode')
4720 if($ilUser->getId() == ANONYMOUS_USER_ID)
4724 "login.php?target=".
$_GET[
"target"].
"&cmd=force_login&lang=".
4725 $ilUser->getCurrentLanguage()
4737 if ($a_add ==
"mem" && $ilAccess->checkAccess(
"write",
"", $a_target))
4740 $_GET[
"cmd"] =
"members";
4741 $_GET[
"ref_id"] = $a_target;
4742 include(
"repository.php");
4746 if ($ilAccess->checkAccess(
"read",
"", $a_target))
4748 $_GET[
"cmd"] =
"frameset";
4749 $_GET[
"ref_id"] = $a_target;
4750 include(
"repository.php");
4756 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
4758 $_GET[
"cmd"] =
"infoScreen";
4759 $_GET[
"ref_id"] = $a_target;
4760 include(
"repository.php");
4765 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
4767 $_GET[
"cmd"] =
"frameset";
4768 $_GET[
"target"] =
"";
4769 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
4772 include(
"repository.php");
4777 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
4783 return mktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
4788 return array(
'y' => date(
'Y',$a_unix_time),
4789 'm' => date(
'n',$a_unix_time),
4790 'd' => date(
'd',$a_unix_time));
4795 return array(
'h' => date(
'G',$a_unix_time),
4796 'm' => date(
'i',$a_unix_time),
4797 's' => date(
's',$a_unix_time));
4807 global $ilUser,
$ilCtrl, $ilUser, $ilAccess;
4810 $this->tabs_gui->setTabActive(
'settings');
4813 !$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
4818 $latitude = $this->
object->getLatitude();
4819 $longitude = $this->
object->getLongitude();
4820 $zoom = $this->
object->getLocationZoom();
4823 if ($latitude == 0 && $longitude == 0 && $zoom == 0)
4826 $latitude = $def[
"latitude"];
4827 $longitude = $def[
"longitude"];
4828 $zoom = $def[
"zoom"];
4834 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
4836 $form->setFormAction($ilCtrl->getFormAction($this));
4838 $form->setTitle($this->lng->txt(
"crs_map_settings"));
4844 $public->setChecked($this->object->getEnableCourseMap());
4845 $form->addItem($public);
4851 $loc_prop->setLongitude($longitude);
4852 $loc_prop->setZoom($zoom);
4853 $form->addItem($loc_prop);
4855 $form->addCommandButton(
"saveMapSettings", $this->lng->txt(
"save"));
4857 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
4869 $this->
object->update();
4871 $ilCtrl->redirect($this,
"editMapSettings");
4881 $this->tabs_gui->setTabActive(
"members");
4883 $this->tabs_gui->setSubTabActive(
"crs_members_map");
4885 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
4891 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
4893 $map->setMapId(
"course_map");
4894 $map->setWidth(
"700px");
4895 $map->setHeight(
"500px");
4896 $map->setLatitude($this->object->getLatitude());
4897 $map->setLongitude($this->object->getLongitude());
4898 $map->setZoom($this->object->getLocationZoom());
4899 $map->setEnableTypeControl(
true);
4900 $map->setEnableNavigationControl(
true);
4901 $map->setEnableCentralMarker(
true);
4903 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
4907 foreach($members as $user_id)
4909 $map->addUserMarker($user_id);
4913 $tpl->setContent($map->getHTML());
4914 $tpl->setLeftContent($map->getUserListHTML());
4923 $this->object->getAboStatus(), $this->
object->getRefId(), $this->
object->getId());
4929 static function _modifyItemGUI($a_item_list_gui, $a_cmd_class, $a_item_data, $a_show_path,
4930 $a_abo_status, $a_course_ref_id, $a_course_obj_id, $a_parent_ref_id = 0)
4935 if ($a_parent_ref_id == 0)
4937 $a_parent_ref_id = $a_course_ref_id;
4941 if($a_item_data[
'type'] ==
'tst' and
4944 $a_item_list_gui->addCommandLinkParameter(array(
'crs_show_result' => $a_course_ref_id));
4949 if(isset($a_item_data[
'timing_type']))
4951 switch($a_item_data[
'timing_type'])
4971 $a_item_list_gui->enableSubscribe($a_abo_status);
4974 if ($activation !=
"")
4976 $lng->loadLanguageModule(
"crs");
4977 $a_item_list_gui->addCustomProperty($lng->txt($a_item_data[
'activation_info']), $activation,
4981 $is_tutor = ($ilAccess->checkAccess(
'write',
'',
4982 $a_course_ref_id,
'crs', $a_course_obj_id));
4984 if($a_show_path and $is_tutor)
4986 $a_item_list_gui->addCustomProperty($lng->txt(
'path'),
4995 $ilCtrl->setParameterByClass(
'ilcourseitemadministrationgui',
"ref_id",
4997 $ilCtrl->setParameterByClass(
'ilcourseitemadministrationgui',
"item_id",
4998 $a_item_data[
'child']);
4999 $a_item_list_gui->addCustomCommand($ilCtrl->getLinkTargetByClass(
5000 array(strtolower($a_cmd_class),
'ilCourseItemAdministrationGUI'),
5013 if ($this->object->getType() !=
'crs')
5017 if (!$ilAccess->checkAccess(
'write',
'',
5018 $this->object->getRefId(),
'crs',$this->
object->getId()))
5022 if($this->object->enabledObjectiveView())
5036 if(!
$_SESSION[
'crs_timings_panel'][$this->object->getId()] or 1)
5040 $this->tabs_gui->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTargetByClass(
"ilobjcoursegui",
"view"));
5044 $this->tabs_gui->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTargetByClass(
"ilobjcoursegui",
"disableAdministrationPanel"));
5047 include_once
'Modules/Course/classes/class.ilCourseItems.php';
5050 $this->tabs_gui->addSubTabTarget(
'timings_timings',
5051 $this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'editUserTimings'));
5078 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
5080 $dt[
'year'] = (int)
$_POST[$a_field][
'date'][
'y'];
5081 $dt[
'mon'] = (int)
$_POST[$a_field][
'date'][
'm'];
5082 $dt[
'mday'] = (int)
$_POST[$a_field][
'date'][
'd'];
5083 $dt[
'hours'] = (int)
$_POST[$a_field][
'time'][
'h'];
5084 $dt[
'minutes'] = (int)
$_POST[$a_field][
'time'][
'm'];
5085 $dt[
'seconds'] = (int)
$_POST[$a_field][
'time'][
's'];
5100 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_objectives_ask_reset.html",
'Modules/Course');
5102 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
5103 $this->tpl->setVariable(
"INFO_STRING",$this->lng->txt(
'crs_objectives_reset_sure'));
5104 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
5105 $this->tpl->setVariable(
"TXT_RESET",$this->lng->txt(
'reset'));
5114 include_once
'./Modules/Course/classes/class.ilCourseObjectiveResult.php';
5117 $tmp_obj_res->
reset($this->object->getId());
5119 $ilUser->deletePref(
'crs_objectives_force_details_'.$this->object->getId());
5127 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
5129 global $ilAccess,$ilUser;
5131 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
5135 $this->start_obj =
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
5136 if(count($this->start_obj->getStartObjects()) and !$this->start_obj->allFullfilled($ilUser->getId()))
5145 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
5146 include_once
'./Services/Repository/classes/class.ilRepositoryExplorer.php';
5147 include_once
'./classes/class.ilLink.php';
5149 global $rbacsystem,
$ilias,$ilUser,$ilAccess,$ilObjDataCache;
5151 $this->tabs_gui->setSubTabActive(
'view');
5153 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_start_view.html",
'Modules/Course');
5154 $this->tpl->setVariable(
"INFO_STRING",$this->lng->txt(
'crs_info_start'));
5155 $this->tpl->setVariable(
"TBL_TITLE_START",$this->lng->txt(
'crs_table_start_objects'));
5156 $this->tpl->setVariable(
"HEADER_NR",$this->lng->txt(
'crs_nr'));
5157 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
5158 $this->tpl->setVariable(
"HEADER_EDITED",$this->lng->txt(
'crs_objective_accomplished'));
5161 $lm_continue =&
new ilCourseLMHistory($this->object->getRefId(),$ilUser->getId());
5165 foreach($this->start_obj->getStartObjects() as $start)
5167 $obj_id = $ilObjDataCache->lookupObjId($start[
'item_ref_id']);
5168 $ref_id = $start[
'item_ref_id'];
5169 $type = $ilObjDataCache->lookupType(
$obj_id);
5175 $obj_frame = $obj_frame ? $obj_frame :
'';
5178 $obj_frame = $type ==
'tst' ?
'' : $obj_frame;
5180 $contentObj =
false;
5182 if($ilAccess->checkAccess(
'read',
'',
$ref_id))
5184 $this->tpl->setCurrentBlock(
"start_read");
5185 $this->tpl->setVariable(
"READ_TITLE_START",$ilObjDataCache->lookupTitle(
$obj_id));
5186 $this->tpl->setVariable(
"READ_TARGET_START",$obj_frame);
5187 $this->tpl->setVariable(
"READ_LINK_START", $obj_link.
'&crs_show_result='.$this->object->getRefId());
5188 $this->tpl->parseCurrentBlock();
5192 $this->tpl->setCurrentBlock(
"start_visible");
5193 $this->tpl->setVariable(
"VISIBLE_LINK_START",$ilObjDataCache->lookupTitle(
$obj_id));
5194 $this->tpl->parseCurrentBlock();
5198 if(isset($continue_data[
$ref_id]))
5200 $this->tpl->setCurrentBlock(
"link");
5201 $this->tpl->setVariable(
"LINK_HREF",
ilLink::_getLink($ref_id,
'',array(
'obj_id',
5202 $continue_data[$ref_id][
'lm_page_id'])));
5203 #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target);
5204 $this->tpl->setVariable(
"LINK_NAME",$this->lng->txt(
'continue_work'));
5205 $this->tpl->parseCurrentBlock();
5209 if(!$ilUser->isDesktopItem($ref_id,$type) and
5210 $this->
object->getAboStatus())
5212 if ($ilAccess->checkAccess(
'read',
'',$ref_id))
5214 $this->tpl->setCurrentBlock(
"link");
5215 $this->ctrl->setParameterByClass(get_class($this),
'item_ref_id',$ref_id);
5216 $this->ctrl->setParameterByClass(get_class($this),
'item_id',$ref_id);
5217 $this->ctrl->setParameterByClass(get_class($this),
'type',$type);
5219 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this,
'addToDesk'));
5220 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"to_desktop"));
5221 $this->tpl->parseCurrentBlock();
5224 elseif($this->object->getAboStatus())
5226 $this->tpl->setCurrentBlock(
"link");
5227 $this->ctrl->setParameterByClass(get_class($this),
'item_ref_id',$ref_id);
5228 $this->ctrl->setParameterByClass(get_class($this),
'item_id',$ref_id);
5229 $this->ctrl->setParameterByClass(get_class($this),
'type',$type);
5231 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this,
'removeFromDesk'));
5232 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"unsubscribe"));
5233 $this->tpl->parseCurrentBlock();
5238 if(strlen($ilObjDataCache->lookupDescription(
$obj_id)))
5240 $this->tpl->setCurrentBlock(
"start_description");
5241 $this->tpl->setVariable(
"DESCRIPTION_START",$ilObjDataCache->lookupDescription(
$obj_id));
5242 $this->tpl->parseCurrentBlock();
5246 if($this->start_obj->isFullfilled($ilUser->getId(),
$ref_id))
5248 $accomplished =
'accomplished';
5252 $accomplished =
'not_accomplished';
5254 $this->tpl->setCurrentBlock(
"start_row");
5256 $this->tpl->setVariable(
"EDITED_ALT",$this->lng->txt(
'crs_objective_'.$accomplished));
5257 $this->tpl->setVariable(
"ROW_CLASS",
'option_value');
5258 $this->tpl->setVariable(
"ROW_CLASS_CENTER",
'option_value_center');
5259 $this->tpl->setVariable(
"OBJ_NR_START",++$counter.
'.');
5260 $this->tpl->parseCurrentBlock();
5274 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
5276 if($settings->isActive() and $settings->getContainer() != $this->
object->getRefId())
5278 $settings->setContainer($this->object->getRefId());
5279 $rbacsystem->initMemberView();
5291 $link = chr(13).chr(10).chr(13).chr(10);
5292 $link .= $this->lng->txt(
'crs_mail_permanent_link');
5293 $link .= chr(13).chr(10).chr(13).chr(10);
5294 include_once
'./classes/class.ilLink.php';
5296 return rawurlencode(base64_encode($link));
5305 if($lg && $ilSetting->get(
"crsgrp_ntf") &&
5308 if(!$ilUser->getPref(
"grpcrs_ntf_".$this->ref_id))
5310 $lg->addHeaderIcon(
"not_icon",
5312 $this->lng->txt(
"crs_notification_deactivated"));
5314 $this->ctrl->setParameter($this,
"crs_ntf", 1);
5315 $caption =
"crs_activate_notification";
5319 $lg->addHeaderIcon(
"not_icon",
5321 $this->lng->txt(
"crs_notification_activated"));
5323 $this->ctrl->setParameter($this,
"crs_ntf", 0);
5324 $caption =
"crs_deactivate_notification";
5327 $lg->addCustomCommand($this->ctrl->getLinkTarget($this,
"saveNotification"),
5331 $this->ctrl->setParameter($this,
"crs_ntf",
"");