24include_once(
'./Services/Membership/classes/class.ilRegistrationGUI.php');
25include_once
'./Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
59 $ilTabs =
$DIC[
'ilTabs'];
61 $next_class = $this->ctrl->getNextClass($this);
64 $ilTabs->activateTab(
'leave');
67 switch ($next_class) {
69 $cmd = $this->ctrl->getCmd(
"show");
90 return $this->lng->txt(
'member_status');
92 return $this->lng->txt(
'grp_registration');
104 if ($this->container->getInformation()) {
107 $imp->setValue($value);
108 $this->form->addItem($imp);
119 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
122 if ($this->container->isRegistrationUnlimited()) {
124 $reg->setValue($this->lng->txt(
'mem_unlimited'));
125 $this->form->addItem($reg);
129 $start = $this->container->getRegistrationStart();
130 $end = $this->container->getRegistrationEnd();
134 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
135 $tpl->setVariable(
'TXT_FIRST', $this->lng->txt(
'mem_start'));
138 $tpl->setVariable(
'TXT_END', $this->lng->txt(
'mem_end'));
141 $warning = $this->lng->txt(
'mem_reg_not_started');
143 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
144 $tpl->setVariable(
'TXT_FIRST', $this->lng->txt(
'mem_start'));
147 $tpl->setVariable(
'TXT_END', $this->lng->txt(
'mem_end'));
150 $warning = $this->lng->txt(
'mem_reg_expired');
152 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
153 $tpl->setVariable(
'TXT_FIRST', $this->lng->txt(
'mem_end'));
158 $reg->setHtml(
$tpl->get());
159 if (strlen($warning)) {
162 #$reg->setAlert($warning);
165 $this->form->addItem($reg);
181 if (!$this->container->isMembershipLimited()) {
185 $tpl =
new ilTemplate(
'tpl.max_members_form.html',
true,
true,
'Services/Membership');
187 if ($this->container->getMinMembers()) {
188 $tpl->setVariable(
'TXT_MIN', $this->lng->txt(
'mem_min_users'));
189 $tpl->setVariable(
'NUM_MIN', $this->container->getMinMembers());
192 if ($this->container->getMaxMembers()) {
193 $tpl->setVariable(
'TXT_MAX', $this->lng->txt(
'mem_max_users'));
194 $tpl->setVariable(
'NUM_MAX', $this->container->getMaxMembers());
196 include_once
'./Modules/Group/classes/class.ilObjGroupAccess.php';
198 $free = $reg_info[
'reg_info_free_places'];
202 $tpl->setVariable(
'NUM_FREE', $free);
204 $tpl->setVariable(
'WARN_FREE', $free);
207 include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
211 $this->container->isWaitingListEnabled() and
212 $this->container->isMembershipLimited() and
215 $tpl->setVariable(
'TXT_WAIT', $this->lng->txt(
'mem_waiting_list_position'));
218 $tpl->setVariable(
'TXT_WAIT', $this->lng->txt(
'mem_waiting_list'));
230 !$this->container->isWaitingListEnabled()) {
233 $alert = $this->lng->txt(
'mem_alert_no_places');
235 $this->container->isWaitingListEnabled() and
236 $this->container->isMembershipLimited() and
242 $this->container->isWaitingListEnabled() and
243 $this->container->isMembershipLimited()) {
244 $alert = $this->lng->txt(
'grp_warn_no_max_set_on_waiting_list');
247 $this->container->isWaitingListEnabled() and
248 $this->container->isMembershipLimited() and
249 $this->getWaitingList()->getCountUsers()) {
250 $alert = $this->lng->txt(
'grp_warn_wl_set_on_waiting_list');
255 $max->setHtml(
$tpl->get());
256 if (strlen($alert)) {
257 #$max->setAlert($alert);
260 $this->form->addItem($max);
280 switch ($this->container->getRegistrationType()) {
283 $reg->setValue($this->lng->txt(
'grp_reg_disabled'));
284 #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
285 $this->form->addItem($reg);
294 $txt->setValue($this->lng->txt(
'grp_pass_request'));
298 $pass->setInputType(
'password');
300 $pass->setMaxLength(32);
301 #$pass->setRequired(true);
302 $pass->setInfo($this->lng->txt(
'group_password_registration_msg'));
305 $this->form->addItem(
$txt);
316 $txt->setValue($this->lng->txt(
'grp_reg_request'));
319 $sub->setValue(
$_POST[
'subject']);
320 $sub->setInfo($this->lng->txt(
'group_req_registration_msg'));
323 if ($this->participants->isSubscriber(
$ilUser->getId())) {
324 $sub_data = $this->participants->getSubscriberData(
$ilUser->getId());
325 $sub->setValue($sub_data[
'subject']);
330 $txt->addSubItem($sub);
331 $this->form->addItem(
$txt);
342 $txt->setValue($this->lng->txt(
'group_req_direct'));
344 $this->form->addItem(
$txt);
364 parent::addCommandButtons();
367 switch ($this->container->getRegistrationType()) {
369 if ($this->participants->isSubscriber(
$ilUser->getId())) {
370 $this->form->clearCommandButtons();
371 $this->form->addCommandButton(
'updateSubscriptionRequest', $this->lng->txt(
'grp_update_subscr_request'));
372 $this->form->addCommandButton(
'cancelSubscriptionRequest', $this->lng->txt(
'grp_cancel_subscr_request'));
377 $this->form->clearCommandButtons();
378 $this->form->addCommandButton(
'join', $this->lng->txt(
'grp_join_request'));
379 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
399 if (
$ilUser->getId() == ANONYMOUS_USER_ID) {
400 $this->join_error = $this->lng->txt(
'permission_denied');
405 $this->join_error = $this->lng->txt(
'mem_error_preconditions');
410 $this->join_error = $this->lng->txt(
'err_wrong_password');
413 if (strcmp(
$pass, $this->container->getPassword()) !== 0) {
414 $this->join_error = $this->lng->txt(
'err_wrong_password');
419 $this->join_error = $this->lng->txt(
'fill_out_all_required_fields');
423 $this->join_error = $this->lng->txt($this->type .
'_agreement_required');
442 $tree =
$DIC[
'tree'];
443 $rbacreview =
$DIC[
'rbacreview'];
450 include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
451 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
454 $this->container->isMembershipLimited() and
455 $this->container->isWaitingListEnabled() and
459 $this->lng->txt(
'grp_added_to_list'),
460 $this->container->getTitle(),
464 $this->participants->sendNotification(
468 ilUtil::sendSuccess($info,
true);
472 $tree->getParentId($this->container->getRefId())
474 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
478 switch ($this->container->getRegistrationType()) {
481 $this->participants->addSubscriber(
$ilUser->getId());
482 $this->participants->updateSubscriptionTime(
$ilUser->getId(), time());
485 $this->participants->sendNotification(
490 ilUtil::sendSuccess($this->lng->txt(
"application_completed"),
true);
494 $tree->getParentId($this->container->getRefId())
496 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
502 $this->participants->sendNotification(
506 $this->participants->sendNotification(
511 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
515 ilUtil::sendSuccess($this->lng->txt(
"grp_registration_completed"),
true);
516 $this->ctrl->returnToParent($this);
534 include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
544 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
556 static $active =
null;
558 if ($active !==
null) {
561 if (!$this->container->getMaxMembers()) {
562 return $active =
false;
565 !$this->container->isWaitingListEnabled() or
566 !$this->container->isMembershipLimited()) {
567 return $active =
false;
570 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
571 return $active = (!$free or $this->
getWaitingList()->getCountUsers());
An exception for terminatinating execution or to throw for unit testing.
const GRP_REGISTRATION_DIRECT
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_DEACTIVATED
const GRP_REGISTRATION_REQUEST
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static checkForumsExistsInsert($ref_id, $user_id=0)
const TYPE_NOTIFICATION_REGISTRATION_REQUEST
const TYPE_NOTIFICATION_REGISTRATION
const TYPE_SUBSCRIBE_MEMBER
const TYPE_WAITING_LIST_MEMBER
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
GUI class for group registrations.
fillRegistrationType()
fill registration procedure
__construct($a_container)
Constructor.
fillMaxMembers()
fill max member informations
getFormTitle()
get form title
validate()
validate join request
addCommandButtons()
Add group specific command buttons.
executeCommand()
Execute command.
fillRegistrationPeriod()
show informations about the registration period
fillInformations()
fill informations
initParticipants()
Init course participants.
This class represents a non editable value in a property form.
static lookupRegistrationInfo($a_obj_id)
Lookup registration info @global ilDB $ilDB @global ilObjUser $ilUser @global ilLanguage $lng.
Base class for Course and Group registration.
getContainer()
Parent object.
validateAgreement()
Check Agreement.
setAccepted($a_status)
Set Agreement accepted.
validateCustomFields()
Check required course fields.
enableRegistration($a_status)
set registration disabled
getWaitingList()
Get waiting list object.
isRegistrationPossible()
check if registration is possible
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc