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);
 
   63        if (!
$DIC->access()->checkAccess(
'join', 
'', $this->getRefId())) {
 
   64            $this->ctrl->redirectByClass(ilObjGroupGUI::class, 
'infoScreen');
 
   68            $ilTabs->activateTab(
'leave');
 
   71        switch ($next_class) {
 
   73                $cmd = $this->ctrl->getCmd(
"show");
 
   94            return $this->lng->txt(
'member_status');
 
   96        return $this->lng->txt(
'grp_registration');
 
  108        if ($this->container->getInformation()) {
 
  111            $imp->setValue($value);
 
  112            $this->form->addItem($imp);
 
  123        include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
 
  126        if ($this->container->isRegistrationUnlimited()) {
 
  128            $reg->setValue($this->lng->txt(
'mem_unlimited'));
 
  129            $this->form->addItem($reg);
 
  133        $start = $this->container->getRegistrationStart();
 
  134        $end = $this->container->getRegistrationEnd();
 
  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_not_started');
 
  147            $tpl = 
new ilTemplate(
'tpl.registration_period_form.html', 
true, 
true, 
'Services/Membership');
 
  148            $tpl->setVariable(
'TXT_FIRST', $this->lng->txt(
'mem_start'));
 
  151            $tpl->setVariable(
'TXT_END', $this->lng->txt(
'mem_end'));
 
  154            $warning = $this->lng->txt(
'mem_reg_expired');
 
  156            $tpl = 
new ilTemplate(
'tpl.registration_period_form.html', 
true, 
true, 
'Services/Membership');
 
  157            $tpl->setVariable(
'TXT_FIRST', $this->lng->txt(
'mem_end'));
 
  162        $reg->setHtml(
$tpl->get());
 
  163        if (strlen($warning)) {
 
  166            #$reg->setAlert($warning); 
  169        $this->form->addItem($reg);
 
  185        if (!$this->container->isMembershipLimited()) {
 
  189        $tpl = 
new ilTemplate(
'tpl.max_members_form.html', 
true, 
true, 
'Services/Membership');
 
  191        if ($this->container->getMinMembers()) {
 
  192            $tpl->setVariable(
'TXT_MIN', $this->lng->txt(
'mem_min_users'));
 
  193            $tpl->setVariable(
'NUM_MIN', $this->container->getMinMembers());
 
  196        if ($this->container->getMaxMembers()) {
 
  197            $tpl->setVariable(
'TXT_MAX', $this->lng->txt(
'mem_max_users'));
 
  198            $tpl->setVariable(
'NUM_MAX', $this->container->getMaxMembers());
 
  199            $tpl->setVariable(
'TXT_FREE', $this->lng->txt(
'mem_free_places') . 
":");
 
  201            include_once 
'./Modules/Group/classes/class.ilObjGroupAccess.php';
 
  203            $free = $reg_info[
'reg_info_free_places'];
 
  207                $tpl->setVariable(
'NUM_FREE', $free);
 
  209                $tpl->setVariable(
'WARN_FREE', $free);
 
  212            include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
 
  216                    $this->container->isWaitingListEnabled() and
 
  217                    $this->container->isMembershipLimited() and
 
  220                    $tpl->setVariable(
'TXT_WAIT', $this->lng->txt(
'mem_waiting_list_position'));
 
  223                    $tpl->setVariable(
'TXT_WAIT', $this->lng->txt(
'mem_waiting_list'));
 
  235                    !$this->container->isWaitingListEnabled()) {
 
  238                $alert = $this->lng->txt(
'mem_alert_no_places');
 
  240                    $this->container->isWaitingListEnabled() and
 
  241                    $this->container->isMembershipLimited() and
 
  247                    $this->container->isWaitingListEnabled() and
 
  248                    $this->container->isMembershipLimited()) {
 
  249                $alert = $this->lng->txt(
'grp_warn_no_max_set_on_waiting_list');
 
  252                    $this->container->isWaitingListEnabled() and
 
  253                    $this->container->isMembershipLimited() and
 
  254                    $this->getWaitingList()->getCountUsers()) {
 
  255                $alert = $this->lng->txt(
'grp_warn_wl_set_on_waiting_list');
 
  260        $max->setHtml(
$tpl->get());
 
  261        if (strlen($alert)) {
 
  262            #$max->setAlert($alert); 
  265        $this->form->addItem($max);
 
  285        switch ($this->container->getRegistrationType()) {
 
  288                $reg->setValue($this->lng->txt(
'grp_reg_disabled'));
 
  289                #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert')); 
  290                $this->form->addItem($reg);
 
  299                $txt->setValue($this->lng->txt(
'grp_pass_request'));
 
  303                $pass->setInputType(
'password');
 
  305                $pass->setMaxLength(32);
 
  306                #$pass->setRequired(true); 
  307                $pass->setInfo($this->lng->txt(
'group_password_registration_msg'));
 
  310                $this->form->addItem(
$txt);
 
  321                $txt->setValue($this->lng->txt(
'grp_reg_request'));
 
  324                $sub->setValue(
$_POST[
'subject']);
 
  325                $sub->setInfo($this->lng->txt(
'group_req_registration_msg'));
 
  328                if ($this->participants->isSubscriber(
$ilUser->getId())) {
 
  329                    $sub_data = $this->participants->getSubscriberData(
$ilUser->getId());
 
  330                    $sub->setValue($sub_data[
'subject']);
 
  335                $txt->addSubItem($sub);
 
  336                $this->form->addItem(
$txt);
 
  347                $txt->setValue($this->lng->txt(
'group_req_direct'));
 
  349                $this->form->addItem(
$txt);
 
  369        parent::addCommandButtons();
 
  372        switch ($this->container->getRegistrationType()) {
 
  374                if ($this->participants->isSubscriber(
$ilUser->getId())) {
 
  375                    $this->form->clearCommandButtons();
 
  376                    $this->form->addCommandButton(
'updateSubscriptionRequest', $this->lng->txt(
'grp_update_subscr_request'));
 
  377                    $this->form->addCommandButton(
'cancelSubscriptionRequest', $this->lng->txt(
'grp_cancel_subscr_request'));
 
  382                    $this->form->clearCommandButtons();
 
  383                    $this->form->addCommandButton(
'join', $this->lng->txt(
'grp_join_request'));
 
  384                    $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
  405            $this->join_error = $this->lng->txt(
'permission_denied');
 
  410            $this->join_error = $this->lng->txt(
'mem_error_preconditions');
 
  415                $this->join_error = $this->lng->txt(
'err_wrong_password');
 
  418            if (strcmp(
$pass, $this->container->getPassword()) !== 0) {
 
  419                $this->join_error = $this->lng->txt(
'err_wrong_password');
 
  424            $this->join_error = $this->lng->txt(
'fill_out_all_required_fields');
 
  428            $this->join_error = $this->lng->txt($this->type . 
'_agreement_required');
 
  447        $tree = 
$DIC[
'tree'];
 
  448        $rbacreview = 
$DIC[
'rbacreview'];
 
  450        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  455        include_once(
'./Modules/Group/classes/class.ilGroupWaitingList.php');
 
  456        $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
 
  459                $this->container->isMembershipLimited() and
 
  460                $this->container->isWaitingListEnabled() and
 
  464                $this->lng->txt(
'grp_added_to_list'),
 
  465                $this->container->getTitle(),
 
  469            $this->participants->sendNotification(
 
  473            ilUtil::sendSuccess($info, 
true);
 
  474            $ilCtrl->setParameterByClass(
 
  477                $tree->getParentId($this->container->getRefId())
 
  479            $ilCtrl->redirectByClass(
"ilrepositorygui", 
"");
 
  483        switch ($this->container->getRegistrationType()) {
 
  486                $this->participants->addSubscriber(
$ilUser->getId());
 
  487                $this->participants->updateSubscriptionTime(
$ilUser->getId(), time());
 
  490                $this->participants->sendNotification(
 
  495                ilUtil::sendSuccess($this->lng->txt(
"application_completed"), 
true);
 
  496                $ilCtrl->setParameterByClass(
 
  499                    $tree->getParentId($this->container->getRefId())
 
  501                $ilCtrl->redirectByClass(
"ilrepositorygui", 
"");
 
  507                $this->participants->sendNotification(
 
  511                $this->participants->sendNotification(
 
  516                include_once 
'./Modules/Forum/classes/class.ilForumNotification.php';
 
  520                    ilUtil::sendSuccess($this->lng->txt(
"grp_registration_completed"), 
true);
 
  521                    $this->ctrl->returnToParent($this);
 
  539        include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
 
  549        include_once 
'./Modules/Group/classes/class.ilGroupWaitingList.php';
 
  561        static $active = 
null;
 
  563        if ($active !== 
null) {
 
  566        if (!$this->container->getMaxMembers()) {
 
  567            return $active = 
false;
 
  570                !$this->container->isWaitingListEnabled() or
 
  571                !$this->container->isMembershipLimited()) {
 
  572            return $active = 
false;
 
  575        $free = max(0, $this->container->getMaxMembers() - $this->participants->getCountMembers());
 
  576        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