25 require_once
"./Services/Container/classes/class.ilContainerGUI.php";
55 $this->ctrl->saveParameter($this,array(
"ref_id",
"cmdClass"));
60 $this->lng->loadLanguageModule(
'crs');
62 $this->SEARCH_USER = 1;
63 $this->SEARCH_GROUP = 2;
64 $this->SEARCH_COURSE = 3;
69 switch($_POST[
"action"])
72 case "deleteSubscribers":
76 case "addSubscribers":
77 $this->addSubscribers();
80 case "addFromWaitingList":
81 $this->addFromWaitingList();
84 case "removeFromWaitingList":
103 if(isset($_POST[
'btn_pressed'][
'deleteMembers']))
107 elseif($_POST[
'btn_pressed'][
'sendMailToSelectedUsers'])
119 if(isset(
$_GET[
'member_id']))
121 $_POST[
'member'] = array(
$_GET[
'member_id']);
125 $_POST[
'member'] = array_unique(array_merge((array) $_POST[
'members'],
126 (array) $_POST[
'tutors'],
127 (array) $_POST[
'admins'],
128 (array) $_POST[
'waiting'],
129 (array) $_POST[
'subscribers']));
133 if (!count($_POST[
"member"]))
139 foreach($_POST[
"member"] as $usr_id)
143 ilUtil::redirect(
"ilias.php?baseClass=ilmailgui&type=new&rcp_to=".implode(
',',$rcps));
165 if(!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
'crs'))
167 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_create"),$this->ilias->error_obj->MESSAGE);
169 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_create.html",
'Modules/Course');
171 $this->ctrl->setParameter($this,
"new_type",
'crs');
172 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"save"));
174 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"crs_new"));
175 $this->tpl->setVariable(
"TYPE_IMG",
177 $this->tpl->setVariable(
"ALT_IMG", $this->lng->txt(
"obj_crs"));
178 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
179 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"crs_add"));
180 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
181 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
182 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
183 $this->tpl->setVariable(
"TXT_DESC",$this->lng->txt(
'desc'));
187 $this->tpl->setVariable(
"TXT_IMPORT_CRS", $this->lng->txt(
"import_crs"));
188 $this->tpl->setVariable(
"TXT_CRS_FILE", $this->lng->txt(
"file"));
189 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
192 $umf=get_cfg_var(
"upload_max_filesize");
194 $pms=get_cfg_var(
"post_max_size");
197 $max_filesize=min($umf, $pms);
199 $max_filesize=max($umf, $pms);
202 $this->tpl->setVariable(
"TXT_FILE_INFO", $this->lng->txt(
"file_notice").$max_filesize);
211 global $_FILES, $rbacsystem, $ilDB;
214 if($_FILES[
'xmldoc'][
'tmp_name'] ==
'none' or !$_FILES[
'xmldoc'][
'tmp_name'])
216 $this->ilias->raiseError(
"No file selected!",$this->ilias->error_obj->MESSAGE);
220 $info = pathinfo($_FILES[
"xmldoc"][
"name"]);
221 if (strtolower($info[
"extension"]) !=
"zip")
223 $this->ilias->raiseError(
"File must be a zip file!",$this->ilias->error_obj->MESSAGE);
227 include_once(
"Modules/Course/classes/class.ilObjCourse.php");
230 $newObj->setType(
'crs');
231 $newObj->setTitle($_FILES[
"xmldoc"][
"name"]);
232 $newObj->setDescription(
"");
233 $newObj->create(
true);
234 $newObj->createReference();
235 $newObj->putInTree(
$_GET[
"ref_id"]);
236 $newObj->setPermissions(
$_GET[
"ref_id"]);
237 $newObj->initDefaultRoles();
240 include_once
'Modules/Course/classes/class.ilFileDataCourse.php';
244 $course_files->
createImportFile($_FILES[
"xmldoc"][
"tmp_name"],$_FILES[
'xmldoc'][
'name']);
245 $course_files->unpackImportFile();
246 $course_files->validateImportFile();
248 include_once
'Modules/Course/classes/class.ilCourseXMLParser.php';
255 $newObj->MDUpdateListener(
'General');
258 #$course_files->deleteImportFile();
262 $this->ctrl->setParameter($this,
"ref_id", $newObj->getRefId());
264 $this->ctrl->getLinkTarget($this,
"edit")));
272 $this->ctrl->setCmd(
"view");
290 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
292 $this->ctrl->setCmdClass(get_class($course_content_obj));
293 $this->ctrl->setCmd(
'editUserTimings');
294 $this->ctrl->forwardCommand($course_content_obj);
305 global $rbacsystem, $ilUser,
$ilCtrl;
308 if(!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
310 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
313 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
320 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
325 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
331 include_once(
'Modules/Course/classes/class.ilCourseAgreementGUI.php');
332 $this->ctrl->setReturn($this,
'view_content');
334 $this->ctrl->setCmdClass(get_class($agreement));
335 $this->ctrl->forwardCommand($agreement);
356 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
359 $this->ctrl->setCmdClass(get_class($course_content_obj));
360 $this->ctrl->forwardCommand($course_content_obj);
378 $this->ctrl->setCmd(
"showSummary");
379 $this->ctrl->setCmdClass(
"ilinfoscreengui");
390 if(!$ilAccess->checkAccess(
'visible',
'',$this->object->getRefId()))
392 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->MESSAGE);
398 include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
401 $this->tabs_gui->setTabActive(
'info_short');
403 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
404 include_once
'Modules/Course/classes/class.ilCourseFile.php';
409 $info->enablePrivateNotes();
410 $info->enableFeedback();
412 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
414 $info->enableNewsEditing();
418 if(strlen($this->object->getImportantInformation()) or
419 strlen($this->object->getSyllabus()) or
422 $info->addSection($this->lng->txt(
'crs_general_informations'));
425 if(strlen($this->object->getImportantInformation()))
427 $info->addProperty($this->lng->txt(
'crs_important_info'),
431 if(strlen($this->object->getSyllabus()))
433 $info->addProperty($this->lng->txt(
'crs_syllabus'), nl2br(
439 $tpl =
new ilTemplate(
'tpl.event_info_file.html',
true,
true,
'Modules/Course');
443 $tpl->setCurrentBlock(
"files");
444 $this->ctrl->setParameter($this,
'file_id',$file->getFileId());
445 $tpl->setVariable(
"DOWN_LINK",$this->ctrl->getLinkTarget($this,
'sendfile'));
446 $tpl->setVariable(
"DOWN_NAME",$file->getFileName());
447 $tpl->setVariable(
"DOWN_INFO_TXT",$this->lng->txt(
'crs_file_size_info'));
448 $tpl->setVariable(
"DOWN_SIZE",$file->getFileSize());
449 $tpl->setVariable(
"TXT_BYTES",$this->lng->txt(
'bytes'));
450 $tpl->parseCurrentBlock();
452 $info->addProperty($this->lng->txt(
'crs_file_download'),
456 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
459 $record_gui->parse();
462 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
465 if($this->object->hasContactData())
467 $info->addSection($this->lng->txt(
"crs_contact"));
469 if(strlen($this->object->getContactName()))
471 $info->addProperty($this->lng->txt(
"crs_contact_name"),
472 $this->
object->getContactName());
474 if(strlen($this->object->getContactResponsibility()))
476 $info->addProperty($this->lng->txt(
"crs_contact_responsibility"),
477 $this->
object->getContactResponsibility());
479 if(strlen($this->object->getContactPhone()))
481 $info->addProperty($this->lng->txt(
"crs_contact_phone"),
482 $this->
object->getContactPhone());
484 if($this->object->getContactEmail())
486 $emails = split(
",",$this->object->getContactEmail());
487 foreach ($emails as $email) {
488 $email = trim($email);
489 $etpl =
new ilTemplate(
"tpl.crs_contact_email.html",
true,
true ,
'Modules/Course');
490 $etpl->setVariable(
"EMAIL_LINK",
"ilias.php?baseClass=ilmailgui&type=new&rcp_to=".$email);
491 $etpl->setVariable(
"CONTACT_EMAIL", $email);
492 $mailString .= $etpl->get().
"<br />";
494 $info->addProperty($this->lng->txt(
"crs_contact_email"), $mailString);
496 if(strlen($this->object->getContactConsultation()))
498 $info->addProperty($this->lng->txt(
"crs_contact_consultation"),
499 nl2br($this->object->getContactConsultation()));
504 $info->addSection($this->lng->txt(
"access"));
505 $info->showLDAPRoleGroupMappingInfo();
508 if($this->object->getOfflineStatus())
510 $info->addProperty($this->lng->txt(
'crs_visibility'),
511 $this->lng->txt(
'crs_visibility_unvisible'));
513 elseif($this->object->getActivationUnlimitedStatus())
515 $info->addProperty($this->lng->txt(
"crs_visibility"),
516 $this->lng->txt(
'crs_unlimited'));
520 $info->addProperty($this->lng->txt(
'crs_visibility'),
526 switch($this->object->getSubscriptionLimitationType())
529 $txt = $this->lng->txt(
"crs_info_reg_deactivated");
533 switch($this->object->getSubscriptionType())
536 $txt = $this->lng->txt(
"crs_info_reg_confirmation");
539 $txt = $this->lng->txt(
"crs_info_reg_direct");
542 $txt = $this->lng->txt(
"crs_info_reg_password");
548 $info->addProperty($this->lng->txt(
"crs_info_reg"),$txt);
553 if($this->object->getSubscriptionUnlimitedStatus())
555 $info->addProperty($this->lng->txt(
"crs_reg_until"),
556 $this->lng->txt(
'crs_unlimited'));
558 elseif($this->object->getSubscriptionStart() < time())
560 $info->addProperty($this->lng->txt(
"crs_reg_until"),
561 $this->lng->txt(
'crs_to').
' '.
564 elseif($this->object->getSubscriptionStart() > time())
566 $info->addProperty($this->lng->txt(
"crs_reg_until"),
567 $this->lng->txt(
'crs_from').
' '.
570 if ($this->object->isSubscriptionMembershipLimited())
572 $info->addProperty($this->lng->txt(
"mem_free_places"),
573 max(0,$this->object->getSubscriptionMaxMembers()- count($this->object->getMembers())));
584 $info->addProperty($this->lng->txt(
"crs_archive"),
591 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
594 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
597 include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
601 $this->lng->loadLanguageModule(
'ps');
602 $info->addSection($this->lng->txt(
'crs_user_agreement_info'));
603 $info->addProperty($this->lng->txt(
'ps_export_data'),$field_info->exportableFieldsToInfoString());
607 $info->addProperty($this->lng->txt(
'ps_crs_user_fields'),$fields);
611 $info->enableLearningProgress(
true);
614 $this->ctrl->forwardCommand($info);
619 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
623 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
625 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
629 $this->tabs_gui->setTabActive(
'settings');
630 $this->tabs_gui->setSubTabActive(
'crs_start_objects');
633 $crs_start =&
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
635 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_list_starter.html",
'Modules/Course');
636 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
638 if(!count($starter = $crs_start->getStartObjects()))
640 $this->tpl->setCurrentBlock(
"btn_cell");
641 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTarget($this,
'selectStarter'));
642 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
'crs_add_starter'));
643 $this->tpl->parseCurrentBlock();
650 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
652 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_crs'));
653 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'crs_edit_start_objects'));
654 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
655 $this->tpl->setVariable(
"HEADER_OPT",$this->lng->txt(
'options'));
656 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'crs_add_starter'));
659 foreach($starter as $start_id =>
$data)
663 if(strlen($tmp_obj->getDescription()))
665 $this->tpl->setCurrentBlock(
"description");
666 $this->tpl->setVariable(
"DESCRIPTION_STARTER",$tmp_obj->getDescription());
667 $this->tpl->parseCurrentBlock();
670 $this->tpl->setCurrentBlock(
"starter_row");
672 $this->tpl->setVariable(
"STARTER_TITLE",$tmp_obj->getTitle());
674 $this->ctrl->setParameter($this,
'del_starter',$start_id);
675 $this->tpl->setVariable(
"DELETE_LINK",$this->ctrl->getLinkTarget($this,
'deleteStarter'));
676 $this->tpl->setVariable(
"DELETE_ALT",$this->lng->txt(
'delete'));
677 $this->tpl->parseCurrentBlock();
683 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
687 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
689 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
692 $crs_start =&
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
704 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
707 $this->tabs_gui->setTabActive(
'settings');
708 $this->tabs_gui->setSubTabActive(
'crs_start_objects');
712 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
714 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
717 $crs_start =&
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
719 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_add_starter.html",
'Modules/Course');
721 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
723 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_crs'));
724 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'crs_select_starter'));
725 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
726 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'crs_add_starter'));
727 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
730 $this->
object->initCourseItemObject();
732 foreach($crs_start->getPossibleStarters($this->object->items_obj) as $item_ref_id)
736 if(strlen($tmp_obj->getDescription()))
738 $this->tpl->setCurrentBlock(
"description");
739 $this->tpl->setVariable(
"DESCRIPTION_STARTER",$tmp_obj->getDescription());
740 $this->tpl->parseCurrentBlock();
743 $this->tpl->setCurrentBlock(
"starter_row");
746 $this->tpl->setVariable(
"STARTER_TITLE",$tmp_obj->getTitle());
747 $this->tpl->parseCurrentBlock();
753 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
757 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
759 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
761 if(!count($_POST[
'starter']))
769 $crs_start =&
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
771 foreach($_POST[
'starter'] as $item_ref_id)
773 if(!$crs_start->exists($item_ref_id))
776 $crs_start->
add($item_ref_id);
803 include_once
'Modules/Course/classes/class.ilCourseFile.php';
807 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
809 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->MESSAGE);
812 $this->tabs_gui->setTabActive(
'settings');
813 $this->tabs_gui->setSubTabActive(
'crs_info_settings');
816 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.edit_info.html',
'Modules/Course');
817 $this->tpl->setVariable(
'INFO_TABLE',$this->form->getHTML());
826 $table_data[
'id'] = $file->getFileId();
827 $table_data[
'filename'] = $file->getFileName();
828 $table_data[
'filetype'] = $file->getFileType();
829 $table_data[
'filesize'] = $file->getFileSize();
831 $rows[] = $table_data;
834 include_once(
"./Modules/Course/classes/class.ilCourseInfoFileTableGUI.php");
836 $table_gui->setTitle($this->lng->txt(
"crs_info_download"));
837 $table_gui->setData($rows);
838 $table_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
839 $table_gui->addMultiCommand(
"confirmDeleteInfoFiles", $this->lng->txt(
"delete"));
840 $table_gui->setSelectAllCheckbox(
"file_id");
841 $this->tpl->setVariable(
'INFO_FILE_TABLE',$table_gui->getHTML());
856 if(!count($_POST[
'file_id']))
864 $this->tabs_gui->setTabActive(
'settings');
865 $this->tabs_gui->setSubTabActive(
'crs_info_settings');
867 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
871 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteInfoFiles"));
872 $c_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
873 $c_gui->setCancel($this->lng->txt(
"cancel"),
"editInfo");
874 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteInfoFiles");
877 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
878 foreach($_POST[
"file_id"] as $file_id)
881 $c_gui->addItem(
"file_id[]", $file_id,
$file->getFileName());
884 $this->tpl->setContent($c_gui->getHTML());
895 if(!count($_POST[
'file_id']))
901 include_once(
'Modules/Course/classes/class.ilCourseFile.php');
903 foreach($_POST[
'file_id'] as $file_id)
906 if($this->object->getId() ==
$file->getCourseId())
925 if(is_object($this->form))
930 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
932 $this->form->setFormAction($this->ctrl->getFormAction($this));
933 $this->form->setMultipart(
true);
934 $this->form->setTitle($this->lng->txt(
'crs_general_info'));
935 $this->form->addCommandButton(
'updateInfo',$this->lng->txt(
'save'));
936 $this->form->addCommandButton(
'editInfo',$this->lng->txt(
'cancel'));
939 $area->
setValue($this->object->getImportantInformation());
942 $this->form->addItem($area);
945 $area->
setValue($this->object->getSyllabus());
948 $this->form->addItem($area);
951 $section->setTitle($this->lng->txt(
'crs_info_download'));
955 $file->enableFileNameSelection(
'file_name');
956 $this->form->addItem(
$file);
959 $section->setTitle($this->lng->txt(
'crs_contact'));
962 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_name'),
'contact_name');
963 $text->
setValue($this->object->getContactName());
965 $text->setMaxLength(70);
966 $this->form->addItem($text);
968 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_responsibility'),
'contact_responsibility');
969 $text->
setValue($this->object->getContactResponsibility());
971 $text->setMaxLength(70);
972 $this->form->addItem($text);
974 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_phone'),
'contact_phone');
975 $text->
setValue($this->object->getContactPhone());
977 $text->setMaxLength(40);
978 $this->form->addItem($text);
980 $text =
new ilTextInputGUI($this->lng->txt(
'crs_contact_email'),
'contact_email');
981 $text->
setValue($this->object->getContactEmail());
982 $text->setInfo($this->lng->txt(
'crs_contact_email_info'));
984 $text->setMaxLength(255);
985 $this->form->addItem($text);
987 $area =
new ilTextAreaInputGUI($this->lng->txt(
'crs_contact_consultation'),
'contact_consultation');
988 $area->
setValue($this->object->getContactConsultation());
991 $this->form->addItem($area);
993 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
996 $record_gui->parse();
1005 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1007 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->MESSAGE);
1010 include_once
'Modules/Course/classes/class.ilCourseFile.php';
1012 $file_obj->setCourseId($this->object->getId());
1013 $file_obj->setFileName(strlen($_POST[
'file_name']) ?
1015 $_FILES[
'file'][
'name']);
1016 $file_obj->setFileSize($_FILES[
'file'][
'size']);
1017 $file_obj->setFileType($_FILES[
'file'][
'type']);
1018 $file_obj->setTemporaryName($_FILES[
'file'][
'tmp_name']);
1019 $file_obj->setErrorCode($_FILES[
'file'][
'error']);
1024 $this->
object->setContactResponsibility(
ilUtil::stripSlashes($_POST[
'contact_responsibility']));
1029 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
1031 'crs',$this->object->getId());
1035 $ilErr->setMessage(
'');
1036 $file_obj->validate();
1037 $this->
object->validateInfoSettings();
1039 if(strlen($ilErr->getMessage()))
1045 $this->
object->update();
1046 $file_obj->create();
1047 $record_gui->saveValues();
1049 $this->
object->updateECSContent();
1061 $activation_start = $this->
loadDate(
'activation_start');
1062 $activation_end = $this->
loadDate(
'activation_end');
1063 $subscription_start = $this->
loadDate(
'subscription_start');
1064 $subscription_end = $this->
loadDate(
'subscription_end');
1065 $archive_start = $this->
loadDate(
'archive_start');
1066 $archive_end = $this->
loadDate(
'archive_end');
1068 $this->
object->setActivationType((
int) $_POST[
'activation_type']);
1069 $this->
object->setActivationStart($activation_start->get(
IL_CAL_UNIX));
1070 $this->
object->setActivationEnd($activation_end->get(
IL_CAL_UNIX));
1071 $this->
object->setSubscriptionLimitationType((
int) $_POST[
'subscription_limitation_type']);
1072 $this->
object->setSubscriptionType((
int) $_POST[
'subscription_type']);
1074 $this->
object->setSubscriptionStart($subscription_start->get(
IL_CAL_UNIX));
1075 $this->
object->setSubscriptionEnd($subscription_end->get(
IL_CAL_UNIX));
1076 $this->
object->enableSubscriptionMembershipLimitation((
int) $_POST[
'subscription_membership_limitation']);
1077 $this->
object->setSubscriptionMaxMembers((
int) $_POST[
'subscription_max']);
1078 $this->
object->enableWaitingList((
int) $_POST[
'waiting_list']);
1079 #$this->object->setSubscriptionNotify((int) $_POST['subscription_notification']);
1080 $this->
object->setViewMode((
int) $_POST[
'view_mode']);
1088 $this->
object->setOrderType((
int) $_POST[
'order_type']);
1090 $this->
object->setArchiveStart($archive_start->get(
IL_CAL_UNIX));
1091 $this->
object->setArchiveEnd($archive_end->get(
IL_CAL_UNIX));
1092 $this->
object->setArchiveType($_POST[
'archive_type']);
1093 $this->
object->setAboStatus((
int) $_POST[
'abo']);
1094 $this->
object->setShowMembers((
int) $_POST[
'show_members']);
1096 if($this->object->validate())
1098 $this->
object->update();
1101 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1135 include_once(
'./Services/WebServices/ECS/classes/class.ilECSSettings.php');
1139 if(!$ecs_settings->isEnabled())
1143 if($_POST[
'ecs_export'] and !$_POST[
'ecs_owner'])
1150 $this->
object->handleECSSettings((
bool) $_POST[
'ecs_export'],(
int) $_POST[
'ecs_owner'],(array) $_POST[
'ecs_mids']);
1153 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1154 $export =
new ilECSExport($this->object->getId());
1155 if($export->isExported())
1158 $rbacadmin->grantPermission($ecs_settings->getGlobalRole(),
1160 $this->
object->getRefId());
1165 $rbacadmin->revokePermission($this->object->getRefId(),
1166 $ecs_settings->getGlobalRole());
1176 ilUtil::sendInfo(
'Course export failed with message: '.$exc->getMessage());
1194 $this->tabs_gui->setTabActive(
'settings');
1195 $this->tabs_gui->setSubTabActive(
'crs_settings');
1199 $this->tpl->setContent($this->form->getHTML());
1211 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1212 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
1214 if(!is_object($this->form))
1219 $this->form->setTitle($this->lng->txt(
'crs_edit'));
1222 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
1223 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1225 $this->form->setTableWidth(
'75%');
1226 $this->form->setFormAction($this->ctrl->getFormAction($this));
1230 $title->setValue($this->object->getTitle());
1232 $title->setMaxLength(128);
1233 $title->setRequired(
true);
1234 $this->form->addItem(
$title);
1238 $desc->
setValue($this->object->getLongDescription());
1241 $this->form->addItem($desc);
1245 $act_type->
setValue($this->object->getActivationType());
1248 $opt->
setInfo($this->lng->txt(
'crs_availability_unvisible_info'));
1249 $act_type->addOption($opt);
1252 $opt->
setInfo($this->lng->txt(
'crs_availability_limitless_info'));
1253 $act_type->addOption($opt);
1256 $opt->
setInfo($this->lng->txt(
'crs_availability_until_info'));
1262 $opt->addSubItem($start);
1268 $opt->addSubItem($end);
1270 $act_type->addOption($opt);
1272 $this->form->addItem($act_type);
1275 $section->setTitle($this->lng->txt(
'crs_reg'));
1278 $reg_type =
new ilRadioGroupInputGUI($this->lng->txt(
'crs_reg_period'),
'subscription_limitation_type');
1279 $reg_type->
setValue($this->object->getSubscriptionLimitationType());
1282 $opt->
setInfo($this->lng->txt(
'crs_registration_deactivated'));
1283 $reg_type->addOption($opt);
1286 $opt->
setInfo($this->lng->txt(
'crs_reg_unlim_info'));
1287 $reg_type->addOption($opt);
1290 $opt->
setInfo($this->lng->txt(
'crs_reg_lim_info'));
1296 $opt->addSubItem($start);
1302 $opt->addSubItem($end);
1304 $reg_type->addOption($opt);
1306 $this->form->addItem($reg_type);
1310 $reg_proc =
new ilRadioGroupInputGUI($this->lng->txt(
'crs_registration_type'),
'subscription_type');
1311 $reg_proc->
setValue($this->object->getSubscriptionType());
1312 $reg_proc->setInfo($this->lng->txt(
'crs_reg_type_info'));
1315 $reg_proc->addOption($opt);
1318 $reg_proc->addOption($opt);
1324 $pass->setMaxLength(12);
1325 $pass->
setValue($this->object->getSubscriptionPassword());
1327 $opt->addSubItem($pass);
1328 $reg_proc->addOption($opt);
1330 $this->form->addItem($reg_proc);
1333 $lim =
new ilCheckboxInputGUI($this->lng->txt(
'crs_subscription_max_members_short'),
'subscription_membership_limitation');
1335 $lim->setOptionTitle($this->lng->txt(
'crs_subscription_max_members'));
1336 $lim->setChecked($this->object->isSubscriptionMembershipLimited());
1340 $max->setMaxLength(4);
1341 $max->setValue($this->object->getSubscriptionMaxMembers() ? $this->
object->getSubscriptionMaxMembers() :
'');
1342 $max->setTitle($this->lng->txt(
'members').
':');
1343 $max->setInfo($this->lng->txt(
'crs_reg_max_info'));
1345 $lim->addSubItem($max);
1348 $wait->setOptionTitle($this->lng->txt(
'crs_waiting_list'));
1349 $wait->setChecked($this->object->enabledWaitingList());
1350 $wait->setInfo($this->lng->txt(
'crs_wait_info'));
1351 $lim->addSubItem($wait);
1353 $this->form->addItem($lim);
1356 $pres->setTitle($this->lng->txt(
'crs_view_mode'));
1358 $this->form->addItem($pres);
1362 $view_type->
setValue($this->object->getViewMode());
1365 $opt->
setInfo($this->lng->txt(
'cntr_view_info_sessions'));
1366 $view_type->addOption($opt);
1369 $opt->
setInfo($this->lng->txt(
'cntr_view_info_simple'));
1370 $view_type->addOption($opt);
1373 $opt->
setInfo($this->lng->txt(
'cntr_view_info_by_type'));
1374 $view_type->addOption($opt);
1377 $opt->
setInfo($this->lng->txt(
'crs_view_info_objective'));
1378 $view_type->addOption($opt);
1381 $opt->
setInfo($this->lng->txt(
'crs_view_info_timing'));
1382 $view_type->addOption($opt);
1385 $opt->
setInfo($this->lng->txt(
'crs_archive_info'));
1388 $down->setOptionTitle($this->lng->txt(
'crs_archive_download'));
1390 $opt->addSubItem($down);
1396 $opt->addSubItem($start);
1402 $opt->addSubItem($end);
1404 $view_type->addOption($opt);
1405 $this->form->addItem($view_type);
1409 $sort->
setValue($this->object->getOrderType());
1412 $opt->
setInfo($this->lng->txt(
'crs_sort_title_info'));
1413 $sort->addOption($opt);
1416 $opt->
setInfo($this->lng->txt(
'crs_sort_manual_info'));
1417 $sort->addOption($opt);
1420 $opt->
setInfo($this->lng->txt(
'crs_sort_timing_info'));
1421 $sort->addOption($opt);
1423 $this->form->addItem($sort);
1426 $further->setTitle($this->lng->txt(
'crs_further_settings'));
1427 $this->form->addItem($further);
1429 $desk =
new ilCheckboxInputGUI($this->lng->txt(
'crs_add_remove_from_desktop'),
'abo');
1430 $desk->
setChecked($this->object->getAboStatus());
1431 $desk->setInfo($this->lng->txt(
'crs_add_remove_from_desktop_info'));
1432 $this->form->addItem($desk);
1435 $mem->
setChecked($this->object->getShowMembers());
1436 $mem->setInfo($this->lng->txt(
'crs_show_members_info'));
1437 $this->form->addItem($mem);
1453 include_once(
'./Services/WebServices/ECS/classes/class.ilECSSettings.php');
1457 if(!$ecs_settings->isEnabled())
1462 $this->lng->loadLanguageModule(
'ecs');
1465 $ecs->setTitle($this->lng->txt(
'ecs_export'));
1466 $this->form->addItem($ecs);
1468 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1469 $ecs_export =
new ilECSExport($this->object->getId());
1472 $exp->setRequired(
true);
1473 $exp->setValue($ecs_export->isExported() ? 1 : 0);
1475 $off =
new ilRadioOption($this->lng->txt(
'ecs_export_disabled'),0);
1476 $exp->addOption($off);
1478 $on =
new ilRadioOption($this->lng->txt(
'ecs_export_enabled'),1);
1479 $exp->addOption($on);
1481 $this->form->addItem($exp);
1487 if($ecs_export->getEContentId())
1489 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentReader.php');
1492 $econtent_reader->
read();
1493 if($content = $econtent_reader->getEContent())
1495 $members = $content[0]->getParticipants();
1496 $owner = $content[0]->getOwner();
1500 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
1502 if(count($parts =
$reader->getPublishableParticipants()) > 1)
1504 $ilLog->write(__METHOD__.
': Found '.count($parts).
' participants for publishing');
1506 $publish_as->setHtml(
'<strong>'.$this->lng->txt(
'ecs_publish_as').
'</strong>');
1509 $coms->setValue($owner);
1511 foreach($parts as $participant)
1513 $community =
$reader->getCommunityById($participant->getCommunityId());
1515 $part =
new ilRadioOption($community->getTitle(),$participant->getMID());
1516 $part->
setInfo($community->getDescription());
1517 $coms->addOption($part);
1519 $publish_as->addSubItem($coms);
1520 $on->addSubItem($publish_as);
1525 $ilLog->write(__METHOD__.
': Found '.count($parts).
' participants for publishing');
1527 $owner_ids =
$reader->getOwnMIDs();
1528 $hidden->setValue($owner_ids[0]);
1529 $this->form->addItem($hidden);
1533 $publish_for->setHtml(
'<strong>'.$this->lng->txt(
'ecs_publish_for').
'</strong>');
1535 foreach(
$reader->getEnabledParticipants() as $participant)
1537 $community =
$reader->getCommunityById($participant->getCommunityId());
1540 $com->setOptionTitle($community->getTitle().
': '.$participant->getParticipantName());
1541 $com->setValue($participant->getMID());
1542 $com->setChecked(in_array($participant->getMID(),$members));
1543 $publish_for->addSubItem($com);
1546 $on->addSubItem($publish_for);
1550 $ilLog->write(__METHOD__.
': Error connecting to ECS server. '.$exc->getMessage());
1555 $ilLog->write(__METHOD__.
': Error parsing ECS query: '.$exc->getMessage());
1569 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
1571 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1575 $this->tabs_gui->setTabActive(
'settings');
1577 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_edit_icons.html",
'Modules/Course');
1579 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1580 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1581 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
1582 $this->tpl->setVariable(
"CMD_CANCEL",
"cancel");
1583 $this->tpl->setVariable(
"CMD_SUBMIT",
"updateCourseIcons");
1584 $this->tpl->parseCurrentBlock();
1589 include_once
'Modules/Course/classes/class.ilCourseFile.php';
1603 if (!$rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]) )
1605 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
1609 if ($this->ilias->getSetting(
"custom_icons"))
1611 $this->
object->saveIcons($_FILES[
"cont_big_icon"][
'tmp_name'],
1612 $_FILES[
"cont_small_icon"][
'tmp_name'], $_FILES[
"cont_tiny_icon"][
'tmp_name']);
1616 $this->ctrl->redirect($this,
"editCourseIcons");
1626 global $rbacsystem,$ilUser,$ilAccess;
1631 $this->tabs_gui->addSubTabTarget(
"crs_settings",
1632 $this->ctrl->getLinkTarget($this,
'edit'),
1633 "edit", get_class($this));
1635 $this->tabs_gui->addSubTabTarget(
"crs_info_settings",
1636 $this->ctrl->getLinkTarget($this,
'editInfo'),
1637 "editInfo", get_class($this));
1639 $this->tabs_gui->addSubTabTarget(
"preconditions",
1640 $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerInterface',
'listConditions'),
1641 "",
"ilConditionHandlerInterface");
1642 $this->tabs_gui->addSubTabTarget(
"crs_start_objects",
1643 $this->ctrl->getLinkTarget($this,
'listStructure'),
1644 "listStructure", get_class($this));
1645 $this->tabs_gui->addSubTabTarget(
'groupings',
1646 $this->ctrl->getLinkTargetByClass(
'ilobjcoursegroupinggui',
'listGroupings'),
1651 if ($this->ilias->getSetting(
"custom_icons"))
1653 $this->tabs_gui->addSubTabTarget(
"icon_settings",
1654 $this->ctrl->getLinkTarget($this,
'editCourseIcons'),
1655 "editCourseIcons", get_class($this));
1659 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1662 $this->tabs_gui->addSubTabTarget(
"crs_map_settings",
1663 $this->ctrl->getLinkTarget($this,
'editMapSettings'),
1664 "editMapSettings", get_class($this));
1668 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1669 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1672 if($rbacsystem->checkAccess(
'export_member_data',$privacy->getPrivacySettingsRefId()) and
1673 ($privacy->enabledExport() or
1676 $this->tabs_gui->addSubTabTarget(
'user_fields',
1677 $this->ctrl->getLinkTargetByClass(
'ilcourseuserfieldsgui'),
1679 'ilcourseuserfieldsgui');
1683 case "item_activation":
1684 $this->tabs_gui->addSubTabTarget(
"activation",
1685 $this->ctrl->getLinkTargetByClass(
'ilCourseItemAdministrationGUI',
'edit'),
1686 "edit", get_class($this));
1687 $this->ctrl->setParameterByClass(
'ilconditionhandlerinterface',
'item_id',(
int)
$_GET[
'item_id']);
1688 $this->tabs_gui->addSubTabTarget(
"preconditions",
1689 $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerInterface',
'listConditions'),
1690 "",
"ilConditionHandlerInterface");
1694 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1696 $this->tabs_gui->addSubTabTarget(
"crs_member_administration",
1697 $this->ctrl->getLinkTarget($this,
'members'),
1698 "members", get_class($this));
1700 $this->tabs_gui->addSubTabTarget(
"crs_members_gallery",
1701 $this->ctrl->getLinkTarget($this,
'membersGallery'),
1702 "membersGallery", get_class($this));
1705 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1708 $this->tabs_gui->addSubTabTarget(
"crs_members_map",
1709 $this->ctrl->getLinkTarget($this,
'membersMap'),
1710 "membersMap", get_class($this));
1714 include_once
'Services/Mail/classes/class.ilMail.php';
1715 $mail =&
new ilMail($ilUser->getId());
1716 if($rbacsystem->checkAccess(
'mail_visible',$mail->getMailObjectReferenceId()))
1718 $this->tabs_gui->addSubTabTarget(
"mail_members",
1719 $this->ctrl->getLinkTarget($this,
'mailMembers'),
1720 "mailMembers", get_class($this));
1723 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1725 $this->tabs_gui->addSubTabTarget(
"events",
1726 $this->ctrl->getLinkTargetByClass(
'ilsessionoverviewgui',
'listSessions'),
1727 "",
'ilsessionoverviewgui');
1730 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
1733 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId())
1734 && $privacy->enabledExport() and $rbacsystem->checkAccess(
'export_member_data',$privacy->getPrivacySettingsRefId()))
1736 $this->tabs_gui->addSubTabTarget(
'export_members',
1737 $this->ctrl->getLinkTargetByClass(
'ilmemberexportgui',
'show'));
1753 $this->
object->removeSmallIcon();
1764 $this->
object->removeBigIcon();
1776 $this->
object->removeTinyIcon();
1786 global $rbacadmin,$ilUser;
1789 $newObj->initDefaultRoles();
1790 $newObj->initCourseMemberObject();
1791 $newObj->members_obj->add($ilUser->getId(),
IL_CRS_ADMIN);
1794 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1805 $this->ctrl->setParameter($this,
"ref_id", $newObj->getRefId());
1807 $this->ctrl->getLinkTarget($this,
"edit")));
1817 $_POST[
"archives"] = $_POST[
"archives"] ? $_POST[
"archives"] : array();
1820 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
1822 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1824 if(!count($_POST[
'archives']))
1827 $this->archiveObject();
1831 if(count($_POST[
'archives']) > 1)
1834 $this->archiveObject();
1839 $this->
object->initCourseArchiveObject();
1841 $abs_path = $this->
object->archives_obj->getArchiveFile((
int) $_POST[
'archives'][0]);
1842 $basename = basename($abs_path);
1857 if(isset(
$_GET[
'admin_hide']))
1859 $ilUser->writePref(
'crs_admin_hide',(
int)
$_GET[
'admin_hide']);
1861 if(isset(
$_GET[
'tutor_hide']))
1863 $ilUser->writePref(
'crs_tutor_hide',(
int)
$_GET[
'tutor_hide']);
1865 if(isset(
$_GET[
'member_hide']))
1867 $ilUser->writePref(
'crs_member_hide',(
int)
$_GET[
'member_hide']);
1869 if(isset(
$_GET[
'subscriber_hide']))
1871 $ilUser->writePref(
'crs_subscriber_hide',(
int)
$_GET[
'subscriber_hide']);
1873 if(isset(
$_GET[
'wait_hide']))
1875 $ilUser->writePref(
'crs_wait_hide',(
int)
$_GET[
'wait_hide']);
1881 if($this->show_tracking)
1883 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
1889 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1892 if($privacy->enabledCourseAccessTimes())
1894 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
1898 foreach($ids as $usr_id)
1901 $tmp_data[
'firstname'] = $name[
'firstname'];
1902 $tmp_data[
'lastname'] = $name[
'lastname'];
1904 $tmp_data[
'passed'] = $this->
object->members_obj->hasPassed($usr_id) ? 1 : 0;
1905 $tmp_data[
'notification'] = $this->
object->members_obj->isNotificationEnabled($usr_id) ? 1 : 0;
1906 $tmp_data[
'blocked'] = $this->
object->members_obj->isBlocked($usr_id) ? 1 : 0;
1907 $tmp_data[
'usr_id'] = $usr_id;
1909 if($this->show_tracking)
1911 if(in_array($usr_id,$completed))
1915 elseif(in_array($usr_id,$in_progress))
1919 elseif(in_array($usr_id,
$failed))
1929 if($privacy->enabledCourseAccessTimes())
1931 if(isset($progress[$usr_id][
'ts']) and $progress[$usr_id][
'ts'])
1937 $tmp_data[
'access_time'] = $this->lng->txt(
'no_date');
1940 $members[] = $tmp_data;
1942 return $members ? $members : array();
1955 global $ilUser, $rbacsystem;
1957 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
1958 include_once(
'./Modules/Course/classes/class.ilCourseParticipantsTableGUI.php');
1959 include_once
'./Services/Tracking/classes/class.ilObjUserTracking.php';
1960 include_once(
'./Services/Tracking/classes/class.ilLPObjSettings.php');
1963 if(isset(
$_GET[
'member_table_nav']))
1974 include_once(
'./Modules/Course/classes/class.ilCourseItems.php');
1979 $this->tabs_gui->setTabActive(
'members');
1980 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
1982 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_edit_members.html',
'Modules/Course');
1983 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
1986 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1987 $this->tpl->setCurrentBlock(
"btn_cell");
1988 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
1989 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"crs_add_member"));
1990 $this->tpl->parseCurrentBlock();
1992 $this->
__showButton(
"printMembers",$this->lng->txt(
"crs_print_list"),
"target=\"_blank\"");
1998 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2000 if(count($wait = $waiting_list->getAllUsers()))
2002 include_once(
'./Services/Membership/classes/class.ilWaitingListTableGUI.php');
2003 if($ilUser->getPref(
'crs_wait_hide'))
2006 $this->ctrl->setParameter($this,
'wait_hide',0);
2007 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2008 $this->lng->txt(
'show'),
2011 $this->ctrl->clearParameters($this);
2016 $this->ctrl->setParameter($this,
'wait_hide',1);
2017 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2018 $this->lng->txt(
'hide'),
2021 $this->ctrl->clearParameters($this);
2023 $table_gui->setUsers($wait);
2024 $table_gui->setTitle($this->lng->txt(
'crs_waiting_list'),
'icon_usr.gif',$this->lng->txt(
'crs_waiting_list'));
2025 $this->tpl->setVariable(
'TABLE_WAIT',$table_gui->getHTML());
2029 if(count($subscribers = $part->getSubscribers()))
2031 include_once(
'./Services/Membership/classes/class.ilSubscriberTableGUI.php');
2032 if($ilUser->getPref(
'crs_subscriber_hide'))
2035 $this->ctrl->setParameter($this,
'subscriber_hide',0);
2036 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2037 $this->lng->txt(
'show'),
2040 $this->ctrl->clearParameters($this);
2045 $this->ctrl->setParameter($this,
'subscriber_hide',1);
2046 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2047 $this->lng->txt(
'hide'),
2050 $this->ctrl->clearParameters($this);
2052 $table_gui->setSubscribers($subscribers);
2053 $table_gui->setTitle($this->lng->txt(
'group_new_registrations'),
'icon_usr.gif',$this->lng->txt(
'group_new_registrations'));
2054 $this->tpl->setVariable(
'TABLE_SUB',$table_gui->getHTML());
2059 if(count($part->getAdmins()))
2063 $showEditLink = $rbacsystem->checkAccess(
"edit_permission", $this->object->getRefId());
2064 if($ilUser->getPref(
'crs_admin_hide'))
2067 $this->ctrl->setParameter($this,
'admin_hide',0);
2068 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2069 $this->lng->txt(
'show'),
2072 $this->ctrl->clearParameters($this);
2077 $this->ctrl->setParameter($this,
'admin_hide',1);
2078 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2079 $this->lng->txt(
'hide'),
2082 $this->ctrl->clearParameters($this);
2084 $table_gui->setTitle($this->lng->txt(
'crs_administrators'),
'icon_usr.gif',$this->lng->txt(
'crs_administrators'));
2086 $this->tpl->setVariable(
'ADMINS',$table_gui->getHTML());
2088 if(count($part->getTutors()))
2090 if($ilUser->getPref(
'crs_tutor_hide'))
2093 $this->ctrl->setParameter($this,
'tutor_hide',0);
2094 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2095 $this->lng->txt(
'show'),
2098 $this->ctrl->clearParameters($this);
2103 $this->ctrl->setParameter($this,
'tutor_hide',1);
2104 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2105 $this->lng->txt(
'hide'),
2108 $this->ctrl->clearParameters($this);
2110 $table_gui->setTitle($this->lng->txt(
'crs_tutors'),
'icon_usr.gif',$this->lng->txt(
'crs_tutors'));
2112 $this->tpl->setVariable(
'TUTORS',$table_gui->getHTML());
2114 if(count($part->getMembers()))
2116 if($ilUser->getPref(
'crs_member_hide'))
2119 $this->ctrl->setParameter($this,
'member_hide',0);
2120 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2121 $this->lng->txt(
'show'),
2124 $this->ctrl->clearParameters($this);
2129 $this->ctrl->setParameter($this,
'member_hide',1);
2130 $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
2131 $this->lng->txt(
'hide'),
2134 $this->ctrl->clearParameters($this);
2137 $table_gui->setTitle($this->lng->txt(
'crs_members'),
'icon_usr.gif',$this->lng->txt(
'crs_members'));
2139 $this->tpl->setVariable(
'MEMBERS',$table_gui->getHTML());
2144 $this->tpl->setVariable(
'TXT_SELECTED_USER',$this->lng->txt(
'crs_selected_users'));
2145 $this->tpl->setVariable(
'BTN_FOOTER_EDIT',$this->lng->txt(
'edit'));
2146 $this->tpl->setVariable(
'BTN_FOOTER_VAL',$this->lng->txt(
'remove'));
2147 $this->tpl->setVariable(
'BTN_FOOTER_MAIL',$this->lng->txt(
'crs_mem_send_mail'));
2167 $visible_members = array_intersect(array_unique((array) $_POST[
'visible_member_ids']),$this->object->members_obj->getAdmins());
2168 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2169 $notification = is_array($_POST[
'notification']) ? $_POST[
'notification'] : array();
2185 $visible_members = array_intersect(array_unique((array) $_POST[
'visible_member_ids']),$this->object->members_obj->getTutors());
2186 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2187 $notification = is_array($_POST[
'notification']) ? $_POST[
'notification'] : array();
2203 $visible_members = array_intersect(array_unique((array) $_POST[
'visible_member_ids']),$this->object->members_obj->getMembers());
2204 $passed = is_array($_POST[
'passed']) ? $_POST[
'passed'] : array();
2205 $blocked = is_array($_POST[
'blocked']) ? $_POST[
'blocked'] : array();
2213 global $ilAccess,
$ilErr,$ilUser,$rbacadmin;
2215 foreach($visible_members as $member_id)
2217 $this->
object->members_obj->updatePassed($member_id,in_array($member_id,$passed));
2221 $this->
object->members_obj->updateNotification($member_id,in_array($member_id,$notification));
2222 $this->
object->members_obj->updateBlocked($member_id,
false);
2226 $this->
object->members_obj->updateNotification($member_id,
false);
2227 $this->
object->members_obj->updateBlocked($member_id,in_array($member_id,$blocked));
2239 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
2241 $this->
object->initCourseMemberObject();
2242 $this->
object->initWaitingList();
2243 if($this->object->waiting_list_obj->getCountUsers())
2246 $f_result = array();
2247 foreach($this->object->waiting_list_obj->getAllUsers() as $waiting_data)
2252 $waiting_list_ids[] = $waiting_data[
'usr_id'];
2256 $this->
object->getId()) as $course_data)
2259 if($course_data[
'id'] != $this->object->getId() and
2260 $tmp_members->isGroupingMember($tmp_obj->getId(),$course_data[
'unique']))
2262 $message .= (
'<br /><font class="alert">'.$this->lng->txt(
'crs_member_of').
' ');
2268 $f_result[$counter][] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname().$message;
2269 $f_result[$counter][] = $tmp_obj->getLogin();
2282 if(count($this->object->members_obj->getSubscribers()))
2285 $f_result = array();
2286 foreach($this->object->members_obj->getSubscribers() as $member_id)
2288 $member_data = $this->
object->members_obj->getSubscriberData($member_id);
2293 $subscriber_ids[$counter] = $member_id;
2296 $f_result[$counter][] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();
2297 $f_result[$counter][] = $tmp_obj->getLogin();
2318 $_POST[
'members'] = array((
int)
$_GET[
'member_id']);
2334 $participants = array_unique(array_merge((array) $_POST[
'admins'],(array) $_POST[
'tutors'],(array) $_POST[
'members']));
2336 if(!count($participants))
2344 $this->tabs_gui->setTabActive(
'members');
2345 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
2347 include_once(
'./Modules/Course/classes/class.ilCourseEditParticipantsTableGUI.php');
2349 $table_gui->setTitle($this->lng->txt(
'crs_header_edit_members'),
'icon_usr.gif',$this->lng->txt(
'crs_header_edit_members'));
2352 $this->tpl->setContent($table_gui->getHTML());
2365 global $rbacsystem, $rbacreview;
2369 if(!count($_POST[
'participants']))
2376 $notifications = $_POST[
'notification'] ? $_POST[
'notification'] : array();
2377 $passed = $_POST[
'passed'] ? $_POST[
'passed'] : array();
2378 $blocked = $_POST[
'blocked'] ? $_POST[
'blocked'] : array();
2381 $hasEditPermissionAccess = $rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId());
2385 $assignableLocalCourseRoles = array();
2386 $courseAdminRoleId = null;
2387 foreach ($this->object->getLocalCourseRoles(
false) as
$title => $role_id)
2389 if (substr($title, 0, 12) ==
'il_crs_admin')
2391 $courseAdminRoleId = $role_id;
2393 $assignableLocalCourseRoles[$role_id] =
$title;
2397 foreach($_POST[
'participants'] as $usr_id)
2399 $memberIsCourseAdmin = $rbacreview->isAssigned($usr_id, $courseAdminRoleId);
2404 if (! $hasEditPermissionAccess && $memberIsCourseAdmin &&
2405 ! in_array($courseAdminRoleId, $_POST[
'roles'][$usr_id])
2408 $_POST[
'roles'][$usr_id][] = $courseAdminRoleId;
2412 foreach ((array) $_POST[
'roles'][$usr_id] as $role_id)
2414 if (! array_key_exists($role_id, $assignableLocalCourseRoles))
2420 if (!$hasEditPermissionAccess &&
2421 $role_id == $courseAdminRoleId &&
2422 ! $memberIsCourseAdmin)
2431 foreach($_POST[
'participants'] as $usr_id)
2433 $this->
object->members_obj->updateRoleAssignments($usr_id,(array) $_POST[
'roles'][$usr_id]);
2436 $this->
object->members_obj->updateNotification($usr_id,0);
2437 if(($this->object->members_obj->isTutor($usr_id) or $this->
object->members_obj->isAdmin($usr_id)) and in_array($usr_id,$notifications))
2439 $this->
object->members_obj->updateNotification($usr_id,1);
2442 $this->
object->members_obj->updateBlocked($usr_id,0);
2443 if((!$this->object->members_obj->isAdmin($usr_id) and !$this->
object->members_obj->isTutor($usr_id)) and in_array($usr_id,$blocked))
2445 $this->
object->members_obj->updateBlocked($usr_id,1);
2447 $this->
object->members_obj->updatePassed($usr_id,in_array($usr_id,$passed));
2448 $this->
object->members_obj->sendNotification(
2449 $this->object->members_obj->NOTIFY_STATUS_CHANGED,
2465 $this->
object->initCourseMemberObject();
2470 if(!isset(
$_GET[
"member_id"]) or !$this->object->members_obj->isAssigned((
int)
$_GET[
"member_id"]))
2472 $this->ilias->raiseError($this->lng->txt(
"crs_no_valid_member_id_given"),$this->ilias->error_obj->MESSAGE);
2477 $passed = $this->
object->members_obj->hasPassed((
int) $_GET[
'member_id']);
2478 $notify = $this->
object->members_obj->isNotificationEnabled((
int) $_GET[
'member_id']);
2479 $blocked = $this->
object->members_obj->isBlocked((
int) $_GET[
'member_id']);
2481 $this->
object->members_obj->updateRoleAssignments((
int) $_GET[
'member_id'],$_POST[
'roles']);
2482 $this->
object->members_obj->updatePassed((
int) $_GET[
'member_id'],(
int) $_POST[
'passed']);
2483 $this->
object->members_obj->updateNotification((
int) $_GET[
'member_id'],(
int) $_POST[
'notification']);
2484 $this->
object->members_obj->updateBlocked((
int) $_GET[
'member_id'],(
int) $_POST[
'blocked']);
2486 if($passed != $this->object->members_obj->hasPassed((
int) $_GET[
'member_id']) or
2487 $notify != $this->
object->members_obj->isNotificationEnabled((
int) $_GET[
'member_id']) or
2488 $blocked != $this->
object->members_obj->isBlocked((
int) $_GET[
'member_id']))
2490 $this->
object->members_obj->sendNotification($this->object->members_obj->NOTIFY_STATUS_CHANGED,(
int) $_GET[
'member_id']);
2504 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
2506 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2508 if(!is_array($_POST[
"user"]))
2513 $this->
object->initCourseMemberObject();
2516 foreach($_POST[
"user"] as $user_id)
2522 if($this->object->members_obj->isAssigned($user_id))
2527 $this->
object->members_obj->sendNotification($this->object->members_obj->NOTIFY_ACCEPT_USER,$user_id);
2535 unset(
$_SESSION[
'crs_usr_search_result']);
2536 $this->ctrl->redirect($this,
'members');
2549 if(!count($_POST[
"waiting"]))
2556 $this->
object->initCourseMemberObject();
2558 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2562 foreach($_POST[
"waiting"] as $user_id)
2568 if($this->object->members_obj->isAssigned($user_id))
2573 $this->
object->members_obj->sendNotification($this->object->members_obj->NOTIFY_ACCEPT_USER,$user_id);
2605 if(!count($_POST[
'waiting']))
2612 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
2615 foreach($_POST[
"waiting"] as $user_id)
2618 $this->
object->members_obj->sendNotification($this->object->members_obj->NOTIFY_DISMISS_SUBSCRIBER,$user_id);
2632 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
2634 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2637 if(!is_array(
$_SESSION[
"crs_delete_waiting_list_ids"]))
2645 $this->
object->initWaitingList();
2646 foreach(
$_SESSION[
'crs_delete_waiting_list_ids'] as $usr_id)
2648 $this->
object->waiting_list_obj->removeFromList($usr_id);
2659 global $rbacsystem,
$ilErr;
2664 if(!is_array($_POST[
"subscribers"]))
2671 $this->
object->initCourseMemberObject();
2673 if(!$this->object->members_obj->assignSubscribers($_POST[
"subscribers"]))
2681 foreach($_POST[
"subscribers"] as $usr_id)
2683 $this->
object->members_obj->sendNotification($this->object->members_obj->NOTIFY_ACCEPT_SUBSCRIBER,$usr_id);
2697 $this->
object->initCourseMemberObject();
2699 if($this->object->isSubscriptionMembershipLimited() and $this->
object->getSubscriptionMaxMembers() and
2700 $this->
object->getSubscriptionMaxMembers() <= $this->
object->members_obj->getCountMembers())
2707 if($number = $this->object->members_obj->autoFillSubscribers())
2725 $this->tabs_gui->setTabActive(
'members');
2728 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
2730 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2732 if(!is_array($_POST[
"subscriber"]) or !count($_POST[
"subscriber"]))
2742 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_editMembers.html",
'Modules/Course');
2743 $this->
object->initCourseMemberObject();
2746 $_SESSION[
"crs_delete_subscriber_ids"] = $_POST[
"subscriber"];
2749 $f_result = array();
2751 foreach($_POST[
"subscriber"] as $member_id)
2753 $member_data = $this->
object->members_obj->getSubscriberData($member_id);
2758 $f_result[$counter][] = $tmp_obj->getLogin();
2759 $f_result[$counter][] = $tmp_obj->getFirstname();
2760 $f_result[$counter][] = $tmp_obj->getLastname();
2774 $this->tabs_gui->setTabActive(
'members');
2777 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
2779 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2781 if(!is_array($_POST[
"waiting_list"]) or !count($_POST[
"waiting_list"]))
2791 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_editMembers.html",
'Modules/Course');
2792 $this->
object->initCourseMemberObject();
2793 $this->
object->initWaitingList();
2796 $_SESSION[
"crs_delete_waiting_list_ids"] = $_POST[
"waiting_list"];
2799 $f_result = array();
2801 foreach($_POST[
"waiting_list"] as $wait_id)
2803 $user_data =& $this->
object->waiting_list_obj->getUser($wait_id);
2807 $f_result[$counter][] = $tmp_obj->getLogin();
2808 $f_result[$counter][] = $tmp_obj->getFirstname();
2809 $f_result[$counter][] = $tmp_obj->getLastname();
2810 #$f_result[$counter][] = strftime("%Y-%m-%d %R",$user_data["time"]);
2822 global $rbacsystem,$ilAccess;
2825 if(!$ilAccess->checkAccess(
"leave",
'', $this->ref_id))
2827 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2830 $this->tabs_gui->setTabActive(
'crs_unsubscribe');
2831 #$this->setSubTabs('members');
2834 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_unsubscribe_sure.html",
'Modules/Course');
2837 $this->tpl->setVariable(
"UNSUB_FORMACTION",$this->ctrl->getFormAction($this));
2838 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
2839 $this->tpl->setVariable(
"CMD_SUBMIT",
'performUnsubscribe');
2840 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"crs_unsubscribe"));
2850 if(!$rbacsystem->checkAccess(
"leave", $this->ref_id))
2852 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2854 $this->
object->initCourseMemberObject();
2855 $this->
object->members_obj->delete($this->ilias->account->getId());
2856 $this->
object->members_obj->sendUnsubscribeNotificationToAdmins($this->ilias->account->getId());
2860 ilUtil::redirect(
"repository.php?ref_id=".$this->tree->getParentId($this->ref_id));
2868 $this->tabs_gui->setTabActive(
'members');
2869 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
2871 $participants = array_merge((array) $_POST[
'admins'],(array) $_POST[
'tutors'], (array) $_POST[
'members']);
2881 $this->
object->initCourseMemberObject();
2882 if(!$this->object->members_obj->checkLastAdmin($participants))
2890 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
2892 $confirm->setFormAction($this->ctrl->getFormAction($this,
'deleteMembers'));
2893 $confirm->setHeaderText($this->lng->txt(
'crs_header_delete_members'));
2894 $confirm->setConfirm($this->lng->txt(
'confirm'),
'removeMembers');
2895 $confirm->setCancel($this->lng->txt(
'cancel'),
'members');
2899 $confirm->addItem(
'participants[]',
2900 $participant[
'usr_id'],
2901 $participant[
'lastname'].
', '.$participant[
'firstname'].
' ['.$participant[
'login'].
']',
2905 $this->tpl->setContent($confirm->getHTML());
2911 global $rbacreview, $rbacsystem;
2915 if(!is_array($_POST[
"participants"]) or !count($_POST[
"participants"]))
2922 $this->
object->initCourseMemberObject();
2926 if (! $rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId()))
2929 $courseAdminRoleId = null;
2930 foreach ($this->object->getLocalCourseRoles(
false) as
$title => $role_id)
2932 if (substr($title, 0, 12) ==
'il_crs_admin')
2934 $courseAdminRoleId = $role_id;
2938 foreach ($_POST[
'participants'] as $usr_id)
2940 if ($rbacreview->isAssigned($usr_id, $courseAdminRoleId))
2949 if(!$this->object->members_obj->deleteParticipants($_POST[
"participants"]))
2959 foreach($_POST[
"participants"] as $usr_id)
2961 $this->
object->members_obj->sendNotification($this->object->members_obj->NOTIFY_DISMISS_MEMBER,$usr_id);
2976 if(!$_POST[
'subscribers'])
2983 $this->
object->initCourseMemberObject();
2985 if(!$this->object->members_obj->deleteSubscribers($_POST[
"subscribers"]))
2993 foreach($_POST[
'subscribers'] as $usr_id)
2995 $this->
object->members_obj->sendNotification($this->object->members_obj->NOTIFY_DISMISS_SUBSCRIBER,$usr_id);
3009 $this->tabs_gui->setTabActive(
'members');
3012 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
3014 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
3016 $this->
object->initCourseMemberObject();
3017 if($this->object->isSubscriptionMembershipLimited() and $this->
object->getSubscriptionMaxMembers() and
3018 $this->
object->getSubscriptionMaxMembers() <= $this->
object->members_obj->getCountMembers())
3025 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_members_search.html",
'Modules/Course');
3027 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
3028 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR",$this->lng->txt(
"crs_search_members"));
3029 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
3030 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"crs_search_str"] ?
3032 $this->tpl->setVariable(
"SEARCH_FOR",$this->lng->txt(
"exc_search_for"));
3033 $this->tpl->setVariable(
"SEARCH_ROW_TXT_USER",$this->lng->txt(
"exc_users"));
3034 $this->tpl->setVariable(
"SEARCH_ROW_TXT_GROUP",$this->lng->txt(
"exc_groups"));
3035 $this->tpl->setVariable(
"SEARCH_ROW_TXT_ROLE",$this->lng->txt(
"exc_roles"));
3036 #$this->tpl->setVariable("SEARCH_ROW_TXT_COURSE",$this->lng->txt("courses"));
3037 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
3038 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
3040 $usr = ($_POST[
"search_for"] ==
"usr" || $_POST[
"search_for"] ==
"") ? 1 : 0;
3041 $grp = ($_POST[
"search_for"] ==
"grp") ? 1 : 0;
3042 $role = ($_POST[
"search_for"] ==
"role") ? 1 : 0;
3047 #$this->tpl->setVariable("SEARCH_ROW_CHECK_COURSE",ilUtil::formRadioButton(0,"search_for",$this->SEARCH_COURSE));
3054 $tmp_array = array();
3057 if(is_array($result))
3059 $tmp_array[] = $result[
'id'];
3068 $_SESSION[
'crs_usr_search_result'] = array_unique(array_merge((array)
$_SESSION[
'crs_usr_search_result'],$tmp_array));
3069 return $_SESSION[
'crs_usr_search_result'];
3074 $_SESSION[
'crs_usr_search_result'] = array();
3081 global $rbacsystem,
$tree;
3083 $this->tabs_gui->setTabActive(
'members');
3085 #$this->__unsetSessionVariables();
3088 $_SESSION[
"crs_search_str"] = $_POST[
"search_str"] = $_POST[
"search_str"]
3089 ? $_POST[
"search_str"]
3091 $_SESSION[
"crs_search_for"] = $_POST[
"search_for"] = $_POST[
"search_for"]
3092 ? $_POST[
"search_for"]
3097 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
3099 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
3101 $this->
object->initCourseMemberObject();
3103 if(!isset($_POST[
"search_for"]) or !isset($_POST[
"search_str"]))
3110 if(!count(
$result = $this->
__search($_POST[
"search_str"],$_POST[
"search_for"])))
3118 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_usr_selection.html",
'Modules/Course');
3119 #$this->__showButton("searchUser",$this->lng->txt("crs_new_search"));
3122 $f_result = array();
3123 switch($_POST[
"search_for"])
3132 $user_ids[$counter] =
$user;
3135 $f_result[$counter][] = $tmp_obj->getLogin();
3136 $f_result[$counter][] = $tmp_obj->getFirstname();
3137 $f_result[$counter][] = $tmp_obj->getLastname();
3149 if(!$tree->isInTree($group[
"id"]))
3158 $grp_ids[$counter] = $group[
"id"];
3161 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
3162 $f_result[$counter][] = $tmp_obj->getCountMembers();
3175 if ($role[
"id"] == ANONYMOUS_ROLE_ID)
3186 if ($tmp_obj->getCountMembers() == 0)
3191 $role_ids[$counter] = $role[
"id"];
3194 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
3195 $f_result[$counter][] = $tmp_obj->getCountMembers();
3209 global $rbacsystem,
$tree;
3211 $this->tabs_gui->setTabActive(
'members');
3213 $_SESSION[
"crs_group"] = $_POST[
"group"] = $_POST[
"group"] ? $_POST[
"group"] :
$_SESSION[
"crs_group"];
3216 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
3218 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
3220 if(!is_array($_POST[
"group"]))
3228 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_usr_selection.html",
'Modules/Course');
3229 #$this->__showButton("searchUser",$this->lng->txt("crs_new_search"));
3230 $this->
object->initCourseMemberObject();
3234 foreach($_POST[
"group"] as $group_id)
3236 if(!$tree->isInTree($group_id))
3244 $members = array_merge($tmp_obj->getGroupMemberIds(),$members);
3248 $members = array_unique($members);
3253 $f_result = array();
3254 foreach($members as
$user)
3261 $user_ids[$counter] =
$user;
3264 $f_result[$counter][] = $tmp_obj->getLogin();
3265 $f_result[$counter][] = $tmp_obj->getLastname();
3266 $f_result[$counter][] = $tmp_obj->getFirstname();
3278 global $rbacsystem,$rbacreview,
$tree;
3280 $this->tabs_gui->setTabActive(
'members');
3282 $_SESSION[
"crs_role"] = $_POST[
"role"] = $_POST[
"role"] ? $_POST[
"role"] :
$_SESSION[
"crs_role"];
3285 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
3287 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
3289 if(!is_array($_POST[
"role"]))
3297 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_usr_selection.html",
'Modules/Course');
3298 #$this->__showButton("searchUser",$this->lng->txt("crs_new_search"));
3299 $this->
object->initCourseMemberObject();
3303 foreach($_POST[
"role"] as $role_id)
3305 $members = array_merge($rbacreview->assignedUsers($role_id),$members);
3308 $members = array_unique($members);
3313 $f_result = array();
3314 foreach($members as
$user)
3321 $user_ids[$counter] =
$user;
3324 $f_result[$counter][] = $tmp_obj->getLogin();
3325 $f_result[$counter][] = $tmp_obj->getLastname();
3326 $f_result[$counter][] = $tmp_obj->getFirstname();
3338 global $rbacsystem,$ilAccess,$ilUser;
3340 $this->
object->initCourseMemberObject();
3342 $this->ctrl->setParameter($this,
"ref_id",$this->ref_id);
3344 if($ilAccess->checkAccess(
'read',
'',$this->ref_id))
3346 $tabs_gui->addTarget(
'view_content',
3347 $this->ctrl->getLinkTarget($this,
''));
3349 if ($ilAccess->checkAccess(
'visible',
'',$this->ref_id))
3356 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilinfoscreengui"
3357 || strtolower(
$_GET[
"cmdClass"]) ==
"ilnotegui")
3360 $tabs_gui->addTarget(
"info_short",
3361 $this->ctrl->getLinkTargetByClass(
3362 array(
"ilobjcoursegui",
"ilinfoscreengui"),
"showSummary"),
3364 "",
"", $force_active);
3366 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3368 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilconditionhandlerinterface"
3369 &&
$_GET[
"item_id"] ==
"")
3372 $tabs_gui->addTarget(
"settings",
3373 $this->ctrl->getLinkTarget($this,
"edit"),
3374 array(
"edit",
"editMapSettings",
"editCourseIcons",
"listStructure"),
"",
"", $force_active);
3378 if ($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3380 $tabs_gui->addTarget(
"meta_data",
3381 $this->ctrl->getLinkTargetByClass(array(
'ilobjcoursegui',
'ilmdeditorgui'),
'listSection'),
3387 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3389 $tabs_gui->addTarget(
"members",
3390 $this->ctrl->getLinkTarget($this,
"members"),
3394 elseif ($ilAccess->checkAccess(
'read',
'',$this->ref_id) &&
3395 $this->
object->getShowMembers() == $this->
object->SHOW_MEMBERS_ENABLED &&
3396 $ilUser->getId() != ANONYMOUS_USER_ID)
3398 $tabs_gui->addTarget(
"members",
3399 $this->ctrl->getLinkTarget($this,
"membersGallery"),
3406 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
3408 include_once(
'./Modules/Course/classes/class.ilCourseObjective.php');
3411 $force_active = (strtolower(
$_GET[
"cmdClass"]) ==
"ilcourseobjectivesgui")
3414 $tabs_gui->addTarget(
"crs_objectives",
3415 $this->ctrl->getLinkTarget($this,
"listObjectives"),
3417 get_class($this),
"", $force_active);
3423 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
3426 $tabs_gui->addTarget(
'learning_progress',
3427 $this->ctrl->getLinkTargetByClass(array(
'ilobjcoursegui',
'illearningprogressgui'),
''),
3429 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
3432 if ($ilAccess->checkAccess(
'edit_permission',
'',$this->ref_id))
3434 $tabs_gui->addTarget(
"perm_settings",
3435 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
3436 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
3439 if ($this->ctrl->getTargetScript() ==
"adm_object.php")
3441 $tabs_gui->addTarget(
"show_owner",
3442 $this->ctrl->getLinkTarget($this,
"owner"),
"owner", get_class($this));
3444 if ($this->tree->getSavedNodeData($this->ref_id))
3446 $tabs_gui->addTarget(
"trash",
3447 $this->ctrl->getLinkTarget($this,
"trash"),
"trash", get_class($this));
3450 if($ilAccess->checkAccess(
'join',
'join',$this->ref_id)
3451 and !$this->
object->members_obj->isAssigned($ilUser->getId()))
3453 $tabs_gui->addTarget(
"join",
3454 $this->ctrl->getLinkTargetByClass(
'ilcourseregistrationgui',
"show"),
3458 if($ilAccess->checkAccess(
'leave',
'',$this->object->getRefId())
3459 and $this->object->members_obj->isMember($ilUser->getId()))
3461 $tabs_gui->addTarget(
"crs_unsubscribe",
3462 $this->ctrl->getLinkTarget($this,
"unsubscribe"),
3471 foreach($a_members as $member_id)
3474 $member_data = $this->
object->members_obj->getSubscriberData($member_id);
3478 $print_member[$member_id][
'login'] = $tmp_obj->getLogin();
3479 $print_member[$member_id][
'name'] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();
3501 global $ilAccess,
$lng;
3503 $lng->loadLanguageModule(
'trac');
3505 #$is_admin = (bool) $ilAccess->checkAccess("write",'',$this->object->getRefId());
3508 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3511 if($privacy->enabledCourseAccessTimes())
3513 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
3517 if($this->show_tracking)
3519 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
3526 foreach($a_members as $member_id)
3531 $print_member[$member_id][
'login'] = $tmp_obj->getLogin();
3532 $print_member[$member_id][
'name'] = $tmp_obj->getLastname().
', '.$tmp_obj->getFirstname();
3534 if($this->object->members_obj->isAdmin($member_id))
3536 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_admin");
3538 elseif($this->object->members_obj->isTutor($member_id))
3540 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_tutor");
3542 elseif($this->object->members_obj->isMember($member_id))
3544 $print_member[$member_id][
'role'] = $this->lng->txt(
"il_crs_member");
3546 if($this->object->members_obj->isAdmin($member_id) or $this->
object->members_obj->isTutor($member_id))
3548 if($this->object->members_obj->isNotificationEnabled($member_id))
3550 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_notify");
3554 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_no_notify");
3559 if($this->object->members_obj->isBlocked($member_id))
3561 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_blocked");
3565 $print_member[$member_id][
'status'] = $this->lng->txt(
"crs_unblocked");
3571 $print_member[$member_id][
'passed'] = $this->
object->members_obj->hasPassed($member_id) ?
3572 $this->lng->txt(
'crs_member_passed') :
3573 $this->lng->txt(
'crs_member_not_passed');
3576 if($privacy->enabledCourseAccessTimes())
3578 if(isset($progress[$member_id][
'ts']) and $progress[$member_id][
'ts'])
3580 $print_member[$member_id][
'access'] =
ilFormat::formatDate($progress[$member_id][
'ts'],
'datetime',
true);
3584 $print_member[$member_id][
'access'] = $this->lng->txt(
'no_date');
3587 if($this->show_tracking)
3589 if(in_array($member_id,$completed))
3593 elseif(in_array($member_id,$in_progress))
3597 elseif(in_array($member_id,
$failed))
3628 case 'notification':
3644 $tpl =
new ilTemplate(
'tpl.crs_members_print.html',
true,
true,
'Modules/Course');
3646 $this->
object->initCourseMemberObject();
3648 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3650 if($privacy->enabledCourseAccessTimes())
3652 include_once(
'./Services/Tracking/classes/class.ilLearningProgress.php');
3656 include_once
'./Services/Tracking/classes/class.ilObjUserTracking.php';
3657 include_once(
'./Services/Tracking/classes/class.ilLPObjSettings.php');
3664 if(count($members = $this->object->members_obj->getParticipants()))
3668 foreach($members as $member_data)
3670 if($this->show_tracking)
3672 $tpl->setCurrentBlock(
'progress_row');
3673 $tpl->setVariable(
'VAL_PROGRESS',$member_data[
'progress']);
3674 $tpl->parseCurrentBlock();
3677 if($privacy->enabledCourseAccessTimes())
3679 $tpl->setCurrentBlock(
'access_row');
3680 $tpl->setVariable(
'VAL_ACCESS',$member_data[
'access']);
3681 $tpl->parseCurrentBlock();
3683 $tpl->setCurrentBlock(
"members_row");
3684 $tpl->setVariable(
"LOGIN",$member_data[
'login']);
3685 $tpl->setVariable(
"NAME",$member_data[
'name']);
3686 $tpl->setVariable(
"ROLE",$member_data[
'role']);
3687 $tpl->setVariable(
"STATUS",$member_data[
'status']);
3688 $tpl->setVariable(
"PASSED",$member_data[
'passed']);
3692 $tpl->setVariable(
"STATUS",$member_data[
'status']);
3693 $tpl->setVariable(
"PASSED",$member_data[
'passed']);
3695 $tpl->parseCurrentBlock();
3698 $tpl->setCurrentBlock(
"members");
3700 $tpl->setVariable(
"MEMBERS_IMG_ALT",$this->lng->txt(
'crs_header_members'));
3701 $tpl->setVariable(
"MEMBERS_TABLE_HEADER",$this->lng->txt(
'crs_members_table'));
3702 $tpl->setVariable(
"TXT_LOGIN",$this->lng->txt(
'username'));
3703 $tpl->setVariable(
"TXT_NAME",$this->lng->txt(
'name'));
3704 $tpl->setVariable(
"TXT_ROLE",$this->lng->txt(
'crs_role'));
3706 if($this->show_tracking)
3708 $tpl->setCurrentBlock(
'progress');
3709 $tpl->setVariable(
'TXT_PROGRESS',$this->lng->txt(
'learning_progress'));
3710 $tpl->parseCurrentBlock();
3713 if($privacy->enabledCourseAccessTimes())
3715 $tpl->setCurrentBlock(
'access');
3716 $tpl->setVariable(
'TXT_ACCESS',$this->lng->txt(
'last_access'));
3717 $tpl->parseCurrentBlock();
3723 $tpl->setVariable(
"TXT_STATUS",$this->lng->txt(
'crs_status'));
3724 $tpl->setVariable(
"TXT_PASSED",$this->lng->txt(
'crs_passed'));
3727 $tpl->parseCurrentBlock();
3731 if(count($members = $this->object->members_obj->getSubscribers()))
3734 foreach($members as $member_data)
3736 $tpl->setCurrentBlock(
"subscribers_row");
3737 $tpl->setVariable(
"SLOGIN",$member_data[
'login']);
3738 $tpl->setVariable(
"SNAME",$member_data[
'name']);
3739 $tpl->setVariable(
"STIME",$member_data[
"time"]);
3740 $tpl->parseCurrentBlock();
3743 $tpl->setCurrentBlock(
"subscribers");
3745 $tpl->setVariable(
"SUBSCRIBERS_IMG_ALT",$this->lng->txt(
'crs_subscribers'));
3746 $tpl->setVariable(
"SUBSCRIBERS_TABLE_HEADER",$this->lng->txt(
'crs_subscribers'));
3747 $tpl->setVariable(
"TXT_SLOGIN",$this->lng->txt(
'username'));
3748 $tpl->setVariable(
"TXT_SNAME",$this->lng->txt(
'name'));
3749 $tpl->setVariable(
"TXT_STIME",$this->lng->txt(
'crs_time'));
3750 $tpl->parseCurrentBlock();
3754 $tpl->setVariable(
"TITLE",$this->lng->txt(
'crs_members_print_title'));
3757 $headline = $this->lng->txt(
'obj_crs').
': '.$this->
object->getTitle().
3760 $tpl->setVariable(
"HEADLINE",$headline);
3773 global $rbacsystem,
$ilErr, $ilAccess, $ilUser;
3775 $is_admin = (bool) $ilAccess->checkAccess(
"write",
"", $this->object->getRefId());
3778 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_DISABLED)
3780 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
3784 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_members_gallery.html',
'Modules/Course');
3787 $this->tabs_gui->setTabActive(
'members');
3788 $this->tabs_gui->setSubTabActive(
'crs_members_gallery');
3790 $this->
object->initCourseMemberObject();
3793 if(count($members = $this->object->members_obj->getParticipants()))
3795 $ordered_members = array();
3797 foreach($members as $member_id)
3807 array_push($ordered_members,array(
"id" => $member_id,
3808 "login" => $usr_obj->getLogin(),
3809 "lastname" => $usr_obj->getLastName(),
3810 "firstname" => $usr_obj->getFirstName(),
3811 "sortlastname" => strtoupper($usr_obj->getLastName()).strtoupper($usr_obj->getFirstName()),
3812 "usr_obj" => $usr_obj));
3817 foreach($ordered_members as $member)
3819 $usr_obj = $member[
"usr_obj"];
3821 $public_profile = $usr_obj->getPref(
"public_profile");
3824 $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui",
"user", $member[
"id"]);
3825 $profile_target = $this->ctrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML");
3828 $file = $usr_obj->getPersonalPicturePath(
"xsmall");
3830 if($this->object->members_obj->isAdmin($member[
"id"]) or $this->
object->members_obj->isTutor($member[
"id"]))
3832 if ($public_profile ==
"y")
3834 $this->tpl->setCurrentBlock(
"tutor_linked");
3835 $this->tpl->setVariable(
"LINK_PROFILE", $profile_target);
3836 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3837 $this->tpl->parseCurrentBlock();
3841 $this->tpl->setCurrentBlock(
"tutor_not_linked");
3842 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3843 $this->tpl->parseCurrentBlock();
3845 $this->tpl->setCurrentBlock(
"tutor");
3849 if ($public_profile ==
"y")
3851 $this->tpl->setCurrentBlock(
"member_linked");
3852 $this->tpl->setVariable(
"LINK_PROFILE", $profile_target);
3853 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3854 $this->tpl->parseCurrentBlock();
3858 $this->tpl->setCurrentBlock(
"member_not_linked");
3859 $this->tpl->setVariable(
"SRC_USR_IMAGE",
$file);
3860 $this->tpl->parseCurrentBlock();
3862 $this->tpl->setCurrentBlock(
"member");
3866 if ($public_profile ==
"y")
3868 $this->tpl->setVariable(
"FIRSTNAME", $member[
"firstname"]);
3869 $this->tpl->setVariable(
"LASTNAME", $member[
"lastname"]);
3871 $this->tpl->setVariable(
"LOGIN", $member[
"login"]);
3872 $this->tpl->parseCurrentBlock();
3875 $this->tpl->setCurrentBlock(
"members");
3876 $this->tpl->setVariable(
"MEMBERS_TABLE_HEADER",$this->lng->txt(
'crs_members_title'));
3877 $this->tpl->parseCurrentBlock();
3881 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'crs_members_print_title'));
3884 $headline = $this->
object->getTitle().
"<br/>".$this->
object->getDescription();
3886 $this->tpl->setVariable(
"HEADLINE",$headline);
3895 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3906 $offset =
$_GET[
"update_members"] ?
$_GET[
"offset"] : 0;
3907 $order =
$_GET[
"update_members"] ?
$_GET[
"sort_by"] :
'login';
3908 $direction =
$_GET[
"update_members"] ?
$_GET[
"sort_order"] :
'';
3912 $offset =
$_GET[
"update_subscribers"] ?
$_GET[
"offset"] : 0;
3913 $order =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_by"] :
'sub_time';
3914 $direction =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_order"] :
'';
3918 $offset =
$_GET[
"offset"];
3919 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3920 $direction =
$_GET[
"sort_order"];
3924 $offset =
$_GET[
"offset"];
3925 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3926 $direction =
$_GET[
"sort_order"];
3930 $offset =
$_GET[
"offset"];
3932 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
3934 $_GET[
"sort_by"] =
"login";
3936 $order =
$_GET[
"sort_by"];
3937 $direction =
$_GET[
"sort_order"];
3941 $tbl->setOrderColumn($order);
3942 $tbl->setOrderDirection($direction);
3943 $tbl->setOffset($offset);
3944 $tbl->setLimit(
$_GET[
"limit"]);
3945 $tbl->setMaxCount(count($result_set));
3946 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3947 $tbl->setData($result_set);
3955 $return_to =
"searchUser";
3957 if ($a_cmd ==
"listUsersRole" or $a_cmd ==
"listUsersGroup")
3959 $return_to =
"search";
3962 $this->
__showButton($return_to,$this->lng->txt(
"back"));
3966 $tpl =& $tbl->getTemplateObject();
3970 $tpl->setCurrentBlock(
"tbl_form_header");
3971 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3972 $tpl->parseCurrentBlock();
3974 $tpl->setCurrentBlock(
"tbl_action_btn");
3975 $tpl->setVariable(
"BTN_NAME",
"assignMembers");
3976 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"add"));
3977 $tpl->parseCurrentBlock();
3979 $tpl->setCurrentBlock(
"plain_button");
3980 $tpl->setVariable(
"PBTN_NAME",
'searchUser');
3981 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
'append_search'));
3982 $tpl->parseCurrentBlock();
3984 $tpl->setCurrentBlock(
"plain_button");
3985 $tpl->setVariable(
"PBTN_NAME",
'cancelSearch');
3986 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"crs_new_search"));
3987 $tpl->parseCurrentBlock();
3989 if (!empty($a_user_ids))
3992 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
3993 $tpl->setVariable(
"JS_VARNAME",
"user");
3995 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
3996 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
3997 $tpl->parseCurrentBlock();
4000 $tpl->setCurrentBlock(
"tbl_action_row");
4001 $tpl->setVariable(
"COLUMN_COUNTS",5);
4003 $tpl->parseCurrentBlock();
4005 $tbl->setTitle($this->lng->txt(
"crs_header_edit_members"),
"icon_usr_b.gif",$this->lng->txt(
"crs_header_edit_members"));
4006 $tbl->setHeaderNames(array(
"",
4007 $this->lng->txt(
"username"),
4008 $this->lng->txt(
"firstname"),
4009 $this->lng->txt(
"lastname")));
4010 $tbl->setHeaderVars(array(
"",
4014 array(
"ref_id" => $this->object->getRefId(),
4016 "cmdClass" =>
"ilobjcoursegui",
4017 "cmdNode" =>
$_GET[
"cmdNode"]));
4019 $tbl->setColumnWidth(array(
"",
"33%",
"33%",
"33%"));
4024 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
4031 $this->
__showButton(
'searchUser',$this->lng->txt(
"back"));
4034 $tpl =& $tbl->getTemplateObject();
4036 $tpl->setCurrentBlock(
"tbl_form_header");
4037 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
4038 $tpl->parseCurrentBlock();
4040 $tpl->setCurrentBlock(
"tbl_action_btn");
4041 $tpl->setVariable(
"BTN_NAME",
"listUsersGroup");
4042 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"crs_list_users"));
4043 $tpl->parseCurrentBlock();
4045 if (!empty($a_grp_ids))
4048 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
4049 $tpl->setVariable(
"JS_VARNAME",
"group");
4051 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
4052 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
4053 $tpl->parseCurrentBlock();
4056 $tpl->setCurrentBlock(
"tbl_action_row");
4057 $tpl->setVariable(
"COLUMN_COUNTS",5);
4059 $tpl->parseCurrentBlock();
4061 $tbl->setTitle($this->lng->txt(
"crs_header_edit_members"),
"icon_usr_b.gif",$this->lng->txt(
"crs_header_edit_members"));
4062 $tbl->setHeaderNames(array(
"",
4063 $this->lng->txt(
"obj_grp"),
4064 $this->lng->txt(
"crs_count_members")));
4065 $tbl->setHeaderVars(array(
"",
4068 array(
"ref_id" => $this->object->getRefId(),
4070 "cmdClass" =>
"ilobjcoursegui",
4071 "cmdNode" =>
$_GET[
"cmdNode"]));
4073 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
4079 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
4086 $this->
__showButton(
'searchUser',$this->lng->txt(
"back"));
4089 $tpl =& $tbl->getTemplateObject();
4091 $tpl->setCurrentBlock(
"tbl_form_header");
4092 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
4093 $tpl->parseCurrentBlock();
4095 $tpl->setCurrentBlock(
"tbl_action_btn");
4096 $tpl->setVariable(
"BTN_NAME",
"searchUser");
4097 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
4098 $tpl->parseCurrentBlock();
4100 $tpl->setCurrentBlock(
"tbl_action_btn");
4101 $tpl->setVariable(
"BTN_NAME",
"listUsersRole");
4102 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"crs_list_users"));
4103 $tpl->parseCurrentBlock();
4105 if (!empty($a_role_ids))
4108 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
4109 $tpl->setVariable(
"JS_VARNAME",
"role");
4111 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
4112 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
4113 $tpl->parseCurrentBlock();
4116 $tpl->setCurrentBlock(
"tbl_action_row");
4117 $tpl->setVariable(
"COLUMN_COUNTS",5);
4119 $tpl->parseCurrentBlock();
4121 $tbl->setTitle($this->lng->txt(
"crs_header_edit_members"),
"icon_usr_b.gif",$this->lng->txt(
"crs_header_edit_members"));
4122 $tbl->setHeaderNames(array(
"",
4123 $this->lng->txt(
"obj_grp"),
4124 $this->lng->txt(
"crs_count_members")));
4125 $tbl->setHeaderVars(array(
"",
4128 array(
"ref_id" => $this->object->getRefId(),
4130 "cmdClass" =>
"ilobjcoursegui",
4131 "cmdNode" =>
$_GET[
"cmdNode"]));
4133 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
4139 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
4148 $tpl =& $tbl->getTemplateObject();
4150 $tpl->setCurrentBlock(
"tbl_form_header");
4151 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
4152 $tpl->parseCurrentBlock();
4153 $tpl->setCurrentBlock(
"tbl_action_btn");
4154 $tpl->setVariable(
"BTN_NAME",
"cancelMember");
4155 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
4156 $tpl->parseCurrentBlock();
4157 $tpl->setCurrentBlock(
"tbl_action_btn");
4158 $tpl->setVariable(
"BTN_NAME",
"performRemoveFromWaitingList");
4159 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
4160 $tpl->parseCurrentBlock();
4161 $tpl->setCurrentBlock(
"tbl_action_row");
4162 $tpl->setVariable(
"COLUMN_COUNTS",4);
4164 $tpl->parseCurrentBlock();
4166 $tbl->setTitle($this->lng->txt(
"crs_header_remove_from_waiting_list"),
"icon_usr_b.gif",
4167 $this->lng->txt(
"crs_header_remove_from_waiting_list"));
4168 $tbl->setHeaderNames(array($this->lng->txt(
"username"),
4169 $this->lng->txt(
"firstname"),
4170 $this->lng->txt(
"lastname"),
4171 $this->lng->txt(
"crs_time")));
4172 $tbl->setHeaderVars(array(
"login",
4176 array(
"ref_id" => $this->object->getRefId(),
4178 "cmdClass" =>
"ilobjcoursegui",
4179 "cmdNode" =>
$_GET[
"cmdNode"]));
4181 $tbl->setColumnWidth(array(
"25%",
"25%",
"25%",
"25%"));
4186 $this->tpl->setVariable(
"EDIT_MEMBER_TABLE",$tbl->tpl->get());
4194 $tpl =& $tbl->getTemplateObject();
4196 $tpl->setCurrentBlock(
"tbl_form_header");
4197 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
4198 $tpl->parseCurrentBlock();
4199 $tpl->setCurrentBlock(
"tbl_action_btn");
4200 $tpl->setVariable(
"BTN_NAME",
"removeSubscribers");
4201 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"delete"));
4202 $tpl->parseCurrentBlock();
4203 $tpl->setCurrentBlock(
"tbl_action_btn");
4204 $tpl->setVariable(
"BTN_NAME",
"cancelMember");
4205 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
4206 $tpl->parseCurrentBlock();
4207 $tpl->setCurrentBlock(
"tbl_action_row");
4208 $tpl->setVariable(
"COLUMN_COUNTS",4);
4210 $tpl->parseCurrentBlock();
4212 $tbl->setTitle($this->lng->txt(
"crs_header_delete_subscribers"),
"icon_usr_b.gif",$this->lng->txt(
"crs_header_delete_members"));
4213 $tbl->setHeaderNames(array($this->lng->txt(
"username"),
4214 $this->lng->txt(
"firstname"),
4215 $this->lng->txt(
"lastname"),
4216 $this->lng->txt(
"crs_time")));
4217 $tbl->setHeaderVars(array(
"login",
4221 array(
"ref_id" => $this->object->getRefId(),
4223 "cmdClass" =>
"ilobjcoursegui",
4224 "cmdNode" =>
$_GET[
"cmdNode"]));
4226 $tbl->setColumnWidth(array(
"25%",
"25%",
"25%",
"25%"));
4231 $this->tpl->setVariable(
"EDIT_MEMBER_TABLE",$tbl->tpl->get());
4240 $actions = array(
"addSubscribers" => $this->lng->txt(
"crs_add_subscribers"),
4241 "deleteSubscribers" => $this->lng->txt(
"crs_delete_subscribers"));
4244 $tpl =& $tbl->getTemplateObject();
4247 $tpl->setCurrentBlock(
"tbl_action_row");
4250 $tpl->setCurrentBlock(
"plain_button");
4251 $tpl->setVariable(
"PBTN_NAME",
"autoFill");
4252 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"crs_auto_fill"));
4253 $tpl->parseCurrentBlock();
4254 $tpl->setCurrentBlock(
"plain_buttons");
4255 $tpl->parseCurrentBlock();
4257 $tpl->setVariable(
"COLUMN_COUNTS",4);
4261 $tpl->setCurrentBlock(
"tbl_action_select");
4263 $tpl->setVariable(
"BTN_NAME",
"gateway");
4264 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"execute"));
4265 $tpl->parseCurrentBlock();
4267 $tbl->enable(
'select_all');
4268 $tbl->setFormName(
"subscriber_form");
4269 $tbl->setSelectAllCheckbox(
"subscriber");
4271 $tpl->setCurrentBlock(
"tbl_action_row");
4272 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
4273 $tpl->parseCurrentBlock();
4276 $tbl->setTitle($this->lng->txt(
"crs_subscribers"),
"icon_usr.gif",$this->lng->txt(
"crs_header_members"));
4277 $tbl->setHeaderNames(array(
'',
4278 $this->lng->txt(
"name"),
4279 $this->lng->txt(
"login"),
4280 $this->lng->txt(
"crs_time")));
4281 $tbl->setHeaderVars(array(
"",
4285 array(
"ref_id" => $this->object->getRefId(),
4287 "update_subscribers" => 1,
4288 "cmdClass" =>
"ilobjcoursegui",
4289 "cmdNode" =>
$_GET[
"cmdNode"]));
4290 $tbl->setColumnWidth(array(
'1%'));
4295 $this->tpl->setCurrentBlock(
'sub_wait_table');
4296 $this->tpl->setVariable(
'SUB_WAIT_NAME',
'subscriber_form');
4297 $this->tpl->setVariable(
'SUB_WAIT_FORMACTION',$this->ctrl->getFormAction($this));
4298 $this->tpl->setVariable(
"SUB_WAIT_TABLE_CONTENT",$tbl->tpl->get());
4299 $this->tpl->parseCurrentBlock();
4305 $actions = array(
"addFromWaitingList" => $this->lng->txt(
"crs_add_subscribers"),
4306 "removeFromWaitingList" => $this->lng->txt(
"crs_delete_from_waiting_list"));
4309 $tpl =& $tbl->getTemplateObject();
4311 $tbl->enable(
'select_all');
4312 $tbl->setFormName(
"wait_form");
4313 $tbl->setSelectAllCheckbox(
"waiting_list");
4317 $tpl->setCurrentBlock(
"tbl_action_row");
4319 $tpl->setVariable(
"COLUMN_COUNTS",5);
4323 $tpl->setCurrentBlock(
"tbl_action_select");
4325 $tpl->setVariable(
"BTN_NAME",
"gateway");
4326 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"execute"));
4327 $tpl->parseCurrentBlock();
4329 $tpl->setCurrentBlock(
"tbl_action_row");
4330 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
4331 $tpl->parseCurrentBlock();
4334 $tbl->setTitle($this->lng->txt(
"crs_waiting_list"),
"icon_usr.gif",$this->lng->txt(
"crs_waiting_list"));
4335 $tbl->setHeaderNames(array(
'',
4336 $this->lng->txt(
"name"),
4337 $this->lng->txt(
"login"),
4338 $this->lng->txt(
"crs_time")));
4339 $tbl->setHeaderVars(array(
"",
4343 array(
"ref_id" => $this->object->getRefId(),
4345 "update_subscribers" => 1,
4346 "cmdClass" =>
"ilobjcoursegui",
4347 "cmdNode" =>
$_GET[
"cmdNode"]));
4348 $tbl->setColumnWidth(array(
'1%'));
4353 $this->tpl->setCurrentBlock(
'sub_wait_table');
4354 $this->tpl->setVariable(
'SUB_WAIT_NAME',
'wait_form');
4355 $this->tpl->setVariable(
'SUB_WAIT_FORMACTION',$this->ctrl->getFormAction($this));
4356 $this->tpl->setVariable(
"SUB_WAIT_TABLE_CONTENT",$tbl->tpl->get());
4357 $this->tpl->parseCurrentBlock();
4364 include_once(
"./classes/class.ilSearch.php");
4366 $this->lng->loadLanguageModule(
"content");
4369 $search->setPerformUpdate(
false);
4370 $search->setMinWordLength(1);
4371 $search->setSearchString($a_search_string);
4372 $search->setCombination(
"and");
4373 $search->setSearchFor(array(0 => $a_search_for));
4374 $search->setSearchType(
'new');
4377 if($search->validate($message))
4379 $search->performSearch();
4384 $this->ctrl->redirect($this,
"searchUser");
4387 if($a_search_for ==
'usr')
4390 return $_SESSION[
'crs_usr_search_result'];
4393 return $search->getResultByType($a_search_for);
4402 for($i=0;$i<=60;$i++)
4404 $days[$i] = $i < 10 ?
"0".$i : $i;
4409 for($i=0;$i<24;$i++)
4411 $days[$i] = $i < 10 ?
"0".$i : $i;
4416 for($i=1;$i<32;$i++)
4418 $days[$i] = $i < 10 ?
"0".$i : $i;
4423 for($i=1;$i<13;$i++)
4425 $month[$i] = $i < 10 ?
"0".$i : $i;
4430 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
4440 return mktime($a_time_arr[
"hour"],
4441 $a_time_arr[
"minute"],
4442 $a_time_arr[
"second"],
4443 $a_time_arr[
"month"],
4445 $a_time_arr[
"year"]);
4449 unset(
$_SESSION[
"crs_delete_member_ids"]);
4450 unset(
$_SESSION[
"crs_delete_subscriber_ids"]);
4460 global $rbacreview,
$ilErr, $ilAccess, $ilObjDataCache;
4461 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
4464 $is_admin = (bool) $ilAccess->checkAccess(
"write",
"", $this->object->getRefId());
4467 $this->object->getShowMembers() == $this->
object->SHOW_MEMBERS_DISABLED)
4469 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
4473 $this->tabs_gui->setTabActive(
'members');
4474 $this->tabs_gui->setSubTabActive(
'mail_members');
4476 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.mail_members.html',
'Modules/Course');
4479 $this->tpl->setVariable(
"MAILACTION",
'ilias.php?baseClass=ilmailgui&type=role');
4480 $this->tpl->setVariable(
"SELECT_ACTION",
'ilias.php?baseClass=ilmailgui&view=my_courses&search_crs='.$this->object->getId());
4481 $this->tpl->setVariable(
"MAIL_SELECTED",$this->lng->txt(
'send_mail_selected'));
4482 $this->tpl->setVariable(
"MAIL_MEMBERS",$this->lng->txt(
'send_mail_members'));
4483 $this->tpl->setVariable(
"MAIL_TUTOR",$this->lng->txt(
'send_mail_tutors'));
4484 $this->tpl->setVariable(
"MAIL_ADMIN",$this->lng->txt(
'send_mail_admins'));
4486 $this->tpl->setVariable(
"OK",$this->lng->txt(
'ok'));
4489 $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
4490 $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder[
'ref_id'],
false);
4493 $sorted_role_ids = array();
4495 foreach($role_ids as $role_id)
4500 $sorted_role_ids[2] = $role_id;
4504 $sorted_role_ids[1] = $role_id;
4508 $sorted_role_ids[0] = $role_id;
4512 $sorted_role_ids[$counter++] = $role_id;
4516 ksort($sorted_role_ids,SORT_NUMERIC);
4517 foreach ((array) $sorted_role_ids as $role_id)
4519 $this->tpl->setCurrentBlock(
"mailbox_row");
4520 $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
4522 htmlspecialchars($role_addr)
4527 $this->tpl->setVariable(
"MAILBOX",$role_addr);
4532 $this->tpl->setVariable(
"MAILBOX",
ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)).
" (" . $role_addr .
")");
4535 $this->tpl->parseCurrentBlock();
4541 global $rbacsystem,$ilUser,$ilAccess,
$ilErr,$ilTabs,$ilNavigationHistory;
4543 $next_class = $this->ctrl->getNextClass($this);
4544 $cmd = $this->ctrl->getCmd();
4550 $ilAccess->checkAccess(
'read',
'',
$_GET[
'ref_id']))
4552 $ilNavigationHistory->addItem(
$_GET[
'ref_id'],
4553 'repository.php?cmd=frameset&ref_id='.
$_GET[
'ref_id'],
'crs');
4558 include_once
'payment/classes/class.ilPaymentObject.php';
4562 $ilTabs->setTabActive(
'info_short');
4564 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
4565 $this->ctrl->setReturn($this,
'');
4567 $this->ctrl->forwardCommand($pp_gui);
4574 case "ilinfoscreengui":
4578 case 'ilmdeditorgui':
4579 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
4581 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
4582 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
4584 $this->ctrl->forwardCommand($md_gui);
4585 $this->tabs_gui->setTabActive(
'meta_data');
4588 case 'ilcourseregistrationgui':
4589 $this->ctrl->setReturn($this,
'');
4590 $this->tabs_gui->setTabActive(
'join');
4591 include_once(
'./Modules/Course/classes/class.ilCourseRegistrationGUI.php');
4593 $this->ctrl->forwardCommand($registration);
4596 case 'ilcourseuserfieldsgui':
4597 include_once
'Modules/Course/classes/Export/class.ilCourseUserFieldsGUI.php';
4601 $this->tabs_gui->setTabActive(
'settings');
4602 $this->ctrl->forwardCommand($cdf_gui);
4605 case "ilcourseobjectivesgui":
4606 include_once
'./Modules/Course/classes/class.ilCourseObjectivesGUI.php';
4608 $this->ctrl->setReturn($this,
"");
4610 $ret =& $this->ctrl->forwardCommand($reg_gui);
4613 case 'ilobjcoursegroupinggui':
4614 include_once
'./Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
4616 $this->ctrl->setReturn($this,
'edit');
4619 $this->ctrl->forwardCommand($crs_grp_gui);
4620 $this->tabs_gui->setTabActive(
'settings');
4621 $this->tabs_gui->setSubTabActive(
'groupings');
4625 $this->tabs_gui->setTabActive(
'none');
4636 case "ilconditionhandlerinterface":
4637 include_once
'./classes/class.ilConditionHandlerInterface.php';
4640 if($_GET[
'item_id'])
4642 $this->ctrl->saveParameter($this,
'item_id',$_GET[
'item_id']);
4643 $this->tabs_gui->setTabActive(
'content');
4647 $this->ctrl->forwardCommand($new_gui);
4652 $this->tabs_gui->setTabActive(
'settings');
4655 $this->ctrl->forwardCommand($new_gui);
4659 case "illearningprogressgui":
4660 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
4663 $this->object->getRefId(),
4664 $_GET[
'user_id'] ? $_GET[
'user_id'] : $ilUser->getId());
4665 $this->ctrl->forwardCommand($new_gui);
4666 $this->tabs_gui->setTabActive(
'learning_progress');
4669 case 'ilpermissiongui':
4670 include_once(
"./classes/class.ilPermissionGUI.php");
4672 $ret =& $this->ctrl->forwardCommand($perm_gui);
4673 $this->tabs_gui->setTabActive(
'perm_settings');
4676 case 'ilrepositorysearchgui':
4677 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
4679 $rep_search->setCallback($this,
'assignMembersObject');
4682 $this->ctrl->setReturn($this,
'members');
4683 $ret =& $this->ctrl->forwardCommand($rep_search);
4685 $this->tabs_gui->setTabActive(
'members');
4686 $this->tabs_gui->setSubTabActive(
'crs_member_administration');
4689 case 'ilcoursecontentinterface':
4691 $this->initCourseContentInterface();
4692 $this->cci_obj->cci_setContainer($this);
4694 $this->ctrl->forwardCommand($this->cci_obj);
4696 $this->tabs_gui->setTabActive(
'content');
4699 case 'ilcoursecontentgui':
4700 $this->ctrl->setReturn($this,
'members');
4701 include_once
'./Modules/Course/classes/class.ilCourseContentGUI.php';
4703 $this->ctrl->forwardCommand($course_content_obj);
4706 case 'ilpublicuserprofilegui':
4707 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
4709 $html = $this->ctrl->forwardCommand($profile_gui);
4711 $this->tabs_gui->setTabActive(
'members');
4712 $this->tabs_gui->setSubTabActive(
'crs_members_gallery');
4713 $this->tpl->setVariable(
"ADM_CONTENT", $html);
4716 case 'ilmemberexportgui':
4717 include_once(
'./Modules/Course/classes/Export/class.ilMemberExportGUI.php');
4720 $this->tabs_gui->setTabActive(
'members');
4721 $this->tabs_gui->setSubTabActive(
'export_members');
4723 $this->ctrl->forwardCommand($export);
4726 case 'ilcourseagreementgui':
4730 case 'ilsessionoverviewgui':
4731 include_once(
'./Modules/Session/classes/class.ilSessionOverviewGUI.php');
4734 $this->tabs_gui->setTabActive(
'members');
4735 $this->tabs_gui->setSubTabActive(
'events');
4737 $this->ctrl->forwardCommand($overview);
4740 case 'ilcourseitemadministrationgui':
4741 include_once
'Modules/Course/classes/class.ilCourseItemAdministrationGUI.php';
4742 $this->tabs_gui->clearSubTabs();
4743 $this->ctrl->setReturn($this,
'view');
4745 $this->ctrl->forwardCommand($item_adm_gui);
4749 case "ilpageobjectgui":
4755 $this->tpl->setContent($ret);
4760 if(!$this->creation_mode and !$ilAccess->checkAccess(
'visible',
'',$this->object->getRefId(),
'crs'))
4762 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
4764 if( !$this->creation_mode
4765 &&
$cmd !=
'infoScreen'
4766 &&
$cmd !=
'sendfile'
4767 &&
$cmd !=
'unsubscribe'
4768 &&
$cmd !=
'performUnsubscribe'
4769 && !$ilAccess->checkAccess(
"read",
'',$this->object->getRefId())
4771 ||
$cmd ==
'subscribe')
4773 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
4774 if($ilAccess->checkAccess(
'join',
'',$this->object->getRefId()) &&
4777 include_once(
'./Modules/Course/classes/class.ilCourseRegistrationGUI.php');
4778 $this->ctrl->redirectByClass(
"ilCourseRegistrationGUI",
"show");
4787 if(
$cmd ==
'listObjectives')
4789 include_once
'./Modules/Course/classes/class.ilCourseObjectivesGUI.php';
4791 $this->ctrl->setReturn($this,
"");
4793 $ret =& $this->ctrl->forwardCommand($obj_gui);
4797 if((!$this->creation_mode)&&(!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))){
4798 include_once(
'Services/Feedback/classes/class.ilFeedbackGUI.php');
4800 $feedbackGUI->handleRequiredFeedback($this->object->getRefId());
4830 global $ilUser,$ilAccess;
4832 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
4838 if(!$this->object->members_obj->isAssigned($ilUser->getId()))
4843 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
4844 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
4854 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
4870 include_once(
'Modules/Course/classes/class.ilCourseAgreementGUI.php');
4871 $this->ctrl->setReturn($this,
'');
4873 $this->ctrl->forwardCommand($agreement);
4879 return array(
"ilCourseRegisterGUI",
'ilConditionHandlerInterface');
4885 $this->initCourseContentInterface();
4886 $this->cci_obj->cci_setContainer($this);
4887 $this->cci_obj->cci_objectives();
4893 $this->tabs_gui->setTabActive(
'edit_content');
4895 $this->initCourseContentInterface();
4896 $this->cci_obj->cci_setContainer($this);
4897 $this->cci_obj->cci_view();
4903 $this->initCourseContentInterface();
4904 $this->cci_obj->cci_setContainer($this);
4905 $this->cci_obj->cci_objectives_ask_reset();
4913 include_once
'./Modules/Course/classes/class.ilCourseObjectiveResult.php';
4916 $tmp_obj_res->
reset($this->object->getId());
4920 $this->initCourseContentInterface();
4921 $this->cci_obj->cci_setContainer($this);
4922 $this->cci_obj->cci_objectives();
4929 include_once
'./classes/class.ilConditionHandlerInterface.php';
4931 if(!is_object($this->chi_obj))
4933 if(
$_GET[
'item_id'])
4936 $this->ctrl->saveParameter($this,
'item_id',
$_GET[
'item_id']);
4950 switch ($this->ctrl->getCmd())
4953 #$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""));
4965 if ($ilAccess->checkAccess(
"read",
"", $a_target))
4967 $_GET[
"cmd"] =
"frameset";
4968 $_GET[
"ref_id"] = $a_target;
4969 include(
"repository.php");
4975 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
4977 $_GET[
"cmd"] =
"infoScreen";
4978 $_GET[
"ref_id"] = $a_target;
4979 include(
"repository.php");
4984 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
4986 $_GET[
"cmd"] =
"frameset";
4987 $_GET[
"target"] =
"";
4988 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
4991 include(
"repository.php");
4996 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
5002 return mktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
5007 return array(
'y' => date(
'Y',$a_unix_time),
5008 'm' => date(
'n',$a_unix_time),
5009 'd' => date(
'd',$a_unix_time));
5014 return array(
'h' => date(
'G',$a_unix_time),
5015 'm' => date(
'i',$a_unix_time),
5016 's' => date(
's',$a_unix_time));
5026 global $ilUser,
$ilCtrl, $ilUser, $ilAccess;
5029 $this->tabs_gui->setTabActive(
'settings');
5032 !$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
5037 $latitude = $this->
object->getLatitude();
5038 $longitude = $this->
object->getLongitude();
5039 $zoom = $this->
object->getLocationZoom();
5042 if ($latitude == 0 && $longitude == 0 && $zoom == 0)
5045 $latitude = $def[
"latitude"];
5046 $longitude = $def[
"longitude"];
5047 $zoom = $def[
"zoom"];
5053 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
5055 $form->setFormAction($ilCtrl->getFormAction($this));
5057 $form->setTitle($this->lng->txt(
"crs_map_settings"));
5063 $public->setChecked($this->object->getEnableCourseMap());
5064 $form->addItem($public);
5070 $loc_prop->setLongitude($longitude);
5071 $loc_prop->setZoom($zoom);
5072 $form->addItem($loc_prop);
5074 $form->addCommandButton(
"saveMapSettings", $this->lng->txt(
"save"));
5076 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
5088 $this->
object->update();
5090 $ilCtrl->redirect($this,
"editMapSettings");
5100 $this->tabs_gui->setTabActive(
"members");
5102 $this->tabs_gui->setSubTabActive(
"crs_members_map");
5104 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
5110 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
5112 $map->setMapId(
"course_map");
5113 $map->setWidth(
"700px");
5114 $map->setHeight(
"500px");
5115 $map->setLatitude($this->object->getLatitude());
5116 $map->setLongitude($this->object->getLongitude());
5117 $map->setZoom($this->object->getLocationZoom());
5118 $map->setEnableTypeControl(
true);
5119 $map->setEnableNavigationControl(
true);
5121 $this->
object->initCourseMemberObject();
5122 if(count($members = $this->object->members_obj->getParticipants()))
5124 foreach($members as $user_id)
5126 $map->addUserMarker($user_id);
5130 $tpl->setContent($map->getHTML());
5131 $tpl->setLeftContent($map->getUserListHTML());
5140 $this->object->getAboStatus(), $this->
object->getRefId(), $this->
object->getId());
5147 $a_abo_status, $a_course_ref_id, $a_course_obj_id, $a_parent_ref_id = 0)
5152 if ($a_parent_ref_id == 0)
5154 $a_parent_ref_id = $a_course_ref_id;
5158 if($a_item_data[
'type'] ==
'tst' and
5161 $a_item_list_gui->addCommandLinkParameter(array(
'crs_show_result' => $a_course_ref_id));
5165 switch($a_item_data[
'timing_type'])
5184 $a_item_list_gui->enableSubscribe($a_abo_status);
5187 if ($activation !=
"")
5189 $a_item_list_gui->addCustomProperty($lng->txt($a_item_data[
'activation_info']), $activation,
5193 $is_tutor = ($ilAccess->checkAccess(
'write',
'',
5194 $a_course_ref_id,
'crs', $a_course_obj_id));
5196 if($a_show_path and $is_tutor)
5198 $a_item_list_gui->addCustomProperty($lng->txt(
'path'),
5206 $ilCtrl->setParameterByClass(
'ilcourseitemadministrationgui',
"ref_id",
5208 $ilCtrl->setParameterByClass(
'ilcourseitemadministrationgui',
"item_id",
5209 $a_item_data[
'child']);
5210 $a_item_list_gui->addCustomCommand($ilCtrl->getLinkTargetByClass(
5211 array(
'ilcoursecontentgui',
'ilCourseItemAdministrationGUI'),
5221 if ($this->object->getType() !=
'crs')
5225 if (!$ilAccess->checkAccess(
'write',
'',
5226 $this->object->getRefId(),
'crs',$this->
object->getId()))
5230 if($this->object->enabledObjectiveView())
5244 if(!
$_SESSION[
'crs_timings_panel'][$this->object->getId()] or 1)
5246 $this->tabs_gui->addSubTabTarget(
'crs_content',
5247 $this->ctrl->getLinkTargetByClass(
"ilobjcoursegui",
'view'));
5249 include_once
'Modules/Course/classes/class.ilCourseItems.php';
5252 $this->tabs_gui->addSubTabTarget(
'timings_timings',
5253 $this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'editUserTimings'));
5258 $this->tabs_gui->addSubTabTarget(
'crs_archives',
5259 $this->ctrl->getLinkTargetByClass(
5260 array(
'ilcoursecontentgui',
'ilcoursearchivesgui'),
'view'));
5277 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
5279 $dt[
'year'] = (int) $_POST[$a_field][
'date'][
'y'];
5280 $dt[
'mon'] = (int) $_POST[$a_field][
'date'][
'm'];
5281 $dt[
'mday'] = (int) $_POST[$a_field][
'date'][
'd'];
5282 $dt[
'hours'] = (int) $_POST[$a_field][
'time'][
'h'];
5283 $dt[
'minutes'] = (int) $_POST[$a_field][
'time'][
'm'];
5284 $dt[
'seconds'] = (int) $_POST[$a_field][
'time'][
's'];
5299 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_objectives_ask_reset.html",
'Modules/Course');
5301 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
5302 $this->tpl->setVariable(
"INFO_STRING",$this->lng->txt(
'crs_objectives_reset_sure'));
5303 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
5304 $this->tpl->setVariable(
"TXT_RESET",$this->lng->txt(
'reset'));
5313 include_once
'./Modules/Course/classes/class.ilCourseObjectiveResult.php';
5316 $tmp_obj_res->
reset($this->object->getId());
5318 $ilUser->deletePref(
'crs_objectives_force_details_'.$this->object->getId());
5326 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
5328 global $ilAccess,$ilUser;
5330 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
5334 $this->start_obj =
new ilCourseStart($this->object->getRefId(),$this->
object->getId());
5335 if(count($this->start_obj->getStartObjects()) and !$this->start_obj->allFullfilled($ilUser->getId()))
5344 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
5345 include_once
'./classes/class.ilRepositoryExplorer.php';
5346 include_once
'./classes/class.ilLink.php';
5348 global $rbacsystem,
$ilias,$ilUser,$ilAccess,$ilObjDataCache;
5350 $this->tabs_gui->setSubTabActive(
'crs_content');
5352 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_start_view.html",
'Modules/Course');
5353 $this->tpl->setVariable(
"INFO_STRING",$this->lng->txt(
'crs_info_start'));
5354 $this->tpl->setVariable(
"TBL_TITLE_START",$this->lng->txt(
'crs_table_start_objects'));
5355 $this->tpl->setVariable(
"HEADER_NR",$this->lng->txt(
'crs_nr'));
5356 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
5357 $this->tpl->setVariable(
"HEADER_EDITED",$this->lng->txt(
'crs_objective_accomplished'));
5360 $lm_continue =&
new ilCourseLMHistory($this->object->getRefId(),$ilUser->getId());
5364 foreach($this->start_obj->getStartObjects() as $start)
5366 $obj_id = $ilObjDataCache->lookupObjId($start[
'item_ref_id']);
5367 $ref_id = $start[
'item_ref_id'];
5368 $type = $ilObjDataCache->lookupType(
$obj_id);
5374 $obj_frame = $obj_frame ? $obj_frame :
'';
5377 $obj_frame = $type ==
'tst' ?
'' : $obj_frame;
5379 $contentObj =
false;
5381 if($ilAccess->checkAccess(
'read',
'',
$ref_id))
5383 $this->tpl->setCurrentBlock(
"start_read");
5384 $this->tpl->setVariable(
"READ_TITLE_START",$ilObjDataCache->lookupTitle(
$obj_id));
5385 $this->tpl->setVariable(
"READ_TARGET_START",$obj_frame);
5386 $this->tpl->setVariable(
"READ_LINK_START", $obj_link.
'&crs_show_result='.$this->object->getRefId());
5387 $this->tpl->parseCurrentBlock();
5391 $this->tpl->setCurrentBlock(
"start_visible");
5392 $this->tpl->setVariable(
"VISIBLE_LINK_START",$ilObjDataCache->lookupTitle(
$obj_id));
5393 $this->tpl->parseCurrentBlock();
5397 if(isset($continue_data[
$ref_id]))
5399 $this->tpl->setCurrentBlock(
"link");
5400 $this->tpl->setVariable(
"LINK_HREF",
ilLink::_getLink($ref_id,
'',array(
'obj_id',
5401 $continue_data[$ref_id][
'lm_page_id'])));
5402 #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target);
5403 $this->tpl->setVariable(
"LINK_NAME",$this->lng->txt(
'continue_work'));
5404 $this->tpl->parseCurrentBlock();
5408 if(!$ilUser->isDesktopItem($ref_id,$type) and
5409 $this->
object->getAboStatus())
5411 if ($ilAccess->checkAccess(
'read',
'',$ref_id))
5413 $this->tpl->setCurrentBlock(
"link");
5414 $this->ctrl->setParameterByClass(get_class($this),
'item_ref_id',$ref_id);
5415 $this->ctrl->setParameterByClass(get_class($this),
'item_id',$ref_id);
5416 $this->ctrl->setParameterByClass(get_class($this),
'type',$type);
5418 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this,
'addToDesk'));
5419 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"to_desktop"));
5420 $this->tpl->parseCurrentBlock();
5423 elseif($this->object->getAboStatus())
5425 $this->tpl->setCurrentBlock(
"link");
5426 $this->ctrl->setParameterByClass(get_class($this),
'item_ref_id',$ref_id);
5427 $this->ctrl->setParameterByClass(get_class($this),
'item_id',$ref_id);
5428 $this->ctrl->setParameterByClass(get_class($this),
'type',$type);
5430 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this,
'removeFromDesk'));
5431 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"unsubscribe"));
5432 $this->tpl->parseCurrentBlock();
5437 if(strlen($ilObjDataCache->lookupDescription(
$obj_id)))
5439 $this->tpl->setCurrentBlock(
"start_description");
5440 $this->tpl->setVariable(
"DESCRIPTION_START",$ilObjDataCache->lookupDescription(
$obj_id));
5441 $this->tpl->parseCurrentBlock();
5445 if($this->start_obj->isFullfilled($ilUser->getId(),
$ref_id))
5447 $accomplished =
'accomplished';
5451 $accomplished =
'not_accomplished';
5453 $this->tpl->setCurrentBlock(
"start_row");
5455 $this->tpl->setVariable(
"EDITED_ALT",$this->lng->txt(
'crs_objective_'.$accomplished));
5456 $this->tpl->setVariable(
"ROW_CLASS",
'option_value');
5457 $this->tpl->setVariable(
"ROW_CLASS_CENTER",
'option_value_center');
5458 $this->tpl->setVariable(
"OBJ_NR_START",++$counter.
'.');
5459 $this->tpl->parseCurrentBlock();