24include_once(
'./Services/Membership/classes/class.ilRegistrationGUI.php');
25include_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'));
163 $reg->setHtml(
$tpl->get());
168 #$reg->setAlert($warning);
171 $this->form->addItem($reg);
185 if(!$this->container->isMembershipLimited())
190 $tpl =
new ilTemplate(
'tpl.max_members_form.html',
true,
true,
'Services/Membership');
192 if($this->container->getMinMembers())
194 $tpl->setVariable(
'TXT_MIN',$this->lng->txt(
'mem_min_users'));
195 $tpl->setVariable(
'NUM_MIN',$this->container->getMinMembers());
198 if($this->container->getMaxMembers())
200 $tpl->setVariable(
'TXT_MAX',$this->lng->txt(
'mem_max_users'));
201 $tpl->setVariable(
'NUM_MAX',$this->container->getMaxMembers());
203 include_once
'./Modules/Group/classes/class.ilObjGroupAccess.php';
205 $free = $reg_info[
'reg_info_free_places'];
207 $tpl->setVariable(
'TXT_FREE',$this->lng->txt(
'mem_free_places'));
210 $tpl->setVariable(
'NUM_FREE',$free);
214 $tpl->setVariable(
'WARN_FREE',$free);
217 include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
221 $this->container->isWaitingListEnabled() and
222 $this->container->isMembershipLimited() and
227 $tpl->setVariable(
'TXT_WAIT',$this->lng->txt(
'mem_waiting_list_position'));
233 $tpl->setVariable(
'TXT_WAIT',$this->lng->txt(
'mem_waiting_list'));
245 !$this->container->isWaitingListEnabled())
249 $alert = $this->lng->txt(
'mem_alert_no_places');
252 $this->container->isWaitingListEnabled() and
253 $this->container->isMembershipLimited() and
261 $this->container->isWaitingListEnabled() and
262 $this->container->isMembershipLimited())
264 $alert = $this->lng->txt(
'grp_warn_no_max_set_on_waiting_list');
268 $this->container->isWaitingListEnabled() and
269 $this->container->isMembershipLimited() and
270 $this->getWaitingList()->getCountUsers())
272 $alert = $this->lng->txt(
'grp_warn_wl_set_on_waiting_list');
277 $max->setHtml(
$tpl->get());
280 #$max->setAlert($alert);
283 $this->form->addItem($max);
302 switch($this->container->getRegistrationType())
306 $reg->setValue($this->lng->txt(
'grp_reg_disabled'));
307 #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
308 $this->form->addItem($reg);
317 $txt->setValue($this->lng->txt(
'grp_pass_request'));
321 $pass->setInputType(
'password');
323 $pass->setMaxLength(32);
324 #$pass->setRequired(true);
325 $pass->setInfo($this->lng->txt(
'group_password_registration_msg'));
328 $this->form->addItem(
$txt);
338 $txt->setValue($this->lng->txt(
'grp_reg_request'));
341 $sub->setValue(
$_POST[
'subject']);
342 $sub->setInfo($this->lng->txt(
'group_req_registration_msg'));
345 if($this->participants->isSubscriber(
$ilUser->getId()))
347 $sub_data = $this->participants->getSubscriberData(
$ilUser->getId());
348 $sub->setValue($sub_data[
'subject']);
353 $txt->addSubItem($sub);
354 $this->form->addItem(
$txt);
364 $txt->setValue($this->lng->txt(
'group_req_direct'));
366 $this->form->addItem(
$txt);
384 parent::addCommandButtons();
387 switch($this->container->getRegistrationType())
390 if($this->participants->isSubscriber(
$ilUser->getId()))
392 $this->form->clearCommandButtons();
393 $this->form->addCommandButton(
'updateSubscriptionRequest', $this->lng->txt(
'grp_update_subscr_request'));
394 $this->form->addCommandButton(
'cancelSubscriptionRequest', $this->lng->txt(
'grp_cancel_subscr_request'));
402 $this->form->clearCommandButtons();
403 $this->form->addCommandButton(
'join', $this->lng->txt(
'grp_join_request'));
404 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
422 if(
$ilUser->getId() == ANONYMOUS_USER_ID)
424 $this->join_error = $this->lng->txt(
'permission_denied');
430 $this->join_error = $this->lng->txt(
'mem_error_preconditions');
437 $this->join_error = $this->lng->txt(
'err_wrong_password');
440 if(strcmp(
$pass,$this->container->getPassword()) !== 0)
442 $this->join_error = $this->lng->txt(
'err_wrong_password');
448 $this->join_error = $this->lng->txt(
'fill_out_all_required_fields');
453 $this->join_error = $this->lng->txt($this->type.
'_agreement_required');
474 include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
475 $free = max(0,$this->container->getMaxMembers() - $this->participants->getCountMembers());
478 $this->container->isMembershipLimited() and
479 $this->container->isWaitingListEnabled() and
483 $info = sprintf($this->lng->txt(
'grp_added_to_list'),
484 $this->container->getTitle(),
487 $this->participants->sendNotification(
492 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
493 $tree->getParentId($this->container->getRefId()));
494 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
498 switch($this->container->getRegistrationType())
502 $this->participants->addSubscriber(
$ilUser->getId());
503 $this->participants->updateSubscriptionTime(
$ilUser->getId(),time());
506 $this->participants->sendNotification(
512 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
513 $tree->getParentId($this->container->getRefId()));
514 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
520 $this->participants->sendNotification(
524 $this->participants->sendNotification(
529 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
535 $this->ctrl->returnToParent($this);
555 include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
565 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
575 static $active =
null;
581 if(!$this->container->getMaxMembers())
583 return $active =
false;
586 !$this->container->isWaitingListEnabled() or
587 !$this->container->isMembershipLimited())
589 return $active =
false;
592 $free = max(0,$this->container->getMaxMembers() - $this->participants->getCountMembers());
593 return $active = (!$free or $this->
getWaitingList()->getCountUsers());
const GRP_REGISTRATION_DIRECT
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_DEACTIVATED
const GRP_REGISTRATION_REQUEST
static formatDate(ilDateTime $date)
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 sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other 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