function __createDefaultSettings() { global $ilDB; include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php'; $this->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode()); $query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility," . "contact_phone,contact_email,contact_consultation,activation_type,activation_start," . "activation_end,sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit," . "sub_max_members,sub_notify,view_mode,archive_start,archive_end,archive_type,abo," . "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members, " . "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) " . "VALUES( " . $ilDB->quote($this->getId(), 'integer') . ", " . $ilDB->quote($this->getSyllabus(), 'text') . ", " . $ilDB->quote($this->getContactName(), 'text') . ", " . $ilDB->quote($this->getContactResponsibility(), 'text') . ", " . $ilDB->quote($this->getContactPhone(), 'text') . ", " . $ilDB->quote($this->getContactEmail(), 'text') . ", " . $ilDB->quote($this->getContactConsultation(), 'text') . ", " . $ilDB->quote(0, 'integer') . ", " . $ilDB->quote($this->getActivationStart(), 'integer') . ", " . $ilDB->quote($this->getActivationEnd(), 'integer') . ", " . $ilDB->quote(IL_CRS_SUBSCRIPTION_DEACTIVATED, 'integer') . ", " . $ilDB->quote($this->getSubscriptionStart(), 'integer') . ", " . $ilDB->quote($this->getSubscriptionEnd(), 'integer') . ", " . $ilDB->quote(IL_CRS_SUBSCRIPTION_DIRECT, 'integer') . ", " . $ilDB->quote($this->getSubscriptionPassword(), 'text') . ", " . "0, " . $ilDB->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " . "1, " . "0, " . $ilDB->quote($this->getArchiveStart(), 'integer') . ", " . $ilDB->quote($this->getArchiveEnd(), 'integer') . ", " . $ilDB->quote(IL_CRS_ARCHIVE_NONE, 'integer') . ", " . $ilDB->quote($this->ABO_ENABLED, 'integer') . ", " . $ilDB->quote($this->getLatitude(), 'text') . ", " . $ilDB->quote($this->getLongitude(), 'text') . ", " . $ilDB->quote($this->getLocationZoom(), 'integer') . ", " . $ilDB->quote($this->getEnableCourseMap(), 'integer') . ", " . "1, " . "1," . $ilDB->quote($this->isSessionLimitEnabled(), 'integer') . ', ' . $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' . $ilDB->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' . $ilDB->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' . $ilDB->quote($this->getRegistrationAccessCode(), 'text') . ', ' . $ilDB->quote((int) $this->getAutoNotification(), 'integer') . ', ' . $ilDB->quote((int) $this->getStatusDetermination(), 'integer') . ', ' . $ilDB->quote((int) $this->getMailToMembersType(), 'integer') . ' ' . ")"; $res = $ilDB->manipulate($query); $this->__readSettings(); include_once './Services/Container/classes/class.ilContainerSortingSettings.php'; $sorting = new ilContainerSortingSettings($this->getId()); $sorting->setSortMode(ilContainer::SORT_MANUAL); $sorting->update(); }
/** * Clone group (no member data) * * @access public * @param int target ref_id * @param int copy id * */ public function cloneObject($a_target_id, $a_copy_id = 0) { global $ilDB, $ilUser; $new_obj = parent::cloneObject($a_target_id, $a_copy_id); $new_obj->setGroupType($this->getGroupType()); $new_obj->initGroupStatus($this->getGroupType() ? $this->getGroupType() : $this->readGroupStatus()); $this->cloneAutoGeneratedRoles($new_obj); $new_obj->setRegistrationType($this->getRegistrationType()); $new_obj->setInformation($this->getInformation()); $new_obj->setRegistrationStart($this->getRegistrationStart()); $new_obj->setRegistrationEnd($this->getRegistrationEnd()); $new_obj->enableUnlimitedRegistration($this->isRegistrationUnlimited()); $new_obj->setPassword($this->getPassword()); $new_obj->enableMembershipLimitation($this->isMembershipLimited()); $new_obj->setMaxMembers($this->getMaxMembers()); $new_obj->enableWaitingList($this->isWaitingListEnabled()); // map $new_obj->setLatitude($this->getLatitude()); $new_obj->setLongitude($this->getLongitude()); $new_obj->setLocationZoom($this->getLocationZoom()); $new_obj->setEnableGroupMap($this->getEnableGroupMap()); $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled()); include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php'; $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode()); $new_obj->setViewMode($this->getViewMode()); $new_obj->setMailToMembersType($this->getMailToMembersType()); $new_obj->update(); global $ilLog; $ilLog->write(__METHOD__ . ': Starting add user'); // Assign user as admin include_once './Modules/Group/classes/class.ilGroupParticipants.php'; $part = ilGroupParticipants::_getInstanceByObjId($new_obj->getId()); $part->add($ilUser->getId(), IL_GRP_ADMIN); $part->updateNotification($ilUser->getId(), 1); // Copy learning progress settings include_once 'Services/Tracking/classes/class.ilLPObjSettings.php'; $obj_settings = new ilLPObjSettings($this->getId()); $obj_settings->cloneSettings($new_obj->getId()); unset($obj_settings); // clone icons $new_obj->saveIcons($this->getBigIconPath(), $this->getSmallIconPath(), $this->getTinyIconPath()); return $new_obj; }
/** * init create/edit form * * @access protected * @param string edit or create * @return */ protected function initForm($a_mode = 'edit') { global $ilUser, $tpl, $tree; if (is_object($this->form)) { return true; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); switch ($a_mode) { case 'edit': $this->form->setFormAction($this->ctrl->getFormAction($this, 'update')); break; default: $this->form->setTableWidth('600px'); $this->form->setFormAction($this->ctrl->getFormAction($this, 'save')); break; } // title $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setSubmitFormOnEnter(true); $title->setValue($this->object->getTitle()); $title->setSize(40); $title->setMaxLength(128); $title->setRequired(true); $this->form->addItem($title); // desc $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc'); $desc->setValue($this->object->getLongDescription()); $desc->setRows(2); $desc->setCols(40); $this->form->addItem($desc); // Group type $grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'), 'grp_type'); if ($a_mode == 'edit') { $type = $this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus(); } else { $type = $this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC; } $grp_type->setValue($type); $grp_type->setRequired(true); // PUBLIC GROUP $opt_public = new ilRadioOption($this->lng->txt('grp_public'), GRP_TYPE_PUBLIC, $this->lng->txt('grp_public_info')); $grp_type->addOption($opt_public); // CLOSED GROUP $opt_closed = new ilRadioOption($this->lng->txt('grp_closed'), GRP_TYPE_CLOSED, $this->lng->txt('grp_closed_info')); $grp_type->addOption($opt_closed); if ($a_mode == 'update_group_type') { $grp_type->setAlert($this->lng->txt('grp_type_changed_info')); } $this->form->addItem($grp_type); if ($a_mode == 'edit') { // Group registration ############################################################ $pres = new ilFormSectionHeaderGUI(); $pres->setTitle($this->lng->txt('grp_setting_header_registration')); $this->form->addItem($pres); // Registration type $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type'); $reg_type->setValue($this->object->getRegistrationType()); $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'), GRP_REGISTRATION_DIRECT); #$this->lng->txt('grp_reg_direct_info')); $reg_type->addOption($opt_dir); $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'), GRP_REGISTRATION_PASSWORD); $pass = new ilTextInputGUI('', 'password'); $pass->setInfo($this->lng->txt('grp_reg_password_info')); $pass->setValue($this->object->getPassword()); $pass->setSize(10); $pass->setMaxLength(32); $opt_pass->addSubItem($pass); $reg_type->addOption($opt_pass); $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info')); $reg_type->addOption($opt_req); $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_disabled'), GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info')); $reg_type->addOption($opt_deact); // Registration codes $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled'); $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled()); $reg_code->setValue(1); $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info')); $this->form->addItem($reg_type); // time limit $time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'), 'reg_limit_time'); $time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time')); $time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true); $this->lng->loadLanguageModule('dateplaner'); include_once './Services/Form/classes/class.ilDateDurationInputGUI.php'; $tpl->addJavaScript('./Services/Form/js/date_duration.js'); $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'), 'reg'); $dur->setStartText($this->lng->txt('cal_start')); $dur->setEndText($this->lng->txt('cal_end')); $dur->setMinuteStepSize(5); $dur->setShowDate(true); $dur->setShowTime(true); $dur->setStart($this->object->getRegistrationStart()); $dur->setEnd($this->object->getRegistrationEnd()); $time_limit->addSubItem($dur); $this->form->addItem($time_limit); // max member $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited'); $lim->setValue(1); $lim->setOptionTitle($this->lng->txt('reg_grp_max_members')); $lim->setChecked($this->object->isMembershipLimited()); $max = new ilTextInputGUI('', 'registration_max_members'); $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : ''); $max->setTitle($this->lng->txt('members') . ':'); $max->setSize(3); $max->setMaxLength(4); $max->setInfo($this->lng->txt('grp_reg_max_members_info')); $lim->addSubItem($max); $wait = new ilCheckboxInputGUI('', 'waiting_list'); $wait->setValue(1); $wait->setOptionTitle($this->lng->txt('grp_waiting_list')); $wait->setInfo($this->lng->txt('grp_waiting_list_info')); $wait->setChecked($this->object->isWaitingListEnabled() ? true : false); $lim->addSubItem($wait); $this->form->addItem($lim); // Registration codes if (!$this->object->getRegistrationAccessCode()) { include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php'; $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode()); } $reg_link = new ilHiddenInputGUI('reg_code'); $reg_link->setValue($this->object->getRegistrationAccessCode()); $this->form->addItem($reg_link); $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link')); include_once './Services/Link/classes/class.ilLink.php'; $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode()); $link->setHTML('<font class="small">' . $val . '</font>'); $reg_code->addSubItem($link); $this->form->addItem($reg_code); // Group presentation $hasParentCourse = $tree->checkForParentType($this->object->getRefId(), 'crs'); $pres = new ilFormSectionHeaderGUI(); $pres->setTitle($this->lng->txt('grp_setting_header_presentation')); $this->form->addItem($pres); // presentation type $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode'); if ($hasParentCourse) { switch ($this->object->getViewMode()) { case ilContainer::VIEW_SESSIONS: $course_view_mode = ' (' . $this->lng->txt('cntr_view_sessions') . ')'; break; case ilContainer::VIEW_SIMPLE: $course_view_mode = ' (' . $this->lng->txt('cntr_view_simple') . ')'; break; case ilContainer::VIEW_BY_TYPE: $course_view_mode = ' (' . $this->lng->txt('cntr_view_by_type') . ')'; break; } $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, ilContainer::VIEW_INHERIT); $opt->setInfo($this->lng->txt('grp_view_inherit_info')); $view_type->addOption($opt); } if ($hasParentCourse && $this->object->getViewMode(false) == ilContainer::VIEW_INHERIT) { $view_type->setValue(ilContainer::VIEW_INHERIT); } else { $view_type->setValue($this->object->getViewMode(true)); } $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), ilContainer::VIEW_SIMPLE); $opt->setInfo($this->lng->txt('grp_view_info_simple')); $view_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE); $opt->setInfo($this->lng->txt('grp_view_info_by_type')); $view_type->addOption($opt); $this->form->addItem($view_type); $sog = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), 'sor'); $sog->setRequired(true); if ($a_mode == 'edit') { $sog->setValue(ilContainerSortingSettings::_readSortMode(ilObject::_lookupObjId($this->object->getRefId()))); } elseif ($hasParentCourse) { $sog->setValue(ilContainer::SORT_INHERIT); } else { $sog->setValue(ilContainer::SORT_TITLE); } if ($hasParentCourse) { $sde = new ilRadioOption(); $sde->setValue(ilContainer::SORT_INHERIT); $title = $this->lng->txt('sort_inherit_prefix'); $title .= ' (' . ilContainerSortingSettings::sortModeToString(ilContainerSortingSettings::lookupSortModeFromParentContainer(ilObject::_lookupObjectId($ref_id))) . ') '; $sde->setTitle($title); $sde->setInfo($this->lng->txt('sorting_info_inherit')); $sog->addOption($sde); } $sma = new ilRadioOption(); $sma->setValue(ilContainer::SORT_TITLE); $sma->setTitle($this->lng->txt('sorting_title_header')); $sma->setInfo($this->lng->txt('sorting_info_title')); $sog->addOption($sma); $sti = new ilRadioOption(); $sti->setValue(ilContainer::SORT_MANUAL); $sti->setTitle($this->lng->txt('sorting_manual_header')); $sti->setInfo($this->lng->txt('sorting_info_manual')); $sog->addOption($sti); $this->form->addItem($sog); include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php'; ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $this->form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY)); } switch ($a_mode) { case 'create': $this->form->setTitle($this->lng->txt('grp_new')); $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png')); $this->form->addCommandButton('save', $this->lng->txt('grp_new')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); return true; case 'edit': $this->form->setTitle($this->lng->txt('grp_edit')); $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png')); // Edit ecs export settings include_once 'Modules/Group/classes/class.ilECSGroupSettings.php'; $ecs = new ilECSGroupSettings($this->object); $ecs->addSettingsToForm($this->form, 'grp'); $this->form->addCommandButton('update', $this->lng->txt('save')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); return true; case 'update_group_type': $grp_type->setValue($type == GRP_TYPE_PUBLIC ? GRP_TYPE_CLOSED : GRP_TYPE_PUBLIC); $this->form->setTitle($this->lng->txt('grp_edit')); $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png')); return true; } return true; }
/** * goto target course */ public static function _goto($a_target, $a_add = "") { global $ilAccess, $ilErr, $lng, $ilUser; include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php'; if (substr($a_add, 0, 5) == 'rcode') { if ($ilUser->getId() == ANONYMOUS_USER_ID) { // Redirect to login for anonymous ilUtil::redirect("login.php?target=" . $_GET["target"] . "&cmd=force_login&lang=" . $ilUser->getCurrentLanguage()); } // Redirects to target location after assigning user to course ilMembershipRegistrationCodeUtils::handleCode($a_target, ilObject::_lookupType(ilObject::_lookupObjId($a_target)), substr($a_add, 5)); } if ($a_add == "mem" && $ilAccess->checkAccess("write", "", $a_target)) { ilObjectGUI::_gotoRepositoryNode($a_target, "members"); } if ($ilAccess->checkAccess("read", "", $a_target)) { ilObjectGUI::_gotoRepositoryNode($a_target); } else { // to do: force flat view if ($ilAccess->checkAccess("visible", "", $a_target)) { ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreenGoto"); } else { if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) { ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"), ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true); ilObjectGUI::_gotoRepositoryRoot(); } } } $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL); }
/** * init create/edit form * * @access protected * @param string edit or create * @return */ protected function initForm($a_mode = 'edit') { global $ilUser, $tpl, $tree; if (is_object($this->form)) { return true; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); switch ($a_mode) { case 'edit': $this->form->setFormAction($this->ctrl->getFormAction($this, 'update')); break; default: $this->form->setTableWidth('600px'); $this->form->setFormAction($this->ctrl->getFormAction($this, 'save')); break; } // title $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setSubmitFormOnEnter(true); $title->setValue($this->object->getTitle()); $title->setSize(min(40, ilObject::TITLE_LENGTH)); $title->setMaxLength(ilObject::TITLE_LENGTH); $title->setRequired(true); $this->form->addItem($title); // desc $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc'); $desc->setValue($this->object->getLongDescription()); $desc->setRows(2); $desc->setCols(40); $this->form->addItem($desc); // Group type $grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'), 'grp_type'); if ($a_mode == 'edit') { $type = $this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus(); } else { $type = $this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC; } $grp_type->setValue($type); $grp_type->setRequired(true); // PUBLIC GROUP $opt_public = new ilRadioOption($this->lng->txt('grp_public'), GRP_TYPE_PUBLIC, $this->lng->txt('grp_public_info')); $grp_type->addOption($opt_public); // CLOSED GROUP $opt_closed = new ilRadioOption($this->lng->txt('grp_closed'), GRP_TYPE_CLOSED, $this->lng->txt('grp_closed_info')); $grp_type->addOption($opt_closed); $this->form->addItem($grp_type); if ($a_mode == 'edit') { // Group registration ############################################################ $pres = new ilFormSectionHeaderGUI(); $pres->setTitle($this->lng->txt('grp_setting_header_registration')); $this->form->addItem($pres); // Registration type $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type'); $reg_type->setValue($this->object->getRegistrationType()); $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'), GRP_REGISTRATION_DIRECT); #$this->lng->txt('grp_reg_direct_info')); $reg_type->addOption($opt_dir); $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'), GRP_REGISTRATION_PASSWORD); $pass = new ilTextInputGUI($this->lng->txt("password"), 'password'); $pass->setInfo($this->lng->txt('grp_reg_password_info')); $pass->setValue($this->object->getPassword()); $pass->setSize(10); $pass->setMaxLength(32); $opt_pass->addSubItem($pass); $reg_type->addOption($opt_pass); $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info')); $reg_type->addOption($opt_req); $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_no_selfreg'), GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info')); $reg_type->addOption($opt_deact); // Registration codes $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled'); $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled()); $reg_code->setValue(1); $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info')); $this->form->addItem($reg_type); // Registration codes if (!$this->object->getRegistrationAccessCode()) { include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php'; $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode()); } $reg_link = new ilHiddenInputGUI('reg_code'); $reg_link->setValue($this->object->getRegistrationAccessCode()); $this->form->addItem($reg_link); $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link')); include_once './Services/Link/classes/class.ilLink.php'; $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode()); $link->setHTML('<font class="small">' . $val . '</font>'); $reg_code->addSubItem($link); $this->form->addItem($reg_code); // time limit $time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'), 'reg_limit_time'); // $time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time')); $time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true); $this->lng->loadLanguageModule('dateplaner'); include_once './Services/Form/classes/class.ilDateDurationInputGUI.php'; $tpl->addJavaScript('./Services/Form/js/date_duration.js'); $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'), 'reg'); $dur->setStartText($this->lng->txt('cal_start')); $dur->setEndText($this->lng->txt('cal_end')); $dur->setShowTime(true); $dur->setStart($this->object->getRegistrationStart()); $dur->setEnd($this->object->getRegistrationEnd()); $time_limit->addSubItem($dur); $this->form->addItem($time_limit); // max member $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited'); $lim->setValue(1); // $lim->setOptionTitle($this->lng->txt('reg_grp_max_members')); $lim->setChecked($this->object->isMembershipLimited()); $max = new ilTextInputGUI($this->lng->txt('reg_grp_max_members'), 'registration_max_members'); $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : ''); //$max->setTitle($this->lng->txt('members')); $max->setSize(3); $max->setMaxLength(4); $max->setInfo($this->lng->txt('grp_reg_max_members_info')); $lim->addSubItem($max); $wait = new ilCheckboxInputGUI($this->lng->txt('grp_waiting_list'), 'waiting_list'); $wait->setValue(1); //$wait->setOptionTitle($this->lng->txt('grp_waiting_list')); $wait->setInfo($this->lng->txt('grp_waiting_list_info')); $wait->setChecked($this->object->isWaitingListEnabled() ? true : false); $lim->addSubItem($wait); $this->form->addItem($lim); // Group presentation $hasParentMembership = $tree->checkForParentType($this->object->getRefId(), 'crs') || $tree->checkForParentType($this->object->getRefId(), 'grp'); $pres = new ilFormSectionHeaderGUI(); $pres->setTitle($this->lng->txt('grp_setting_header_presentation')); $this->form->addItem($pres); // presentation type $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode'); if ($hasParentMembership) { switch ($this->object->getViewMode()) { case ilContainer::VIEW_SESSIONS: $course_view_mode = ': ' . $this->lng->txt('cntr_view_sessions'); break; case ilContainer::VIEW_SIMPLE: $course_view_mode = ': ' . $this->lng->txt('cntr_view_simple'); break; case ilContainer::VIEW_BY_TYPE: $course_view_mode = ': ' . $this->lng->txt('cntr_view_by_type'); break; } $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, ilContainer::VIEW_INHERIT); $opt->setInfo($this->lng->txt('grp_view_inherit_info')); $view_type->addOption($opt); } if ($hasParentMembership && $this->object->getViewMode(false) == ilContainer::VIEW_INHERIT) { $view_type->setValue(ilContainer::VIEW_INHERIT); } else { $view_type->setValue($this->object->getViewMode(true)); } $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), ilContainer::VIEW_SIMPLE); $opt->setInfo($this->lng->txt('grp_view_info_simple')); $view_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE); $opt->setInfo($this->lng->txt('grp_view_info_by_type')); $view_type->addOption($opt); $this->form->addItem($view_type); // Sorting $sorting_settings = array(); if ($hasParentMembership) { $sorting_settings[] = ilContainer::SORT_INHERIT; } $sorting_settings[] = ilContainer::SORT_TITLE; $sorting_settings[] = ilContainer::SORT_CREATION; $sorting_settings[] = ilContainer::SORT_MANUAL; $this->initSortingForm($this->form, $sorting_settings); // additional features $feat = new ilFormSectionHeaderGUI(); $feat->setTitle($this->lng->txt('obj_features')); $this->form->addItem($feat); include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php'; ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $this->form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY, ilObjectServiceSettingsGUI::AUTO_RATING_NEW_OBJECTS, ilObjectServiceSettingsGUI::TAG_CLOUD)); // Notification Settings /*$notification = new ilFormSectionHeaderGUI(); $notification->setTitle($this->lng->txt('grp_notification')); $this->form->addItem($notification);*/ // Show members type $mail_type = new ilRadioGroupInputGUI($this->lng->txt('grp_mail_type'), 'mail_type'); $mail_type->setValue($this->object->getMailToMembersType()); $mail_tutors = new ilRadioOption($this->lng->txt('grp_mail_tutors_only'), ilObjGroup::MAIL_ALLOWED_TUTORS, $this->lng->txt('grp_mail_tutors_only_info')); $mail_type->addOption($mail_tutors); $mail_all = new ilRadioOption($this->lng->txt('grp_mail_all'), ilObjGroup::MAIL_ALLOWED_ALL, $this->lng->txt('grp_mail_all_info')); $mail_type->addOption($mail_all); $this->form->addItem($mail_type); } switch ($a_mode) { case 'create': $this->form->setTitle($this->lng->txt('grp_new')); $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg')); $this->form->addCommandButton('save', $this->lng->txt('grp_new')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); return true; case 'edit': $this->form->setTitle($this->lng->txt('grp_edit')); $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg')); // Edit ecs export settings include_once 'Modules/Group/classes/class.ilECSGroupSettings.php'; $ecs = new ilECSGroupSettings($this->object); $ecs->addSettingsToForm($this->form, 'grp'); $this->form->addCommandButton('update', $this->lng->txt('save')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); return true; } return true; }