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);
61 $ilTabs->activateTab(
'leave');
64 switch ($next_class) {
66 $cmd = $this->ctrl->getCmd(
"show");
85 return $this->lng->txt(
'member_status');
87 return $this->lng->txt(
'grp_registration');
99 if ($this->container->getInformation()) {
102 $imp->setValue($value);
103 $this->form->addItem($imp);
114 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
117 if ($this->container->isRegistrationUnlimited()) {
119 $reg->
setValue($this->lng->txt(
'mem_unlimited'));
120 $this->form->addItem($reg);
124 $start = $this->container->getRegistrationStart();
125 $end = $this->container->getRegistrationEnd();
129 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
130 $tpl->setVariable(
'TXT_FIRST', $this->lng->txt(
'mem_start'));
133 $tpl->setVariable(
'TXT_END', $this->lng->txt(
'mem_end'));
136 $warning = $this->lng->txt(
'mem_reg_not_started');
138 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
139 $tpl->setVariable(
'TXT_FIRST', $this->lng->txt(
'mem_start'));
142 $tpl->setVariable(
'TXT_END', $this->lng->txt(
'mem_end'));
145 $warning = $this->lng->txt(
'mem_reg_expired');
147 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
148 $tpl->setVariable(
'TXT_FIRST', $this->lng->txt(
'mem_end'));
157 #$reg->setAlert($warning); 160 $this->form->addItem($reg);
174 if (!$this->container->isMembershipLimited()) {
178 $tpl =
new ilTemplate(
'tpl.max_members_form.html',
true,
true,
'Services/Membership');
180 if ($this->container->getMinMembers()) {
181 $tpl->setVariable(
'TXT_MIN', $this->lng->txt(
'mem_min_users'));
182 $tpl->setVariable(
'NUM_MIN', $this->container->getMinMembers());
185 if ($this->container->getMaxMembers()) {
186 $tpl->setVariable(
'TXT_MAX', $this->lng->txt(
'mem_max_users'));
187 $tpl->setVariable(
'NUM_MAX', $this->container->getMaxMembers());
189 include_once
'./Modules/Group/classes/class.ilObjGroupAccess.php';
191 $free = $reg_info[
'reg_info_free_places'];
195 $tpl->setVariable(
'NUM_FREE', $free);
197 $tpl->setVariable(
'WARN_FREE', $free);
200 include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
204 $this->container->isWaitingListEnabled() and
205 $this->container->isMembershipLimited() and
208 $tpl->setVariable(
'TXT_WAIT', $this->lng->txt(
'mem_waiting_list_position'));
211 $tpl->setVariable(
'TXT_WAIT', $this->lng->txt(
'mem_waiting_list'));
223 !$this->container->isWaitingListEnabled()) {
226 $alert = $this->lng->txt(
'mem_alert_no_places');
228 $this->container->isWaitingListEnabled() and
229 $this->container->isMembershipLimited() and
235 $this->container->isWaitingListEnabled() and
236 $this->container->isMembershipLimited()) {
237 $alert = $this->lng->txt(
'grp_warn_no_max_set_on_waiting_list');
240 $this->container->isWaitingListEnabled() and
241 $this->container->isMembershipLimited() and
243 $alert = $this->lng->txt(
'grp_warn_wl_set_on_waiting_list');
249 if (strlen($alert)) {
250 #$max->setAlert($alert); 253 $this->form->addItem($max);
271 switch ($this->container->getRegistrationType()) {
274 $reg->
setValue($this->lng->txt(
'grp_reg_disabled'));
275 #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert')); 276 $this->form->addItem($reg);
285 $txt->setValue($this->lng->txt(
'grp_pass_request'));
289 $pass->setInputType(
'password');
291 $pass->setMaxLength(32);
292 #$pass->setRequired(true); 293 $pass->setInfo($this->lng->txt(
'group_password_registration_msg'));
296 $this->form->addItem(
$txt);
307 $txt->setValue($this->lng->txt(
'grp_reg_request'));
311 $sub->setInfo($this->lng->txt(
'group_req_registration_msg'));
314 if ($this->participants->isSubscriber($ilUser->getId())) {
315 $sub_data = $this->participants->getSubscriberData($ilUser->getId());
316 $sub->setValue($sub_data[
'subject']);
321 $txt->addSubItem($sub);
322 $this->form->addItem(
$txt);
333 $txt->setValue($this->lng->txt(
'group_req_direct'));
335 $this->form->addItem(
$txt);
353 parent::addCommandButtons();
356 switch ($this->container->getRegistrationType()) {
358 if ($this->participants->isSubscriber($ilUser->getId())) {
359 $this->form->clearCommandButtons();
360 $this->form->addCommandButton(
'updateSubscriptionRequest', $this->lng->txt(
'grp_update_subscr_request'));
361 $this->form->addCommandButton(
'cancelSubscriptionRequest', $this->lng->txt(
'grp_cancel_subscr_request'));
366 $this->form->clearCommandButtons();
367 $this->form->addCommandButton(
'join', $this->lng->txt(
'grp_join_request'));
368 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
386 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
387 $this->join_error = $this->lng->txt(
'permission_denied');
392 $this->join_error = $this->lng->txt(
'mem_error_preconditions');
397 $this->join_error = $this->lng->txt(
'err_wrong_password');
400 if (strcmp(
$pass, $this->container->getPassword()) !== 0) {
401 $this->join_error = $this->lng->txt(
'err_wrong_password');
406 $this->join_error = $this->lng->txt(
'fill_out_all_required_fields');
410 $this->join_error = $this->lng->txt($this->type .
'_agreement_required');
431 include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
432 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
435 $this->container->isMembershipLimited() and
436 $this->container->isWaitingListEnabled() and
437 (!$free or $waiting_list->getCountUsers())) {
438 $waiting_list->
addToList($ilUser->getId());
440 $this->lng->txt(
'grp_added_to_list'),
441 $this->container->getTitle(),
442 $waiting_list->getPosition($ilUser->getId())
445 $this->participants->sendNotification(
450 $ilCtrl->setParameterByClass(
453 $tree->getParentId($this->container->getRefId())
455 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
459 switch ($this->container->getRegistrationType()) {
462 $this->participants->addSubscriber($ilUser->getId());
463 $this->participants->updateSubscriptionTime($ilUser->getId(),
time());
466 $this->participants->sendNotification(
472 $ilCtrl->setParameterByClass(
475 $tree->getParentId($this->container->getRefId())
477 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
483 $this->participants->sendNotification(
487 $this->participants->sendNotification(
492 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
497 $this->ctrl->returnToParent($this);
515 include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
525 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
535 static $active = null;
537 if ($active !== null) {
540 if (!$this->container->getMaxMembers()) {
541 return $active =
false;
544 !$this->container->isWaitingListEnabled() or
545 !$this->container->isMembershipLimited()) {
546 return $active =
false;
549 $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
550 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.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
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.
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
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static checkForumsExistsInsert($ref_id, $user_id=0)
getContainer()
Parent object.
static redirect($a_script)
const GRP_REGISTRATION_DIRECT
getFormTitle()
get form title