24 include_once(
'./Services/Membership/classes/class.ilRegistrationGUI.php');
25 include_once
'./Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
46 parent::__construct($a_container);
58 $next_class = $this->ctrl->getNextClass($this);
62 $ilTabs->activateTab(
'leave');
68 $cmd = $this->ctrl->getCmd(
"show");
88 return $this->lng->txt(
'member_status');
90 return $this->lng->txt(
'grp_registration');
102 if($this->container->getInformation())
106 $imp->setValue($value);
107 $this->form->addItem($imp);
118 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
121 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();
135 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
136 $tpl->setVariable(
'TXT_FIRST',$this->lng->txt(
'mem_start'));
139 $tpl->setVariable(
'TXT_END',$this->lng->txt(
'mem_end'));
142 $warning = $this->lng->txt(
'mem_reg_not_started');
146 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
147 $tpl->setVariable(
'TXT_FIRST',$this->lng->txt(
'mem_start'));
150 $tpl->setVariable(
'TXT_END',$this->lng->txt(
'mem_end'));
153 $warning = $this->lng->txt(
'mem_reg_expired');
157 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
158 $tpl->setVariable(
'TXT_FIRST',$this->lng->txt(
'mem_end'));
168 #$reg->setAlert($warning); 171 $this->form->addItem($reg);
185 if(!$this->container->isMembershipLimited())
189 $tpl =
new ilTemplate(
'tpl.max_members_form.html',
true,
true,
'Services/Membership');
190 $tpl->setVariable(
'TXT_MAX',$this->lng->txt(
'mem_max_users'));
191 $tpl->setVariable(
'NUM_MAX',$this->container->getMaxMembers());
193 $tpl->setVariable(
'TXT_FREE',$this->lng->txt(
'mem_free_places').
":");
195 include_once
'./Modules/Group/classes/class.ilObjGroupAccess.php';
197 $free = $reg_info[
'reg_info_free_places'];
202 $tpl->setVariable(
'NUM_FREE',$free);
206 $tpl->setVariable(
'WARN_FREE',$free);
209 include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
213 $this->container->isWaitingListEnabled() and
214 $this->container->isMembershipLimited() and
219 $tpl->setVariable(
'TXT_WAIT',$this->lng->txt(
'mem_waiting_list_position'));
225 $tpl->setVariable(
'TXT_WAIT',$this->lng->txt(
'mem_waiting_list'));
237 !$this->container->isWaitingListEnabled())
241 $alert = $this->lng->txt(
'mem_alert_no_places');
244 $this->container->isWaitingListEnabled() and
245 $this->container->isMembershipLimited() and
253 $this->container->isWaitingListEnabled() and
254 $this->container->isMembershipLimited())
256 $alert = $this->lng->txt(
'grp_warn_no_max_set_on_waiting_list');
260 $this->container->isWaitingListEnabled() and
261 $this->container->isMembershipLimited() and
264 $alert = $this->lng->txt(
'grp_warn_wl_set_on_waiting_list');
271 #$max->setAlert($alert); 274 $this->form->addItem($max);
293 switch($this->container->getRegistrationType())
297 $reg->
setValue($this->lng->txt(
'grp_reg_disabled'));
298 #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert')); 299 $this->form->addItem($reg);
308 $txt->setValue($this->lng->txt(
'grp_pass_request'));
312 $pass->setInputType(
'password');
314 $pass->setMaxLength(32);
315 #$pass->setRequired(true); 316 $pass->setInfo($this->lng->txt(
'group_password_registration_msg'));
319 $this->form->addItem(
$txt);
329 $txt->setValue($this->lng->txt(
'grp_reg_request'));
333 $sub->setInfo($this->lng->txt(
'group_req_registration_msg'));
336 if($this->participants->isSubscriber($ilUser->getId()))
338 $sub_data = $this->participants->getSubscriberData($ilUser->getId());
339 $sub->setValue($sub_data[
'subject']);
344 $txt->addSubItem($sub);
345 $this->form->addItem(
$txt);
355 $txt->setValue($this->lng->txt(
'group_req_direct'));
357 $this->form->addItem(
$txt);
375 parent::addCommandButtons();
378 switch($this->container->getRegistrationType())
381 if($this->participants->isSubscriber($ilUser->getId()))
383 $this->form->clearCommandButtons();
384 $this->form->addCommandButton(
'updateSubscriptionRequest', $this->lng->txt(
'grp_update_subscr_request'));
385 $this->form->addCommandButton(
'cancelSubscriptionRequest', $this->lng->txt(
'grp_cancel_subscr_request'));
393 $this->form->clearCommandButtons();
394 $this->form->addCommandButton(
'join', $this->lng->txt(
'grp_join_request'));
395 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
413 if($ilUser->getId() == ANONYMOUS_USER_ID)
415 $this->join_error = $this->lng->txt(
'permission_denied');
421 $this->join_error = $this->lng->txt(
'mem_error_preconditions');
428 $this->join_error = $this->lng->txt(
'err_wrong_password');
431 if(strcmp(
$pass,$this->container->getPassword()) !== 0)
433 $this->join_error = $this->lng->txt(
'err_wrong_password');
439 $this->join_error = $this->lng->txt(
'fill_out_all_required_fields');
444 $this->join_error = $this->lng->txt($this->type.
'_agreement_required');
465 include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
466 $free = max(0,$this->container->getMaxMembers() - $this->participants->getCountMembers());
469 $this->container->isMembershipLimited() and
470 $this->container->isWaitingListEnabled() and
471 (!$free or $waiting_list->getCountUsers()))
473 $waiting_list->
addToList($ilUser->getId());
474 $info = sprintf($this->lng->txt(
'grp_added_to_list'),
475 $this->container->getTitle(),
476 $waiting_list->getPosition($ilUser->getId()));
478 $this->participants->sendNotification(
483 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
484 $tree->getParentId($this->container->getRefId()));
485 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
489 switch($this->container->getRegistrationType())
493 $this->participants->addSubscriber($ilUser->getId());
494 $this->participants->updateSubscriptionTime($ilUser->getId(),time());
497 $this->participants->sendNotification(
503 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
504 $tree->getParentId($this->container->getRefId()));
505 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
511 $this->participants->sendNotification(
515 $this->participants->sendNotification(
520 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
526 $this->ctrl->returnToParent($this);
546 include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
556 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
566 static $active = null;
572 if(!$this->container->getMaxMembers())
574 return $active =
false;
577 !$this->container->isWaitingListEnabled() or
578 !$this->container->isMembershipLimited())
580 return $active =
false;
583 $free = max(0,$this->container->getMaxMembers() - $this->participants->getCountMembers());
584 return $active = (!$free or $this->
getWaitingList()->getCountUsers());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
fillRegistrationType()
fill registration procedure
const TYPE_NOTIFICATION_REGISTRATION_REQUEST
setValue($a_value)
Set Value.
addToList($a_usr_id)
Add to waiting list and raise event.
fillInformations()
fill informations
const GRP_REGISTRATION_DEACTIVATED
const TYPE_SUBSCRIBE_MEMBER
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.
getWaitingList()
Get waiting list object.
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.
setValue($a_value)
Set Value.
Base class for Course and Group registration.
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_REQUEST
const TYPE_NOTIFICATION_REGISTRATION
validateAgreement()
Check Agreement.
const TYPE_WAITING_LIST_MEMBER
setAccepted($a_status)
Set Agreement accepted.
static lookupRegistrationInfo($a_obj_id)
Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.
addCommandButtons()
Add group specific command buttons.
enableRegistration($a_status)
set registration disabled
fillRegistrationPeriod()
show informations about the registration period
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
special template class to simplify handling of ITX/PEAR
isRegistrationPossible()
check if registration is possible
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
validateCustomFields()
Check required course fields.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
GUI class for group registrations.
initParticipants()
Init course participants.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct($a_container)
Constructor.
fillMaxMembers()
fill max member informations
This class represents a non editable value in a property form.
executeCommand()
Execute command.
This class represents a text area property in a property form.
validate()
validate join request
static checkForumsExistsInsert($ref_id, $user_id=0)
getContainer()
Parent object.
static redirect($a_script)
http redirect to other script
const GRP_REGISTRATION_DIRECT
getFormTitle()
get form title