ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilRegistrationGUI Class Reference

Base class for Course and Group registration. More...

+ Inheritance diagram for ilRegistrationGUI:
+ Collaboration diagram for ilRegistrationGUI:

Public Member Functions

 __construct ($a_container)
 Constructor.
 cancel ()
 cancel subscription
 show ()
 show registration form
 join ()
 join

Protected Member Functions

 isRegistrationPossible ()
 check if registration is possible
 enableRegistration ($a_status)
 set registration disabled
 initParticipants ()
 Init participants object (course or group participants)
 initWaitingList ()
 Init waiting list (course or group waiting list)
 isWaitingListActive ()
 Check if the waiting list is active Maximum of members exceeded or any user on the waiting list.
 getWaitingList ()
 Get waiting list object.
 leaveWaitingList ()
 getFormTitle ()
 Get title for property form.
 fillInformations ()
 fill informations
 fillRegistrationPeriod ()
 show informations about the registration period
 fillMaxMembers ()
 show informations about the maximum number of user.
 fillRegistrationType ()
 show informations about registration procedure
 fillMembershipLimitation ()
 Show membership limitations.
 fillAgreement ()
 Show user agreement.
 validate ()
 validate join request
 initForm ()
 init registration form
 addCommandButtons ()
 Add command buttons.
 updateSubscriptionRequest ()
 Update subscription message.
 cancelSubscriptionRequest ()

Protected Attributes

 $container = null
 $ref_id
 $obj_id
 $participants
 $waiting_list = null
 $form
 $registration_possible = true
 $join_error = ''
 $tpl
 $lng
 $ctrl

Detailed Description

Base class for Course and Group registration.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 33 of file class.ilRegistrationGUI.php.

Constructor & Destructor Documentation

ilRegistrationGUI::__construct (   $a_container)

Constructor.

public

Parameters
objectCourse or Group object
Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Definition at line 58 of file class.ilRegistrationGUI.php.

References $ilCtrl, $lng, $tpl, ilObject\_lookupObjId(), ilObject\_lookupType(), initParticipants(), and initWaitingList().

{
global $lng,$ilCtrl,$tpl;
$this->lng = $lng;
$this->lng->loadLanguageModule('crs');
$this->lng->loadLanguageModule('grp');
$this->ctrl = $ilCtrl;
$this->tpl = $tpl;
$this->container = $a_container;
$this->ref_id = $this->container->getRefId();
$this->obj_id = ilObject::_lookupObjId($this->ref_id);
$this->type = ilObject::_lookupType($this->obj_id);
// Init participants
$this->initParticipants();
// Init waiting list
$this->initWaitingList();
}

+ Here is the call graph for this function:

Member Function Documentation

ilRegistrationGUI::addCommandButtons ( )
protected

Add command buttons.

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Definition at line 365 of file class.ilRegistrationGUI.php.

References elseif(), getWaitingList(), isRegistrationPossible(), isWaitingListActive(), and ilUtil\sendQuestion().

Referenced by initForm().

{
global $ilUser;
if($this->isRegistrationPossible() and $this->isWaitingListActive() and !$this->getWaitingList()->isOnList($ilUser->getId()))
{
$this->form->addCommandButton('join',$this->lng->txt('mem_add_to_wl'));
$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
}
elseif($this->isRegistrationPossible() and !$this->getWaitingList()->isOnList($ilUser->getId()))
{
$this->form->addCommandButton('join',$this->lng->txt('join'));
$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
}
if($this->getWaitingList()->isOnList($ilUser->getId()))
{
sprintf($this->lng->txt($this->container->getType().'_cancel_waiting_list'),
$this->container->getTitle())
);
$this->form->addCommandButton('leaveWaitingList', $this->lng->txt('leave_waiting_list'));
$this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRegistrationGUI::cancel ( )

cancel subscription

public

Definition at line 265 of file class.ilRegistrationGUI.php.

References ilUtil\redirect().

{
global $tree;
ilUtil::redirect('repository.php?ref_id='.
$tree->getParentId($this->container->getRefId()));
}

+ Here is the call graph for this function:

ilRegistrationGUI::cancelSubscriptionRequest ( )
protected

Definition at line 403 of file class.ilRegistrationGUI.php.

References ilUtil\redirect(), and ilUtil\sendSuccess().

{
global $ilUser,$tree;
$this->participants->deleteSubscriber($ilUser->getId());
ilUtil::sendSuccess($this->lng->txt('sub_request_deleted'),true);
ilUtil::redirect("repository.php?ref_id=".$tree->getParentId($this->container->getRefId()));
}

+ Here is the call graph for this function:

ilRegistrationGUI::enableRegistration (   $a_status)
protected
ilRegistrationGUI::fillAgreement ( )
protected

Show user agreement.

protected

Returns

Reimplemented in ilCourseRegistrationGUI.

Definition at line 254 of file class.ilRegistrationGUI.php.

Referenced by initForm().

{
return true;
}

+ Here is the caller graph for this function:

ilRegistrationGUI::fillInformations ( )
abstractprotected

fill informations

protected

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

ilRegistrationGUI::fillMaxMembers ( )
abstractprotected

show informations about the maximum number of user.

protected

Parameters
@return

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

ilRegistrationGUI::fillMembershipLimitation ( )
protected

Show membership limitations.

protected

Returns

Definition at line 200 of file class.ilRegistrationGUI.php.

References $obj_id, $ref_id, $title, $tpl, $type, ilObjCourseGrouping\_checkGroupingDependencies(), ilObjCourseGrouping\_getGroupingItems(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), enableRegistration(), ilUtil\getTypeIconPath(), and ilCustomInputGUI\setHtml().

Referenced by initForm().

{
global $ilAccess;
include_once('Modules/Course/classes/class.ilObjCourseGrouping.php');
if(!$items = ilObjCourseGrouping::_getGroupingItems($this->container))
{
return true;
}
$mem = new ilCustomInputGUI($this->lng->txt('groupings'));
$tpl = new ilTemplate('tpl.membership_limitation_form.html',true,true,'Services/Membership');
$tpl->setVariable('LIMIT_INTRO',$this->lng->txt($this->type.'_grp_info_reg'));
foreach($items as $ref_id)
{
if($ilAccess->checkAccess('visible','',$ref_id,$type))
{
include_once('./classes/class.ilLink.php');
$tpl->setVariable('LINK_ITEM','repository.php?ref_id='.$ref_id);
$tpl->setVariable('ITEM_LINKED_TITLE',$title);
}
else
{
$tpl->setVariable('ITEM_TITLE');
}
$tpl->setCurrentBlock('items');
$tpl->setVariable('TYPE_ICON',ilUtil::getTypeIconPath($type,$obj_id,'tiny'));
$tpl->setVariable('ALT_ICON',$this->lng->txt('obj_'.$type));
$tpl->parseCurrentBlock();
}
$mem->setHtml($tpl->get());
{
$mem->setAlert($this->container->getMessage());
$this->enableRegistration(false);
}
$this->form->addItem($mem);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRegistrationGUI::fillRegistrationPeriod ( )
abstractprotected

show informations about the registration period

protected

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

ilRegistrationGUI::fillRegistrationType ( )
abstractprotected

show informations about registration procedure

protected

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

ilRegistrationGUI::getFormTitle ( )
abstractprotected

Get title for property form.

protected

Returns
string title

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

ilRegistrationGUI::initForm ( )
protected

init registration form

protected

Returns

Definition at line 326 of file class.ilRegistrationGUI.php.

References addCommandButtons(), fillAgreement(), fillInformations(), fillMaxMembers(), fillMembershipLimitation(), fillRegistrationPeriod(), fillRegistrationType(), getFormTitle(), and isRegistrationPossible().

Referenced by join(), and show().

{
global $ilUser;
if(is_object($this->form))
{
return true;
}
include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this,'join'));
$this->form->setTitle($this->getFormTitle());
$this->fillInformations();
{
}
{
}
{
$this->fillMaxMembers();
}
{
$this->fillAgreement();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRegistrationGUI::initParticipants ( )
abstractprotected

Init participants object (course or group participants)

protected

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by __construct().

+ Here is the caller graph for this function:

ilRegistrationGUI::initWaitingList ( )
abstractprotected

Init waiting list (course or group waiting list)

protected

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by __construct().

+ Here is the caller graph for this function:

ilRegistrationGUI::isRegistrationPossible ( )
protected
ilRegistrationGUI::isWaitingListActive ( )
abstractprotected

Check if the waiting list is active Maximum of members exceeded or any user on the waiting list.

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by addCommandButtons().

+ Here is the caller graph for this function:

ilRegistrationGUI::join ( )

join

public

Parameters
@return

Definition at line 294 of file class.ilRegistrationGUI.php.

References initForm(), ilUtil\sendFailure(), show(), and validate().

{
$this->initForm();
if(!$this->validate())
{
ilUtil::sendFailure($this->join_error);
$this->show();
return false;
}
$this->add();
}

+ Here is the call graph for this function:

ilRegistrationGUI::leaveWaitingList ( )
protected

Definition at line 140 of file class.ilRegistrationGUI.php.

References $ilCtrl, getWaitingList(), ilUtil\redirect(), and ilUtil\sendSuccess().

{
global $ilUser,$tree,$ilCtrl;
$this->getWaitingList()->removeFromList($ilUser->getId());
$parent = $tree->getParentId($this->container->getRefId());
$message = sprintf($this->lng->txt($this->container->getType().'_removed_from_waiting_list'),
$this->container->getTitle());
ilUtil::sendSuccess($message,true);
ilUtil::redirect('repository.php?ref_id='.$parent);
}

+ Here is the call graph for this function:

ilRegistrationGUI::show ( )

show registration form

public

Parameters
@return

Definition at line 280 of file class.ilRegistrationGUI.php.

References initForm().

Referenced by join().

{
$this->initForm();
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRegistrationGUI::updateSubscriptionRequest ( )
protected

Update subscription message.

Returns
void

Definition at line 394 of file class.ilRegistrationGUI.php.

References $_POST, ilUtil\redirect(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

{
global $ilUser,$tree;
$this->participants->updateSubject($ilUser->getId(),ilUtil::stripSlashes($_POST['subject']));
ilUtil::sendSuccess($this->lng->txt('sub_request_saved'),true);
ilUtil::redirect("repository.php?ref_id=".$tree->getParentId($this->container->getRefId()));
}

+ Here is the call graph for this function:

ilRegistrationGUI::validate ( )
protected

validate join request

protected

Returns
bool

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Definition at line 315 of file class.ilRegistrationGUI.php.

Referenced by join().

{
return true;
}

+ Here is the caller graph for this function:

Field Documentation

ilRegistrationGUI::$container = null
protected

Definition at line 35 of file class.ilRegistrationGUI.php.

ilRegistrationGUI::$ctrl
protected

Definition at line 49 of file class.ilRegistrationGUI.php.

ilRegistrationGUI::$form
protected

Definition at line 41 of file class.ilRegistrationGUI.php.

ilRegistrationGUI::$join_error = ''
protected

Definition at line 44 of file class.ilRegistrationGUI.php.

ilRegistrationGUI::$lng
protected

Definition at line 48 of file class.ilRegistrationGUI.php.

Referenced by __construct(), and ilGroupRegistrationGUI\add().

ilRegistrationGUI::$obj_id
protected

Definition at line 37 of file class.ilRegistrationGUI.php.

Referenced by fillMembershipLimitation().

ilRegistrationGUI::$participants
protected

Definition at line 39 of file class.ilRegistrationGUI.php.

ilRegistrationGUI::$ref_id
protected

Definition at line 36 of file class.ilRegistrationGUI.php.

Referenced by fillMembershipLimitation().

ilRegistrationGUI::$registration_possible = true
protected

Definition at line 43 of file class.ilRegistrationGUI.php.

Referenced by isRegistrationPossible().


The documentation for this class was generated from the following file: