25 include_once(
'./Services/Membership/classes/class.ilRegistrationGUI.php');
49 parent::__construct($a_container);
51 $this->parent_gui = $a_parent_gui;
65 $ilTabs->activateTab(
'leave');
70 $this->ctrl->setReturn($this->parent_gui,
'infoScreen');
71 $this->ctrl->returnToParent($this);
75 $next_class = $this->ctrl->getNextClass($this);
79 $cmd = $this->ctrl->getCmd(
"show");
98 return $this->lng->txt(
'member_status');
100 return $this->lng->txt(
'crs_registration');
112 if($this->container->getImportantInformation())
116 $imp->setValue($value);
117 $this->form->addItem($imp);
120 if($this->container->getSyllabus())
124 $syl->setValue($value);
125 $this->form->addItem($syl);
136 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
139 if($this->container->getSubscriptionUnlimitedStatus())
142 $reg->
setValue($this->lng->txt(
'mem_unlimited'));
143 $this->form->addItem($reg);
156 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
157 $tpl->setVariable(
'TXT_FIRST',$this->lng->txt(
'mem_start'));
160 $tpl->setVariable(
'TXT_END',$this->lng->txt(
'mem_end'));
163 $warning = $this->lng->txt(
'mem_reg_not_started');
167 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
168 $tpl->setVariable(
'TXT_FIRST',$this->lng->txt(
'mem_start'));
171 $tpl->setVariable(
'TXT_END',$this->lng->txt(
'mem_end'));
175 $warning = $this->lng->txt(
'mem_reg_expired');
179 $tpl =
new ilTemplate(
'tpl.registration_period_form.html',
true,
true,
'Services/Membership');
180 $tpl->setVariable(
'TXT_FIRST',$this->lng->txt(
'mem_end'));
191 #$reg->setAlert($warning); 193 $this->form->addItem($reg);
209 if(!$this->container->isSubscriptionMembershipLimited())
213 $tpl =
new ilTemplate(
'tpl.max_members_form.html',
true,
true,
'Services/Membership');
214 $tpl->setVariable(
'TXT_MAX',$this->lng->txt(
'mem_max_users'));
215 $tpl->setVariable(
'NUM_MAX',$this->container->getSubscriptionMaxMembers());
217 $tpl->setVariable(
'TXT_FREE',$this->lng->txt(
'mem_free_places').
":");
219 include_once
'./Modules/Course/classes/class.ilObjCourseAccess.php';
221 $free = $reg_info[
'reg_info_free_places'];
225 $tpl->setVariable(
'NUM_FREE',$free);
229 $tpl->setVariable(
'WARN_FREE',$free);
232 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
235 $this->container->isSubscriptionMembershipLimited() and
236 $this->container->enabledWaitingList() and
241 $tpl->setVariable(
'TXT_WAIT',$this->lng->txt(
'mem_waiting_list_position'));
247 $tpl->setVariable(
'TXT_WAIT',$this->lng->txt(
'mem_waiting_list'));
258 !$this->container->enabledWaitingList())
263 #$alert = $this->lng->txt('mem_alert_no_places'); 266 $this->container->enabledWaitingList() and
267 $this->container->isSubscriptionMembershipLimited() and
276 $this->container->enabledWaitingList() and
277 $this->container->isSubscriptionMembershipLimited())
281 #$alert = $this->lng->txt('crs_warn_no_max_set_on_waiting_list'); 285 $this->container->enabledWaitingList() and
286 $this->container->isSubscriptionMembershipLimited() and
290 #$alert = $this->lng->txt('crs_warn_wl_set_on_waiting_list'); 297 $max->setAlert($alert);
299 $this->form->addItem($max);
316 #$reg->setHtml($this->lng->txt('crs_info_reg_deactivated')); 317 $reg->
setAlert($this->lng->txt(
'crs_info_reg_deactivated'));
318 #ilUtil::sendFailure($this->lng->txt('crs_info_reg_deactivated')); 319 #$reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type')); 320 #$reg->setValue($this->lng->txt('crs_info_reg_deactivated')); 321 #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert')); 322 $this->form->addItem($reg);
329 switch($this->container->getSubscriptionType())
338 $txt->setValue($this->lng->txt(
'crs_info_reg_direct'));
340 $this->form->addItem(
$txt);
345 $txt->setValue($this->lng->txt(
'crs_subscription_options_password'));
349 $pass->setInputType(
'password');
351 $pass->setMaxLength(32);
352 #$pass->setRequired(true); 353 $pass->setInfo($this->lng->txt(
'crs_info_reg_password'));
356 $this->form->addItem(
$txt);
366 $txt->setValue($this->lng->txt(
'crs_subscription_options_confirmation'));
370 $sub->setInfo($this->lng->txt(
'crs_info_reg_confirmation'));
373 if($this->participants->isSubscriber($ilUser->getId()))
375 $sub_data = $this->participants->getSubscriberData($ilUser->getId());
376 $sub->setValue($sub_data[
'subject']);
381 $txt->addSubItem($sub);
382 $this->form->addItem(
$txt);
401 parent::addCommandButtons();
404 switch($this->container->getSubscriptionType())
407 if($this->participants->isSubscriber($ilUser->getId()))
409 $this->form->clearCommandButtons();
410 $this->form->addCommandButton(
'updateSubscriptionRequest', $this->lng->txt(
'crs_update_subscr_request'));
411 $this->form->addCommandButton(
'cancelSubscriptionRequest', $this->lng->txt(
'crs_cancel_subscr_request'));
415 $this->form->clearCommandButtons();
416 $this->form->addCommandButton(
'join', $this->lng->txt(
'crs_join_request'));
417 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
440 if($ilUser->getId() == ANONYMOUS_USER_ID)
442 $this->join_error = $this->lng->txt(
'permission_denied');
451 $this->join_error = $this->lng->txt(
'mem_error_preconditions');
458 $this->join_error = $this->lng->txt(
'crs_password_required');
461 if(strcmp(
$pass,$this->container->getSubscriptionPassword()) !== 0)
463 $this->join_error = $this->lng->txt(
'crs_password_not_valid');
469 $this->join_error = $this->lng->txt(
'fill_out_all_required_fields');
474 $this->join_error = $this->lng->txt(
'crs_agreement_required');
497 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
498 $free = max(0,$this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
500 if($this->container->isSubscriptionMembershipLimited() and $this->container->enabledWaitingList() and (!$free or $waiting_list->getCountUsers()))
502 $waiting_list->
addToList($ilUser->getId());
503 $info = sprintf($this->lng->txt(
'crs_added_to_list'),
504 $waiting_list->getPosition($ilUser->getId()));
507 $this->participants->sendNotification($this->participants->NOTIFY_SUBSCRIPTION_REQUEST,$ilUser->getId());
508 $this->participants->sendNotification($this->participants->NOTIFY_WAITING_LIST,$ilUser->getId());
509 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
510 $tree->getParentId($this->container->getRefId()));
511 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
514 switch($this->container->getSubscriptionType())
517 $this->participants->addSubscriber($ilUser->getId());
518 $this->participants->updateSubscriptionTime($ilUser->getId(),time());
520 $this->participants->sendNotification($this->participants->NOTIFY_SUBSCRIPTION_REQUEST,$ilUser->getId());
523 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
524 $tree->getParentId($this->container->getRefId()));
525 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
530 if($this->container->isSubscriptionMembershipLimited() && $this->container->getSubscriptionMaxMembers())
535 $this->container->getSubscriptionMaxMembers(),
547 $this->participants->sendNotification($this->participants->NOTIFY_ADMINS,$ilUser->getId());
548 $this->participants->sendNotification($this->participants->NOTIFY_REGISTERED,$ilUser->getId());
550 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
553 if($this->container->getType() ==
"crs")
555 $this->container->checkLPStatusSync($ilUser->getId());
561 $this->ctrl->returnToParent($this);
583 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
594 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
604 static $active = null;
610 if(!$this->container->enabledWaitingList() or !$this->container->isSubscriptionMembershipLimited())
612 return $active =
false;
614 if(!$this->container->getSubscriptionMaxMembers())
616 return $active =
false;
619 $free = max(0,$this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
620 return $active = (!$free or $this->
getWaitingList()->getCountUsers());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
setValue($a_value)
Set Value.
getFormTitle()
get form title
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 _getInstanceByObjId($a_obj_id)
Get singleton instance.
setValue($a_value)
Set Value.
__construct($a_container, $a_parent_gui)
Constructor.
static getDefaultMemberRole($a_ref_id)
const IL_CRS_SUBSCRIPTION_CONFIRMATION
Base class for Course and Group registration.
fillRegistrationType()
fill registration type
addToList($a_usr_id)
Add to waiting list and raise event.
validateAgreement()
Check Agreement.
setAccepted($a_status)
Set Agreement accepted.
const IL_CRS_SUBSCRIPTION_PASSWORD
fillRegistrationPeriod()
show informations about the registration period
enableRegistration($a_status)
set registration disabled
executeCommand()
Execute command.
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.
static lookupRegistrationInfo($a_obj_id)
Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.
validateCustomFields()
Check required course fields.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
validate()
Validate subscription request.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
GUI class for course registrations.
show()
show registration form
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
fillInformations()
fill informations
const IL_CRS_SUBSCRIPTION_DIRECT
addCommandButtons()
Add group specific command buttons.
static checkForumsExistsInsert($ref_id, $user_id=0)
getContainer()
Parent object.
static redirect($a_script)
http redirect to other script
const IL_CRS_SUBSCRIPTION_DEACTIVATED
fillMaxMembers()
fill max members
initParticipants()
Init course participants.