5 require_once
"./Services/Container/classes/class.ilContainerGUI.php";
39 $this->ctrl->saveParameter($this,array(
"ref_id",
"cmdClass"));
44 $this->lng->loadLanguageModule(
'crs');
46 $this->SEARCH_USER = 1;
47 $this->SEARCH_GROUP = 2;
48 $this->SEARCH_COURSE = 3;
56 case "deleteSubscribers":
60 case "addSubscribers":
61 $this->addSubscribers();
64 case "addFromWaitingList":
65 $this->addFromWaitingList();
68 case "removeFromWaitingList":
87 if(isset(
$_POST[
'btn_pressed'][
'deleteMembers']))
91 elseif(
$_POST[
'btn_pressed'][
'sendMailToSelectedUsers'])
103 if(isset(
$_GET[
'member_id']))
109 $_POST[
'member'] = array_unique(array_merge((array)
$_POST[
'members'],
110 (array) $_POST[
'tutors'],
111 (array) $_POST[
'admins'],
112 (array) $_POST[
'waiting'],
113 (array) $_POST[
'subscribers'],
114 (array) $_POST[
'roles']
119 if (!count(
$_POST[
"member"]))
125 foreach(
$_POST[
"member"] as $usr_id)
129 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
134 'rcp_to' => implode(
',',$rcps),
149 #ilUtil::sendSuccess($this->lng->txt("action_aborted"),true);
162 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
165 $part->updateNotification($ilUser->getId(), 1);
172 $this->ctrl->setCmd(
"view");
190 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
192 $this->ctrl->setCmdClass(get_class($course_content_obj));
193 $this->ctrl->setCmd(
'editUserTimings');
194 $this->ctrl->forwardCommand($course_content_obj);
215 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
222 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
226 if ($ilCtrl->getNextClass() !=
"ilcolumngui")
228 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
230 $this->
object->getRefId(),
'crs');
235 include_once(
'Services/Membership/classes/class.ilMemberAgreementGUI.php');
236 $this->tabs_gui->clearTargets();
237 $this->ctrl->setReturn($this,
'view_content');
239 $this->ctrl->setCmdClass(get_class($agreement));
240 $this->ctrl->forwardCommand($agreement);
246 include_once
"Services/Container/classes/class.ilContainerStartObjectsContentGUI.php";
248 $stgui->enableDesktop($this->object->getAboStatus(), $this);
249 return $stgui->getHTML();
265 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
268 $this->ctrl->setCmdClass(get_class($course_content_obj));
269 $this->ctrl->forwardCommand($course_content_obj);
287 $this->ctrl->setCmd(
"showSummary");
288 $this->ctrl->setCmdClass(
"ilinfoscreengui");
302 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
305 $this->tabs_gui->setTabActive(
'info_short');
307 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
308 include_once
'Modules/Course/classes/class.ilCourseFile.php';
313 $info->enablePrivateNotes();
314 $info->enableFeedback();
316 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
318 $info->enableNewsEditing();
321 if(strlen($this->object->getImportantInformation()) or
322 strlen($this->object->getSyllabus()) or
325 $info->addSection($this->lng->txt(
'crs_general_informations'));
328 if(strlen($this->object->getImportantInformation()))
330 $info->addProperty($this->lng->txt(
'crs_important_info'),
334 if(strlen($this->object->getSyllabus()))
336 $info->addProperty($this->lng->txt(
'crs_syllabus'), nl2br(
342 $tpl =
new ilTemplate(
'tpl.event_info_file.html',
true,
true,
'Modules/Course');
344 foreach($files as
$file)
346 $tpl->setCurrentBlock(
"files");
347 $this->ctrl->setParameter($this,
'file_id',$file->getFileId());
348 $tpl->setVariable(
"DOWN_LINK",$this->ctrl->getLinkTarget($this,
'sendfile'));
349 $tpl->setVariable(
"DOWN_NAME",$file->getFileName());
350 $tpl->setVariable(
"DOWN_INFO_TXT",$this->lng->txt(
'crs_file_size_info'));
351 $tpl->setVariable(
"DOWN_SIZE",$file->getFileSize());
352 $tpl->setVariable(
"TXT_BYTES",$this->lng->txt(
'bytes'));
353 $tpl->parseCurrentBlock();
355 $info->addProperty($this->lng->txt(
'crs_file_download'),
359 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
362 $record_gui->parse();
365 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
368 if($this->object->hasContactData())
370 $info->addSection($this->lng->txt(
"crs_contact"));
372 if(strlen($this->object->getContactName()))
374 $info->addProperty($this->lng->txt(
"crs_contact_name"),
375 $this->
object->getContactName());
377 if(strlen($this->object->getContactResponsibility()))
379 $info->addProperty($this->lng->txt(
"crs_contact_responsibility"),
380 $this->
object->getContactResponsibility());
382 if(strlen($this->object->getContactPhone()))
384 $info->addProperty($this->lng->txt(
"crs_contact_phone"),
385 $this->
object->getContactPhone());
387 if($this->object->getContactEmail())
389 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
390 $emails = split(
",",$this->object->getContactEmail());
391 foreach ($emails as $email) {
392 $email = trim($email);
393 $etpl =
new ilTemplate(
"tpl.crs_contact_email.html",
true,
true ,
'Modules/Course');
396 $etpl->setVariable(
"CONTACT_EMAIL", $email);
397 $mailString .= $etpl->get().
"<br />";
399 $info->addProperty($this->lng->txt(
"crs_contact_email"), $mailString);
401 if(strlen($this->object->getContactConsultation()))
403 $info->addProperty($this->lng->txt(
"crs_contact_consultation"),
404 nl2br($this->object->getContactConsultation()));
411 $this->lng->loadLanguageModule(
"rep");
412 $info->addSection($this->lng->txt(
"rep_activation_availability"));
413 $info->showLDAPRoleGroupMappingInfo();
416 if($this->object->getActivationUnlimitedStatus())
418 $info->addProperty($this->lng->txt(
"rep_activation_access"),
419 $this->lng->txt(
'crs_visibility_limitless'));
423 $info->addProperty($this->lng->txt(
'rep_activation_access'),
429 switch($this->object->getSubscriptionLimitationType())
432 $txt = $this->lng->txt(
"crs_info_reg_deactivated");
436 switch($this->object->getSubscriptionType())
439 $txt = $this->lng->txt(
"crs_info_reg_confirmation");
442 $txt = $this->lng->txt(
"crs_info_reg_direct");
445 $txt = $this->lng->txt(
"crs_info_reg_password");
451 $info->addProperty($this->lng->txt(
"crs_info_reg"),
$txt);
456 if($this->object->getSubscriptionUnlimitedStatus())
458 $info->addProperty($this->lng->txt(
"crs_reg_until"),
459 $this->lng->txt(
'crs_unlimited'));
461 elseif($this->object->getSubscriptionStart() < time())
463 $info->addProperty($this->lng->txt(
"crs_reg_until"),
464 $this->lng->txt(
'crs_to').
' '.
467 elseif($this->object->getSubscriptionStart() > time())
469 $info->addProperty($this->lng->txt(
"crs_reg_until"),
470 $this->lng->txt(
'crs_from').
' '.
473 if ($this->object->isSubscriptionMembershipLimited())
475 include_once
'./Services/Membership/classes/class.ilParticipants.php';
477 $this->lng->txt(
"mem_free_places"),
490 $info->addProperty($this->lng->txt(
"crs_archive"),
497 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
500 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
503 include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
507 $this->lng->loadLanguageModule(
'ps');
508 $info->addSection($this->lng->txt(
'crs_user_agreement_info'));
509 $info->addProperty($this->lng->txt(
'ps_export_data'),$field_info->exportableFieldsToInfoString());
513 $info->addProperty($this->lng->txt(
'ps_crs_user_fields'),$fields);
517 $info->enableLearningProgress(
true);
520 $this->ctrl->forwardCommand($info);
530 $ilUser->setPref(
"grpcrs_ntf_".$this->ref_id, (
bool)
$_REQUEST[
"crs_ntf"]);
531 $ilUser->writePrefs();
534 $this->ctrl->redirect($this,
"");
545 include_once
'Modules/Course/classes/class.ilCourseFile.php';
557 $this->tabs_gui->setTabActive(
'settings');
558 $this->tabs_gui->setSubTabActive(
'crs_info_settings');
564 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.edit_info.html',
'Modules/Course');
565 $this->tpl->setVariable(
'INFO_TABLE',$a_form->getHTML());
572 foreach($files as
$file)
574 $table_data[
'id'] = $file->getFileId();
575 $table_data[
'filename'] = $file->getFileName();
576 $table_data[
'filetype'] = $file->getFileType();
577 $table_data[
'filesize'] = $file->getFileSize();
579 $rows[] = $table_data;
582 include_once(
"./Modules/Course/classes/class.ilCourseInfoFileTableGUI.php");
584 $table_gui->setTitle($this->lng->txt(
"crs_info_download"));
585 $table_gui->setData($rows);
586 $table_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
587 $table_gui->addMultiCommand(
"confirmDeleteInfoFiles", $this->lng->txt(
"delete"));
588 $table_gui->setSelectAllCheckbox(
"file_id");
589 $this->tpl->setVariable(
'INFO_FILE_TABLE',$table_gui->getHTML());
604 if(!count(
$_POST[
'file_id']))
612 $this->tabs_gui->setTabActive(
'settings');
613 $this->tabs_gui->setSubTabActive(
'crs_info_settings');
615 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
619 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteInfoFiles"));
620 $c_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
621 $c_gui->setCancel($this->lng->txt(
"cancel"),
"editInfo");
622 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteInfoFiles");
625 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
626 foreach(
$_POST[
"file_id"] as $file_id)
629 $c_gui->addItem(
"file_id[]", $file_id,
$file->getFileName());
632 $this->tpl->setContent($c_gui->getHTML());
643 if(!count(
$_POST[
'file_id']))
649 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
651 foreach(
$_POST[
'file_id'] as $file_id)
654 if($this->object->getId() ==
$file->getCourseId())
673 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
675 $form->setFormAction($this->ctrl->getFormAction($this,
'updateInfo'));
676 $form->setMultipart(
true);
677 $form->setTitle($this->lng->txt(
'crs_general_info'));
678 $form->addCommandButton(
'updateInfo',$this->lng->txt(
'save'));
679 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
682 $area->
setValue($this->object->getImportantInformation());
685 $form->addItem($area);
688 $area->
setValue($this->object->getSyllabus());
691 $form->addItem($area);
694 $section->setTitle($this->lng->txt(
'crs_info_download'));
698 $file->enableFileNameSelection(
'file_name');
699 $form->addItem(
$file);
702 $section->setTitle($this->lng->txt(
'crs_contact'));
705 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_name'),
'contact_name');
706 $text->
setValue($this->object->getContactName());
708 $text->setMaxLength(70);
709 $form->addItem($text);
711 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_responsibility'),
'contact_responsibility');
712 $text->
setValue($this->object->getContactResponsibility());
714 $text->setMaxLength(70);
715 $form->addItem($text);
717 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_phone'),
'contact_phone');
718 $text->
setValue($this->object->getContactPhone());
720 $text->setMaxLength(40);
721 $form->addItem($text);
723 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_email'),
'contact_email');
724 $text->
setValue($this->object->getContactEmail());
725 $text->setInfo($this->lng->txt(
'crs_contact_email_info'));
727 $text->setMaxLength(255);
728 $form->addItem($text);
730 $area =
new ilTextAreaInputGUI($this->lng->txt(
'crs_contact_consultation'),
'contact_consultation');
731 $area->
setValue($this->object->getContactConsultation());
734 $form->addItem($area);
736 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
739 $this->record_gui->parse();
750 include_once
'Modules/Course/classes/class.ilCourseFile.php';
752 $file_obj->setCourseId($this->object->getId());
753 $file_obj->setFileName(strlen(
$_POST[
'file_name']) ?
755 $_FILES[
'file'][
'name']);
756 $file_obj->setFileSize($_FILES[
'file'][
'size']);
757 $file_obj->setFileType($_FILES[
'file'][
'type']);
758 $file_obj->setTemporaryName($_FILES[
'file'][
'tmp_name']);
759 $file_obj->setErrorCode($_FILES[
'file'][
'error']);
773 $ilErr->setMessage(
'');
775 $file_obj->validate();
776 $this->
object->validateInfoSettings();
777 if(strlen($ilErr->getMessage()))
779 $error = $ilErr->getMessage();
785 if(!$this->record_gui->importEditFormPostValues())
800 $this->
object->update();
802 $this->record_gui->writeEditForm();
806 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
808 $ecs->handleContentUpdate();
827 $period = $form->getItemByPostVar(
"access_period");
828 $sub_period = $form->getItemByPostVar(
"subscription_period");
830 if((
int)
$_POST[
'activation_type'])
838 $this->
object->setOfflineStatus(!(
bool)$_POST[
'activation_online']);
839 $this->
object->setActivationStart($period->getStart()->get(
IL_CAL_UNIX));
840 $this->
object->setActivationEnd($period->getEnd()->get(
IL_CAL_UNIX));
841 $this->
object->setActivationVisibility((
int)$_POST[
'activation_visibility']);
843 $sub_type = (int)$_POST[
'subscription_type'];
846 $this->
object->setSubscriptionType($sub_type);
848 if((
int)$_POST[
'subscription_limitation_type'])
865 $this->
object->setSubscriptionStart($sub_period->getStart()->get(
IL_CAL_UNIX));
866 $this->
object->setSubscriptionEnd($sub_period->getEnd()->get(
IL_CAL_UNIX));
868 $this->
object->enableSubscriptionMembershipLimitation((
int) $_POST[
'subscription_membership_limitation']);
869 $this->
object->setSubscriptionMaxMembers((
int) $_POST[
'subscription_max']);
871 $this->
object->enableRegistrationAccessCode((
int) $_POST[
'reg_code_enabled']);
874 $this->
object->enableWaitingList((
int) $_POST[
'waiting_list']);
875 #$this->object->setSubscriptionNotify((int) $_POST['subscription_notification']);
876 $this->
object->setViewMode((
int) $_POST[
'view_mode']);
884 $this->
object->setOrderType($form->getInput(
'sorting'));
893 $this->
object->setAboStatus((
int) $_POST[
'abo']);
894 $this->
object->setShowMembers((
int) $_POST[
'show_members']);
895 $this->
object->setMailToMembersType((
int) $_POST[
'mail_type']);
897 $this->
object->enableSessionLimit((
int) $_POST[
'sl']);
898 $this->
object->setNumberOfPreviousSessions(is_numeric($_POST[
'sp']) ? (
int) $_POST[
'sp'] : -1 );
899 $this->
object->setNumberOfnextSessions(is_numeric($_POST[
'sn']) ? (
int) $_POST[
'sn'] : -1 );
901 $this->
object->setAutoNotification($_POST[
'auto_notification'] == 1 ?
true :
false);
904 $show_lp_sync_confirmation =
false;
907 if(isset($_POST[
'status_dt']))
912 $show_lp_sync_confirmation =
true;
916 $this->
object->setStatusDetermination((
int)$_POST[
'status_dt']);
921 if($this->object->validate())
923 $this->
object->update();
926 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
933 include_once
'./Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
935 $this->object->getId(),
946 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
948 if(!$ecs->handleSettingsUpdate())
954 if($show_lp_sync_confirmation)
973 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
975 $cgui->setFormAction($this->ctrl->getFormAction($this,
"setLPSync"));
976 $cgui->setHeaderText($this->lng->txt(
"crs_status_determination_sync"));
977 $cgui->setCancel($this->lng->txt(
"cancel"),
"edit");
978 $cgui->setConfirm($this->lng->txt(
"confirm"),
"setLPSync");
980 $tpl->setContent($cgui->getHTML());
986 $this->
object->update();
988 $this->
object->syncMembersStatusWithLP();
991 $this->ctrl->redirect($this,
"edit");
1005 $this->tabs_gui->setSubTabActive(
'crs_settings');
1017 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1018 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
1021 $form->setTitle($this->lng->txt(
'crs_edit'));
1023 $form->addCommandButton(
'update',$this->lng->txt(
'save'));
1024 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1026 $form->setFormAction($this->ctrl->getFormAction($this,
'update'));
1031 $title->setValue($this->object->getTitle());
1034 $title->setRequired(
true);
1035 $form->addItem($title);
1039 $desc->
setValue($this->object->getLongDescription());
1042 $form->addItem($desc);
1050 $this->lng->loadLanguageModule(
'rep');
1053 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
1056 $online =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_online'),
'activation_online');
1057 $online->
setChecked(!$this->object->getOfflineStatus());
1058 $online->setInfo($this->lng->txt(
'crs_activation_online_info'));
1059 $form->addItem($online);
1061 $act_type =
new ilCheckboxInputGUI($this->lng->txt(
'crs_visibility_until'),
'activation_type');
1065 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
1066 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
1070 $dur->setStartText($this->lng->txt(
'rep_activation_limited_start'));
1072 $dur->setEndText($this->lng->txt(
'rep_activation_limited_end'));
1073 $act_type->addSubItem($dur);
1075 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'activation_visibility');
1076 $visible->
setInfo($this->lng->txt(
'crs_activation_limited_visibility_info'));
1077 $visible->setChecked($this->object->getActivationVisibility());
1078 $act_type->addSubItem($visible);
1080 $form->addItem($act_type);
1084 $section->setTitle($this->lng->txt(
'crs_reg'));
1087 $reg_proc =
new ilRadioGroupInputGUI($this->lng->txt(
'crs_registration_type'),
'subscription_type');
1090 ? $this->object->getSubscriptionType()
1095 $reg_proc->addOption($opt);
1100 $pass->
setInfo($this->lng->txt(
'crs_reg_password_info'));
1101 $pass->setSubmitFormOnEnter(
true);
1103 $pass->setMaxLength(12);
1104 $pass->
setValue($this->object->getSubscriptionPassword());
1106 $opt->addSubItem($pass);
1107 $reg_proc->addOption($opt);
1110 $opt->
setInfo($this->lng->txt(
'crs_registration_confirmation_info'));
1111 $reg_proc->addOption($opt);
1114 $opt->
setInfo($this->lng->txt(
'crs_registration_deactivated'));
1115 $reg_proc->addOption($opt);
1117 $form->addItem($reg_proc);
1121 $reg_code =
new ilCheckboxInputGUI($this->lng->txt(
'crs_reg_code'),
'reg_code_enabled');
1122 $reg_code->
setChecked($this->object->isRegistrationAccessCodeEnabled());
1123 $reg_code->setValue(1);
1124 $reg_code->setInfo($this->lng->txt(
'crs_reg_code_enabled_info'));
1132 #$link = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_link'));
1134 if(!$this->object->getRegistrationAccessCode())
1136 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1140 $reg_link->setValue($this->object->getRegistrationAccessCode());
1141 $form->addItem($reg_link);
1144 include_once
'./Services/Link/classes/class.ilLink.php';
1145 $val =
ilLink::_getLink($this->object->getRefId(),$this->
object->getType(),array(),
'_rcode'.$this->object->getRegistrationAccessCode());
1146 $link->setHTML(
'<font class="small">'.$val.
'</font>');
1147 $reg_code->addSubItem($link);
1149 $form->addItem($reg_code);
1153 $time_limit =
new ilCheckboxInputGUI($this->lng->txt(
'crs_registration_limited'),
'subscription_limitation_type');
1156 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
1160 $sdur->setStartText($this->lng->txt(
'crs_start'));
1162 $sdur->setEndText($this->lng->txt(
'crs_end'));
1164 $time_limit->addSubItem($sdur);
1165 $form->addItem($time_limit);
1169 $lim =
new ilCheckboxInputGUI($this->lng->txt(
'crs_subscription_max_members_short'),
'subscription_membership_limitation');
1171 $lim->setChecked($this->object->isSubscriptionMembershipLimited());
1174 $max->setSubmitFormOnEnter(
true);
1176 $max->setMaxLength(4);
1177 $max->setValue($this->object->getSubscriptionMaxMembers() ? $this->
object->getSubscriptionMaxMembers() :
'');
1178 $max->setTitle($this->lng->txt(
'crs_subscription_max_members'));
1179 $max->setInfo($this->lng->txt(
'crs_reg_max_info'));
1181 $lim->addSubItem($max);
1184 $wait->
setChecked($this->object->enabledWaitingList());
1185 $wait->setInfo($this->lng->txt(
'crs_wait_info'));
1186 $lim->addSubItem($wait);
1188 $form->addItem($lim);
1192 $pres->setTitle($this->lng->txt(
'crs_view_mode'));
1194 $form->addItem($pres);
1198 $view_type->
setValue($this->object->getViewMode());
1201 $opts->
setInfo($this->lng->txt(
'cntr_view_info_sessions'));
1202 $view_type->addOption($opts);
1207 $sess->setChecked($this->object->isSessionLimitEnabled());
1208 $sess->setInfo($this->lng->txt(
'sess_limit_info'));
1211 #$prev->setSubmitFormOnEnter(true);
1213 $prev->setValue($this->object->getNumberOfPreviousSessions() == -1 ?
1215 $this->
object->getNumberOfPreviousSessions()
1218 $prev->setMaxLength(3);
1219 $sess->addSubItem($prev);
1222 #$next->setSubmitFormOnEnter(true);
1224 $next->setValue($this->object->getNumberOfNextSessions() == -1 ?
1226 $this->
object->getNumberOfnextSessions()
1229 $next->setMaxLength(3);
1230 $sess->addSubItem($next);
1232 $opts->addSubItem(
$sess);
1238 $optsi->
setInfo($this->lng->txt(
'cntr_view_info_simple'));
1239 $view_type->addOption($optsi);
1242 $optbt->
setInfo($this->lng->txt(
'cntr_view_info_by_type'));
1243 $view_type->addOption($optbt);
1246 $opto->
setInfo($this->lng->txt(
'crs_view_info_objective'));
1247 $view_type->addOption($opto);
1250 $optt->
setInfo($this->lng->txt(
'crs_view_info_timing'));
1251 $view_type->addOption($optt);
1253 $form->addItem($view_type);
1268 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
1271 include_once
'./Services/Object/classes/class.ilObjectLP.php';
1273 if($olp->getCurrentMode())
1276 $lp_status->setTitle($this->lng->txt(
'crs_course_status_of_users'));
1277 $form->addItem($lp_status);
1279 $lp_status_options =
new ilRadioGroupInputGUI($this->lng->txt(
'crs_status_determination'),
"status_dt");
1281 $lp_status_options->
setValue($this->object->getStatusDetermination());
1283 $lp_option =
new ilRadioOption($this->lng->txt(
'crs_status_determination_lp'),
1285 $lp_status_options->addOption($lp_option);
1286 $lp_status_options->addOption(
new ilRadioOption($this->lng->txt(
'crs_status_determination_manual'),
1289 $form->addItem($lp_status_options);
1295 $feat->setTitle($this->lng->txt(
'obj_features'));
1296 $form->addItem($feat);
1298 include_once
'./Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
1300 $this->object->getId(),
1311 $mem->
setChecked($this->object->getShowMembers());
1312 $mem->setInfo($this->lng->txt(
'crs_show_members_info'));
1313 $form->addItem($mem);
1317 $mail_type->
setValue($this->object->getMailToMembersType());
1320 $this->lng->txt(
'crs_mail_tutors_only_info'));
1321 $mail_type->addOption($mail_tutors);
1324 $this->lng->txt(
'crs_mail_all_info'));
1325 $mail_type->addOption($mail_all);
1326 $form->addItem($mail_type);
1334 $not =
new ilCheckboxInputGUI($this->lng->txt(
'crs_auto_notification'),
'auto_notification');
1336 $not->setInfo($this->lng->txt(
'crs_auto_notification_info'));
1337 $not->setChecked( $this->object->getAutoNotification() );
1338 $form->addItem($not);
1346 $desk =
new ilCheckboxInputGUI($this->lng->txt(
'crs_add_remove_from_desktop'),
'abo');
1347 $desk->
setChecked($this->object->getAboStatus());
1348 $desk->setInfo($this->lng->txt(
'crs_add_remove_from_desktop_info'));
1349 $form->addItem($desk);
1353 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
1355 $ecs->addSettingsToForm($form,
'crs');
1375 $this->tabs_gui->setTabActive(
'settings');
1382 $tpl->setContent($a_form->getHTML());
1387 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1389 $form->setFormAction($this->ctrl->getFormAction($this));
1394 $form->addCommandButton(
'updateCourseIcons', $this->lng->txt(
'save'));
1401 include_once
'Modules/Course/classes/class.ilCourseFile.php';
1417 if($form->checkInput())
1420 if ($ilSetting->get(
"custom_icons"))
1422 if(
$_POST[
"cont_icon_delete"])
1424 $this->
object->removeCustomIcon();
1426 $this->
object->saveIcons($_FILES[
"cont_icon"][
'tmp_name']);
1430 $this->ctrl->redirect($this,
"editCourseIcons");
1433 $form->setValuesByPost();
1448 $this->tabs_gui->addSubTabTarget(
"crs_settings",
1449 $this->ctrl->getLinkTarget($this,
'edit'),
1450 "edit", get_class($this));
1452 $this->tabs_gui->addSubTabTarget(
"crs_info_settings",
1453 $this->ctrl->getLinkTarget($this,
'editInfo'),
1454 "editInfo", get_class($this));
1456 $this->tabs_gui->addSubTabTarget(
"preconditions",
1457 $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerGUI',
'listConditions'),
1458 "",
"ilConditionHandlerGUI");
1460 $this->tabs_gui->addSubTabTarget(
"crs_start_objects",
1461 $this->ctrl->getLinkTargetByClass(
'ilContainerStartObjectsGUI',
'listStructure'),
1462 "listStructure", get_class($this));
1464 $this->tabs_gui->addSubTabTarget(
'groupings',
1465 $this->ctrl->getLinkTargetByClass(
'ilobjcoursegroupinggui',
'listGroupings'),
1470 if ($this->ilias->getSetting(
"custom_icons"))
1472 $this->tabs_gui->addSubTabTarget(
"icon_settings",
1473 $this->ctrl->getLinkTarget($this,
'editCourseIcons'),
1474 "editCourseIcons", get_class($this));
1478 include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
1481 $this->tabs_gui->addSubTabTarget(
"crs_map_settings",
1482 $this->ctrl->getLinkTarget($this,
'editMapSettings'),
1483 "editMapSettings", get_class($this));
1487 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1488 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1492 $this->tabs_gui->addSubTabTarget(
'crs_custom_user_fields',
1493 $this->ctrl->getLinkTargetByClass(
'ilobjectcustomuserfieldsgui'),
1495 'ilobjectcustomuserfieldsgui');
1499 include_once
"Services/Certificate/classes/class.ilCertificate.php";
1502 $this->tabs_gui->addSubTabTarget(
1504 $this->ctrl->getLinkTargetByClass(
"ilcertificategui",
"certificateeditor"),
1505 "",
"ilcertificategui");
1510 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1512 $this->tabs_gui->addSubTabTarget(
"crs_member_administration",
1513 $this->ctrl->getLinkTarget($this,
'members'),
1514 "members", get_class($this));
1516 $this->tabs_gui->addSubTabTarget(
"crs_members_groups",
1517 $this->ctrl->getLinkTargetByClass(
"ilCourseParticipantsGroupsGUI",
"show"),
1518 "",
"ilCourseParticipantsGroupsGUI");
1520 $this->tabs_gui->addSubTabTarget(
"crs_members_gallery",
1521 $this->ctrl->getLinkTarget($this,
'membersGallery'),
1522 "membersGallery", get_class($this));
1525 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_ENABLED
1528 $this->tabs_gui->addSubTabTarget(
"crs_members_gallery",
1529 $this->ctrl->getLinkTarget($this,
'membersGallery'),
1530 "membersGallery", get_class($this));
1534 include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
1537 $this->tabs_gui->addSubTabTarget(
"crs_members_map",
1538 $this->ctrl->getLinkTarget($this,
'membersMap'),
1539 "membersMap", get_class($this));
1542 $childs = (array) $tree->getChildsByType($this->object->getRefId(),
'sess');
1543 if(count($childs) && $ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1545 $this->tabs_gui->addSubTabTarget(
"events",
1546 $this->ctrl->getLinkTargetByClass(
'ilsessionoverviewgui',
'listSessions'),
1547 "",
'ilsessionoverviewgui');
1550 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
1553 $this->tabs_gui->addSubTabTarget(
'export_members',
1554 $this->ctrl->getLinkTargetByClass(
'ilmemberexportgui',
'show'),
1555 "",
'ilmemberexportgui');
1584 $this->
object->removeSmallIcon();
1585 $this->ctrl->redirect($this,
'editCourseIcons');
1595 $this->
object->removeBigIcon();
1596 $this->ctrl->redirect($this,
'editCourseIcons');
1607 $this->
object->removeTinyIcon();
1608 $this->ctrl->redirect($this,
'editCourseIcons');
1619 $a_new_object->getMemberObject()->add($ilUser->getId(),
IL_CRS_ADMIN);
1620 $a_new_object->getMemberObject()->updateNotification($ilUser->getId(),1);
1624 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1632 $this->ctrl->setParameter($this,
"ref_id", $a_new_object->
getRefId());
1634 $this->ctrl->getLinkTarget($this,
"edit",
"",
false,
false)));
1651 if(!count(
$_POST[
'archives']))
1654 $this->archiveObject();
1658 if(count(
$_POST[
'archives']) > 1)
1661 $this->archiveObject();
1666 $this->
object->initCourseArchiveObject();
1668 $abs_path = $this->
object->archives_obj->getArchiveFile((
int)
$_POST[
'archives'][0]);
1669 $basename = basename($abs_path);
1684 if(isset(
$_GET[
'admin_hide']))
1686 $ilUser->writePref(
'crs_admin_hide',(
int)
$_GET[
'admin_hide']);
1688 if(isset(
$_GET[
'tutor_hide']))
1690 $ilUser->writePref(
'crs_tutor_hide',(
int)
$_GET[
'tutor_hide']);
1692 if(isset(
$_GET[
'member_hide']))
1694 $ilUser->writePref(
'crs_member_hide',(
int)
$_GET[
'member_hide']);
1696 if(isset(
$_GET[
'subscriber_hide']))
1698 $ilUser->writePref(
'crs_subscriber_hide',(
int)
$_GET[
'subscriber_hide']);
1700 if(isset(
$_GET[
'wait_hide']))
1702 $ilUser->writePref(
'crs_wait_hide',(
int)
$_GET[
'wait_hide']);
1704 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
1707 if(isset(
$_GET[
'role_hide_'.$role_id]))
1709 $ilUser->writePref(
'crs_role_hide_'.$role_id,(
int)
$_GET[
'role_hide_'.$role_id]);
1716 if($this->show_tracking)
1718 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
1723 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1726 if($privacy->enabledCourseAccessTimes())
1728 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
1732 $do_prtf = (is_array($selected_columns) &&
1733 in_array(
'prtf', $selected_columns) &&
1737 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
1739 $this->ctrl->getLinkTarget($this,
"members"));
1742 foreach((array) $ids as $usr_id)
1745 $tmp_data[
'firstname'] = $name[
'firstname'];
1746 $tmp_data[
'lastname'] = $name[
'lastname'];
1748 $tmp_data[
'passed'] = $this->
object->getMembersObject()->hasPassed($usr_id) ? 1 : 0;
1751 $tmp_data[
'passed_info'] = $this->
object->getMembersObject()->getPassedInfo($usr_id);
1753 $tmp_data[
'notification'] = $this->
object->getMembersObject()->isNotificationEnabled($usr_id) ? 1 : 0;
1754 $tmp_data[
'blocked'] = $this->
object->getMembersObject()->isBlocked($usr_id) ? 1 : 0;
1755 $tmp_data[
'usr_id'] = $usr_id;
1757 if($this->show_tracking)
1759 if(in_array($usr_id,$completed))
1763 elseif(in_array($usr_id,$in_progress))
1767 elseif(in_array($usr_id,
$failed))
1777 if($privacy->enabledCourseAccessTimes())
1779 if(isset($progress[$usr_id][
'ts']) and $progress[$usr_id][
'ts'])
1781 $tmp_data[
'access_ut'] = $progress[$usr_id][
'ts'];
1786 $tmp_data[
'access_ut'] = 0;
1787 $tmp_data[
'access_time'] = $this->lng->txt(
'no_date');
1793 $tmp_data[
'prtf'] = $all_prtf[$usr_id];
1796 $members[$usr_id] = $tmp_data;
1798 return $members ? $members : array();
1814 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
1815 include_once(
'./Modules/Course/classes/class.ilCourseParticipantsTableGUI.php');
1818 if(isset(
$_GET[
'member_table_nav']))
1825 include_once
'./Services/Tracking/classes/class.ilObjUserTracking.php';
1828 if($this->show_tracking)
1830 include_once(
'./Services/Object/classes/class.ilObjectLP.php');
1832 $this->show_tracking = $olp->isActive();
1835 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
1840 $this->tabs_gui->setTabActive(
'members');
1841 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
1843 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_edit_members.html',
'Modules/Course');
1844 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
1847 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
1853 'auto_complete_name' => $lng->txt(
'user'),
1855 'submit_name' => $lng->txt(
'add')
1860 $ilToolbar->addSeparator();
1863 $ilToolbar->addButton($this->lng->txt(
"crs_search_users"),
1864 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
1867 $ilToolbar->addSeparator();
1870 $ilToolbar->addButton($this->lng->txt(
"crs_print_list"),
1871 $this->ctrl->getLinkTarget($this,
'printMembers'));
1882 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
1884 if(count($wait = $waiting_list->getAllUsers()))
1886 include_once(
'./Services/Membership/classes/class.ilWaitingListTableGUI.php');
1887 if($ilUser->getPref(
'crs_wait_hide'))
1890 $this->ctrl->setParameter($this,
'wait_hide',0);
1891 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
1892 $this->lng->txt(
'show'));
1893 $this->ctrl->clearParameters($this);
1898 $this->ctrl->setParameter($this,
'wait_hide',1);
1899 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
1900 $this->lng->txt(
'hide'));
1901 $this->ctrl->clearParameters($this);
1903 $table_gui->setUsers($wait);
1904 $table_gui->setTitle($this->lng->txt(
'crs_waiting_list'),
'icon_usr.svg',$this->lng->txt(
'crs_waiting_list'));
1905 $this->tpl->setVariable(
'TABLE_WAIT',$table_gui->getHTML());
1911 include_once(
'./Services/Membership/classes/class.ilSubscriberTableGUI.php');
1912 if($ilUser->getPref(
'crs_subscriber_hide'))
1915 $this->ctrl->setParameter($this,
'subscriber_hide',0);
1916 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
1917 $this->lng->txt(
'show'));
1918 $this->ctrl->clearParameters($this);
1923 $this->ctrl->setParameter($this,
'subscriber_hide',1);
1924 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
1925 $this->lng->txt(
'hide'));
1926 $this->ctrl->clearParameters($this);
1928 $table_gui->readSubscriberData();
1929 $table_gui->setTitle($this->lng->txt(
'group_new_registrations'),
'icon_usr.svg',$this->lng->txt(
'group_new_registrations'));
1930 $this->tpl->setVariable(
'TABLE_SUB',$table_gui->getHTML());
1935 if($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultAdminRole())))
1941 $ilAccess->checkAccess(
"edit_permission",
'', $this->object->getRefId()) or
1944 if($ilUser->getPref(
'crs_admin_hide'))
1951 $this->timings_enabled,
1953 $this->object->getDefaultAdminRole(),
1956 $this->ctrl->setParameter($this,
'admin_hide',0);
1958 $this->lng->txt(
'show'));
1959 $this->ctrl->clearParameters($this);
1968 $this->timings_enabled,
1970 $this->object->getDefaultAdminRole(),
1973 $this->ctrl->setParameter($this,
'admin_hide',1);
1975 $this->lng->txt(
'hide'));
1976 $this->ctrl->clearParameters($this);
1978 $table_gui->setTitle($this->lng->txt(
'crs_administrators'),
'icon_usr.svg',$this->lng->txt(
'crs_administrators'));
1979 $table_gui->parse();
1980 $this->tpl->setVariable(
'ADMINS',$table_gui->getHTML());
1982 if($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultTutorRole())))
1984 if($ilUser->getPref(
'crs_tutor_hide'))
1991 $this->timings_enabled,
1993 $this->object->getDefaultTutorRole(),
1996 $this->ctrl->setParameter($this,
'tutor_hide',0);
1998 $this->lng->txt(
'show'));
1999 $this->ctrl->clearParameters($this);
2008 $this->timings_enabled,
2010 $this->object->getDefaultTutorRole(),
2013 $this->ctrl->setParameter($this,
'tutor_hide',1);
2015 $this->lng->txt(
'hide'));
2016 $this->ctrl->clearParameters($this);
2018 $table_gui->setTitle($this->lng->txt(
'crs_tutors'),
'icon_usr.svg',$this->lng->txt(
'crs_tutors'));
2019 $table_gui->parse();
2020 $this->tpl->setVariable(
'TUTORS',$table_gui->getHTML());
2022 if($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultMemberRole())))
2024 if($ilUser->getPref(
'crs_member_hide'))
2030 $this->show_tracking,
2031 $this->timings_enabled,
2033 $this->object->getDefaultMemberRole(),
2037 $this->ctrl->setParameter($this,
'member_hide',0);
2039 $this->lng->txt(
'show'));
2040 $this->ctrl->clearParameters($this);
2048 $this->show_tracking,
2049 $this->timings_enabled,
2051 $this->object->getDefaultMemberRole(),
2054 $this->ctrl->setParameter($this,
'member_hide',1);
2056 $this->lng->txt(
'hide'));
2057 $this->ctrl->clearParameters($this);
2059 $table_gui->setTitle($this->lng->txt(
'crs_members'),
'icon_usr.svg',$this->lng->txt(
'crs_members'));
2060 $table_gui->parse();
2061 $this->tpl->setCurrentBlock(
'member_block');
2062 $this->tpl->setVariable(
'MEMBERS',$table_gui->getHTML());
2063 $this->tpl->parseCurrentBlock();
2069 if(!(
$GLOBALS[
'rbacreview']->getNumberOfAssignedUsers(array($role_id))))
2073 if($ilUser->getPref(
'crs_role_hide_'.$role_id))
2079 $this->show_tracking,
2080 $this->timings_enabled,
2085 $this->ctrl->setParameter($this,
'role_hide_'.$role_id,0);
2087 $this->ctrl->getLinkTarget($this,
'members'),
2088 $this->lng->txt(
'show')
2090 $this->ctrl->clearParameters($this);
2098 $this->show_tracking,
2099 $this->timings_enabled,
2104 $this->ctrl->setParameter($this,
'role_hide_'.$role_id,1);
2106 $this->ctrl->getLinkTarget($this,
'members'),
2107 $this->lng->txt(
'hide')
2109 $this->ctrl->clearParameters($this);
2113 $table_gui->parse();
2114 $this->tpl->setCurrentBlock(
'member_block');
2115 $this->tpl->setVariable(
'MEMBERS',$table_gui->getHTML());
2116 $this->tpl->parseCurrentBlock();
2120 $this->tpl->setVariable(
'TXT_SELECTED_USER',$this->lng->txt(
'crs_selected_users'));
2121 $this->tpl->setVariable(
'BTN_FOOTER_EDIT',$this->lng->txt(
'edit'));
2122 $this->tpl->setVariable(
'BTN_FOOTER_VAL',$this->lng->txt(
'remove'));
2123 $this->tpl->setVariable(
'BTN_FOOTER_MAIL',$this->lng->txt(
'crs_mem_send_mail'));
2141 $visible_members = array_intersect(array_unique((array)
$_POST[
'visible_member_ids']),$this->object->getMembersObject()->getAdmins());
2142 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2143 $notification = is_array($_POST[
'notification']) ? $_POST[
'notification'] : array();
2159 $visible_members = array_intersect(array_unique((array)
$_POST[
'visible_member_ids']),$this->object->getMembersObject()->getTutors());
2160 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2161 $notification = is_array($_POST[
'notification']) ? $_POST[
'notification'] : array();
2177 $visible_members = array_intersect(array_unique((array)
$_POST[
'visible_member_ids']),$this->object->getMembersObject()->getMembers());
2178 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2179 $blocked = is_array($_POST[
'blocked']) ? $_POST[
'blocked'] : array();
2194 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
2199 $users = array_merge($users,$rbacreview->assignedUsers($role_id));
2202 $passed = is_array(
$_POST[
'passed']) ?
$_POST[
'passed'] : array();
2203 $blocked = is_array(
$_POST[
'blocked']) ?
$_POST[
'blocked'] : array();
2218 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
2222 include_once
'./Services/Object/classes/class.ilObjectLP.php';
2226 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
2227 $marks =
new ilLPMarks($this->object->getId(), $a_member_id);
2230 if($marks->getCompleted() != $a_has_passed)
2235 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
2246 foreach($visible_members as $member_id)
2248 $this->
object->getMembersObject()->updatePassed($member_id,in_array($member_id,$passed),
true);
2255 $this->
object->getMembersObject()->updateNotification($member_id,in_array($member_id,$notification));
2256 $this->
object->getMembersObject()->updateBlocked($member_id,
false);
2260 if($this->object->getMembersObject()->isBlocked($member_id) and !in_array($member_id,$blocked))
2262 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_UNBLOCK_MEMBER,$member_id);
2264 if(!$this->object->getMembersObject()->isBlocked($member_id) and in_array($member_id,$blocked))
2266 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_BLOCK_MEMBER,$member_id);
2268 $this->
object->getMembersObject()->updateNotification($member_id,
false);
2269 $this->
object->getMembersObject()->updateBlocked($member_id,in_array($member_id,$blocked));
2283 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
2285 $this->
object->initWaitingList();
2286 if($this->object->waiting_list_obj->getCountUsers())
2289 $f_result = array();
2290 foreach($this->object->waiting_list_obj->getAllUsers() as $waiting_data)
2295 $waiting_list_ids[] = $waiting_data[
'usr_id'];
2299 $this->
object->getId()) as $course_data)
2302 if($course_data[
'id'] != $this->object->getId() and
2303 $tmp_members->isGroupingMember($tmp_obj->getId(),$course_data[
'unique']))
2305 $message .= (
'<br /><span class="ilAlert">'.$this->lng->txt(
'crs_member_of').
' ');
2311 $f_result[$counter][] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname().$message;
2312 $f_result[$counter][] = $tmp_obj->getLogin();
2333 $_POST[
'members'] = array((
int)
$_GET[
'member_id']);
2349 $post_participants = array_unique(array_merge((array)
$_POST[
'admins'],(array) $_POST[
'tutors'],(array) $_POST[
'members'], (array) $_POST[
'roles']));
2351 $participants = array_intersect((array) $post_participants, (array) $real_participants);
2355 if(!count($participants))
2363 $this->tabs_gui->setTabActive(
'members');
2364 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
2366 include_once(
'./Modules/Course/classes/class.ilCourseEditParticipantsTableGUI.php');
2368 $table_gui->setTitle($this->lng->txt(
'crs_header_edit_members'),
'icon_usr.svg',$this->lng->txt(
'crs_header_edit_members'));
2371 $this->tpl->setContent($table_gui->getHTML());
2384 global $rbacsystem, $rbacreview,
$ilUser, $ilAccess;
2388 if(!count(
$_POST[
'participants']))
2395 $notifications =
$_POST[
'notification'] ?
$_POST[
'notification'] : array();
2396 $passed =
$_POST[
'passed'] ?
$_POST[
'passed'] : array();
2397 $blocked =
$_POST[
'blocked'] ?
$_POST[
'blocked'] : array();
2400 $hasEditPermissionAccess =
2402 $ilAccess->checkAccess(
'edit_permission',
'',$this->object->getRefId()) or
2408 $assignableLocalCourseRoles = array();
2409 $courseAdminRoleId = $this->
object->getDefaultAdminRole();
2410 foreach ($this->object->getLocalCourseRoles(
false) as $title => $role_id)
2412 $assignableLocalCourseRoles[$role_id] = $title;
2416 foreach(
$_POST[
'participants'] as $usr_id)
2418 $memberIsCourseAdmin = $rbacreview->isAssigned($usr_id, $courseAdminRoleId);
2423 if (! $hasEditPermissionAccess && $memberIsCourseAdmin &&
2424 ! in_array($courseAdminRoleId,
$_POST[
'roles'][$usr_id])
2427 $_POST[
'roles'][$usr_id][] = $courseAdminRoleId;
2431 foreach ((array)
$_POST[
'roles'][$usr_id] as $role_id)
2433 if(!array_key_exists($role_id, $assignableLocalCourseRoles))
2439 if(!$hasEditPermissionAccess &&
2440 $role_id == $courseAdminRoleId &&
2441 !$memberIsCourseAdmin)
2453 if(!isset(
$_POST[
'roles'][$admin_id]))
2458 if(in_array($courseAdminRoleId,
$_POST[
'roles'][$admin_id]))
2468 $_POST[
'members'] = $_POST[
'participants'];
2473 foreach(
$_POST[
'participants'] as $usr_id)
2475 $this->
object->getMembersObject()->updateRoleAssignments($usr_id,(array)
$_POST[
'roles'][$usr_id]);
2478 $this->
object->getMembersObject()->updateNotification($usr_id,0);
2479 if(($this->object->getMembersObject()->isTutor($usr_id) or $this->
object->getMembersObject()->isAdmin($usr_id)) and in_array($usr_id,$notifications))
2481 $this->
object->getMembersObject()->updateNotification($usr_id,1);
2484 $this->
object->getMembersObject()->updateBlocked($usr_id,0);
2485 if((!$this->object->getMembersObject()->isAdmin($usr_id) and !$this->
object->getMembersObject()->isTutor($usr_id)) and in_array($usr_id,$blocked))
2487 $this->
object->getMembersObject()->updateBlocked($usr_id,1);
2489 $this->
object->getMembersObject()->updatePassed($usr_id,in_array($usr_id,$passed),
true);
2490 $this->
object->getMembersObject()->sendNotification(
2491 $this->object->getMembersObject()->NOTIFY_STATUS_CHANGED,
2497 $this->ctrl->redirect($this,
"members");
2512 if(!isset(
$_GET[
"member_id"]) or !$this->object->getMembersObject()->isAssigned((
int)
$_GET[
"member_id"]))
2514 $this->ilias->raiseError($this->lng->txt(
"crs_no_valid_member_id_given"),$this->ilias->error_obj->MESSAGE);
2519 $passed = $this->
object->getMembersObject()->hasPassed((
int) $_GET[
'member_id']);
2520 $notify = $this->
object->getMembersObject()->isNotificationEnabled((
int) $_GET[
'member_id']);
2521 $blocked = $this->
object->getMembersObject()->isBlocked((
int) $_GET[
'member_id']);
2523 $this->
object->getMembersObject()->updateRoleAssignments((
int) $_GET[
'member_id'],
$_POST[
'roles']);
2524 $this->
object->getMembersObject()->updatePassed((
int) $_GET[
'member_id'],(
int)
$_POST[
'passed'],
true);
2525 $this->
object->getMembersObject()->updateNotification((
int) $_GET[
'member_id'],(
int) $_POST[
'notification']);
2526 $this->
object->getMembersObject()->updateBlocked((
int) $_GET[
'member_id'],(
int) $_POST[
'blocked']);
2528 if($passed != $this->object->getMembersObject()->hasPassed((
int) $_GET[
'member_id']) or
2529 $notify != $this->
object->getMembersObject()->isNotificationEnabled((
int) $_GET[
'member_id']) or
2530 $blocked != $this->
object->getMembersObject()->isBlocked((
int) $_GET[
'member_id']))
2532 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_STATUS_CHANGED,(int) $_GET[
'member_id']);
2556 if(!count($a_usr_ids))
2563 foreach($a_usr_ids as $user_id)
2569 if($this->object->getMembersObject()->isAssigned($user_id))
2575 case $this->
object->getDefaultMemberRole():
2576 $this->
object->getMembersObject()->add($user_id,
IL_CRS_MEMBER);
2578 case $this->
object->getDefaultTutorRole():
2579 $this->
object->getMembersObject()->add($user_id,
IL_CRS_TUTOR);
2581 case $this->
object->getDefaultAdminRole():
2582 $this->
object->getMembersObject()->add($user_id,
IL_CRS_ADMIN);
2585 if(in_array($a_type,$this->object->getLocalCourseRoles(
true)))
2587 $this->
object->getMembersObject()->add($user_id,
IL_CRS_MEMBER);
2588 $this->
object->getMembersObject()->updateRoleAssignments($user_id,(array)$a_type);
2592 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_ACCEPT_USER,$user_id);
2594 $this->
object->checkLPStatusSync($user_id);
2603 unset(
$_SESSION[
'crs_usr_search_result']);
2606 $this->ctrl->redirect($this,
'members');
2618 if(!count(
$_POST[
"waiting"]))
2625 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2629 foreach(
$_POST[
"waiting"] as $user_id)
2635 if($this->object->getMembersObject()->isAssigned($user_id))
2639 $this->
object->getMembersObject()->add($user_id,
IL_CRS_MEMBER);
2640 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_ACCEPT_USER,$user_id);
2643 $this->
object->checkLPStatusSync($user_id);
2674 if(!count(
$_POST[
'waiting']))
2681 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2684 foreach(
$_POST[
"waiting"] as $user_id)
2687 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER,$user_id);
2708 if(!is_array(
$_SESSION[
"crs_delete_waiting_list_ids"]))
2716 $this->
object->initWaitingList();
2717 foreach(
$_SESSION[
'crs_delete_waiting_list_ids'] as $usr_id)
2719 $this->
object->waiting_list_obj->removeFromList($usr_id);
2730 global $rbacsystem,
$ilErr;
2735 if(!is_array(
$_POST[
"subscribers"]))
2743 if(!$this->object->getMembersObject()->assignSubscribers(
$_POST[
"subscribers"]))
2751 foreach(
$_POST[
"subscribers"] as $usr_id)
2753 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_ACCEPT_SUBSCRIBER,$usr_id);
2755 $this->
object->checkLPStatusSync($usr_id);
2770 if($this->object->isSubscriptionMembershipLimited() and $this->
object->getSubscriptionMaxMembers() and
2771 $this->
object->getSubscriptionMaxMembers() <= $this->
object->getMembersObject()->getCountMembers())
2778 if($number = $this->object->getMembersObject()->autoFillSubscribers())
2796 $this->tabs_gui->setTabActive(
'members');
2806 if(!is_array(
$_POST[
"subscriber"]) or !count(
$_POST[
"subscriber"]))
2816 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_editMembers.html",
'Modules/Course');
2822 $f_result = array();
2824 foreach(
$_POST[
"subscriber"] as $member_id)
2826 $member_data = $this->
object->getMembersObject()->getSubscriberData($member_id);
2831 $f_result[$counter][] = $tmp_obj->getLogin();
2832 $f_result[$counter][] = $tmp_obj->getFirstname();
2833 $f_result[$counter][] = $tmp_obj->getLastname();
2847 $this->tabs_gui->setTabActive(
'members');
2857 if(!is_array(
$_POST[
"waiting_list"]) or !count(
$_POST[
"waiting_list"]))
2867 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_editMembers.html",
'Modules/Course');
2868 $this->
object->initWaitingList();
2874 $f_result = array();
2876 foreach(
$_POST[
"waiting_list"] as $wait_id)
2878 $user_data =& $this->
object->waiting_list_obj->getUser($wait_id);
2882 $f_result[$counter][] = $tmp_obj->getLogin();
2883 $f_result[$counter][] = $tmp_obj->getFirstname();
2884 $f_result[$counter][] = $tmp_obj->getLastname();
2885 #$f_result[$counter][] = strftime("%Y-%m-%d %R",$user_data["time"]);
2901 if($this->object->getMembersObject()->isLastAdmin($ilUser->getId()))
2908 $this->tabs_gui->setTabActive(
'crs_unsubscribe');
2910 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
2912 $cgui->setHeaderText($this->lng->txt(
'crs_unsubscribe_sure'));
2913 $cgui->setFormAction($this->ctrl->getFormAction($this));
2914 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancel");
2915 $cgui->setConfirm($this->lng->txt(
"crs_unsubscribe"),
"performUnsubscribe");
2916 $this->tpl->setContent($cgui->getHTML());
2933 $this->
object->getMembersObject()->delete($this->ilias->account->getId());
2934 $this->
object->getMembersObject()->sendUnsubscribeNotificationToAdmins($this->ilias->account->getId());
2935 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_UNSUBSCRIBE,$ilUser->getId());
2939 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->tree->getParentId($this->ref_id));
2940 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
2954 $participants = array_merge((array)
$_POST[
'admins'],(array) $_POST[
'tutors'], (array) $_POST[
'members'], (array) $_POST[
'roles']);
2964 if(!$this->object->getMemberObject()->checkLastAdmin($participants))
2974 !$ilAccess->checkAccess(
'edit_permission',
'',$this->object->getRefId()) and
2978 foreach ($participants as $usr_id)
2981 if($part->isAdmin())
2991 $this->tabs_gui->setTabActive(
'members');
2992 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
2994 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
2996 $confirm->setFormAction($this->ctrl->getFormAction($this,
'deleteMembers'));
2997 $confirm->setHeaderText($this->lng->txt(
'crs_header_delete_members'));
2998 $confirm->setConfirm($this->lng->txt(
'confirm'),
'removeMembers');
2999 $confirm->setCancel($this->lng->txt(
'cancel'),
'members');
3001 foreach($participants as $usr_id)
3005 $confirm->addItem(
'participants[]',
3007 $name[
'lastname'].
', '.$name[
'firstname'].
' ['.$name[
'login'].
']',
3011 $this->tpl->setContent($confirm->getHTML());
3023 global $rbacreview, $rbacsystem, $ilAccess,
$ilUser;
3027 if(!is_array(
$_POST[
"participants"]) or !count(
$_POST[
"participants"]))
3038 !$ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId()) and
3043 $courseAdminRoleId = null;
3044 foreach ($this->object->getLocalCourseRoles(
false) as $title => $role_id)
3046 if (substr($title, 0, 12) ==
'il_crs_admin')
3048 $courseAdminRoleId = $role_id;
3052 foreach (
$_POST[
'participants'] as $usr_id)
3054 if ($rbacreview->isAssigned($usr_id, $courseAdminRoleId))
3063 if(!$this->object->getMembersObject()->deleteParticipants(
$_POST[
"participants"]))
3073 foreach(
$_POST[
"participants"] as $usr_id)
3075 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_DISMISS_MEMBER,$usr_id);
3079 $this->ctrl->redirect($this,
"members");
3090 if(!
$_POST[
'subscribers'])
3097 if(!$this->object->getMembersObject()->deleteSubscribers(
$_POST[
"subscribers"]))
3105 foreach(
$_POST[
'subscribers'] as $usr_id)
3107 $this->
object->getMembersObject()->sendNotification($this->object->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER,$usr_id);
3122 if ($ilAccess->checkAccess(
'visible',
'',$this->ref_id))
3124 $GLOBALS[
'ilTabs']->addTarget(
"info_short",
3125 $this->ctrl->getLinkTargetByClass(
3126 array(
"ilobjcoursegui",
"ilinfoscreengui"),
"showSummary"),
3130 if($ilAccess->checkAccess(
'leave',
'',$this->object->getRefId()) and $this->object->getMemberObject()->isMember())
3132 $GLOBALS[
'ilTabs']->addTarget(
"crs_unsubscribe",
3133 $this->ctrl->getLinkTarget($this,
"unsubscribe"),
3145 global $rbacsystem,$ilAccess,
$ilUser,
$lng, $ilHelp;
3147 $ilHelp->setScreenIdComponent(
"crs");
3149 $this->ctrl->setParameter($this,
"ref_id",$this->ref_id);
3151 if($ilAccess->checkAccess(
'read',
'',$this->ref_id))
3153 $tabs_gui->addTab(
'view_content', $lng->txt(
"content"),
3154 $this->ctrl->getLinkTarget($this,
''));
3158 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3160 include_once(
'./Modules/Course/classes/class.ilCourseObjective.php');
3163 $tabs_gui->addTarget(
3165 $this->ctrl->getLinkTargetByClass(
'illoeditorgui',
''),
3172 if ($ilAccess->checkAccess(
'visible',
'',$this->ref_id))
3179 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilinfoscreengui"
3180 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
3183 $tabs_gui->addTarget(
"info_short",
3184 $this->ctrl->getLinkTargetByClass(
3185 array(
"ilobjcoursegui",
"ilinfoscreengui"),
"showSummary"),
3187 "",
"", $force_active);
3189 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3191 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilconditionhandlergui"
3192 &&
$_GET[
"item_id"] ==
"")
3195 $tabs_gui->addTarget(
"settings",
3196 $this->ctrl->getLinkTarget($this,
"edit"),
3197 array(
"edit",
"editMapSettings",
"editCourseIcons",
"listStructure"),
"",
"", $force_active);
3202 include_once
'./Services/Mail/classes/class.ilMail.php';
3206 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3208 $tabs_gui->addTarget(
"members",
3209 $this->ctrl->getLinkTarget($this,
"members"),
3214 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_ENABLED and
3218 $tabs_gui->addTarget(
"members",
3219 $this->ctrl->getLinkTarget($this,
"membersGallery"),
3225 $GLOBALS[
'rbacsystem']->checkAccess(
'internal_mail',$mail->getMailObjectReferenceId ()) and
3229 $tabs_gui->addTarget(
"members",
3230 $this->ctrl->getLinkTarget($this,
"mailMembersBtn"),
3238 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
3241 $tabs_gui->addTarget(
'learning_progress',
3242 $this->ctrl->getLinkTargetByClass(array(
'ilobjcoursegui',
'illearningprogressgui'),
''),
3244 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
3250 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
3251 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->ref_id)
3254 $tabs_gui->addTarget(
"licenses",
3255 $this->ctrl->getLinkTargetByClass(
'illicenseoverviewgui',
''),
3256 "",
"illicenseoverviewgui");
3260 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3262 $tabs_gui->addTarget(
"meta_data",
3263 $this->ctrl->getLinkTargetByClass(array(
'ilobjcoursegui',
'ilmdeditorgui'),
'listSection'),
3268 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
3270 $tabs_gui->addTarget(
3272 $this->ctrl->getLinkTargetByClass(
'ilexportgui',
''),
3278 if ($ilAccess->checkAccess(
'edit_permission',
'',$this->ref_id))
3280 $tabs_gui->addTarget(
"perm_settings",
3281 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
3282 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
3285 if ($this->ctrl->getTargetScript() ==
"adm_object.php")
3287 $tabs_gui->addTarget(
"show_owner",
3288 $this->ctrl->getLinkTarget($this,
"owner"),
"owner", get_class($this));
3290 if ($this->tree->getSavedNodeData($this->ref_id))
3292 $tabs_gui->addTarget(
"trash",
3293 $this->ctrl->getLinkTarget($this,
"trash"),
"trash", get_class($this));
3297 if($ilAccess->checkAccess(
'join',
'',$this->ref_id)
3298 and !$this->
object->getMemberObject()->isAssigned())
3300 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
3305 $this->lng->txt(
'membership_leave'),
3306 $this->ctrl->getLinkTargetByClass(
'ilcourseregistrationgui',
'show',
'')
3313 $tabs_gui->addTarget(
"join",
3314 $this->ctrl->getLinkTargetByClass(
'ilcourseregistrationgui',
"show"),
3319 if($ilAccess->checkAccess(
'leave',
'',$this->object->getRefId())
3320 and $this->object->getMemberObject()->isMember())
3322 $tabs_gui->addTarget(
"crs_unsubscribe",
3323 $this->ctrl->getLinkTarget($this,
"unsubscribe"),
3332 foreach($a_members as $member_id)
3335 $member_data = $this->
object->getMembersObject()->getSubscriberData($member_id);
3339 $print_member[$member_id][
'login'] = $tmp_obj->getLogin();
3340 $print_member[$member_id][
'name'] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();
3362 global $ilAccess,
$lng;
3364 $lng->loadLanguageModule(
'trac');
3366 #$is_admin = (bool) $ilAccess->checkAccess("write",'',$this->object->getRefId());
3369 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3372 if($privacy->enabledCourseAccessTimes())
3374 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
3378 if($this->show_tracking)
3380 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
3386 foreach($a_members as $member_id)
3391 $print_member[$member_id][
'login'] = $tmp_obj->getLogin();
3392 $print_member[$member_id][
'name'] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();
3394 if($this->object->getMembersObject()->isAdmin($member_id))
3396 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_admin");
3398 elseif($this->object->getMembersObject()->isTutor($member_id))
3400 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_tutor");
3402 elseif($this->object->getMembersObject()->isMember($member_id))
3404 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_member");
3406 if($this->object->getMembersObject()->isAdmin($member_id) or $this->
object->getMembersObject()->isTutor($member_id))
3408 if($this->object->getMembersObject()->isNotificationEnabled($member_id))
3410 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_notify");
3414 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_no_notify");
3419 if($this->object->getMembersObject()->isBlocked($member_id))
3421 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_blocked");
3425 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_unblocked");
3431 $print_member[$member_id][
'passed'] = $this->
object->getMembersObject()->hasPassed($member_id) ?
3432 $this->lng->txt(
'crs_member_passed') :
3433 $this->lng->txt(
'crs_member_not_passed');
3436 if($privacy->enabledCourseAccessTimes())
3438 if(isset($progress[$member_id][
'ts']) and $progress[$member_id][
'ts'])
3446 $print_member[$member_id][
'access'] = $this->lng->txt(
'no_date');
3449 if($this->show_tracking)
3451 if(in_array($member_id,$completed))
3455 elseif(in_array($member_id,$in_progress))
3459 elseif(in_array($member_id,
$failed))
3490 case 'notification':
3504 $ilTabs->clearTargets();
3505 $ilTabs->setBackTarget($this->lng->txt(
'back'),
3506 $this->ctrl->getLinkTarget($this,
'members'));
3509 $form = $list->initForm(
'printMembersOutput');
3510 $this->tpl->setContent($form->getHTML());
3515 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
3518 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
3521 include_once
'Services/Membership/classes/class.ilAttendanceList.php';
3523 $list->setId(
'crsmemlst');
3525 $list->setTitle($this->lng->txt(
'crs_members_print_title'),
3526 $this->lng->txt(
'obj_crs').
': '.$this->
object->getTitle());
3528 include_once
'./Services/Tracking/classes/class.ilObjUserTracking.php';
3531 if($this->show_tracking)
3533 include_once(
'./Services/Object/classes/class.ilObjectLP.php');
3535 $this->show_tracking = $olp->isActive();
3537 if($this->show_tracking)
3539 $list->addPreset(
'progress', $this->lng->txt(
'learning_progress'),
true);
3542 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3544 if($privacy->enabledCourseAccessTimes())
3546 $list->addPreset(
'access', $this->lng->txt(
'last_access'),
true);
3549 $list->addPreset(
'status', $this->lng->txt(
'crs_status'),
true);
3550 $list->addPreset(
'passed', $this->lng->txt(
'crs_passed'),
true);
3557 return $this->members_data[$a_user_id];
3563 $list->initFromForm();
3564 $list->setCallback(array($this,
'getAttendanceListUserData'));
3566 $this->members_data = $this->
fetchPrintMemberData($this->object->getMembersObject()->getParticipants());
3567 $list->getNonMemberUserData($this->members_data);
3569 $list->getFullscreenHTML();
3610 $is_admin = (bool) $ilAccess->checkAccess(
"write",
"", $this->object->getRefId());
3613 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_DISABLED)
3615 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
3619 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_members_gallery.html',
'Modules/Course');
3622 $this->tabs_gui->setTabActive(
'members');
3623 $this->tabs_gui->setSubTabActive(
'crs_members_gallery');
3628 if(count($members = $this->object->getMembersObject()->getParticipants()))
3630 $ordered_members = array();
3632 foreach($members as $member_id)
3642 array_push($ordered_members,array(
"id" => $member_id,
3643 "login" => $usr_obj->getLogin(),
3644 "lastname" => $usr_obj->getLastName(),
3645 "firstname" => $usr_obj->getFirstName(),
3646 "sortlastname" => strtoupper($usr_obj->getLastName()).strtoupper($usr_obj->getFirstName()),
3647 "usr_obj" => $usr_obj));
3652 foreach($ordered_members as $member)
3654 $usr_obj = $member[
"usr_obj"];
3656 if(!$usr_obj->getActive())
3661 $public_profile = in_array($usr_obj->getPref(
"public_profile"), array(
"y",
"g")) ?
"y" :
"";
3664 $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user", $member[
"id"]);
3665 $profile_target = $this->ctrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML");
3668 $file = $usr_obj->getPersonalPicturePath(
"xsmall");
3686 if ($public_profile ==
"y") {
3687 $this->tpl->setCurrentBlock(
"member_linked");
3688 $this->tpl->setVariable(
"LINK_PROFILE", $profile_target);
3689 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3690 $this->tpl->parseCurrentBlock();
3709 $this->tpl->setCurrentBlock(
"member_not_linked");
3710 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3711 $this->tpl->parseCurrentBlock();
3713 $this->tpl->setCurrentBlock(
"member");
3715 if ($this->object->getMembersObject()->isAdmin($member[
"id"])) {
3716 $this->tpl->setVariable(
"MEMBER_CLASS",
"il_Admin");
3718 elseif ($this->object->getMembersObject()->isTutor($member[
"id"])) {
3719 $this->tpl->setVariable(
"MEMBER_CLASS",
"il_Tutor");
3722 $this->tpl->setVariable(
"MEMBER_CLASS",
"il_Member");
3728 if ($public_profile ==
"y")
3730 $this->tpl->setVariable(
"FIRSTNAME", $member[
"firstname"]);
3731 $this->tpl->setVariable(
"LASTNAME", $member[
"lastname"]);
3733 $this->tpl->setVariable(
"LOGIN", $member[
"login"]);
3734 $this->tpl->parseCurrentBlock();
3736 $this->tpl->setCurrentBlock(
"members");
3737 $this->tpl->setVariable(
"MEMBERS_TABLE_HEADER",$this->lng->txt(
'crs_members_title'));
3738 $this->tpl->parseCurrentBlock();
3741 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'crs_members_print_title'));
3744 $headline = $this->
object->getTitle().
"<br/>".$this->
object->getDescription();
3746 $this->tpl->setVariable(
"HEADLINE",$headline);
3755 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3766 $offset =
$_GET[
"update_members"] ?
$_GET[
"offset"] : 0;
3767 $order =
$_GET[
"update_members"] ?
$_GET[
"sort_by"] :
'login';
3768 $direction =
$_GET[
"update_members"] ?
$_GET[
"sort_order"] :
'';
3772 $offset =
$_GET[
"update_subscribers"] ?
$_GET[
"offset"] : 0;
3773 $order =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_by"] :
'sub_time';
3774 $direction =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_order"] :
'';
3778 $offset =
$_GET[
"offset"];
3779 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3780 $direction =
$_GET[
"sort_order"];
3784 $offset =
$_GET[
"offset"];
3785 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3786 $direction =
$_GET[
"sort_order"];
3790 $offset =
$_GET[
"offset"];
3792 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
3794 $_GET[
"sort_by"] =
"login";
3796 $order =
$_GET[
"sort_by"];
3797 $direction =
$_GET[
"sort_order"];
3801 $tbl->setOrderColumn($order);
3802 $tbl->setOrderDirection($direction);
3803 $tbl->setOffset($offset);
3804 $tbl->setLimit(
$_GET[
"limit"]);
3805 $tbl->setMaxCount(count($result_set));
3806 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3807 $tbl->setData($result_set);
3814 $tpl =& $tbl->getTemplateObject();
3816 $tpl->setCurrentBlock(
"tbl_form_header");
3817 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3818 $tpl->parseCurrentBlock();
3819 $tpl->setCurrentBlock(
"tbl_action_btn");
3820 $tpl->setVariable(
"BTN_NAME",
"cancelMember");
3821 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
3822 $tpl->parseCurrentBlock();
3823 $tpl->setCurrentBlock(
"tbl_action_btn");
3824 $tpl->setVariable(
"BTN_NAME",
"performRemoveFromWaitingList");
3825 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
3826 $tpl->parseCurrentBlock();
3827 $tpl->setCurrentBlock(
"tbl_action_row");
3828 $tpl->setVariable(
"COLUMN_COUNTS",4);
3830 $tpl->parseCurrentBlock();
3832 $tbl->setTitle($this->lng->txt(
"crs_header_remove_from_waiting_list"),
"icon_usr.svg",
3833 $this->lng->txt(
"crs_header_remove_from_waiting_list"));
3834 $tbl->setHeaderNames(array($this->lng->txt(
"username"),
3835 $this->lng->txt(
"firstname"),
3836 $this->lng->txt(
"lastname"),
3837 $this->lng->txt(
"crs_time")));
3838 $tbl->setHeaderVars(array(
"login",
3842 array(
"ref_id" => $this->object->getRefId(),
3844 "cmdClass" =>
"ilobjcoursegui",
3845 "cmdNode" =>
$_GET[
"cmdNode"]));
3847 $tbl->setColumnWidth(array(
"25%",
"25%",
"25%",
"25%"));
3852 $this->tpl->setVariable(
"EDIT_MEMBER_TABLE",$tbl->tpl->get());
3860 $tpl =& $tbl->getTemplateObject();
3862 $tpl->setCurrentBlock(
"tbl_form_header");
3863 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3864 $tpl->parseCurrentBlock();
3865 $tpl->setCurrentBlock(
"tbl_action_btn");
3866 $tpl->setVariable(
"BTN_NAME",
"removeSubscribers");
3867 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
3868 $tpl->parseCurrentBlock();
3869 $tpl->setCurrentBlock(
"tbl_action_btn");
3870 $tpl->setVariable(
"BTN_NAME",
"cancelMember");
3871 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
3872 $tpl->parseCurrentBlock();
3873 $tpl->setCurrentBlock(
"tbl_action_row");
3874 $tpl->setVariable(
"COLUMN_COUNTS",4);
3876 $tpl->parseCurrentBlock();
3878 $tbl->setTitle($this->lng->txt(
"crs_header_delete_subscribers"),
"icon_usr.svg",$this->lng->txt(
"crs_header_delete_members"));
3879 $tbl->setHeaderNames(array($this->lng->txt(
"username"),
3880 $this->lng->txt(
"firstname"),
3881 $this->lng->txt(
"lastname"),
3882 $this->lng->txt(
"crs_time")));
3883 $tbl->setHeaderVars(array(
"login",
3887 array(
"ref_id" => $this->object->getRefId(),
3889 "cmdClass" =>
"ilobjcoursegui",
3890 "cmdNode" =>
$_GET[
"cmdNode"]));
3892 $tbl->setColumnWidth(array(
"25%",
"25%",
"25%",
"25%"));
3897 $this->tpl->setVariable(
"EDIT_MEMBER_TABLE",$tbl->tpl->get());
3906 $actions = array(
"addFromWaitingList" => $this->lng->txt(
"crs_add_subscribers"),
3907 "removeFromWaitingList" => $this->lng->txt(
"crs_delete_from_waiting_list"));
3910 $tpl =& $tbl->getTemplateObject();
3912 $tbl->enable(
'select_all');
3913 $tbl->setFormName(
"wait_form");
3914 $tbl->setSelectAllCheckbox(
"waiting_list");
3918 $tpl->setCurrentBlock(
"tbl_action_row");
3920 $tpl->setVariable(
"COLUMN_COUNTS",5);
3924 $tpl->setCurrentBlock(
"tbl_action_select");
3926 $tpl->setVariable(
"BTN_NAME",
"gateway");
3927 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"execute"));
3928 $tpl->parseCurrentBlock();
3930 $tpl->setCurrentBlock(
"tbl_action_row");
3931 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
3932 $tpl->parseCurrentBlock();
3935 $tbl->setTitle($this->lng->txt(
"crs_waiting_list"),
"icon_usr.svg",$this->lng->txt(
"crs_waiting_list"));
3936 $tbl->setHeaderNames(array(
'',
3937 $this->lng->txt(
"name"),
3938 $this->lng->txt(
"login"),
3939 $this->lng->txt(
"crs_time")));
3940 $tbl->setHeaderVars(array(
"",
3944 array(
"ref_id" => $this->object->getRefId(),
3946 "update_subscribers" => 1,
3947 "cmdClass" =>
"ilobjcoursegui",
3948 "cmdNode" =>
$_GET[
"cmdNode"]));
3949 $tbl->setColumnWidth(array(
'1%'));
3954 $this->tpl->setCurrentBlock(
'sub_wait_table');
3955 $this->tpl->setVariable(
'SUB_WAIT_NAME',
'wait_form');
3956 $this->tpl->setVariable(
'SUB_WAIT_FORMACTION',$this->ctrl->getFormAction($this));
3957 $this->tpl->setVariable(
"SUB_WAIT_TABLE_CONTENT",$tbl->tpl->get());
3958 $this->tpl->parseCurrentBlock();
3970 for($i=0;$i<=60;$i++)
3972 $days[$i] = $i < 10 ?
"0".$i : $i;
3977 for($i=0;$i<24;$i++)
3979 $days[$i] = $i < 10 ?
"0".$i : $i;
3984 for($i=1;$i<32;$i++)
3986 $days[$i] = $i < 10 ?
"0".$i : $i;
3991 for($i=1;$i<13;$i++)
3993 $month[$i] = $i < 10 ?
"0".$i : $i;
3998 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
4008 return mktime($a_time_arr[
"hour"],
4009 $a_time_arr[
"minute"],
4010 $a_time_arr[
"second"],
4011 $a_time_arr[
"month"],
4013 $a_time_arr[
"year"]);
4017 unset(
$_SESSION[
"crs_delete_member_ids"]);
4018 unset(
$_SESSION[
"crs_delete_subscriber_ids"]);
4028 global $rbacreview,
$ilErr, $ilAccess, $ilObjDataCache,
$ilias;
4029 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
4031 $this->lng->loadLanguageModule(
'mail');
4032 if(!isset(
$_GET[
'returned_from_mail']))
4037 $is_admin = (bool) $ilAccess->checkAccess(
"write",
"", $this->object->getRefId());
4042 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
4045 $this->tabs_gui->setTabActive(
'members');
4046 $b_cmd =
$_GET[
"back_cmd"] ?
$_GET[
"back_cmd"] :
"members";
4047 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this,$b_cmd));
4049 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.mail_members.html',
'Services/Contact');
4052 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
4054 $this->tpl->setVariable(
"SELECT_ACTION",
'ilias.php?baseClass=ilmailgui&view=my_courses&search_crs='.$this->object->getId());
4055 $this->tpl->setVariable(
"MAIL_SELECTED",$this->lng->txt(
'send_mail_selected'));
4056 $this->tpl->setVariable(
"MAIL_MEMBERS",$this->lng->txt(
'send_mail_members'));
4057 $this->tpl->setVariable(
"MAIL_TUTOR",$this->lng->txt(
'send_mail_tutors'));
4058 $this->tpl->setVariable(
"MAIL_ADMIN",$this->lng->txt(
'send_mail_admins'));
4060 $this->tpl->setVariable(
"OK",$this->lng->txt(
'next'));
4063 $role_ids = $rbacreview->getRolesOfRoleFolder($this->object->getRefId(),
false);
4066 $sorted_role_ids = array();
4068 foreach($role_ids as $role_id)
4073 $sorted_role_ids[2] = $role_id;
4077 $sorted_role_ids[1] = $role_id;
4081 $sorted_role_ids[0] = $role_id;
4085 $sorted_role_ids[$counter++] = $role_id;
4090 ksort($sorted_role_ids,SORT_NUMERIC);
4091 foreach ((array) $sorted_role_ids as $role_id)
4093 $this->tpl->setCurrentBlock(
"mailbox_row");
4094 $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
4098 if(count($ids_for_role_title) >= 2)
4100 $ilias->setSetting(
'pear_mail_enable', 1);
4104 htmlspecialchars($role_addr)
4106 if (ilMail::_usePearMail() && substr($role_addr, 0, 4) !=
'#il_')
4109 $this->tpl->setVariable(
"MAILBOX",$role_addr);
4114 $this->tpl->setVariable(
"MAILBOX",
ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)).
" (" . $role_addr .
")");
4117 $this->tpl->parseCurrentBlock();
4125 $next_class = $this->ctrl->getNextClass($this);
4126 $cmd = $this->ctrl->getCmd();
4135 $ilAccess->checkAccess(
'read',
'',
$_GET[
'ref_id']))
4137 include_once(
"./Services/Link/classes/class.ilLink.php");
4138 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
4144 if(IS_PAYMENT_ENABLED)
4146 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
4149 $ilTabs->setTabActive(
'info_short');
4151 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
4152 $this->ctrl->setReturn($this,
'');
4154 $this->ctrl->forwardCommand($pp_gui);
4162 case "ilinfoscreengui":
4166 case 'ilmdeditorgui':
4167 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
4169 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
4172 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
4174 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
4175 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
4177 $this->ctrl->forwardCommand($md_gui);
4178 $this->tabs_gui->setTabActive(
'meta_data');
4181 case 'ilcourseregistrationgui':
4182 $this->ctrl->setReturn($this,
'');
4183 $this->tabs_gui->setTabActive(
'join');
4184 include_once(
'./Modules/Course/classes/class.ilCourseRegistrationGUI.php');
4186 $this->ctrl->forwardCommand($registration);
4189 case 'ilobjectcustomuserfieldsgui':
4190 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
4194 $this->ctrl->setReturn($this,
'members');
4199 $this->tabs_gui->setTabActive(
'settings');
4200 $this->ctrl->forwardCommand($cdf_gui);
4203 case "ilcourseobjectivesgui":
4204 include_once
'./Modules/Course/classes/class.ilCourseObjectivesGUI.php';
4206 $this->ctrl->setReturn($this,
"");
4208 $ret =& $this->ctrl->forwardCommand($reg_gui);
4211 case 'ilobjcoursegroupinggui':
4212 include_once
'./Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
4214 $this->ctrl->setReturn($this,
'edit');
4217 $this->ctrl->forwardCommand($crs_grp_gui);
4218 $this->tabs_gui->setTabActive(
'settings');
4219 $this->tabs_gui->setSubTabActive(
'groupings');
4223 $this->tabs_gui->setTabActive(
'none');
4233 case "ilconditionhandlergui":
4234 include_once
'./Services/AccessControl/classes/class.ilConditionHandlerGUI.php';
4237 $this->tabs_gui->setTabActive(
'settings');
4239 $this->ctrl->forwardCommand($new_gui);
4242 case "illearningprogressgui":
4243 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
4246 $this->object->getRefId(),
4247 $_GET[
'user_id'] ? $_GET[
'user_id'] : $ilUser->getId());
4248 $this->ctrl->forwardCommand($new_gui);
4249 $this->tabs_gui->setTabActive(
'learning_progress');
4252 case 'illicenseoverviewgui':
4253 include_once(
"./Services/License/classes/class.ilLicenseOverviewGUI.php");
4255 $ret =& $this->ctrl->forwardCommand($license_gui);
4256 $this->tabs_gui->setTabActive(
'licenses');
4259 case 'ilpermissiongui':
4260 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
4261 $this->tabs_gui->setTabActive(
'perm_settings');
4263 $ret =& $this->ctrl->forwardCommand($perm_gui);
4266 case 'ilrepositorysearchgui':
4267 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
4272 $rep_search->setCallback($this,
4273 'assignMembersObject',
4279 $rep_search->setCallback($this,
4280 'assignMembersObject',
4293 $this->ctrl->setReturn($this,
'members');
4294 $ret =& $this->ctrl->forwardCommand($rep_search);
4296 $this->tabs_gui->setTabActive(
'members');
4297 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
4300 case 'ilcoursecontentinterface':
4302 $this->initCourseContentInterface();
4303 $this->cci_obj->cci_setContainer($this);
4305 $this->ctrl->forwardCommand($this->cci_obj);
4307 $this->tabs_gui->setTabActive(
'content');
4310 case 'ilcoursecontentgui':
4311 $this->ctrl->setReturn($this,
'members');
4312 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
4314 $this->ctrl->forwardCommand($course_content_obj);
4317 case 'ilpublicuserprofilegui':
4318 $this->tpl->enableDragDropFileUpload(null);
4319 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
4322 $this->tabs_gui->setTabActive(
'members');
4323 $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this,
"membersGallery"));
4324 $this->tabs_gui->setSubTabActive(
'crs_members_gallery');
4325 $html = $this->ctrl->forwardCommand($profile_gui);
4326 $this->tpl->setVariable(
"ADM_CONTENT", $html);
4329 case 'ilmemberexportgui':
4330 include_once(
'./Services/Membership/classes/Export/class.ilMemberExportGUI.php');
4333 $this->tabs_gui->setTabActive(
'members');
4334 $this->tabs_gui->setSubTabActive(
'export_members');
4336 $this->ctrl->forwardCommand($export);
4339 case 'ilmemberagreementgui':
4340 include_once(
'Services/Membership/classes/class.ilMemberAgreementGUI.php');
4341 $this->tabs_gui->clearTargets();
4343 $this->ctrl->setReturn($this,
'');
4345 $this->ctrl->forwardCommand($agreement);
4348 case 'ilsessionoverviewgui':
4350 $this->tabs_gui->setTabActive(
'members');
4351 $this->tabs_gui->setSubTabActive(
'events');
4353 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
4356 include_once(
'./Modules/Session/classes/class.ilSessionOverviewGUI.php');
4358 $this->ctrl->forwardCommand($overview);
4362 case "ilcontainerpagegui":
4366 $this->tpl->setContent($ret);
4370 case "ilcontainerstartobjectspagegui":
4372 include_once
"Services/Container/classes/class.ilContainerStartObjectsPageGUI.php";
4374 $ret = $this->ctrl->forwardCommand($pgui);
4377 $this->tpl->setContent($ret);
4381 case 'ilobjectcopygui':
4382 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
4384 $cp->setType(
'crs');
4385 $this->ctrl->forwardCommand($cp);
4388 case "ilobjstylesheetgui":
4392 case 'ilcourseparticipantsgroupsgui':
4393 include_once
'./Modules/Course/classes/class.ilCourseParticipantsGroupsGUI.php';
4402 $this->tabs_gui->setTabActive(
'members');
4403 $this->ctrl->forwardCommand($cmg_gui);
4407 $this->tabs_gui->setTabActive(
'export');
4408 include_once
'./Services/Export/classes/class.ilExportGUI.php';
4410 $exp->addFormat(
'xml');
4411 $this->ctrl->forwardCommand($exp);
4414 case "ilcommonactiondispatchergui":
4415 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
4417 $this->ctrl->forwardCommand($gui);
4420 case 'ildidactictemplategui':
4421 $this->ctrl->setReturn($this,
'edit');
4422 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
4424 $this->ctrl->forwardCommand($did);
4427 case "ilcertificategui":
4428 $this->tabs_gui->activateTab(
"settings");
4431 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
4432 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
4434 $this->ctrl->forwardCommand($output_gui);
4437 case 'ilobjectservicesettingsgui':
4438 $this->ctrl->setReturn($this,
'edit');
4440 $this->tabs_gui->activateTab(
'settings');
4441 $this->tabs_gui->acltivateSubTab(
'tool_settings');
4443 include_once
'./Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
4446 $this->object->getId(),
4450 $this->ctrl->forwardCommand($service);
4453 case 'illoeditorgui':
4454 #$this->tabs_gui->clearTargets();
4455 #$this->tabs_gui->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,''));
4456 $this->tabs_gui->activateTab(
'crs_objectives');
4458 include_once
'./Modules/Course/classes/Objectives/class.ilLOEditorGUI.php';
4460 $this->ctrl->forwardCommand($editor);
4463 case 'ilcontainerstartobjectsgui':
4464 $this->ctrl->setReturn($this,
'edit');
4465 $this->tabs_gui->clearTargets();
4466 $this->tabs_gui->setBackTarget($this->lng->txt(
"back_to_crs_content"),
4467 $this->ctrl->getLinkTarget($this,
"edit"));
4468 $this->tabs_gui->addTab(
"start",
4469 $this->lng->txt(
"crs_start_objects"),
4470 $this->ctrl->getLinkTargetByClass(
"ilcontainerstartobjectsgui",
"listStructure"));
4472 $ilHelp->setScreenIdComponent(
"crs");
4474 include_once
'./Services/Container/classes/class.ilContainerStartObjectsGUI.php';
4476 $this->ctrl->forwardCommand($stgui);
4492 if(
$cmd ==
'infoScreenGoto')
4501 $cmd =
'infoScreen';
4505 if(!$this->creation_mode)
4507 if (
$cmd ==
"infoScreen")
4518 if( !$this->creation_mode
4519 &&
$cmd !=
'infoScreen'
4520 &&
$cmd !=
'sendfile'
4521 &&
$cmd !=
'unsubscribe'
4522 &&
$cmd !=
'performUnsubscribe'
4523 && !$ilAccess->checkAccess(
"read",
'',$this->object->getRefId())
4525 ||
$cmd ==
'subscribe')
4527 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
4528 if($rbacsystem->checkAccess(
'join',$this->object->getRefId()) &&
4531 include_once(
'./Modules/Course/classes/class.ilCourseRegistrationGUI.php');
4532 $this->ctrl->redirectByClass(
"ilCourseRegistrationGUI");
4541 if(
$cmd ==
'listObjectives')
4543 include_once
'./Modules/Course/classes/class.ilCourseObjectivesGUI.php';
4545 $this->ctrl->setReturn($this,
"");
4547 $ret =& $this->ctrl->forwardCommand($obj_gui);
4582 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
4588 if(!$this->object->getMemberObject()->isAssigned())
4593 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
4599 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
4600 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
4607 $GLOBALS[
'ilLog']->write(__METHOD__.
': Missing course confirmation.');
4611 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
4614 $GLOBALS[
'ilLog']->write(__METHOD__.
': Missing required fields');
4632 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
4636 $buffer = $lic_set->get(
"license_warning");
4638 include_once(
"./Services/License/classes/class.ilLicense.php");
4640 foreach ($licensed_items as $item)
4642 $license =&
new ilLicense($item[
'obj_id']);
4643 $remaining = $license->getRemainingLicenses();
4644 if ($remaining <= $buffer)
4646 $lng->loadlanguageModule(
"license");
4647 ilUtil::sendInfo(sprintf($this->lng->txt(
"course_licenses_rare"), $remaining), $a_keep);
4657 return array(
"ilCourseRegisterGUI",
'ilConditionHandlerGUI');
4663 switch ($this->ctrl->getCmd())
4666 #$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""));
4674 public static function _goto($a_target, $a_add =
"")
4678 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
4679 if(substr($a_add,0,5) ==
'rcode')
4681 if($ilUser->getId() == ANONYMOUS_USER_ID)
4685 "login.php?target=".
$_GET[
"target"].
"&cmd=force_login&lang=".
4686 $ilUser->getCurrentLanguage()
4698 if ($a_add ==
"mem" && $ilAccess->checkAccess(
"write",
"", $a_target))
4703 if ($ilAccess->checkAccess(
"read",
"", $a_target))
4710 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
4716 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
4724 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
4730 return mktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
4735 return array(
'y' => date(
'Y',$a_unix_time),
4736 'm' => date(
'n',$a_unix_time),
4737 'd' => date(
'd',$a_unix_time));
4742 return array(
'h' => date(
'G',$a_unix_time),
4743 'm' => date(
'i',$a_unix_time),
4744 's' => date(
's',$a_unix_time));
4757 $this->tabs_gui->setTabActive(
'settings');
4760 !$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
4765 $latitude = $this->
object->getLatitude();
4766 $longitude = $this->
object->getLongitude();
4767 $zoom = $this->
object->getLocationZoom();
4770 if ($latitude == 0 && $longitude == 0 && $zoom == 0)
4773 $latitude = $def[
"latitude"];
4774 $longitude = $def[
"longitude"];
4775 $zoom = $def[
"zoom"];
4778 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
4780 $form->setFormAction($ilCtrl->getFormAction($this));
4782 $form->setTitle($this->lng->txt(
"crs_map_settings"));
4788 $public->setChecked($this->object->getEnableCourseMap());
4789 $form->addItem($public);
4795 $loc_prop->setLongitude($longitude);
4796 $loc_prop->setZoom($zoom);
4797 $form->addItem($loc_prop);
4799 $form->addCommandButton(
"saveMapSettings", $this->lng->txt(
"save"));
4801 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
4813 $this->
object->update();
4815 $ilCtrl->redirect($this,
"editMapSettings");
4825 $this->tabs_gui->setTabActive(
"members");
4827 $this->tabs_gui->setSubTabActive(
"crs_members_map");
4829 include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
4836 $map->setMapId(
"course_map")
4838 ->setHeight(
"500px")
4839 ->setLatitude($this->object->getLatitude())
4840 ->setLongitude($this->object->getLongitude())
4841 ->setZoom($this->object->getLocationZoom())
4842 ->setEnableTypeControl(
true)
4843 ->setEnableNavigationControl(
true)
4844 ->setEnableCentralMarker(
true);
4846 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
4850 foreach($members as $user_id)
4852 $map->addUserMarker($user_id);
4856 $tpl->setContent($map->getHTML());
4857 $tpl->setLeftContent($map->getUserListHTML());
4866 $this->object->getAboStatus(), $this->
object->getRefId(), $this->
object->getId());
4872 static function _modifyItemGUI($a_item_list_gui, $a_cmd_class, $a_item_data, $a_show_path,
4873 $a_abo_status, $a_course_ref_id, $a_course_obj_id, $a_parent_ref_id = 0)
4875 global
$lng, $ilAccess;
4878 if ($a_parent_ref_id == 0)
4880 $a_parent_ref_id = $a_course_ref_id;
4884 if($a_item_data[
'type'] ==
'tst' and
4887 $a_item_list_gui->addCommandLinkParameter(array(
'crs_show_result' => $a_course_ref_id));
4890 $a_item_list_gui->enableSubscribe($a_abo_status);
4892 $is_tutor = ($ilAccess->checkAccess(
'write',
'',
4893 $a_course_ref_id,
'crs', $a_course_obj_id));
4895 if($a_show_path and $is_tutor)
4897 $a_item_list_gui->addCustomProperty($lng->txt(
'path'),
4911 if ($this->object->getType() !=
'crs')
4915 if (!$ilAccess->checkAccess(
'write',
'',
4916 $this->object->getRefId(),
'crs',$this->
object->getId()))
4920 if($this->object->enabledObjectiveView())
4934 if(!
$_SESSION[
'crs_timings_panel'][$this->object->getId()] or 1)
4938 $this->tabs_gui->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTargetByClass(
"ilobjcoursegui",
"view"));
4942 $this->tabs_gui->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTargetByClass(
"ilobjcoursegui",
"disableAdministrationPanel"));
4947 $this->tabs_gui->addSubTabTarget(
'timings_timings',
4948 $this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'editUserTimings'));
4968 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
4971 if(is_array(
$_POST[$a_field][
'date']))
4973 $dt[
'year'] = (int)
$_POST[$a_field][
'date'][
'y'];
4974 $dt[
'mon'] = (int)
$_POST[$a_field][
'date'][
'm'];
4975 $dt[
'mday'] = (int)
$_POST[$a_field][
'date'][
'd'];
4976 $dt[
'hours'] = (int)
$_POST[$a_field][
'time'][
'h'];
4977 $dt[
'minutes'] = (int)
$_POST[$a_field][
'time'][
'm'];
4978 $dt[
'seconds'] = (int)
$_POST[$a_field][
'time'][
's'];
4982 $date = date_parse(
$_POST[$a_field][
'date'].
" ".
$_POST[$a_field][
'time']);
4983 $dt[
'year'] = (int) $date[
'year'];
4984 $dt[
'mon'] = (int) $date[
'month'];
4985 $dt[
'mday'] = (int) $date[
'day'];
4986 $dt[
'hours'] = (int) $date[
'hour'];
4987 $dt[
'minutes'] = (int) $date[
'minute'];
4988 $dt[
'seconds'] = (int) $date[
'second'];
5006 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
5008 $confirm->setFormAction($this->ctrl->getFormAction($this));
5009 $confirm->setConfirm($this->lng->txt(
'reset'),
'reset');
5010 $confirm->setCancel($this->lng->txt(
'cancel'),
'cancel');
5012 $GLOBALS[
'tpl']->setContent($confirm->getHTML());
5020 include_once
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
5025 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestRun.php';
5026 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
5028 $this->object->getId(),
5033 include_once
'./Modules/Course/classes/class.ilCourseObjectiveResult.php';
5036 $tmp_obj_res->
reset($this->object->getId());
5038 $ilUser->deletePref(
'crs_objectives_force_details_'.$this->object->getId());
5048 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
5053 include_once
'./Services/Container/classes/class.ilContainerStartObjects.php';
5055 $this->
object->getId());
5056 if(count($this->start_obj->getStartObjects()) &&
5057 !$this->start_obj->allFullfilled($ilUser->getId()))
5074 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
5076 if($settings->isActive() and $settings->getContainer() != $this->
object->getRefId())
5078 $settings->setContainer($this->object->getRefId());
5079 $rbacsystem->initMemberView();
5091 $link = chr(13).chr(10).chr(13).chr(10);
5092 $link .= $this->lng->txt(
'crs_mail_permanent_link');
5093 $link .= chr(13).chr(10).chr(13).chr(10);
5094 include_once
'./Services/Link/classes/class.ilLink.php';
5096 return rawurlencode(base64_encode($link));
5108 include_once
"Services/Certificate/classes/class.ilCertificate.php";
5113 $cert_url = $this->ctrl->getLinkTarget($this,
"deliverCertificate");
5115 $this->lng->loadLanguageModule(
"certificate");
5116 $lg->addCustomCommand($cert_url,
"download_certificate");
5118 $lg->addHeaderIcon(
"cert_icon",
5120 $this->lng->txt(
"download_certificate"),
5127 if($ilSetting->get(
"crsgrp_ntf"))
5129 if(!$ilUser->getPref(
"grpcrs_ntf_".$this->ref_id))
5131 $lg->addHeaderIcon(
"not_icon",
5133 $this->lng->txt(
"crs_notification_deactivated"));
5135 $this->ctrl->setParameter($this,
"crs_ntf", 1);
5136 $caption =
"crs_activate_notification";
5140 $lg->addHeaderIcon(
"not_icon",
5142 $this->lng->txt(
"crs_notification_activated"));
5144 $this->ctrl->setParameter($this,
"crs_ntf", 0);
5145 $caption =
"crs_deactivate_notification";
5148 $lg->addCustomCommand($this->ctrl->getLinkTarget($this,
"saveNotification"),
5152 $this->ctrl->setParameter($this,
"crs_ntf",
"");
5164 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
5170 $user_id = $ilUser->getId();
5173 include_once
"Services/Certificate/classes/class.ilCertificate.php";
5179 $this->ctrl->redirect($this);
5182 include_once
"./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
5184 $certificate->outCertificate(array(
"user_id" => $user_id),
true);
5190 $this->ctrl->redirectByClass(array(
'ilrepositorygui',
'ilobjcoursegui',
'illoeditorgui'),
'materials');
5195 if(isset(
$_POST[
'position'][
"lobj"]))
5197 $lobj =
$_POST[
'position'][
"lobj"];
5198 unset(
$_POST[
'position'][
"lobj"]);
5200 $objective_order = array();
5201 foreach($lobj as $objective_id => $materials)
5203 $objective_order[$objective_id] = $materials[0];
5204 unset($lobj[$objective_id][0]);
5208 include_once
"Modules/Course/classes/class.ilCourseObjective.php";
5209 asort($objective_order);
5211 foreach(array_keys($objective_order) as $objective_id)
5214 $obj->writePosition(++$pos);
5218 include_once
"Modules/Course/classes/class.ilCourseObjectiveMaterials.php";
5219 foreach($lobj as $objective_id => $materials)
5225 foreach(array_keys($materials) as $ass_id)
5227 $objmat->writePosition($ass_id, ++$pos);
5240 $objective_id = (int)
$_REQUEST[
'objective_id'];
5243 include_once
'./Modules/Course/classes/Objectives/class.ilLOUserResults.php';
5244 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
5246 $this->object->getId(),
5248 $passed =
$res->getCompletedObjectiveIdsByType(
5250 $this->object->getId())->getQualifiedTest() == $test_id) ?
5257 $objective_ids = array($objective_id);
5258 if(in_array($objective_id, $passed))
5265 include_once
'./Modules/Course/classes/class.ilCourseObjective.php';
5269 if(count($objective_ids) == count($passed))
5275 if(is_null($a_force_new_run))
5278 switch($resume_type)
5283 $a_force_new_run = TRUE;
5286 $a_force_new_run = FALSE;
5292 include_once
'./Modules/Test/classes/class.ilObjTest.php';
5300 if($a_force_new_run === TRUE)
5302 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestRun.php';
5304 $this->object->getId(),
5309 foreach((array) $objective_ids as $oid)
5311 if(!in_array($oid, $passed))
5314 $this->object->getId(),
5324 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
5327 include_once
'Modules/Test/classes/class.ilTestPlayerFactory.php';
5329 $playerGuiClass = get_class($testPlayerFactory->getPlayerGUI());
5331 $sessionLock = md5(
$_COOKIE[session_name()] . time());
5340 $test_cmd =
'resumePlayer';
5344 $test_cmd =
'startPlayer';
5347 $GLOBALS[
'ilCtrl']->setParameterByClass($playerGuiClass,
'ref_id',$test_id);
5348 $GLOBALS[
'ilCtrl']->setParameterByClass($playerGuiClass,
'crs_show_result',$this->object->getRefId());
5349 $GLOBALS[
'ilCtrl']->setParameterByClass($playerGuiClass,
'lock',$sessionLock);
5350 $GLOBALS[
'ilCtrl']->redirectByClass(
5368 include_once
'./Modules/Test/classes/class.ilObjTest.php';
5375 $GLOBALS[
'ilLog']->write(__METHOD__.
' No previous pass exists.');
5379 $GLOBALS[
'ilLog']->write(__METHOD__.
' Active test pass exists... ');
5382 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestRun.php';
5384 $this->object->getId(),
5388 if(count((array) $last_objectives) > 1)
5392 if(!$a_objective_id)
5394 $GLOBALS[
'ilLog']->write(__METHOD__.
': Continuing multi objective test pass.');
5404 if(count((array) $last_objectives) == 1)
5408 $a_objective_id && in_array($a_objective_id,(array) $last_objectives)
5414 $a_objective_id && !in_array($a_objective_id,(array) $last_objectives)
5447 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
5451 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
5454 $question = $this->lng->txt(
'crs_loc_qst_resume_tst_qtest');
5458 $question = $this->lng->txt(
'crs_loc_qst_resume_tst_itest');
5463 $confirm->addHiddenItem(
'objective_id', $a_objective_id);
5464 $confirm->addHiddenItem(
'tid', $a_test_id);
5465 $confirm->setConfirm($this->lng->txt(
'crs_loc_tst_resume'),
'redirectLocToTestContinue');
5466 $confirm->setCancel($this->lng->txt(
'crs_loc_tst_new_run'),
'redirectLocToTestNewRun');
5468 $GLOBALS[
'tpl']->setContent($confirm->getHTML());
5480 $crs_admin = $this->
object->getDefaultAdminRole();
5481 $crs_member = $this->
object->getDefaultMemberRole();
5482 $local_roles = $this->
object->getLocalCourseRoles(
false);
5483 $crs_roles = array();
5486 if(in_array($crs_member, $local_roles))
5489 unset($local_roles[$crs_roles[$crs_member]]);
5492 foreach($local_roles as $title => $role_id)
5520 $this->tabs_gui->setTabActive(
'members');
5534 global
$ilUser, $rbacsystem, $ilAccess;
5535 include_once
'Services/Mail/classes/class.ilMail.php';
5536 $mail =
new ilMail($ilUser->getId());
5540 $ilAccess->checkAccess(
'write',
"",$this->object->getRefId())) and
5541 $rbacsystem->checkAccess(
'internal_mail',$mail->getMailObjectReferenceId()))
5546 $ilToolbar->addSeparator();
5551 $this->ctrl->setParameter($this,
"back_cmd", $back_cmd);
5554 $ilToolbar->addButton($this->lng->txt(
"mail_members"),
5555 $this->ctrl->getLinkTarget($this,
'mailMembers'));
5561 if(!is_array(
$_POST[
"subscribers"]))
5569 $this->lng->loadLanguageModule(
'mmbr');
5573 $this->tabs_gui->setTabActive(
'members');
5574 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
5576 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
5580 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"refuseSubscribers"));
5581 $c_gui->setHeaderText($this->lng->txt(
"info_refuse_sure"));
5582 $c_gui->setCancel($this->lng->txt(
"cancel"),
"members");
5583 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"refuseSubscribers");
5585 foreach(
$_POST[
"subscribers"] as $subscribers)
5589 $c_gui->addItem(
'subscribers[]',
5591 $name[
'lastname'].
', '.$name[
'firstname'].
' ['.$name[
'login'].
']',
5595 $this->tpl->setContent($c_gui->getHTML());
5601 if(!is_array(
$_POST[
"subscribers"]))
5610 $this->tabs_gui->setTabActive(
'members');
5611 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
5613 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
5617 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"assignSubscribers"));
5618 $c_gui->setHeaderText($this->lng->txt(
"info_assign_sure"));
5619 $c_gui->setCancel($this->lng->txt(
"cancel"),
"members");
5620 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"assignSubscribers");
5622 foreach(
$_POST[
"subscribers"] as $subscribers)
5626 $c_gui->addItem(
'subscribers[]',
5628 $name[
'lastname'].
', '.$name[
'firstname'].
' ['.$name[
'login'].
']',
5632 $this->tpl->setContent($c_gui->getHTML());
5638 if(!is_array(
$_POST[
"waiting"]))
5646 $this->lng->loadLanguageModule(
'mmbr');
5650 $this->tabs_gui->setTabActive(
'members');
5651 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
5653 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
5657 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"refuseFromList"));
5658 $c_gui->setHeaderText($this->lng->txt(
"info_refuse_sure"));
5659 $c_gui->setCancel($this->lng->txt(
"cancel"),
"members");
5660 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"refuseFromList");
5662 foreach(
$_POST[
"waiting"] as $waiting)
5666 $c_gui->addItem(
'waiting[]',
5668 $name[
'lastname'].
', '.$name[
'firstname'].
' ['.$name[
'login'].
']',
5672 $this->tpl->setContent($c_gui->getHTML());
5678 if(!is_array(
$_POST[
"waiting"]))
5687 $this->tabs_gui->setTabActive(
'members');
5688 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
5690 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
5694 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"assignFromWaitingList"));
5695 $c_gui->setHeaderText($this->lng->txt(
"info_assign_sure"));
5696 $c_gui->setCancel($this->lng->txt(
"cancel"),
"members");
5697 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"assignFromWaitingList");
5699 foreach(
$_POST[
"waiting"] as $waiting)
5703 $c_gui->addItem(
'waiting[]',
5705 $name[
'lastname'].
', '.$name[
'firstname'].
' ['.$name[
'login'].
']',
5709 $this->tpl->setContent($c_gui->getHTML());