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);
161 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
164 $part->updateNotification($ilUser->getId(), 1);
171 $this->ctrl->setCmd(
"view");
189 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
191 $this->ctrl->setCmdClass(get_class($course_content_obj));
192 $this->ctrl->setCmd(
'editUserTimings');
193 $this->ctrl->forwardCommand($course_content_obj);
214 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
221 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
225 if ($ilCtrl->getNextClass() !=
"ilcolumngui")
227 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
229 $this->
object->getRefId(),
'crs');
234 include_once(
'Services/Membership/classes/class.ilMemberAgreementGUI.php');
235 $this->tabs_gui->clearTargets();
236 $this->ctrl->setReturn($this,
'view_content');
238 $this->ctrl->setCmdClass(get_class($agreement));
239 $this->ctrl->forwardCommand($agreement);
261 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
264 $this->ctrl->setCmdClass(get_class($course_content_obj));
265 $this->ctrl->forwardCommand($course_content_obj);
283 $this->ctrl->setCmd(
"showSummary");
284 $this->ctrl->setCmdClass(
"ilinfoscreengui");
298 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
301 $this->tabs_gui->setTabActive(
'info_short');
303 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
304 include_once
'Modules/Course/classes/class.ilCourseFile.php';
309 $info->enablePrivateNotes();
310 $info->enableFeedback();
312 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
314 $info->enableNewsEditing();
317 if(strlen($this->object->getImportantInformation()) or
318 strlen($this->object->getSyllabus()) or
321 $info->addSection($this->lng->txt(
'crs_general_informations'));
324 if(strlen($this->object->getImportantInformation()))
326 $info->addProperty($this->lng->txt(
'crs_important_info'),
330 if(strlen($this->object->getSyllabus()))
332 $info->addProperty($this->lng->txt(
'crs_syllabus'), nl2br(
338 $tpl =
new ilTemplate(
'tpl.event_info_file.html',
true,
true,
'Modules/Course');
340 foreach($files as
$file)
342 $tpl->setCurrentBlock(
"files");
343 $this->ctrl->setParameter($this,
'file_id',$file->getFileId());
344 $tpl->setVariable(
"DOWN_LINK",$this->ctrl->getLinkTarget($this,
'sendfile'));
345 $tpl->setVariable(
"DOWN_NAME",$file->getFileName());
346 $tpl->setVariable(
"DOWN_INFO_TXT",$this->lng->txt(
'crs_file_size_info'));
347 $tpl->setVariable(
"DOWN_SIZE",$file->getFileSize());
348 $tpl->setVariable(
"TXT_BYTES",$this->lng->txt(
'bytes'));
349 $tpl->parseCurrentBlock();
351 $info->addProperty($this->lng->txt(
'crs_file_download'),
355 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
358 $record_gui->parse();
361 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
364 if($this->object->hasContactData())
366 $info->addSection($this->lng->txt(
"crs_contact"));
368 if(strlen($this->object->getContactName()))
370 $info->addProperty($this->lng->txt(
"crs_contact_name"),
371 $this->
object->getContactName());
373 if(strlen($this->object->getContactResponsibility()))
375 $info->addProperty($this->lng->txt(
"crs_contact_responsibility"),
376 $this->
object->getContactResponsibility());
378 if(strlen($this->object->getContactPhone()))
380 $info->addProperty($this->lng->txt(
"crs_contact_phone"),
381 $this->
object->getContactPhone());
383 if($this->object->getContactEmail())
385 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
386 $emails = split(
",",$this->object->getContactEmail());
387 foreach ($emails as $email) {
388 $email = trim($email);
389 $etpl =
new ilTemplate(
"tpl.crs_contact_email.html",
true,
true ,
'Modules/Course');
392 $etpl->setVariable(
"CONTACT_EMAIL", $email);
393 $mailString .= $etpl->get().
"<br />";
395 $info->addProperty($this->lng->txt(
"crs_contact_email"), $mailString);
397 if(strlen($this->object->getContactConsultation()))
399 $info->addProperty($this->lng->txt(
"crs_contact_consultation"),
400 nl2br($this->object->getContactConsultation()));
407 $this->lng->loadLanguageModule(
"rep");
408 $info->addSection($this->lng->txt(
"rep_activation_availability"));
409 $info->showLDAPRoleGroupMappingInfo();
412 if($this->object->getActivationUnlimitedStatus())
414 $info->addProperty($this->lng->txt(
"rep_activation_access"),
415 $this->lng->txt(
'crs_visibility_limitless'));
419 $info->addProperty($this->lng->txt(
'rep_activation_access'),
425 switch($this->object->getSubscriptionLimitationType())
428 $txt = $this->lng->txt(
"crs_info_reg_deactivated");
432 switch($this->object->getSubscriptionType())
435 $txt = $this->lng->txt(
"crs_info_reg_confirmation");
438 $txt = $this->lng->txt(
"crs_info_reg_direct");
441 $txt = $this->lng->txt(
"crs_info_reg_password");
447 $info->addProperty($this->lng->txt(
"crs_info_reg"),$txt);
452 if($this->object->getSubscriptionUnlimitedStatus())
454 $info->addProperty($this->lng->txt(
"crs_reg_until"),
455 $this->lng->txt(
'crs_unlimited'));
457 elseif($this->object->getSubscriptionStart() < time())
459 $info->addProperty($this->lng->txt(
"crs_reg_until"),
460 $this->lng->txt(
'crs_to').
' '.
463 elseif($this->object->getSubscriptionStart() > time())
465 $info->addProperty($this->lng->txt(
"crs_reg_until"),
466 $this->lng->txt(
'crs_from').
' '.
469 if ($this->object->isSubscriptionMembershipLimited())
471 include_once
'./Services/Membership/classes/class.ilParticipants.php';
473 $this->lng->txt(
"mem_free_places"),
486 $info->addProperty($this->lng->txt(
"crs_archive"),
493 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
496 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
499 include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
503 $this->lng->loadLanguageModule(
'ps');
504 $info->addSection($this->lng->txt(
'crs_user_agreement_info'));
505 $info->addProperty($this->lng->txt(
'ps_export_data'),$field_info->exportableFieldsToInfoString());
509 $info->addProperty($this->lng->txt(
'ps_crs_user_fields'),$fields);
513 $info->enableLearningProgress(
true);
516 $this->ctrl->forwardCommand($info);
526 $ilUser->setPref(
"grpcrs_ntf_".$this->ref_id, (
bool)
$_REQUEST[
"crs_ntf"]);
527 $ilUser->writePrefs();
530 $this->ctrl->redirect($this,
"");
540 global
$tpl, $ilToolbar;
545 $this->tabs_gui->setTabActive(
'settings');
546 $this->tabs_gui->setSubTabActive(
'crs_start_objects');
548 $ilToolbar->addButton($this->lng->txt(
'crs_add_starter'),
549 $this->ctrl->getLinkTarget($this,
'selectStarter'));
551 include_once
'./Modules/Course/classes/class.ilCourseStartObjectsTableGUI.php';
553 $tpl->setContent($table->getHTML());
560 if(!count(
$_POST[
'starter']))
568 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
570 $cgui->setFormAction($this->ctrl->getFormAction($this,
"listStructure"));
571 $cgui->setHeaderText($this->lng->txt(
"crs_starter_delete_sure"));
572 $cgui->setCancel($this->lng->txt(
"cancel"),
"listStructure");
573 $cgui->setConfirm($this->lng->txt(
"delete"),
"deleteStarter");
576 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
577 $crs_start =
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
579 foreach(
$_POST[
'starter'] as $starter_id)
585 $cgui->addItem(
"starter[]", $starter_id, $title, $icon, $alt);
588 $tpl->setContent($cgui->getHTML());
595 if(!count(
$_POST[
'starter']))
601 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
602 $crs_start =
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
603 foreach(
$_POST[
'starter'] as $starter_id)
605 $crs_start->
delete((
int)$starter_id);
622 $this->tabs_gui->clearTargets();
623 $this->tabs_gui->setBackTarget($this->lng->txt(
'back'),
624 $this->ctrl->getLinkTarget($this,
'listStructure'));
626 include_once
'./Modules/Course/classes/class.ilCourseStartObjectsTableGUI.php';
629 $tpl->setContent($table->getHTML());
638 if(!count(
$_POST[
'starter']))
646 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
647 $crs_start =&
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
649 foreach(
$_POST[
'starter'] as $item_ref_id)
651 if(!$crs_start->exists($item_ref_id))
654 $crs_start->
add($item_ref_id);
681 include_once
'Modules/Course/classes/class.ilCourseFile.php';
693 $this->tabs_gui->setTabActive(
'settings');
694 $this->tabs_gui->setSubTabActive(
'crs_info_settings');
697 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.edit_info.html',
'Modules/Course');
698 $this->tpl->setVariable(
'INFO_TABLE',$form->getHTML());
705 foreach($files as
$file)
707 $table_data[
'id'] = $file->getFileId();
708 $table_data[
'filename'] = $file->getFileName();
709 $table_data[
'filetype'] = $file->getFileType();
710 $table_data[
'filesize'] = $file->getFileSize();
712 $rows[] = $table_data;
715 include_once(
"./Modules/Course/classes/class.ilCourseInfoFileTableGUI.php");
717 $table_gui->setTitle($this->lng->txt(
"crs_info_download"));
718 $table_gui->setData($rows);
719 $table_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
720 $table_gui->addMultiCommand(
"confirmDeleteInfoFiles", $this->lng->txt(
"delete"));
721 $table_gui->setSelectAllCheckbox(
"file_id");
722 $this->tpl->setVariable(
'INFO_FILE_TABLE',$table_gui->getHTML());
737 if(!count(
$_POST[
'file_id']))
745 $this->tabs_gui->setTabActive(
'settings');
746 $this->tabs_gui->setSubTabActive(
'crs_info_settings');
748 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
752 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteInfoFiles"));
753 $c_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
754 $c_gui->setCancel($this->lng->txt(
"cancel"),
"editInfo");
755 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteInfoFiles");
758 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
759 foreach(
$_POST[
"file_id"] as $file_id)
762 $c_gui->addItem(
"file_id[]", $file_id,
$file->getFileName());
765 $this->tpl->setContent($c_gui->getHTML());
776 if(!count(
$_POST[
'file_id']))
782 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
784 foreach(
$_POST[
'file_id'] as $file_id)
787 if($this->object->getId() ==
$file->getCourseId())
806 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
808 $form->setFormAction($this->ctrl->getFormAction($this,
'updateInfo'));
809 $form->setMultipart(
true);
810 $form->setTitle($this->lng->txt(
'crs_general_info'));
811 $form->addCommandButton(
'updateInfo',$this->lng->txt(
'save'));
812 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
815 $area->
setValue($this->object->getImportantInformation());
818 $form->addItem($area);
821 $area->
setValue($this->object->getSyllabus());
824 $form->addItem($area);
827 $section->setTitle($this->lng->txt(
'crs_info_download'));
831 $file->enableFileNameSelection(
'file_name');
832 $form->addItem(
$file);
835 $section->setTitle($this->lng->txt(
'crs_contact'));
838 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_name'),
'contact_name');
839 $text->
setValue($this->object->getContactName());
841 $text->setMaxLength(70);
842 $form->addItem($text);
844 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_responsibility'),
'contact_responsibility');
845 $text->
setValue($this->object->getContactResponsibility());
847 $text->setMaxLength(70);
848 $form->addItem($text);
850 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_phone'),
'contact_phone');
851 $text->
setValue($this->object->getContactPhone());
853 $text->setMaxLength(40);
854 $form->addItem($text);
856 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_email'),
'contact_email');
857 $text->
setValue($this->object->getContactEmail());
858 $text->setInfo($this->lng->txt(
'crs_contact_email_info'));
860 $text->setMaxLength(255);
861 $form->addItem($text);
863 $area =
new ilTextAreaInputGUI($this->lng->txt(
'crs_contact_consultation'),
'contact_consultation');
864 $area->
setValue($this->object->getContactConsultation());
867 $form->addItem($area);
869 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
872 $record_gui->parse();
883 include_once
'Modules/Course/classes/class.ilCourseFile.php';
885 $file_obj->setCourseId($this->object->getId());
886 $file_obj->setFileName(strlen(
$_POST[
'file_name']) ?
888 $_FILES[
'file'][
'name']);
889 $file_obj->setFileSize($_FILES[
'file'][
'size']);
890 $file_obj->setFileType($_FILES[
'file'][
'type']);
891 $file_obj->setTemporaryName($_FILES[
'file'][
'tmp_name']);
892 $file_obj->setErrorCode($_FILES[
'file'][
'error']);
902 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
904 'crs',$this->object->getId());
908 $ilErr->setMessage(
'');
909 $file_obj->validate();
910 $this->
object->validateInfoSettings();
912 if(strlen($ilErr->getMessage()))
918 $this->
object->update();
920 $record_gui->saveValues();
923 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
925 $ecs->handleContentUpdate();
944 $period = $form->getItemByPostVar(
"access_period");
945 $sub_period = $form->getItemByPostVar(
"subscription_period");
947 if((
int)
$_POST[
'activation_type'])
955 $this->
object->setOfflineStatus(!(
bool)$_POST[
'activation_online']);
956 $this->
object->setActivationStart($period->getStart()->get(
IL_CAL_UNIX));
957 $this->
object->setActivationEnd($period->getEnd()->get(
IL_CAL_UNIX));
958 $this->
object->setActivationVisibility((
int)$_POST[
'activation_visibility']);
960 $sub_type = (int)$_POST[
'subscription_type'];
963 $this->
object->setSubscriptionType($sub_type);
965 if((
int)$_POST[
'subscription_limitation_type'])
982 $this->
object->setSubscriptionStart($sub_period->getStart()->get(
IL_CAL_UNIX));
983 $this->
object->setSubscriptionEnd($sub_period->getEnd()->get(
IL_CAL_UNIX));
985 $this->
object->enableSubscriptionMembershipLimitation((
int) $_POST[
'subscription_membership_limitation']);
986 $this->
object->setSubscriptionMaxMembers((
int) $_POST[
'subscription_max']);
988 $this->
object->enableRegistrationAccessCode((
int) $_POST[
'reg_code_enabled']);
991 $this->
object->enableWaitingList((
int) $_POST[
'waiting_list']);
992 #$this->object->setSubscriptionNotify((int) $_POST['subscription_notification']);
993 $this->
object->setViewMode((
int) $_POST[
'view_mode']);
1001 $this->
object->setOrderType((
int) $_POST[
'order_type']);
1008 $this->
object->setAboStatus((
int) $_POST[
'abo']);
1009 $this->
object->setShowMembers((
int) $_POST[
'show_members']);
1010 $this->
object->setMailToMembersType((
int) $_POST[
'mail_type']);
1012 $this->
object->enableSessionLimit((
int) $_POST[
'sl']);
1013 $this->
object->setNumberOfPreviousSessions(is_numeric($_POST[
'sp']) ? (
int) $_POST[
'sp'] : -1 );
1014 $this->
object->setNumberOfnextSessions(is_numeric($_POST[
'sn']) ? (
int) $_POST[
'sn'] : -1 );
1016 $this->
object->setAutoNotification($_POST[
'auto_notification'] == 1 ?
true :
false);
1019 $show_lp_sync_confirmation =
false;
1022 if(isset($_POST[
'status_dt']))
1027 $show_lp_sync_confirmation =
true;
1031 $this->
object->setStatusDetermination((
int)$_POST[
'status_dt']);
1036 if($this->object->validate())
1038 $this->
object->update();
1041 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1048 include_once
'./Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
1050 $this->object->getId(),
1060 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
1062 if(!$ecs->handleSettingsUpdate())
1068 if($show_lp_sync_confirmation)
1087 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1089 $cgui->setFormAction($this->ctrl->getFormAction($this,
"setLPSync"));
1090 $cgui->setHeaderText($this->lng->txt(
"crs_status_determination_sync"));
1091 $cgui->setCancel($this->lng->txt(
"cancel"),
"edit");
1092 $cgui->setConfirm($this->lng->txt(
"confirm"),
"setLPSync");
1094 $tpl->setContent($cgui->getHTML());
1100 $this->
object->update();
1102 $this->
object->syncMembersStatusWithLP();
1105 $this->ctrl->redirect($this,
"edit");
1119 $this->tabs_gui->setSubTabActive(
'crs_settings');
1131 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1132 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
1135 $form->setTitle($this->lng->txt(
'crs_edit'));
1138 $form->addCommandButton(
'update',$this->lng->txt(
'save'));
1139 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1141 $form->setFormAction($this->ctrl->getFormAction($this,
'update'));
1146 $title->setValue($this->object->getTitle());
1149 $title->setRequired(
true);
1150 $form->addItem($title);
1154 $desc->
setValue($this->object->getLongDescription());
1157 $form->addItem($desc);
1165 $this->lng->loadLanguageModule(
'rep');
1168 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
1171 $online =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_online'),
'activation_online');
1172 $online->
setChecked(!$this->object->getOfflineStatus());
1173 $online->setInfo($this->lng->txt(
'crs_activation_online_info'));
1174 $form->addItem($online);
1176 $act_type =
new ilCheckboxInputGUI($this->lng->txt(
'crs_visibility_until'),
'activation_type');
1180 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
1181 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
1185 $dur->setStartText($this->lng->txt(
'rep_activation_limited_start'));
1187 $dur->setEndText($this->lng->txt(
'rep_activation_limited_end'));
1188 $act_type->addSubItem($dur);
1190 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'activation_visibility');
1191 $visible->
setInfo($this->lng->txt(
'crs_activation_limited_visibility_info'));
1192 $visible->setChecked($this->object->getActivationVisibility());
1193 $act_type->addSubItem($visible);
1195 $form->addItem($act_type);
1199 $section->setTitle($this->lng->txt(
'crs_reg'));
1202 $reg_proc =
new ilRadioGroupInputGUI($this->lng->txt(
'crs_registration_type'),
'subscription_type');
1205 ? $this->object->getSubscriptionType()
1210 $reg_proc->addOption($opt);
1215 $pass->
setInfo($this->lng->txt(
'crs_reg_password_info'));
1216 $pass->setSubmitFormOnEnter(
true);
1218 $pass->setMaxLength(12);
1219 $pass->
setValue($this->object->getSubscriptionPassword());
1221 $opt->addSubItem($pass);
1222 $reg_proc->addOption($opt);
1225 $opt->
setInfo($this->lng->txt(
'crs_registration_confirmation_info'));
1226 $reg_proc->addOption($opt);
1229 $opt->
setInfo($this->lng->txt(
'crs_registration_deactivated'));
1230 $reg_proc->addOption($opt);
1232 $form->addItem($reg_proc);
1236 $reg_code =
new ilCheckboxInputGUI($this->lng->txt(
'crs_reg_code'),
'reg_code_enabled');
1237 $reg_code->
setChecked($this->object->isRegistrationAccessCodeEnabled());
1238 $reg_code->setValue(1);
1239 $reg_code->setInfo($this->lng->txt(
'crs_reg_code_enabled_info'));
1247 #$link = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_link'));
1249 if(!$this->object->getRegistrationAccessCode())
1251 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1255 $reg_link->setValue($this->object->getRegistrationAccessCode());
1256 $form->addItem($reg_link);
1259 include_once
'./Services/Link/classes/class.ilLink.php';
1260 $val =
ilLink::_getLink($this->object->getRefId(),$this->
object->getType(),array(),
'_rcode'.$this->object->getRegistrationAccessCode());
1261 $link->setHTML(
'<font class="small">'.$val.
'</font>');
1262 $reg_code->addSubItem($link);
1264 $form->addItem($reg_code);
1268 $time_limit =
new ilCheckboxInputGUI($this->lng->txt(
'crs_registration_limited'),
'subscription_limitation_type');
1271 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
1275 $sdur->setStartText($this->lng->txt(
'crs_start'));
1277 $sdur->setEndText($this->lng->txt(
'crs_end'));
1279 $time_limit->addSubItem($sdur);
1280 $form->addItem($time_limit);
1284 $lim =
new ilCheckboxInputGUI($this->lng->txt(
'crs_subscription_max_members_short'),
'subscription_membership_limitation');
1286 $lim->setChecked($this->object->isSubscriptionMembershipLimited());
1289 $max->setSubmitFormOnEnter(
true);
1291 $max->setMaxLength(4);
1292 $max->setValue($this->object->getSubscriptionMaxMembers() ? $this->
object->getSubscriptionMaxMembers() :
'');
1293 $max->setTitle($this->lng->txt(
'crs_subscription_max_members'));
1294 $max->setInfo($this->lng->txt(
'crs_reg_max_info'));
1296 $lim->addSubItem($max);
1299 $wait->
setChecked($this->object->enabledWaitingList());
1300 $wait->setInfo($this->lng->txt(
'crs_wait_info'));
1301 $lim->addSubItem($wait);
1303 $form->addItem($lim);
1307 $pres->setTitle($this->lng->txt(
'crs_view_mode'));
1309 $form->addItem($pres);
1313 $view_type->
setValue($this->object->getViewMode());
1316 $opts->
setInfo($this->lng->txt(
'cntr_view_info_sessions'));
1317 $view_type->addOption($opts);
1322 $sess->setChecked($this->object->isSessionLimitEnabled());
1323 $sess->setInfo($this->lng->txt(
'sess_limit_info'));
1326 #$prev->setSubmitFormOnEnter(true);
1328 $prev->setValue($this->object->getNumberOfPreviousSessions() == -1 ?
1330 $this->
object->getNumberOfPreviousSessions()
1333 $prev->setMaxLength(3);
1334 $sess->addSubItem($prev);
1337 #$next->setSubmitFormOnEnter(true);
1339 $next->setValue($this->object->getNumberOfNextSessions() == -1 ?
1341 $this->
object->getNumberOfnextSessions()
1344 $next->setMaxLength(3);
1345 $sess->addSubItem($next);
1347 $opts->addSubItem(
$sess);
1353 $optsi->
setInfo($this->lng->txt(
'cntr_view_info_simple'));
1354 $view_type->addOption($optsi);
1357 $optbt->
setInfo($this->lng->txt(
'cntr_view_info_by_type'));
1358 $view_type->addOption($optbt);
1361 $opto->
setInfo($this->lng->txt(
'crs_view_info_objective'));
1362 $view_type->addOption($opto);
1365 $optt->
setInfo($this->lng->txt(
'crs_view_info_timing'));
1366 $view_type->addOption($optt);
1391 $form->addItem($view_type);
1395 $sort->
setValue($this->object->getOrderType());
1398 $opt->
setInfo($this->lng->txt(
'crs_sort_title_info'));
1399 $sort->addOption($opt);
1402 $opt->
setInfo($this->lng->txt(
'crs_sort_manual_info'));
1403 $sort->addOption($opt);
1406 $opt->
setInfo($this->lng->txt(
'crs_sort_timing_info'));
1407 $sort->addOption($opt);
1410 $form->addItem($sort);
1414 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
1417 include_once
'./Services/Object/classes/class.ilObjectLP.php';
1419 if($olp->getCurrentMode())
1422 $lp_status->setTitle($this->lng->txt(
'crs_course_status_of_users'));
1423 $form->addItem($lp_status);
1425 $lp_status_options =
new ilRadioGroupInputGUI($this->lng->txt(
'crs_status_determination'),
"status_dt");
1427 $lp_status_options->
setValue($this->object->getStatusDetermination());
1429 $lp_option =
new ilRadioOption($this->lng->txt(
'crs_status_determination_lp'),
1431 $lp_status_options->addOption($lp_option);
1432 $lp_status_options->addOption(
new ilRadioOption($this->lng->txt(
'crs_status_determination_manual'),
1435 $form->addItem($lp_status_options);
1441 $feat->setTitle($this->lng->txt(
'obj_features'));
1442 $form->addItem($feat);
1444 include_once
'./Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
1446 $this->object->getId(),
1456 $mem->
setChecked($this->object->getShowMembers());
1457 $mem->setInfo($this->lng->txt(
'crs_show_members_info'));
1458 $form->addItem($mem);
1462 $mail_type->
setValue($this->object->getMailToMembersType());
1465 $this->lng->txt(
'crs_mail_tutors_only_info'));
1466 $mail_type->addOption($mail_tutors);
1469 $this->lng->txt(
'crs_mail_all_info'));
1470 $mail_type->addOption($mail_all);
1471 $form->addItem($mail_type);
1479 $not =
new ilCheckboxInputGUI($this->lng->txt(
'crs_auto_notification'),
'auto_notification');
1481 $not->setInfo($this->lng->txt(
'crs_auto_notification_info'));
1482 $not->setChecked( $this->object->getAutoNotification() );
1483 $form->addItem($not);
1491 $desk =
new ilCheckboxInputGUI($this->lng->txt(
'crs_add_remove_from_desktop'),
'abo');
1492 $desk->
setChecked($this->object->getAboStatus());
1493 $desk->setInfo($this->lng->txt(
'crs_add_remove_from_desktop_info'));
1494 $form->addItem($desk);
1498 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
1500 $ecs->addSettingsToForm($form,
'crs');
1520 $this->tabs_gui->setTabActive(
'settings');
1527 $tpl->setContent($a_form->getHTML());
1532 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1534 $form->setFormAction($this->ctrl->getFormAction($this));
1539 $form->addCommandButton(
'updateCourseIcons', $this->lng->txt(
'save'));
1546 include_once
'Modules/Course/classes/class.ilCourseFile.php';
1560 if($form->checkInput())
1563 if ($this->ilias->getSetting(
"custom_icons"))
1565 if(
$_POST[
"cont_big_icon_delete"])
1567 $this->
object->removeBigIcon();
1569 if(
$_POST[
"cont_small_icon_delete"])
1571 $this->
object->removeSmallIcon();
1573 if(
$_POST[
"cont_tiny_icon_delete"])
1575 $this->
object->removeTinyIcon();
1577 $this->
object->saveIcons($_FILES[
"cont_big_icon"][
'tmp_name'],
1578 $_FILES[
"cont_small_icon"][
'tmp_name'], $_FILES[
"cont_tiny_icon"][
'tmp_name']);
1582 $this->ctrl->redirect($this,
"editCourseIcons");
1585 $form->setValuesByPost();
1600 $this->tabs_gui->addSubTabTarget(
"crs_settings",
1601 $this->ctrl->getLinkTarget($this,
'edit'),
1602 "edit", get_class($this));
1604 $this->tabs_gui->addSubTabTarget(
"crs_info_settings",
1605 $this->ctrl->getLinkTarget($this,
'editInfo'),
1606 "editInfo", get_class($this));
1608 $this->tabs_gui->addSubTabTarget(
"preconditions",
1609 $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerInterface',
'listConditions'),
1610 "",
"ilConditionHandlerInterface");
1611 $this->tabs_gui->addSubTabTarget(
"crs_start_objects",
1612 $this->ctrl->getLinkTarget($this,
'listStructure'),
1613 "listStructure", get_class($this));
1614 $this->tabs_gui->addSubTabTarget(
'groupings',
1615 $this->ctrl->getLinkTargetByClass(
'ilobjcoursegroupinggui',
'listGroupings'),
1620 if ($this->ilias->getSetting(
"custom_icons"))
1622 $this->tabs_gui->addSubTabTarget(
"icon_settings",
1623 $this->ctrl->getLinkTarget($this,
'editCourseIcons'),
1624 "editCourseIcons", get_class($this));
1628 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1631 $this->tabs_gui->addSubTabTarget(
"crs_map_settings",
1632 $this->ctrl->getLinkTarget($this,
'editMapSettings'),
1633 "editMapSettings", get_class($this));
1637 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1638 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1642 $this->tabs_gui->addSubTabTarget(
'crs_custom_user_fields',
1643 $this->ctrl->getLinkTargetByClass(
'ilobjectcustomuserfieldsgui'),
1645 'ilobjectcustomuserfieldsgui');
1649 include_once
"Services/Certificate/classes/class.ilCertificate.php";
1652 $this->tabs_gui->addSubTabTarget(
1654 $this->ctrl->getLinkTargetByClass(
"ilcertificategui",
"certificateeditor"),
1655 "",
"ilcertificategui");
1660 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1662 $this->tabs_gui->addSubTabTarget(
"crs_member_administration",
1663 $this->ctrl->getLinkTarget($this,
'members'),
1664 "members", get_class($this));
1666 $this->tabs_gui->addSubTabTarget(
"crs_members_groups",
1667 $this->ctrl->getLinkTargetByClass(
"ilCourseParticipantsGroupsGUI",
"show"),
1668 "",
"ilCourseParticipantsGroupsGUI");
1670 $this->tabs_gui->addSubTabTarget(
"crs_members_gallery",
1671 $this->ctrl->getLinkTarget($this,
'membersGallery'),
1672 "membersGallery", get_class($this));
1675 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_ENABLED
1678 $this->tabs_gui->addSubTabTarget(
"crs_members_gallery",
1679 $this->ctrl->getLinkTarget($this,
'membersGallery'),
1680 "membersGallery", get_class($this));
1684 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1687 $this->tabs_gui->addSubTabTarget(
"crs_members_map",
1688 $this->ctrl->getLinkTarget($this,
'membersMap'),
1689 "membersMap", get_class($this));
1693 include_once
'Services/Mail/classes/class.ilMail.php';
1694 $mail =
new ilMail($ilUser->getId());
1697 $ilAccess->checkAccess(
'write',
'',$this->object->getRefId())) &&
1698 $rbacsystem->checkAccess(
'internal_mail',$mail->getMailObjectReferenceId())
1701 $this->tabs_gui->addSubTabTarget(
"mail_members",
1702 $this->ctrl->getLinkTarget($this,
'mailMembers'),
1703 "mailMembers", get_class($this));
1706 $childs = (array) $tree->getChildsByType($this->object->getRefId(),
'sess');
1707 if(count($childs) && $ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1709 $this->tabs_gui->addSubTabTarget(
"events",
1710 $this->ctrl->getLinkTargetByClass(
'ilsessionoverviewgui',
'listSessions'),
1711 "",
'ilsessionoverviewgui');
1714 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
1717 $this->tabs_gui->addSubTabTarget(
'export_members',
1718 $this->ctrl->getLinkTargetByClass(
'ilmemberexportgui',
'show'),
1719 "",
'ilmemberexportgui');
1735 $this->
object->removeSmallIcon();
1736 $this->ctrl->redirect($this,
'editCourseIcons');
1746 $this->
object->removeBigIcon();
1747 $this->ctrl->redirect($this,
'editCourseIcons');
1758 $this->
object->removeTinyIcon();
1759 $this->ctrl->redirect($this,
'editCourseIcons');
1770 $a_new_object->getMemberObject()->add($ilUser->getId(),
IL_CRS_ADMIN);
1771 $a_new_object->getMemberObject()->updateNotification($ilUser->getId(),1);
1775 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1783 $this->ctrl->setParameter($this,
"ref_id", $a_new_object->
getRefId());
1785 $this->ctrl->getLinkTarget($this,
"edit",
"",
false,
false)));
1802 if(!count(
$_POST[
'archives']))
1805 $this->archiveObject();
1809 if(count(
$_POST[
'archives']) > 1)
1812 $this->archiveObject();
1817 $this->
object->initCourseArchiveObject();
1819 $abs_path = $this->
object->archives_obj->getArchiveFile((
int)
$_POST[
'archives'][0]);
1820 $basename = basename($abs_path);
1835 if(isset(
$_GET[
'admin_hide']))
1837 $ilUser->writePref(
'crs_admin_hide',(
int)
$_GET[
'admin_hide']);
1839 if(isset(
$_GET[
'tutor_hide']))
1841 $ilUser->writePref(
'crs_tutor_hide',(
int)
$_GET[
'tutor_hide']);
1843 if(isset(
$_GET[
'member_hide']))
1845 $ilUser->writePref(
'crs_member_hide',(
int)
$_GET[
'member_hide']);
1847 if(isset(
$_GET[
'subscriber_hide']))
1849 $ilUser->writePref(
'crs_subscriber_hide',(
int)
$_GET[
'subscriber_hide']);
1851 if(isset(
$_GET[
'wait_hide']))
1853 $ilUser->writePref(
'crs_wait_hide',(
int)
$_GET[
'wait_hide']);
1855 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
1858 if(isset(
$_GET[
'role_hide_'.$role_id]))
1860 $ilUser->writePref(
'crs_role_hide_'.$role_id,(
int)
$_GET[
'role_hide_'.$role_id]);
1867 if($this->show_tracking)
1869 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
1874 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1877 if($privacy->enabledCourseAccessTimes())
1879 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
1883 $do_prtf = (is_array($selected_columns) &&
1884 in_array(
'prtf', $selected_columns) &&
1888 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
1890 $this->ctrl->getLinkTarget($this,
"members"));
1893 foreach((array) $ids as
$usr_id)
1896 $tmp_data[
'firstname'] = $name[
'firstname'];
1897 $tmp_data[
'lastname'] = $name[
'lastname'];
1899 $tmp_data[
'passed'] = $this->
object->getMembersObject()->hasPassed(
$usr_id) ? 1 : 0;
1902 $tmp_data[
'passed_info'] = $this->
object->getMembersObject()->getPassedInfo(
$usr_id);
1904 $tmp_data[
'notification'] = $this->
object->getMembersObject()->isNotificationEnabled(
$usr_id) ? 1 : 0;
1905 $tmp_data[
'blocked'] = $this->
object->getMembersObject()->isBlocked(
$usr_id) ? 1 : 0;
1906 $tmp_data[
'usr_id'] =
$usr_id;
1908 if($this->show_tracking)
1910 if(in_array(
$usr_id,$completed))
1914 elseif(in_array(
$usr_id,$in_progress))
1928 if($privacy->enabledCourseAccessTimes())
1932 $tmp_data[
'access_ut'] = $progress[
$usr_id][
'ts'];
1937 $tmp_data[
'access_ut'] = 0;
1938 $tmp_data[
'access_time'] = $this->lng->txt(
'no_date');
1944 $tmp_data[
'prtf'] = $all_prtf[
$usr_id];
1947 $members[
$usr_id] = $tmp_data;
1949 return $members ? $members : array();
1965 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
1966 include_once(
'./Modules/Course/classes/class.ilCourseParticipantsTableGUI.php');
1969 if(isset(
$_GET[
'member_table_nav']))
1976 include_once
'./Services/Tracking/classes/class.ilObjUserTracking.php';
1979 if($this->show_tracking)
1981 include_once(
'./Services/Object/classes/class.ilObjectLP.php');
1983 $this->show_tracking = $olp->isActive();
1986 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
1991 $this->tabs_gui->setTabActive(
'members');
1992 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
1994 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_edit_members.html',
'Modules/Course');
1995 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
1998 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
2020 'auto_complete_name' => $lng->txt(
'user'),
2021 'user_type' => $types,
2022 'submit_name' => $lng->txt(
'add')
2027 $ilToolbar->addSeparator();
2030 $ilToolbar->addButton($this->lng->txt(
"crs_search_users"),
2031 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
2034 $ilToolbar->addSeparator();
2037 $ilToolbar->addButton($this->lng->txt(
"crs_print_list"),
2038 $this->ctrl->getLinkTarget($this,
'printMembers'));
2048 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2050 if(count($wait = $waiting_list->getAllUsers()))
2052 include_once(
'./Services/Membership/classes/class.ilWaitingListTableGUI.php');
2053 if($ilUser->getPref(
'crs_wait_hide'))
2056 $this->ctrl->setParameter($this,
'wait_hide',0);
2057 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2058 $this->lng->txt(
'show'),
2061 $this->ctrl->clearParameters($this);
2066 $this->ctrl->setParameter($this,
'wait_hide',1);
2067 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2068 $this->lng->txt(
'hide'),
2071 $this->ctrl->clearParameters($this);
2073 $table_gui->setUsers($wait);
2074 $table_gui->setTitle($this->lng->txt(
'crs_waiting_list'),
'icon_usr.png',$this->lng->txt(
'crs_waiting_list'));
2075 $this->tpl->setVariable(
'TABLE_WAIT',$table_gui->getHTML());
2081 include_once(
'./Services/Membership/classes/class.ilSubscriberTableGUI.php');
2082 if($ilUser->getPref(
'crs_subscriber_hide'))
2085 $this->ctrl->setParameter($this,
'subscriber_hide',0);
2086 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2087 $this->lng->txt(
'show'),
2090 $this->ctrl->clearParameters($this);
2095 $this->ctrl->setParameter($this,
'subscriber_hide',1);
2096 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2097 $this->lng->txt(
'hide'),
2100 $this->ctrl->clearParameters($this);
2102 $table_gui->readSubscriberData();
2103 $table_gui->setTitle($this->lng->txt(
'group_new_registrations'),
'icon_usr.png',$this->lng->txt(
'group_new_registrations'));
2104 $this->tpl->setVariable(
'TABLE_SUB',$table_gui->getHTML());
2109 if($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultAdminRole())))
2115 $ilAccess->checkAccess(
"edit_permission",
'', $this->object->getRefId()) or
2118 if($ilUser->getPref(
'crs_admin_hide'))
2125 $this->timings_enabled,
2127 $this->object->getDefaultAdminRole(),
2130 $this->ctrl->setParameter($this,
'admin_hide',0);
2132 $this->lng->txt(
'show'),
2135 $this->ctrl->clearParameters($this);
2144 $this->timings_enabled,
2146 $this->object->getDefaultAdminRole(),
2149 $this->ctrl->setParameter($this,
'admin_hide',1);
2151 $this->lng->txt(
'hide'),
2154 $this->ctrl->clearParameters($this);
2156 $table_gui->setTitle($this->lng->txt(
'crs_administrators'),
'icon_usr.png',$this->lng->txt(
'crs_administrators'));
2157 $table_gui->parse();
2158 $this->tpl->setVariable(
'ADMINS',$table_gui->getHTML());
2160 if($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultTutorRole())))
2162 if($ilUser->getPref(
'crs_tutor_hide'))
2169 $this->timings_enabled,
2171 $this->object->getDefaultTutorRole(),
2174 $this->ctrl->setParameter($this,
'tutor_hide',0);
2176 $this->lng->txt(
'show'),
2179 $this->ctrl->clearParameters($this);
2188 $this->timings_enabled,
2190 $this->object->getDefaultTutorRole(),
2193 $this->ctrl->setParameter($this,
'tutor_hide',1);
2195 $this->lng->txt(
'hide'),
2198 $this->ctrl->clearParameters($this);
2200 $table_gui->setTitle($this->lng->txt(
'crs_tutors'),
'icon_usr.png',$this->lng->txt(
'crs_tutors'));
2201 $table_gui->parse();
2202 $this->tpl->setVariable(
'TUTORS',$table_gui->getHTML());
2204 if($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultMemberRole())))
2206 if($ilUser->getPref(
'crs_member_hide'))
2212 $this->show_tracking,
2213 $this->timings_enabled,
2215 $this->object->getDefaultMemberRole(),
2219 $this->ctrl->setParameter($this,
'member_hide',0);
2221 $this->lng->txt(
'show'),
2224 $this->ctrl->clearParameters($this);
2232 $this->show_tracking,
2233 $this->timings_enabled,
2235 $this->object->getDefaultMemberRole(),
2238 $this->ctrl->setParameter($this,
'member_hide',1);
2240 $this->lng->txt(
'hide'),
2243 $this->ctrl->clearParameters($this);
2245 $table_gui->setTitle($this->lng->txt(
'crs_members'),
'icon_usr.png',$this->lng->txt(
'crs_members'));
2246 $table_gui->parse();
2247 $this->tpl->setCurrentBlock(
'member_block');
2248 $this->tpl->setVariable(
'MEMBERS',$table_gui->getHTML());
2249 $this->tpl->parseCurrentBlock();
2255 if(!(
$GLOBALS[
'rbacreview']->getNumberOfAssignedUsers(array($role_id))))
2259 if($ilUser->getPref(
'crs_role_hide_'.$role_id))
2265 $this->show_tracking,
2266 $this->timings_enabled,
2271 $this->ctrl->setParameter($this,
'role_hide_'.$role_id,0);
2273 $this->ctrl->getLinkTarget($this,
'members'),
2274 $this->lng->txt(
'show'),
2278 $this->ctrl->clearParameters($this);
2286 $this->show_tracking,
2287 $this->timings_enabled,
2292 $this->ctrl->setParameter($this,
'role_hide_'.$role_id,1);
2294 $this->ctrl->getLinkTarget($this,
'members'),
2295 $this->lng->txt(
'hide'),
2299 $this->ctrl->clearParameters($this);
2303 $table_gui->parse();
2304 $this->tpl->setCurrentBlock(
'member_block');
2305 $this->tpl->setVariable(
'MEMBERS',$table_gui->getHTML());
2306 $this->tpl->parseCurrentBlock();
2310 $this->tpl->setVariable(
'TXT_SELECTED_USER',$this->lng->txt(
'crs_selected_users'));
2311 $this->tpl->setVariable(
'BTN_FOOTER_EDIT',$this->lng->txt(
'edit'));
2312 $this->tpl->setVariable(
'BTN_FOOTER_VAL',$this->lng->txt(
'remove'));
2313 $this->tpl->setVariable(
'BTN_FOOTER_MAIL',$this->lng->txt(
'crs_mem_send_mail'));
2331 $visible_members = array_intersect(array_unique((array)
$_POST[
'visible_member_ids']),$this->object->getMembersObject()->getAdmins());
2332 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2333 $notification = is_array($_POST[
'notification']) ? $_POST[
'notification'] : array();
2349 $visible_members = array_intersect(array_unique((array)
$_POST[
'visible_member_ids']),$this->object->getMembersObject()->getTutors());
2350 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2351 $notification = is_array($_POST[
'notification']) ? $_POST[
'notification'] : array();
2367 $visible_members = array_intersect(array_unique((array)
$_POST[
'visible_member_ids']),$this->object->getMembersObject()->getMembers());
2368 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2369 $blocked = is_array($_POST[
'blocked']) ? $_POST[
'blocked'] : array();
2384 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
2389 $users = array_merge($users,$rbacreview->assignedUsers($role_id));
2392 $passed = is_array(
$_POST[
'passed']) ?
$_POST[
'passed'] : array();
2393 $blocked = is_array(
$_POST[
'blocked']) ?
$_POST[
'blocked'] : array();
2408 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
2412 include_once
'./Services/Object/classes/class.ilObjectLP.php';
2416 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
2417 $marks =
new ilLPMarks($this->object->getId(), $a_member_id);
2420 if($marks->getCompleted() != $a_has_passed)
2425 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
2436 foreach($visible_members as $member_id)
2438 $this->
object->getMembersObject()->updatePassed($member_id,in_array($member_id,$passed),
true);
2445 $this->
object->getMembersObject()->updateNotification($member_id,in_array($member_id,$notification));
2446 $this->
object->getMembersObject()->updateBlocked($member_id,
false);
2450 if($this->object->getMembersObject()->isBlocked($member_id) and !in_array($member_id,$blocked))
2452 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_UNBLOCK_MEMBER,$member_id);
2454 if(!$this->object->getMembersObject()->isBlocked($member_id) and in_array($member_id,$blocked))
2456 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_BLOCK_MEMBER,$member_id);
2458 $this->
object->getMembersObject()->updateNotification($member_id,
false);
2459 $this->
object->getMembersObject()->updateBlocked($member_id,in_array($member_id,$blocked));
2473 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
2475 $this->
object->initWaitingList();
2476 if($this->object->waiting_list_obj->getCountUsers())
2479 $f_result = array();
2480 foreach($this->object->waiting_list_obj->getAllUsers() as $waiting_data)
2485 $waiting_list_ids[] = $waiting_data[
'usr_id'];
2489 $this->
object->getId()) as $course_data)
2492 if($course_data[
'id'] != $this->object->getId() and
2493 $tmp_members->isGroupingMember($tmp_obj->getId(),$course_data[
'unique']))
2495 $message .= (
'<br /><font class="alert">'.$this->lng->txt(
'crs_member_of').
' ');
2501 $f_result[$counter][] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname().$message;
2502 $f_result[$counter][] = $tmp_obj->getLogin();
2523 $_POST[
'members'] = array((
int)
$_GET[
'member_id']);
2539 $post_participants = array_unique(array_merge((array)
$_POST[
'admins'],(array) $_POST[
'tutors'],(array) $_POST[
'members'], (array) $_POST[
'roles']));
2541 $participants = array_intersect((array) $post_participants, (array) $real_participants);
2545 if(!count($participants))
2553 $this->tabs_gui->setTabActive(
'members');
2554 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
2556 include_once(
'./Modules/Course/classes/class.ilCourseEditParticipantsTableGUI.php');
2558 $table_gui->setTitle($this->lng->txt(
'crs_header_edit_members'),
'icon_usr.png',$this->lng->txt(
'crs_header_edit_members'));
2561 $this->tpl->setContent($table_gui->getHTML());
2574 global $rbacsystem, $rbacreview,
$ilUser, $ilAccess;
2578 if(!count(
$_POST[
'participants']))
2585 $notifications =
$_POST[
'notification'] ?
$_POST[
'notification'] : array();
2586 $passed =
$_POST[
'passed'] ?
$_POST[
'passed'] : array();
2587 $blocked =
$_POST[
'blocked'] ?
$_POST[
'blocked'] : array();
2590 $hasEditPermissionAccess =
2592 $ilAccess->checkAccess(
'edit_permission',
'',$this->object->getRefId()) or
2598 $assignableLocalCourseRoles = array();
2599 $courseAdminRoleId = $this->
object->getDefaultAdminRole();
2600 foreach ($this->object->getLocalCourseRoles(
false) as $title => $role_id)
2602 $assignableLocalCourseRoles[$role_id] = $title;
2608 $memberIsCourseAdmin = $rbacreview->isAssigned($usr_id, $courseAdminRoleId);
2613 if (! $hasEditPermissionAccess && $memberIsCourseAdmin &&
2614 ! in_array($courseAdminRoleId,
$_POST[
'roles'][$usr_id])
2621 foreach ((array)
$_POST[
'roles'][$usr_id] as $role_id)
2623 if(!array_key_exists($role_id, $assignableLocalCourseRoles))
2629 if(!$hasEditPermissionAccess &&
2630 $role_id == $courseAdminRoleId &&
2631 !$memberIsCourseAdmin)
2643 if(!isset(
$_POST[
'roles'][$admin_id]))
2648 if(in_array($courseAdminRoleId,
$_POST[
'roles'][$admin_id]))
2658 $_POST[
'members'] = $_POST[
'participants'];
2663 foreach(
$_POST[
'participants'] as $usr_id)
2665 $this->
object->getMembersObject()->updateRoleAssignments($usr_id,(array)
$_POST[
'roles'][$usr_id]);
2668 $this->
object->getMembersObject()->updateNotification($usr_id,0);
2669 if(($this->object->getMembersObject()->isTutor($usr_id) or $this->
object->getMembersObject()->isAdmin($usr_id)) and in_array($usr_id,$notifications))
2671 $this->
object->getMembersObject()->updateNotification($usr_id,1);
2674 $this->
object->getMembersObject()->updateBlocked($usr_id,0);
2675 if((!$this->object->getMembersObject()->isAdmin($usr_id) and !$this->
object->getMembersObject()->isTutor($usr_id)) and in_array($usr_id,$blocked))
2677 $this->
object->getMembersObject()->updateBlocked($usr_id,1);
2679 $this->
object->getMembersObject()->updatePassed($usr_id,in_array($usr_id,$passed),
true);
2680 $this->
object->getMembersObject()->sendNotification(
2681 $this->object->getMembersObject()->NOTIFY_STATUS_CHANGED,
2702 if(!isset(
$_GET[
"member_id"]) or !$this->object->getMembersObject()->isAssigned((
int)
$_GET[
"member_id"]))
2704 $this->ilias->raiseError($this->lng->txt(
"crs_no_valid_member_id_given"),$this->ilias->error_obj->MESSAGE);
2709 $passed = $this->
object->getMembersObject()->hasPassed((
int) $_GET[
'member_id']);
2710 $notify = $this->
object->getMembersObject()->isNotificationEnabled((
int) $_GET[
'member_id']);
2711 $blocked = $this->
object->getMembersObject()->isBlocked((
int) $_GET[
'member_id']);
2713 $this->
object->getMembersObject()->updateRoleAssignments((
int) $_GET[
'member_id'],
$_POST[
'roles']);
2714 $this->
object->getMembersObject()->updatePassed((
int) $_GET[
'member_id'],(
int)
$_POST[
'passed'],
true);
2715 $this->
object->getMembersObject()->updateNotification((
int) $_GET[
'member_id'],(
int) $_POST[
'notification']);
2716 $this->
object->getMembersObject()->updateBlocked((
int) $_GET[
'member_id'],(
int) $_POST[
'blocked']);
2718 if($passed != $this->object->getMembersObject()->hasPassed((
int) $_GET[
'member_id']) or
2719 $notify != $this->
object->getMembersObject()->isNotificationEnabled((
int) $_GET[
'member_id']) or
2720 $blocked != $this->
object->getMembersObject()->isBlocked((
int) $_GET[
'member_id']))
2722 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_STATUS_CHANGED,(int) $_GET[
'member_id']);
2746 if(!count($a_usr_ids))
2753 foreach($a_usr_ids as $user_id)
2759 if($this->object->getMembersObject()->isAssigned($user_id))
2766 $this->
object->getMembersObject()->add($user_id,
IL_CRS_MEMBER);
2769 $this->
object->getMembersObject()->add($user_id,
IL_CRS_TUTOR);
2772 $this->
object->getMembersObject()->add($user_id,
IL_CRS_ADMIN);
2776 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_ACCEPT_USER,$user_id);
2778 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
2781 $this->
object->checkLPStatusSync($user_id);
2790 unset(
$_SESSION[
'crs_usr_search_result']);
2793 $this->ctrl->redirect($this,
'members');
2805 if(!count(
$_POST[
"waiting"]))
2812 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2816 foreach(
$_POST[
"waiting"] as $user_id)
2822 if($this->object->getMembersObject()->isAssigned($user_id))
2826 $this->
object->getMembersObject()->add($user_id,
IL_CRS_MEMBER);
2827 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_ACCEPT_USER,$user_id);
2830 include_once(
'./Modules/Forum/classes/class.ilForumNotification.php');
2833 $this->
object->checkLPStatusSync($user_id);
2864 if(!count(
$_POST[
'waiting']))
2871 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2874 foreach(
$_POST[
"waiting"] as $user_id)
2877 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER,$user_id);
2898 if(!is_array(
$_SESSION[
"crs_delete_waiting_list_ids"]))
2906 $this->
object->initWaitingList();
2909 $this->
object->waiting_list_obj->removeFromList($usr_id);
2920 global $rbacsystem,
$ilErr;
2925 if(!is_array(
$_POST[
"subscribers"]))
2933 if(!$this->object->getMembersObject()->assignSubscribers(
$_POST[
"subscribers"]))
2943 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_ACCEPT_SUBSCRIBER,
$usr_id);
2945 include_once(
'./Modules/Forum/classes/class.ilForumNotification.php');
2948 $this->
object->checkLPStatusSync($usr_id);
2963 if($this->object->isSubscriptionMembershipLimited() and $this->
object->getSubscriptionMaxMembers() and
2964 $this->
object->getSubscriptionMaxMembers() <= $this->
object->getMembersObject()->getCountMembers())
2971 if($number = $this->object->getMembersObject()->autoFillSubscribers())
2989 $this->tabs_gui->setTabActive(
'members');
2999 if(!is_array(
$_POST[
"subscriber"]) or !count(
$_POST[
"subscriber"]))
3009 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_editMembers.html",
'Modules/Course');
3015 $f_result = array();
3017 foreach(
$_POST[
"subscriber"] as $member_id)
3019 $member_data = $this->
object->getMembersObject()->getSubscriberData($member_id);
3024 $f_result[$counter][] = $tmp_obj->getLogin();
3025 $f_result[$counter][] = $tmp_obj->getFirstname();
3026 $f_result[$counter][] = $tmp_obj->getLastname();
3040 $this->tabs_gui->setTabActive(
'members');
3050 if(!is_array(
$_POST[
"waiting_list"]) or !count(
$_POST[
"waiting_list"]))
3060 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_editMembers.html",
'Modules/Course');
3061 $this->
object->initWaitingList();
3067 $f_result = array();
3069 foreach(
$_POST[
"waiting_list"] as $wait_id)
3071 $user_data =& $this->
object->waiting_list_obj->getUser($wait_id);
3075 $f_result[$counter][] = $tmp_obj->getLogin();
3076 $f_result[$counter][] = $tmp_obj->getFirstname();
3077 $f_result[$counter][] = $tmp_obj->getLastname();
3078 #$f_result[$counter][] = strftime("%Y-%m-%d %R",$user_data["time"]);
3094 if($this->object->getMembersObject()->isLastAdmin($ilUser->getId()))
3101 $this->tabs_gui->setTabActive(
'crs_unsubscribe');
3103 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
3105 $cgui->setHeaderText($this->lng->txt(
'crs_unsubscribe_sure'));
3106 $cgui->setFormAction($this->ctrl->getFormAction($this));
3107 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancel");
3108 $cgui->setConfirm($this->lng->txt(
"crs_unsubscribe"),
"performUnsubscribe");
3109 $this->tpl->setContent($cgui->getHTML());
3126 $this->
object->getMembersObject()->delete($this->ilias->account->getId());
3127 $this->
object->getMembersObject()->sendUnsubscribeNotificationToAdmins($this->ilias->account->getId());
3128 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_UNSUBSCRIBE,$ilUser->getId());
3130 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
3135 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->tree->getParentId($this->ref_id));
3136 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
3150 $participants = array_merge((array)
$_POST[
'admins'],(array) $_POST[
'tutors'], (array) $_POST[
'members'], (array) $_POST[
'roles']);
3160 if(!$this->object->getMemberObject()->checkLastAdmin($participants))
3170 !$ilAccess->checkAccess(
'edit_permission',
'',$this->object->getRefId()) and
3174 foreach ($participants as
$usr_id)
3177 if($part->isAdmin())
3187 $this->tabs_gui->setTabActive(
'members');
3188 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
3190 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
3192 $confirm->setFormAction($this->ctrl->getFormAction($this,
'deleteMembers'));
3193 $confirm->setHeaderText($this->lng->txt(
'crs_header_delete_members'));
3194 $confirm->setConfirm($this->lng->txt(
'confirm'),
'removeMembers');
3195 $confirm->setCancel($this->lng->txt(
'cancel'),
'members');
3197 foreach($participants as
$usr_id)
3201 $confirm->addItem(
'participants[]',
3203 $name[
'lastname'].
', '.$name[
'firstname'].
' ['.$name[
'login'].
']',
3207 $this->tpl->setContent($confirm->getHTML());
3219 global $rbacreview, $rbacsystem, $ilAccess,
$ilUser;
3223 if(!is_array(
$_POST[
"participants"]) or !count(
$_POST[
"participants"]))
3234 !$ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId()) and
3239 $courseAdminRoleId = null;
3240 foreach ($this->object->getLocalCourseRoles(
false) as $title => $role_id)
3242 if (substr($title, 0, 12) ==
'il_crs_admin')
3244 $courseAdminRoleId = $role_id;
3250 if ($rbacreview->isAssigned($usr_id, $courseAdminRoleId))
3259 if(!$this->object->getMembersObject()->deleteParticipants(
$_POST[
"participants"]))
3268 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
3273 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_DISMISS_MEMBER,
$usr_id);
3289 if(!
$_POST[
'subscribers'])
3296 if(!$this->object->getMembersObject()->deleteSubscribers(
$_POST[
"subscribers"]))
3306 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER,
$usr_id);
3321 if ($ilAccess->checkAccess(
'visible',
'',$this->ref_id))
3323 $GLOBALS[
'ilTabs']->addTarget(
"info_short",
3324 $this->ctrl->getLinkTargetByClass(
3325 array(
"ilobjcoursegui",
"ilinfoscreengui"),
"showSummary"),
3329 if($ilAccess->checkAccess(
'leave',
'',$this->object->getRefId()) and $this->object->getMemberObject()->isMember())
3331 $GLOBALS[
'ilTabs']->addTarget(
"crs_unsubscribe",
3332 $this->ctrl->getLinkTarget($this,
"unsubscribe"),
3344 global $rbacsystem,$ilAccess,
$ilUser,
$lng, $ilHelp;
3346 $ilHelp->setScreenIdComponent(
"crs");
3348 $this->ctrl->setParameter($this,
"ref_id",$this->ref_id);
3350 if($ilAccess->checkAccess(
'read',
'',$this->ref_id))
3352 $tabs_gui->addTab(
'view_content', $lng->txt(
"content"),
3353 $this->ctrl->getLinkTarget($this,
''));
3356 if ($ilAccess->checkAccess(
'visible',
'',$this->ref_id))
3363 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilinfoscreengui"
3364 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
3367 $tabs_gui->addTarget(
"info_short",
3368 $this->ctrl->getLinkTargetByClass(
3369 array(
"ilobjcoursegui",
"ilinfoscreengui"),
"showSummary"),
3371 "",
"", $force_active);
3373 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3375 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilconditionhandlerinterface"
3376 &&
$_GET[
"item_id"] ==
"")
3379 $tabs_gui->addTarget(
"settings",
3380 $this->ctrl->getLinkTarget($this,
"edit"),
3381 array(
"edit",
"editMapSettings",
"editCourseIcons",
"listStructure"),
"",
"", $force_active);
3386 include_once
'./Services/Mail/classes/class.ilMail.php';
3390 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3392 $tabs_gui->addTarget(
"members",
3393 $this->ctrl->getLinkTarget($this,
"members"),
3398 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_ENABLED and
3402 $tabs_gui->addTarget(
"members",
3403 $this->ctrl->getLinkTarget($this,
"membersGallery"),
3409 $GLOBALS[
'rbacsystem']->checkAccess(
'internal_mail',$mail->getMailObjectReferenceId ()) and
3413 $tabs_gui->addTarget(
"members",
3414 $this->ctrl->getLinkTarget($this,
"mailMembers"),
3422 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
3425 $tabs_gui->addTarget(
'learning_progress',
3426 $this->ctrl->getLinkTargetByClass(array(
'ilobjcoursegui',
'illearningprogressgui'),
''),
3428 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
3433 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3435 include_once(
'./Modules/Course/classes/class.ilCourseObjective.php');
3438 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilcourseobjectivesgui")
3441 $tabs_gui->addTarget(
"crs_objectives",
3442 $this->ctrl->getLinkTarget($this,
"listObjectives"),
3444 get_class($this),
"", $force_active);
3449 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
3450 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->ref_id)
3453 $tabs_gui->addTarget(
"licenses",
3454 $this->ctrl->getLinkTargetByClass(
'illicenseoverviewgui',
''),
3455 "",
"illicenseoverviewgui");
3459 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3461 $tabs_gui->addTarget(
"meta_data",
3462 $this->ctrl->getLinkTargetByClass(array(
'ilobjcoursegui',
'ilmdeditorgui'),
'listSection'),
3467 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
3469 $tabs_gui->addTarget(
3471 $this->ctrl->getLinkTargetByClass(
'ilexportgui',
''),
3477 if ($ilAccess->checkAccess(
'edit_permission',
'',$this->ref_id))
3479 $tabs_gui->addTarget(
"perm_settings",
3480 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
3481 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
3484 if ($this->ctrl->getTargetScript() ==
"adm_object.php")
3486 $tabs_gui->addTarget(
"show_owner",
3487 $this->ctrl->getLinkTarget($this,
"owner"),
"owner", get_class($this));
3489 if ($this->tree->getSavedNodeData($this->ref_id))
3491 $tabs_gui->addTarget(
"trash",
3492 $this->ctrl->getLinkTarget($this,
"trash"),
"trash", get_class($this));
3496 if($ilAccess->checkAccess(
'join',
'',$this->ref_id)
3497 and !$this->
object->getMemberObject()->isAssigned())
3499 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
3504 $this->lng->txt(
'membership_leave'),
3505 $this->ctrl->getLinkTargetByClass(
'ilcourseregistrationgui',
'show',
'')
3512 $tabs_gui->addTarget(
"join",
3513 $this->ctrl->getLinkTargetByClass(
'ilcourseregistrationgui',
"show"),
3518 if($ilAccess->checkAccess(
'leave',
'',$this->object->getRefId())
3519 and $this->object->getMemberObject()->isMember())
3521 $tabs_gui->addTarget(
"crs_unsubscribe",
3522 $this->ctrl->getLinkTarget($this,
"unsubscribe"),
3531 foreach($a_members as $member_id)
3534 $member_data = $this->
object->getMembersObject()->getSubscriberData($member_id);
3538 $print_member[$member_id][
'login'] = $tmp_obj->getLogin();
3539 $print_member[$member_id][
'name'] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();
3561 global $ilAccess,
$lng;
3563 $lng->loadLanguageModule(
'trac');
3565 #$is_admin = (bool) $ilAccess->checkAccess("write",'',$this->object->getRefId());
3568 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3571 if($privacy->enabledCourseAccessTimes())
3573 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
3577 if($this->show_tracking)
3579 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
3585 foreach($a_members as $member_id)
3590 $print_member[$member_id][
'login'] = $tmp_obj->getLogin();
3591 $print_member[$member_id][
'name'] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();
3593 if($this->object->getMembersObject()->isAdmin($member_id))
3595 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_admin");
3597 elseif($this->object->getMembersObject()->isTutor($member_id))
3599 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_tutor");
3601 elseif($this->object->getMembersObject()->isMember($member_id))
3603 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_member");
3605 if($this->object->getMembersObject()->isAdmin($member_id) or $this->
object->getMembersObject()->isTutor($member_id))
3607 if($this->object->getMembersObject()->isNotificationEnabled($member_id))
3609 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_notify");
3613 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_no_notify");
3618 if($this->object->getMembersObject()->isBlocked($member_id))
3620 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_blocked");
3624 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_unblocked");
3630 $print_member[$member_id][
'passed'] = $this->
object->getMembersObject()->hasPassed($member_id) ?
3631 $this->lng->txt(
'crs_member_passed') :
3632 $this->lng->txt(
'crs_member_not_passed');
3635 if($privacy->enabledCourseAccessTimes())
3637 if(isset($progress[$member_id][
'ts']) and $progress[$member_id][
'ts'])
3645 $print_member[$member_id][
'access'] = $this->lng->txt(
'no_date');
3648 if($this->show_tracking)
3650 if(in_array($member_id,$completed))
3654 elseif(in_array($member_id,$in_progress))
3658 elseif(in_array($member_id,
$failed))
3689 case 'notification':
3703 $ilTabs->clearTargets();
3704 $ilTabs->setBackTarget($this->lng->txt(
'back'),
3705 $this->ctrl->getLinkTarget($this,
'members'));
3708 $form = $list->initForm(
'printMembersOutput');
3709 $this->tpl->setContent($form->getHTML());
3714 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
3717 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
3720 include_once
'Services/Membership/classes/class.ilAttendanceList.php';
3722 $list->setId(
'crsmemlst');
3724 $list->setTitle($this->lng->txt(
'crs_members_print_title'),
3725 $this->lng->txt(
'obj_crs').
': '.$this->
object->getTitle());
3727 include_once
'./Services/Tracking/classes/class.ilObjUserTracking.php';
3730 if($this->show_tracking)
3732 include_once(
'./Services/Object/classes/class.ilObjectLP.php');
3734 $this->show_tracking = $olp->isActive();
3736 if($this->show_tracking)
3738 $list->addPreset(
'progress', $this->lng->txt(
'learning_progress'),
true);
3741 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3743 if($privacy->enabledCourseAccessTimes())
3745 $list->addPreset(
'access', $this->lng->txt(
'last_access'),
true);
3748 $list->addPreset(
'status', $this->lng->txt(
'crs_status'),
true);
3749 $list->addPreset(
'passed', $this->lng->txt(
'crs_passed'),
true);
3756 return $this->members_data[$a_user_id];
3762 $list->initFromForm();
3763 $list->setCallback(array($this,
'getAttendanceListUserData'));
3765 $this->members_data = $this->
fetchPrintMemberData($this->object->getMembersObject()->getParticipants());
3766 $list->getNonMemberUserData($this->members_data);
3768 $list->getFullscreenHTML();
3809 $is_admin = (bool) $ilAccess->checkAccess(
"write",
"", $this->object->getRefId());
3812 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_DISABLED)
3814 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
3818 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_members_gallery.html',
'Modules/Course');
3821 $this->tabs_gui->setTabActive(
'members');
3822 $this->tabs_gui->setSubTabActive(
'crs_members_gallery');
3825 if(count($members = $this->object->getMembersObject()->getParticipants()))
3827 $ordered_members = array();
3829 foreach($members as $member_id)
3839 array_push($ordered_members,array(
"id" => $member_id,
3840 "login" => $usr_obj->getLogin(),
3841 "lastname" => $usr_obj->getLastName(),
3842 "firstname" => $usr_obj->getFirstName(),
3843 "sortlastname" => strtoupper($usr_obj->getLastName()).strtoupper($usr_obj->getFirstName()),
3844 "usr_obj" => $usr_obj));
3849 foreach($ordered_members as $member)
3851 $usr_obj = $member[
"usr_obj"];
3853 if(!$usr_obj->getActive())
3858 $public_profile = in_array($usr_obj->getPref(
"public_profile"), array(
"y",
"g")) ?
"y" :
"";
3861 $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user", $member[
"id"]);
3862 $profile_target = $this->ctrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML");
3865 $file = $usr_obj->getPersonalPicturePath(
"xsmall");
3883 if ($public_profile ==
"y") {
3884 $this->tpl->setCurrentBlock(
"member_linked");
3885 $this->tpl->setVariable(
"LINK_PROFILE", $profile_target);
3886 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3887 $this->tpl->parseCurrentBlock();
3906 $this->tpl->setCurrentBlock(
"member_not_linked");
3907 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3908 $this->tpl->parseCurrentBlock();
3910 $this->tpl->setCurrentBlock(
"member");
3912 if ($this->object->getMembersObject()->isAdmin($member[
"id"])) {
3913 $this->tpl->setVariable(
"MEMBER_CLASS",
"il_Admin");
3915 elseif ($this->object->getMembersObject()->isTutor($member[
"id"])) {
3916 $this->tpl->setVariable(
"MEMBER_CLASS",
"il_Tutor");
3919 $this->tpl->setVariable(
"MEMBER_CLASS",
"il_Member");
3925 if ($public_profile ==
"y")
3927 $this->tpl->setVariable(
"FIRSTNAME", $member[
"firstname"]);
3928 $this->tpl->setVariable(
"LASTNAME", $member[
"lastname"]);
3930 $this->tpl->setVariable(
"LOGIN", $member[
"login"]);
3931 $this->tpl->parseCurrentBlock();
3933 $this->tpl->setCurrentBlock(
"members");
3934 $this->tpl->setVariable(
"MEMBERS_TABLE_HEADER",$this->lng->txt(
'crs_members_title'));
3935 $this->tpl->parseCurrentBlock();
3938 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'crs_members_print_title'));
3941 $headline = $this->
object->getTitle().
"<br/>".$this->
object->getDescription();
3943 $this->tpl->setVariable(
"HEADLINE",$headline);
3952 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3963 $offset =
$_GET[
"update_members"] ?
$_GET[
"offset"] : 0;
3964 $order =
$_GET[
"update_members"] ?
$_GET[
"sort_by"] :
'login';
3965 $direction =
$_GET[
"update_members"] ?
$_GET[
"sort_order"] :
'';
3969 $offset =
$_GET[
"update_subscribers"] ?
$_GET[
"offset"] : 0;
3970 $order =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_by"] :
'sub_time';
3971 $direction =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_order"] :
'';
3975 $offset =
$_GET[
"offset"];
3976 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3977 $direction =
$_GET[
"sort_order"];
3981 $offset =
$_GET[
"offset"];
3982 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3983 $direction =
$_GET[
"sort_order"];
3987 $offset =
$_GET[
"offset"];
3989 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
3991 $_GET[
"sort_by"] =
"login";
3993 $order =
$_GET[
"sort_by"];
3994 $direction =
$_GET[
"sort_order"];
3998 $tbl->setOrderColumn($order);
3999 $tbl->setOrderDirection($direction);
4000 $tbl->setOffset($offset);
4001 $tbl->setLimit(
$_GET[
"limit"]);
4002 $tbl->setMaxCount(count($result_set));
4003 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
4004 $tbl->setData($result_set);
4011 $tpl =& $tbl->getTemplateObject();
4013 $tpl->setCurrentBlock(
"tbl_form_header");
4014 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
4015 $tpl->parseCurrentBlock();
4016 $tpl->setCurrentBlock(
"tbl_action_btn");
4017 $tpl->setVariable(
"BTN_NAME",
"cancelMember");
4018 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
4019 $tpl->parseCurrentBlock();
4020 $tpl->setCurrentBlock(
"tbl_action_btn");
4021 $tpl->setVariable(
"BTN_NAME",
"performRemoveFromWaitingList");
4022 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
4023 $tpl->parseCurrentBlock();
4024 $tpl->setCurrentBlock(
"tbl_action_row");
4025 $tpl->setVariable(
"COLUMN_COUNTS",4);
4027 $tpl->parseCurrentBlock();
4029 $tbl->setTitle($this->lng->txt(
"crs_header_remove_from_waiting_list"),
"icon_usr_b.png",
4030 $this->lng->txt(
"crs_header_remove_from_waiting_list"));
4031 $tbl->setHeaderNames(array($this->lng->txt(
"username"),
4032 $this->lng->txt(
"firstname"),
4033 $this->lng->txt(
"lastname"),
4034 $this->lng->txt(
"crs_time")));
4035 $tbl->setHeaderVars(array(
"login",
4039 array(
"ref_id" => $this->object->getRefId(),
4041 "cmdClass" =>
"ilobjcoursegui",
4042 "cmdNode" =>
$_GET[
"cmdNode"]));
4044 $tbl->setColumnWidth(array(
"25%",
"25%",
"25%",
"25%"));
4049 $this->tpl->setVariable(
"EDIT_MEMBER_TABLE",$tbl->tpl->get());
4057 $tpl =& $tbl->getTemplateObject();
4059 $tpl->setCurrentBlock(
"tbl_form_header");
4060 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
4061 $tpl->parseCurrentBlock();
4062 $tpl->setCurrentBlock(
"tbl_action_btn");
4063 $tpl->setVariable(
"BTN_NAME",
"removeSubscribers");
4064 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
4065 $tpl->parseCurrentBlock();
4066 $tpl->setCurrentBlock(
"tbl_action_btn");
4067 $tpl->setVariable(
"BTN_NAME",
"cancelMember");
4068 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
4069 $tpl->parseCurrentBlock();
4070 $tpl->setCurrentBlock(
"tbl_action_row");
4071 $tpl->setVariable(
"COLUMN_COUNTS",4);
4073 $tpl->parseCurrentBlock();
4075 $tbl->setTitle($this->lng->txt(
"crs_header_delete_subscribers"),
"icon_usr_b.png",$this->lng->txt(
"crs_header_delete_members"));
4076 $tbl->setHeaderNames(array($this->lng->txt(
"username"),
4077 $this->lng->txt(
"firstname"),
4078 $this->lng->txt(
"lastname"),
4079 $this->lng->txt(
"crs_time")));
4080 $tbl->setHeaderVars(array(
"login",
4084 array(
"ref_id" => $this->object->getRefId(),
4086 "cmdClass" =>
"ilobjcoursegui",
4087 "cmdNode" =>
$_GET[
"cmdNode"]));
4089 $tbl->setColumnWidth(array(
"25%",
"25%",
"25%",
"25%"));
4094 $this->tpl->setVariable(
"EDIT_MEMBER_TABLE",$tbl->tpl->get());
4103 $actions = array(
"addFromWaitingList" => $this->lng->txt(
"crs_add_subscribers"),
4104 "removeFromWaitingList" => $this->lng->txt(
"crs_delete_from_waiting_list"));
4107 $tpl =& $tbl->getTemplateObject();
4109 $tbl->enable(
'select_all');
4110 $tbl->setFormName(
"wait_form");
4111 $tbl->setSelectAllCheckbox(
"waiting_list");
4115 $tpl->setCurrentBlock(
"tbl_action_row");
4117 $tpl->setVariable(
"COLUMN_COUNTS",5);
4121 $tpl->setCurrentBlock(
"tbl_action_select");
4123 $tpl->setVariable(
"BTN_NAME",
"gateway");
4124 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"execute"));
4125 $tpl->parseCurrentBlock();
4127 $tpl->setCurrentBlock(
"tbl_action_row");
4128 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
4129 $tpl->parseCurrentBlock();
4132 $tbl->setTitle($this->lng->txt(
"crs_waiting_list"),
"icon_usr.png",$this->lng->txt(
"crs_waiting_list"));
4133 $tbl->setHeaderNames(array(
'',
4134 $this->lng->txt(
"name"),
4135 $this->lng->txt(
"login"),
4136 $this->lng->txt(
"crs_time")));
4137 $tbl->setHeaderVars(array(
"",
4141 array(
"ref_id" => $this->object->getRefId(),
4143 "update_subscribers" => 1,
4144 "cmdClass" =>
"ilobjcoursegui",
4145 "cmdNode" =>
$_GET[
"cmdNode"]));
4146 $tbl->setColumnWidth(array(
'1%'));
4151 $this->tpl->setCurrentBlock(
'sub_wait_table');
4152 $this->tpl->setVariable(
'SUB_WAIT_NAME',
'wait_form');
4153 $this->tpl->setVariable(
'SUB_WAIT_FORMACTION',$this->ctrl->getFormAction($this));
4154 $this->tpl->setVariable(
"SUB_WAIT_TABLE_CONTENT",$tbl->tpl->get());
4155 $this->tpl->parseCurrentBlock();
4167 for($i=0;$i<=60;$i++)
4169 $days[$i] = $i < 10 ?
"0".$i : $i;
4174 for($i=0;$i<24;$i++)
4176 $days[$i] = $i < 10 ?
"0".$i : $i;
4181 for($i=1;$i<32;$i++)
4183 $days[$i] = $i < 10 ?
"0".$i : $i;
4188 for($i=1;$i<13;$i++)
4190 $month[$i] = $i < 10 ?
"0".$i : $i;
4195 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
4205 return mktime($a_time_arr[
"hour"],
4206 $a_time_arr[
"minute"],
4207 $a_time_arr[
"second"],
4208 $a_time_arr[
"month"],
4210 $a_time_arr[
"year"]);
4214 unset(
$_SESSION[
"crs_delete_member_ids"]);
4215 unset(
$_SESSION[
"crs_delete_subscriber_ids"]);
4225 global $rbacreview,
$ilErr, $ilAccess, $ilObjDataCache,
$ilias;
4226 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
4228 $this->lng->loadLanguageModule(
'mail');
4229 if(!isset(
$_GET[
'returned_from_mail']))
4234 $is_admin = (bool) $ilAccess->checkAccess(
"write",
"", $this->object->getRefId());
4239 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
4243 $this->tabs_gui->setTabActive(
'members');
4244 $this->tabs_gui->setSubTabActive(
'mail_members');
4246 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.mail_members.html',
'Services/Contact');
4249 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
4251 $this->tpl->setVariable(
"SELECT_ACTION",
'ilias.php?baseClass=ilmailgui&view=my_courses&search_crs='.$this->object->getId());
4252 $this->tpl->setVariable(
"MAIL_SELECTED",$this->lng->txt(
'send_mail_selected'));
4253 $this->tpl->setVariable(
"MAIL_MEMBERS",$this->lng->txt(
'send_mail_members'));
4254 $this->tpl->setVariable(
"MAIL_TUTOR",$this->lng->txt(
'send_mail_tutors'));
4255 $this->tpl->setVariable(
"MAIL_ADMIN",$this->lng->txt(
'send_mail_admins'));
4257 $this->tpl->setVariable(
"OK",$this->lng->txt(
'next'));
4260 $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
4261 $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder[
'ref_id'],
false);
4264 $sorted_role_ids = array();
4266 foreach($role_ids as $role_id)
4271 $sorted_role_ids[2] = $role_id;
4275 $sorted_role_ids[1] = $role_id;
4279 $sorted_role_ids[0] = $role_id;
4283 $sorted_role_ids[$counter++] = $role_id;
4288 ksort($sorted_role_ids,SORT_NUMERIC);
4289 foreach ((array) $sorted_role_ids as $role_id)
4291 $this->tpl->setCurrentBlock(
"mailbox_row");
4292 $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
4296 if(count($ids_for_role_title) >= 2)
4298 $ilias->setSetting(
'pear_mail_enable', 1);
4302 htmlspecialchars($role_addr)
4304 if (ilMail::_usePearMail() && substr($role_addr, 0, 4) !=
'#il_')
4307 $this->tpl->setVariable(
"MAILBOX",$role_addr);
4312 $this->tpl->setVariable(
"MAILBOX",
ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)).
" (" . $role_addr .
")");
4315 $this->tpl->parseCurrentBlock();
4323 $next_class = $this->ctrl->getNextClass($this);
4324 $cmd = $this->ctrl->getCmd();
4333 $ilAccess->checkAccess(
'read',
'',
$_GET[
'ref_id']))
4335 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset");
4337 $ilNavigationHistory->addItem(
$_GET[
'ref_id'],
4343 if(IS_PAYMENT_ENABLED)
4345 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
4348 $ilTabs->setTabActive(
'info_short');
4350 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
4351 $this->ctrl->setReturn($this,
'');
4353 $this->ctrl->forwardCommand($pp_gui);
4361 case "ilinfoscreengui":
4365 case 'ilmdeditorgui':
4366 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
4368 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
4371 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
4373 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
4374 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
4376 $this->ctrl->forwardCommand($md_gui);
4377 $this->tabs_gui->setTabActive(
'meta_data');
4380 case 'ilcourseregistrationgui':
4381 $this->ctrl->setReturn($this,
'');
4382 $this->tabs_gui->setTabActive(
'join');
4383 include_once(
'./Modules/Course/classes/class.ilCourseRegistrationGUI.php');
4385 $this->ctrl->forwardCommand($registration);
4388 case 'ilobjectcustomuserfieldsgui':
4389 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
4393 $this->tabs_gui->setTabActive(
'settings');
4394 $this->ctrl->forwardCommand($cdf_gui);
4397 case "ilcourseobjectivesgui":
4398 include_once
'./Modules/Course/classes/class.ilCourseObjectivesGUI.php';
4400 $this->ctrl->setReturn($this,
"");
4402 $ret =& $this->ctrl->forwardCommand($reg_gui);
4405 case 'ilobjcoursegroupinggui':
4406 include_once
'./Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
4408 $this->ctrl->setReturn($this,
'edit');
4411 $this->ctrl->forwardCommand($crs_grp_gui);
4412 $this->tabs_gui->setTabActive(
'settings');
4413 $this->tabs_gui->setSubTabActive(
'groupings');
4417 $this->tabs_gui->setTabActive(
'none');
4427 case "ilconditionhandlerinterface":
4428 include_once
'./Services/AccessControl/classes/class.ilConditionHandlerInterface.php';
4431 $this->tabs_gui->setTabActive(
'settings');
4433 $this->ctrl->forwardCommand($new_gui);
4436 case "illearningprogressgui":
4437 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
4440 $this->object->getRefId(),
4441 $_GET[
'user_id'] ? $_GET[
'user_id'] : $ilUser->getId());
4442 $this->ctrl->forwardCommand($new_gui);
4443 $this->tabs_gui->setTabActive(
'learning_progress');
4446 case 'illicenseoverviewgui':
4447 include_once(
"./Services/License/classes/class.ilLicenseOverviewGUI.php");
4449 $ret =& $this->ctrl->forwardCommand($license_gui);
4450 $this->tabs_gui->setTabActive(
'licenses');
4453 case 'ilpermissiongui':
4454 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
4455 $this->tabs_gui->setTabActive(
'perm_settings');
4457 $ret =& $this->ctrl->forwardCommand($perm_gui);
4460 case 'ilrepositorysearchgui':
4461 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
4466 $rep_search->setCallback($this,
4467 'assignMembersObject',
4477 $rep_search->setCallback($this,
4478 'assignMembersObject',
4491 $this->ctrl->setReturn($this,
'members');
4492 $ret =& $this->ctrl->forwardCommand($rep_search);
4494 $this->tabs_gui->setTabActive(
'members');
4495 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
4498 case 'ilcoursecontentinterface':
4500 $this->initCourseContentInterface();
4501 $this->cci_obj->cci_setContainer($this);
4503 $this->ctrl->forwardCommand($this->cci_obj);
4505 $this->tabs_gui->setTabActive(
'content');
4508 case 'ilcoursecontentgui':
4509 $this->ctrl->setReturn($this,
'members');
4510 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
4512 $this->ctrl->forwardCommand($course_content_obj);
4515 case 'ilpublicuserprofilegui':
4516 $this->tpl->enableDragDropFileUpload(null);
4517 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
4520 $this->tabs_gui->setTabActive(
'members');
4521 $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this,
"membersGallery"));
4522 $this->tabs_gui->setSubTabActive(
'crs_members_gallery');
4523 $html = $this->ctrl->forwardCommand($profile_gui);
4524 $this->tpl->setVariable(
"ADM_CONTENT", $html);
4527 case 'ilmemberexportgui':
4528 include_once(
'./Services/Membership/classes/Export/class.ilMemberExportGUI.php');
4531 $this->tabs_gui->setTabActive(
'members');
4532 $this->tabs_gui->setSubTabActive(
'export_members');
4534 $this->ctrl->forwardCommand($export);
4537 case 'ilmemberagreementgui':
4538 include_once(
'Services/Membership/classes/class.ilMemberAgreementGUI.php');
4539 $this->tabs_gui->clearTargets();
4541 $this->ctrl->setReturn($this,
'');
4543 $this->ctrl->forwardCommand($agreement);
4546 case 'ilsessionoverviewgui':
4548 $this->tabs_gui->setTabActive(
'members');
4549 $this->tabs_gui->setSubTabActive(
'events');
4551 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
4554 include_once(
'./Modules/Session/classes/class.ilSessionOverviewGUI.php');
4556 $this->ctrl->forwardCommand($overview);
4560 case "ilcontainerpagegui":
4564 $this->tpl->setContent($ret);
4568 case 'ilobjectcopygui':
4569 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
4571 $cp->setType(
'crs');
4572 $this->ctrl->forwardCommand($cp);
4575 case "ilobjstylesheetgui":
4579 case 'ilcourseparticipantsgroupsgui':
4580 include_once
'./Modules/Course/classes/class.ilCourseParticipantsGroupsGUI.php';
4584 $this->tabs_gui->setTabActive(
'members');
4585 $this->ctrl->forwardCommand($cmg_gui);
4589 $this->tabs_gui->setTabActive(
'export');
4590 include_once
'./Services/Export/classes/class.ilExportGUI.php';
4592 $exp->addFormat(
'xml');
4593 $this->ctrl->forwardCommand($exp);
4596 case "ilcommonactiondispatchergui":
4597 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
4599 $this->ctrl->forwardCommand($gui);
4602 case 'ildidactictemplategui':
4603 $this->ctrl->setReturn($this,
'edit');
4604 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
4606 $this->ctrl->forwardCommand($did);
4609 case "ilcertificategui":
4610 $this->tabs_gui->activateTab(
"settings");
4613 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
4614 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
4616 $this->ctrl->forwardCommand($output_gui);
4619 case 'ilobjectservicesettingsgui':
4620 $this->ctrl->setReturn($this,
'edit');
4622 $this->tabs_gui->activateTab(
'settings');
4623 $this->tabs_gui->activateSubTab(
'tool_settings');
4625 include_once
'./Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
4628 $this->object->getId(),
4632 $this->ctrl->forwardCommand($service);
4648 if(
$cmd ==
'infoScreenGoto')
4657 $cmd =
'infoScreen';
4661 if(!$this->creation_mode)
4663 if (
$cmd ==
"infoScreen")
4674 if( !$this->creation_mode
4675 &&
$cmd !=
'infoScreen'
4676 &&
$cmd !=
'sendfile'
4677 &&
$cmd !=
'unsubscribe'
4678 &&
$cmd !=
'performUnsubscribe'
4679 && !$ilAccess->checkAccess(
"read",
'',$this->object->getRefId())
4681 ||
$cmd ==
'subscribe')
4683 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
4684 if($rbacsystem->checkAccess(
'join',$this->object->getRefId()) &&
4687 include_once(
'./Modules/Course/classes/class.ilCourseRegistrationGUI.php');
4688 $this->ctrl->redirectByClass(
"ilCourseRegistrationGUI");
4697 if(
$cmd ==
'listObjectives')
4699 include_once
'./Modules/Course/classes/class.ilCourseObjectivesGUI.php';
4701 $this->ctrl->setReturn($this,
"");
4703 $ret =& $this->ctrl->forwardCommand($obj_gui);
4738 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
4744 if(!$this->object->getMemberObject()->isAssigned())
4749 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
4755 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
4756 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
4763 $GLOBALS[
'ilLog']->write(__METHOD__.
': Missing course confirmation.');
4767 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
4770 $GLOBALS[
'ilLog']->write(__METHOD__.
': Missing required fields');
4788 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
4792 $buffer = $lic_set->get(
"license_warning");
4794 include_once(
"./Services/License/classes/class.ilLicense.php");
4796 foreach ($licensed_items as $item)
4798 $license =&
new ilLicense($item[
'obj_id']);
4799 $remaining = $license->getRemainingLicenses();
4800 if ($remaining <= $buffer)
4802 $lng->loadlanguageModule(
"license");
4803 ilUtil::sendInfo(sprintf($this->lng->txt(
"course_licenses_rare"), $remaining), $a_keep);
4813 return array(
"ilCourseRegisterGUI",
'ilConditionHandlerInterface');
4819 $this->initCourseContentInterface();
4820 $this->cci_obj->cci_setContainer($this);
4821 $this->cci_obj->cci_objectives();
4827 $this->tabs_gui->setTabActive(
'edit_content');
4829 $this->initCourseContentInterface();
4830 $this->cci_obj->cci_setContainer($this);
4831 $this->cci_obj->cci_view();
4837 $this->initCourseContentInterface();
4838 $this->cci_obj->cci_setContainer($this);
4839 $this->cci_obj->cci_objectives_ask_reset();
4847 include_once
'./Modules/Course/classes/class.ilCourseObjectiveResult.php';
4850 $tmp_obj_res->
reset($this->object->getId());
4854 $this->initCourseContentInterface();
4855 $this->cci_obj->cci_setContainer($this);
4856 $this->cci_obj->cci_objectives();
4862 switch ($this->ctrl->getCmd())
4865 #$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""));
4877 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
4878 if(substr($a_add,0,5) ==
'rcode')
4880 if($ilUser->getId() == ANONYMOUS_USER_ID)
4884 "login.php?target=".
$_GET[
"target"].
"&cmd=force_login&lang=".
4885 $ilUser->getCurrentLanguage()
4897 if ($a_add ==
"mem" && $ilAccess->checkAccess(
"write",
"", $a_target))
4902 if ($ilAccess->checkAccess(
"read",
"", $a_target))
4909 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
4915 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
4923 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
4929 return mktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
4934 return array(
'y' => date(
'Y',$a_unix_time),
4935 'm' => date(
'n',$a_unix_time),
4936 'd' => date(
'd',$a_unix_time));
4941 return array(
'h' => date(
'G',$a_unix_time),
4942 'm' => date(
'i',$a_unix_time),
4943 's' => date(
's',$a_unix_time));
4956 $this->tabs_gui->setTabActive(
'settings');
4959 !$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
4964 $latitude = $this->
object->getLatitude();
4965 $longitude = $this->
object->getLongitude();
4966 $zoom = $this->
object->getLocationZoom();
4969 if ($latitude == 0 && $longitude == 0 && $zoom == 0)
4972 $latitude = $def[
"latitude"];
4973 $longitude = $def[
"longitude"];
4974 $zoom = $def[
"zoom"];
4980 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
4982 $form->setFormAction($ilCtrl->getFormAction($this));
4984 $form->setTitle($this->lng->txt(
"crs_map_settings"));
4990 $public->setChecked($this->object->getEnableCourseMap());
4991 $form->addItem($public);
4997 $loc_prop->setLongitude($longitude);
4998 $loc_prop->setZoom($zoom);
4999 $form->addItem($loc_prop);
5001 $form->addCommandButton(
"saveMapSettings", $this->lng->txt(
"save"));
5003 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
5015 $this->
object->update();
5017 $ilCtrl->redirect($this,
"editMapSettings");
5027 $this->tabs_gui->setTabActive(
"members");
5029 $this->tabs_gui->setSubTabActive(
"crs_members_map");
5031 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
5037 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
5039 $map->setMapId(
"course_map");
5040 $map->setWidth(
"700px");
5041 $map->setHeight(
"500px");
5042 $map->setLatitude($this->object->getLatitude());
5043 $map->setLongitude($this->object->getLongitude());
5044 $map->setZoom($this->object->getLocationZoom());
5045 $map->setEnableTypeControl(
true);
5046 $map->setEnableNavigationControl(
true);
5047 $map->setEnableCentralMarker(
true);
5049 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
5053 foreach($members as $user_id)
5055 $map->addUserMarker($user_id);
5059 $tpl->setContent($map->getHTML());
5060 $tpl->setLeftContent($map->getUserListHTML());
5069 $this->object->getAboStatus(), $this->
object->getRefId(), $this->
object->getId());
5075 static function _modifyItemGUI($a_item_list_gui, $a_cmd_class, $a_item_data, $a_show_path,
5076 $a_abo_status, $a_course_ref_id, $a_course_obj_id, $a_parent_ref_id = 0)
5078 global
$lng, $ilAccess;
5081 if ($a_parent_ref_id == 0)
5083 $a_parent_ref_id = $a_course_ref_id;
5087 if($a_item_data[
'type'] ==
'tst' and
5090 $a_item_list_gui->addCommandLinkParameter(array(
'crs_show_result' => $a_course_ref_id));
5093 $a_item_list_gui->enableSubscribe($a_abo_status);
5095 $is_tutor = ($ilAccess->checkAccess(
'write',
'',
5096 $a_course_ref_id,
'crs', $a_course_obj_id));
5098 if($a_show_path and $is_tutor)
5100 $a_item_list_gui->addCustomProperty($lng->txt(
'path'),
5114 if ($this->object->getType() !=
'crs')
5118 if (!$ilAccess->checkAccess(
'write',
'',
5119 $this->object->getRefId(),
'crs',$this->
object->getId()))
5123 if($this->object->enabledObjectiveView())
5137 if(!
$_SESSION[
'crs_timings_panel'][$this->object->getId()] or 1)
5141 $this->tabs_gui->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTargetByClass(
"ilobjcoursegui",
"view"));
5145 $this->tabs_gui->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTargetByClass(
"ilobjcoursegui",
"disableAdministrationPanel"));
5150 $this->tabs_gui->addSubTabTarget(
'timings_timings',
5151 $this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'editUserTimings'));
5170 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
5173 if(is_array(
$_POST[$a_field][
'date']))
5175 $dt[
'year'] = (int)
$_POST[$a_field][
'date'][
'y'];
5176 $dt[
'mon'] = (int)
$_POST[$a_field][
'date'][
'm'];
5177 $dt[
'mday'] = (int)
$_POST[$a_field][
'date'][
'd'];
5178 $dt[
'hours'] = (int)
$_POST[$a_field][
'time'][
'h'];
5179 $dt[
'minutes'] = (int)
$_POST[$a_field][
'time'][
'm'];
5180 $dt[
'seconds'] = (int)
$_POST[$a_field][
'time'][
's'];
5184 $date = date_parse(
$_POST[$a_field][
'date'].
" ".
$_POST[$a_field][
'time']);
5185 $dt[
'year'] = (int) $date[
'year'];
5186 $dt[
'mon'] = (int) $date[
'month'];
5187 $dt[
'mday'] = (int) $date[
'day'];
5188 $dt[
'hours'] = (int) $date[
'hour'];
5189 $dt[
'minutes'] = (int) $date[
'minute'];
5190 $dt[
'seconds'] = (int) $date[
'second'];
5206 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_objectives_ask_reset.html",
'Modules/Course');
5208 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
5209 $this->tpl->setVariable(
"INFO_STRING",$this->lng->txt(
'crs_objectives_reset_sure'));
5210 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
5211 $this->tpl->setVariable(
"TXT_RESET",$this->lng->txt(
'reset'));
5220 include_once
'./Modules/Course/classes/class.ilCourseObjectiveResult.php';
5223 $tmp_obj_res->
reset($this->object->getId());
5225 $ilUser->deletePref(
'crs_objectives_force_details_'.$this->object->getId());
5233 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
5237 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
5241 $this->start_obj =
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
5242 if(count($this->start_obj->getStartObjects()) and !$this->start_obj->allFullfilled($ilUser->getId()))
5251 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
5252 include_once
'./Services/Repository/classes/class.ilRepositoryExplorer.php';
5253 include_once
'./Services/Link/classes/class.ilLink.php';
5255 global $rbacsystem,
$ilias,
$ilUser,$ilAccess,$ilObjDataCache;
5257 $this->tabs_gui->setSubTabActive(
'view');
5259 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_start_view.html",
'Modules/Course');
5260 $this->tpl->setVariable(
"INFO_STRING",$this->lng->txt(
'crs_info_start'));
5261 $this->tpl->setVariable(
"TBL_TITLE_START",$this->lng->txt(
'crs_table_start_objects'));
5262 $this->tpl->setVariable(
"HEADER_NR",$this->lng->txt(
'crs_nr'));
5263 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
5264 $this->tpl->setVariable(
"HEADER_EDITED",$this->lng->txt(
'crs_objective_accomplished'));
5267 $lm_continue =&
new ilCourseLMHistory($this->object->getRefId(),$ilUser->getId());
5271 foreach($this->start_obj->getStartObjects() as $start)
5273 $obj_id = $ilObjDataCache->lookupObjId($start[
'item_ref_id']);
5274 $ref_id = $start[
'item_ref_id'];
5275 $type = $ilObjDataCache->lookupType(
$obj_id);
5281 $obj_frame = $obj_frame ? $obj_frame :
'';
5284 $obj_frame = $type ==
'tst' ?
'' : $obj_frame;
5286 $contentObj =
false;
5288 if($ilAccess->checkAccess(
'read',
'',
$ref_id))
5290 $this->tpl->setCurrentBlock(
"start_read");
5291 $this->tpl->setVariable(
"READ_TITLE_START",$ilObjDataCache->lookupTitle(
$obj_id));
5292 $this->tpl->setVariable(
"READ_TARGET_START",$obj_frame);
5293 $this->tpl->setVariable(
"READ_LINK_START", $obj_link.
'&crs_show_result='.$this->object->getRefId());
5294 $this->tpl->parseCurrentBlock();
5298 $this->tpl->setCurrentBlock(
"start_visible");
5299 $this->tpl->setVariable(
"VISIBLE_LINK_START",$ilObjDataCache->lookupTitle(
$obj_id));
5300 $this->tpl->parseCurrentBlock();
5304 if(isset($continue_data[
$ref_id]))
5306 $this->tpl->setCurrentBlock(
"link");
5307 $this->tpl->setVariable(
"LINK_HREF",
ilLink::_getLink($ref_id,
'',array(
'obj_id',
5308 $continue_data[$ref_id][
'lm_page_id'])));
5309 #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target);
5310 $this->tpl->setVariable(
"LINK_NAME",$this->lng->txt(
'continue_work'));
5311 $this->tpl->parseCurrentBlock();
5315 if(!$ilUser->isDesktopItem($ref_id,$type) and
5316 $this->
object->getAboStatus())
5318 if ($ilAccess->checkAccess(
'read',
'',$ref_id))
5320 $this->tpl->setCurrentBlock(
"link");
5321 $this->ctrl->setParameterByClass(get_class($this),
'item_ref_id',$ref_id);
5322 $this->ctrl->setParameterByClass(get_class($this),
'item_id',$ref_id);
5323 $this->ctrl->setParameterByClass(get_class($this),
'type',$type);
5325 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this,
'addToDesk'));
5326 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"to_desktop"));
5327 $this->tpl->parseCurrentBlock();
5330 elseif($this->object->getAboStatus())
5332 $this->tpl->setCurrentBlock(
"link");
5333 $this->ctrl->setParameterByClass(get_class($this),
'item_ref_id',$ref_id);
5334 $this->ctrl->setParameterByClass(get_class($this),
'item_id',$ref_id);
5335 $this->ctrl->setParameterByClass(get_class($this),
'type',$type);
5337 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this,
'removeFromDesk'));
5338 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"unsubscribe"));
5339 $this->tpl->parseCurrentBlock();
5344 if(strlen($ilObjDataCache->lookupDescription(
$obj_id)))
5346 $this->tpl->setCurrentBlock(
"start_description");
5347 $this->tpl->setVariable(
"DESCRIPTION_START",$ilObjDataCache->lookupDescription(
$obj_id));
5348 $this->tpl->parseCurrentBlock();
5352 if($this->start_obj->isFullfilled($ilUser->getId(),
$ref_id))
5354 $accomplished =
'accomplished';
5358 $accomplished =
'not_accomplished';
5360 $this->tpl->setCurrentBlock(
"start_row");
5362 $this->tpl->setVariable(
"EDITED_ALT",$this->lng->txt(
'crs_objective_'.$accomplished));
5363 $this->tpl->setVariable(
"ROW_CLASS",
'option_value');
5364 $this->tpl->setVariable(
"ROW_CLASS_CENTER",
'option_value_center');
5365 $this->tpl->setVariable(
"OBJ_NR_START",++$counter.
'.');
5366 $this->tpl->parseCurrentBlock();
5380 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
5382 if($settings->isActive() and $settings->getContainer() != $this->
object->getRefId())
5384 $settings->setContainer($this->object->getRefId());
5385 $rbacsystem->initMemberView();
5397 $link = chr(13).chr(10).chr(13).chr(10);
5398 $link .= $this->lng->txt(
'crs_mail_permanent_link');
5399 $link .= chr(13).chr(10).chr(13).chr(10);
5400 include_once
'./Services/Link/classes/class.ilLink.php';
5402 return rawurlencode(base64_encode($link));
5414 include_once
"Services/Certificate/classes/class.ilCertificate.php";
5419 $cert_url = $this->ctrl->getLinkTarget($this,
"deliverCertificate");
5421 $this->lng->loadLanguageModule(
"certificate");
5422 $lg->addCustomCommand($cert_url,
"download_certificate");
5424 $lg->addHeaderIcon(
"cert_icon",
5426 $this->lng->txt(
"download_certificate"),
5433 if($ilSetting->get(
"crsgrp_ntf"))
5435 if(!$ilUser->getPref(
"grpcrs_ntf_".$this->ref_id))
5437 $lg->addHeaderIcon(
"not_icon",
5439 $this->lng->txt(
"crs_notification_deactivated"));
5441 $this->ctrl->setParameter($this,
"crs_ntf", 1);
5442 $caption =
"crs_activate_notification";
5446 $lg->addHeaderIcon(
"not_icon",
5448 $this->lng->txt(
"crs_notification_activated"));
5450 $this->ctrl->setParameter($this,
"crs_ntf", 0);
5451 $caption =
"crs_deactivate_notification";
5454 $lg->addCustomCommand($this->ctrl->getLinkTarget($this,
"saveNotification"),
5458 $this->ctrl->setParameter($this,
"crs_ntf",
"");
5470 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
5476 $user_id = $ilUser->getId();
5479 include_once
"Services/Certificate/classes/class.ilCertificate.php";
5485 $this->ctrl->redirect($this);
5488 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
5490 $certificate->outCertificate(array(
"user_id" => $user_id),
true);