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

GUI class for course registrations. More...

+ Inheritance diagram for ilCourseRegistrationGUI:
+ Collaboration diagram for ilCourseRegistrationGUI:

Public Member Functions

 __construct ($a_container)
 Constructor.
 executeCommand ()
 Execute command.
- Public Member Functions inherited from ilRegistrationGUI
 cancel ()
 cancel subscription
 show ()
 show registration form
 join ()
 join

Protected Member Functions

 getFormTitle ()
 get form title
 fillInformations ()
 fill informations
 fillRegistrationPeriod ()
 show informations about the registration period
 fillMaxMembers ()
 fill max members
 fillRegistrationType ()
 fill registration type
 addCommandButtons ()
 Add group specific command buttons.
 fillAgreement ()
 Show user agreement.
 showCourseDefinedFields ()
 Show course defined fields.
 validate ()
 Validate subscription request.
 add ()
 add user
 initParticipants ()
 Init course participants.
 initWaitingList ()
 isWaitingListActive ()
- Protected Member Functions inherited from ilRegistrationGUI
 isRegistrationPossible ()
 check if registration is possible
 enableRegistration ($a_status)
 set registration disabled
 getWaitingList ()
 Get waiting list object.
 leaveWaitingList ()
 fillMembershipLimitation ()
 Show membership limitations.
 initForm ()
 init registration form
 updateSubscriptionRequest ()
 Update subscription message.
 cancelSubscriptionRequest ()

Protected Attributes

 $privacy = null
- Protected Attributes inherited from ilRegistrationGUI
 $container = null
 $ref_id
 $obj_id
 $participants
 $waiting_list = null
 $form
 $registration_possible = true
 $join_error = ''
 $tpl
 $lng
 $ctrl

Private Member Functions

 validateAgreement ()
 Check Agreement.
 validateCourseDefinedFields ()
 Check required course fields.
 setAccepted ($a_status)
 Set Agreement accepted.

Detailed Description

GUI class for course registrations.

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

ilCourseRegistrationGUI:

Definition at line 38 of file class.ilCourseRegistrationGUI.php.

Constructor & Destructor Documentation

ilCourseRegistrationGUI::__construct (   $a_container)

Constructor.

public

Parameters
objectcourse object

Reimplemented from ilRegistrationGUI.

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

References ilPrivacySettings\_getInstance().

{
parent::__construct($a_container);
$this->privacy = ilPrivacySettings::_getInstance();
}

+ Here is the call graph for this function:

Member Function Documentation

ilCourseRegistrationGUI::add ( )
protected

add user

protected

Parameters
@return

Definition at line 651 of file class.ilCourseRegistrationGUI.php.

References $_POST, ilRegistrationGUI\$waiting_list, ilWaitingList\addToList(), IL_CRS_MEMBER, IL_CRS_SUBSCRIPTION_CONFIRMATION, ilUtil\redirect(), ilUtil\sendSuccess(), setAccepted(), and ilUtil\stripSlashes().

{
global $ilUser,$tree;
// TODO: language vars
// set aggreement accepted
$this->setAccepted(true);
include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
$free = max(0,$this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
$waiting_list = new ilCourseWaitingList($this->container->getId());
if($this->container->isSubscriptionMembershipLimited() and $this->container->enabledWaitingList() and (!$free or $waiting_list->getCountUsers()))
{
$waiting_list->addToList($ilUser->getId());
$info = sprintf($this->lng->txt('crs_added_to_list'),
$waiting_list->getPosition($ilUser->getId()));
ilUtil::sendSuccess($info,true);
$this->participants->sendNotification($this->participants->NOTIFY_SUBSCRIPTION_REQUEST,$ilUser->getId());
$this->participants->sendNotification($this->participants->NOTIFY_WAITING_LIST,$ilUser->getId());
ilUtil::redirect("repository.php?ref_id=".$tree->getParentId($this->container->getRefId()));
}
switch($this->container->getSubscriptionType())
{
$this->participants->addSubscriber($ilUser->getId());
$this->participants->updateSubscriptionTime($ilUser->getId(),time());
$this->participants->updateSubject($ilUser->getId(),ilUtil::stripSlashes($_POST['subject']));
$this->participants->sendNotification($this->participants->NOTIFY_SUBSCRIPTION_REQUEST,$ilUser->getId());
ilUtil::sendSuccess($this->lng->txt("application_completed"),true);
ilUtil::redirect("repository.php?ref_id=".$tree->getParentId($this->container->getRefId()));
break;
default:
$this->participants->add($ilUser->getId(),IL_CRS_MEMBER);
$this->participants->sendNotification($this->participants->NOTIFY_ADMINS,$ilUser->getId());
$this->participants->sendNotification($this->participants->NOTIFY_REGISTERED,$ilUser->getId());
ilUtil::sendSuccess($this->lng->txt("crs_subscription_successful"),true);
$this->ctrl->returnToParent($this);
break;
}
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::addCommandButtons ( )
protected

Add group specific command buttons.

Returns

Reimplemented from ilRegistrationGUI.

Definition at line 368 of file class.ilCourseRegistrationGUI.php.

References IL_CRS_SUBSCRIPTION_CONFIRMATION, and ilRegistrationGUI\isRegistrationPossible().

{
global $ilUser;
if(!$this->isRegistrationPossible())
{
return false;
}
switch($this->container->getSubscriptionType())
{
if($this->participants->isSubscriber($ilUser->getId()))
{
$this->form->clearCommandButtons();
$this->form->addCommandButton('updateSubscriptionRequest', $this->lng->txt('crs_update_subscr_request'));
$this->form->addCommandButton('cancelSubscriptionRequest', $this->lng->txt('crs_cancel_subscr_request'));
}
else
{
$this->form->clearCommandButtons();
$this->form->addCommandButton('join', $this->lng->txt('crs_join_request'));
$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
}
break;
}
return true;
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::executeCommand ( )

Execute command.

public

Definition at line 60 of file class.ilCourseRegistrationGUI.php.

References $cmd, and ilRegistrationGUI\getWaitingList().

{
global $ilTabs,$ilUser;
if($this->getWaitingList()->isOnList($ilUser->getId()))
{
$ilTabs->activateTab('leave');
}
$next_class = $this->ctrl->getNextClass($this);
switch($next_class)
{
default:
$cmd = $this->ctrl->getCmd("show");
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::fillAgreement ( )
protected

Show user agreement.

protected

Returns

Reimplemented from ilRegistrationGUI.

Definition at line 405 of file class.ilCourseRegistrationGUI.php.

References $section, ilRegistrationGUI\$tpl, ilExportFieldsInfo\_getInstance(), ilPrivacySettings\_getInstance(), ilCourseDefinedFieldDefinition\_hasFields(), ilRegistrationGUI\isRegistrationPossible(), ilCustomInputGUI\setHtml(), ilFormPropertyGUI\setRequired(), and showCourseDefinedFields().

{
global $ilUser;
if(!$this->isRegistrationPossible())
{
return true;
}
$this->privacy = ilPrivacySettings::_getInstance();
include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
if(!$this->privacy->confirmationRequired() and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId()))
{
return true;
}
$this->lng->loadLanguageModule('ps');
include_once('Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
if(!count($fields_info->getExportableFields()))
{
return true;
}
$section->setTitle($this->lng->txt('usr_agreement'));
$this->form->addItem($section);
$fields = new ilCustomInputGUI($this->lng->txt('crs_user_agreement'),'');
$tpl = new ilTemplate('tpl.agreement_form.html',true,true,'Services/Membership');
$tpl->setVariable('TXT_INFO_AGREEMENT',$this->lng->txt('crs_info_agreement'));
foreach($fields_info->getExportableFields() as $field)
{
$tpl->setCurrentBlock('field_item');
$tpl->setVariable('FIELD_NAME',$this->lng->txt($field));
$tpl->parseCurrentBlock();
}
$fields->setHtml($tpl->get());
$this->form->addItem($fields);
// Checkbox agreement
$agreement = new ilCheckboxInputGUI($this->lng->txt('crs_agree'),'agreement');
$agreement->setRequired(true);
$agreement->setOptionTitle($this->lng->txt('crs_info_agree'));
$agreement->setValue(1);
$this->form->addItem($agreement);
return true;
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::fillInformations ( )
protected

fill informations

protected

Parameters
@return

Reimplemented from ilRegistrationGUI.

Definition at line 104 of file class.ilCourseRegistrationGUI.php.

References ilUtil\makeClickable().

{
if($this->container->getImportantInformation())
{
$imp = new ilNonEditableValueGUI($this->lng->txt('crs_important_info'));
$value = nl2br(ilUtil::makeClickable($this->container->getImportantInformation(), true));
$imp->setValue($value);
$this->form->addItem($imp);
}
if($this->container->getSyllabus())
{
$syl = new ilNonEditableValueGUI($this->lng->txt('crs_syllabus'));
$value = nl2br(ilUtil::makeClickable ($this->container->getSyllabus(), true));
$syl->setValue($value);
$this->form->addItem($syl);
}
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::fillMaxMembers ( )
protected

fill max members

protected

Parameters
@return

Reimplemented from ilRegistrationGUI.

Definition at line 199 of file class.ilCourseRegistrationGUI.php.

References ilRegistrationGUI\$tpl, ilRegistrationGUI\$waiting_list, elseif(), ilRegistrationGUI\enableRegistration(), ilRegistrationGUI\getWaitingList(), ilUtil\sendFailure(), and ilCustomInputGUI\setHtml().

{
global $ilUser;
if(!$this->container->isSubscriptionMembershipLimited())
{
return true;
}
$tpl = new ilTemplate('tpl.max_members_form.html',true,true,'Services/Membership');
$tpl->setVariable('TXT_MAX',$this->lng->txt('mem_max_users'));
$tpl->setVariable('NUM_MAX',$this->container->getSubscriptionMaxMembers());
$tpl->setVariable('TXT_FREE',$this->lng->txt('mem_free_places').":");
$free = max(0,$this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
if($free)
$tpl->setVariable('NUM_FREE',$free);
else
$tpl->setVariable('WARN_FREE',$free);
include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
$waiting_list = new ilCourseWaitingList($this->container->getId());
if($this->container->enabledWaitingList() and (!$free or $waiting_list->getCountUsers()))
{
if($waiting_list->isOnList($ilUser->getId()))
{
$tpl->setVariable('TXT_WAIT',$this->lng->txt('mem_waiting_list_position'));
$tpl->setVariable('NUM_WAIT',$waiting_list->getPosition($ilUser->getId()));
}
else
{
$tpl->setVariable('TXT_WAIT',$this->lng->txt('mem_waiting_list'));
if($free and $waiting_list->getCountUsers())
$tpl->setVariable('WARN_WAIT',$waiting_list->getCountUsers());
else
$tpl->setVariable('NUM_WAIT',$waiting_list->getCountUsers());
}
}
$alert = '';
if(!$free and !$this->container->enabledWaitingList())
{
// Disable registration
$this->enableRegistration(false);
ilUtil::sendFailure($this->lng->txt('mem_alert_no_places'));
#$alert = $this->lng->txt('mem_alert_no_places');
}
elseif($this->container->enabledWaitingList() and $waiting_list->isOnList($ilUser->getId()))
{
// Disable registration
$this->enableRegistration(false);
}
elseif(!$free and $this->container->enabledWaitingList())
{
ilUtil::sendFailure($this->lng->txt('crs_warn_no_max_set_on_waiting_list'));
#$alert = $this->lng->txt('crs_warn_no_max_set_on_waiting_list');
}
elseif($free and $this->container->enabledWaitingList() and $this->getWaitingList()->getCountUsers())
{
ilUtil::sendFailure($this->lng->txt('crs_warn_wl_set_on_waiting_list'));
#$alert = $this->lng->txt('crs_warn_wl_set_on_waiting_list');
}
$max = new ilCustomInputGUI($this->lng->txt('mem_participants'));
$max->setHtml($tpl->get());
if(strlen($alert))
{
$max->setAlert($alert);
}
$this->form->addItem($max);
return true;
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::fillRegistrationPeriod ( )
protected

show informations about the registration period

protected

Reimplemented from ilRegistrationGUI.

Definition at line 128 of file class.ilCourseRegistrationGUI.php.

References $start, ilRegistrationGUI\$tpl, ilDateTime\_after(), ilDateTime\_before(), elseif(), ilRegistrationGUI\enableRegistration(), ilDatePresentation\formatDate(), IL_CAL_UNIX, IL_CRS_SUBSCRIPTION_DEACTIVATED, ilUtil\sendFailure(), ilCustomInputGUI\setHtml(), and ilNonEditableValueGUI\setValue().

{
include_once('./Services/Calendar/classes/class.ilDateTime.php');
$now = new ilDateTime(time(),IL_CAL_UNIX,'UTC');
if($this->container->getSubscriptionUnlimitedStatus())
{
$reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_period'));
$reg->setValue($this->lng->txt('mem_unlimited'));
$this->form->addItem($reg);
return true;
}
elseif($this->container->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_DEACTIVATED)
{
return true;
}
$start = new ilDateTime($this->container->getSubscriptionStart(),IL_CAL_UNIX,'UTC');
$end = new ilDateTime($this->container->getSubscriptionEnd(),IL_CAL_UNIX,'UTC');
{
$tpl = new ilTemplate('tpl.registration_period_form.html',true,true,'Services/Membership');
$tpl->setVariable('TXT_FIRST',$this->lng->txt('mem_start'));
$tpl->setVariable('FIRST',ilDatePresentation::formatDate($start));
$tpl->setVariable('TXT_END',$this->lng->txt('mem_end'));
$tpl->setVariable('END',ilDatePresentation::formatDate($end));
$warning = $this->lng->txt('mem_reg_not_started');
}
{
$tpl = new ilTemplate('tpl.registration_period_form.html',true,true,'Services/Membership');
$tpl->setVariable('TXT_FIRST',$this->lng->txt('mem_start'));
$tpl->setVariable('FIRST',ilDatePresentation::formatDate($start));
$tpl->setVariable('TXT_END',$this->lng->txt('mem_end'));
$tpl->setVariable('END',ilDatePresentation::formatDate($end));
$warning = $this->lng->txt('mem_reg_expired');
}
else
{
$tpl = new ilTemplate('tpl.registration_period_form.html',true,true,'Services/Membership');
$tpl->setVariable('TXT_FIRST',$this->lng->txt('mem_end'));
$tpl->setVariable('FIRST',ilDatePresentation::formatDate($end));
}
$reg = new ilCustomInputGUI($this->lng->txt('mem_reg_period'));
$reg->setHtml($tpl->get());
if(strlen($warning))
{
// Disable registration
$this->enableRegistration(false);
#$reg->setAlert($warning);
}
$this->form->addItem($reg);
return true;
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::fillRegistrationType ( )
protected

fill registration type

protected

Returns

Reimplemented from ilRegistrationGUI.

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

References $_POST, $pass, ilRegistrationGUI\enableRegistration(), IL_CRS_SUBSCRIPTION_CONFIRMATION, IL_CRS_SUBSCRIPTION_DEACTIVATED, IL_CRS_SUBSCRIPTION_DIRECT, IL_CRS_SUBSCRIPTION_PASSWORD, isWaitingListActive(), ilUtil\sendFailure(), ilFormPropertyGUI\setAlert(), ilNonEditableValueGUI\setValue(), and ilTextAreaInputGUI\setValue().

{
global $ilUser;
if($this->container->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_DEACTIVATED)
{
$reg = new ilCustomInputGUI($this->lng->txt('mem_reg_type'));
#$reg->setHtml($this->lng->txt('crs_info_reg_deactivated'));
$reg->setAlert($this->lng->txt('crs_info_reg_deactivated'));
#ilUtil::sendFailure($this->lng->txt('crs_info_reg_deactivated'));
#$reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
#$reg->setValue($this->lng->txt('crs_info_reg_deactivated'));
#$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
$this->form->addItem($reg);
// Disable registration
$this->enableRegistration(false);
return true;
}
switch($this->container->getSubscriptionType())
{
// no "request" info if waiting list is active
if($this->isWaitingListActive())
return true;
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('crs_info_reg_direct'));
$this->form->addItem($txt);
break;
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('crs_subscription_options_password'));
$pass = new ilTextInputGUI($this->lng->txt('passwd'),'grp_passw');
$pass->setInputType('password');
$pass->setSize(12);
$pass->setMaxLength(32);
#$pass->setRequired(true);
$pass->setInfo($this->lng->txt('crs_info_reg_password'));
$txt->addSubItem($pass);
$this->form->addItem($txt);
break;
// no "request" info if waiting list is active
if($this->isWaitingListActive())
return true;
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('crs_subscription_options_confirmation'));
$sub = new ilTextAreaInputGUI($this->lng->txt('crs_reg_subject'),'subject');
$sub->setValue($_POST['subject']);
$sub->setInfo($this->lng->txt('crs_info_reg_confirmation'));
$sub->setCols(40);
$sub->setRows(5);
if($this->participants->isSubscriber($ilUser->getId()))
{
$sub_data = $this->participants->getSubscriberData($ilUser->getId());
$sub->setValue($sub_data['subject']);
$sub->setInfo('');
ilUtil::sendFailure($this->lng->txt('crs_reg_user_already_subscribed'));
$this->enableRegistration(false);
}
$txt->addSubItem($sub);
$this->form->addItem($txt);
break;
default:
return true;
}
return true;
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::getFormTitle ( )
protected

get form title

protected

Returns
string title

Reimplemented from ilRegistrationGUI.

Definition at line 86 of file class.ilCourseRegistrationGUI.php.

References ilRegistrationGUI\getWaitingList().

{
global $ilUser;
if($this->getWaitingList()->isOnList($ilUser->getId()))
{
return $this->lng->txt('member_status');
}
return $this->lng->txt('crs_registration');
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::initParticipants ( )
protected

Init course participants.

protected

Reimplemented from ilRegistrationGUI.

Definition at line 728 of file class.ilCourseRegistrationGUI.php.

References ilCourseParticipants\_getInstanceByObjId().

{
include_once('./Modules/Course/classes/class.ilCourseParticipants.php');
$this->participants = ilCourseParticipants::_getInstanceByObjId($this->obj_id);
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::initWaitingList ( )
protected
See Also
ilRegistrationGUI::initWaitingList() protected

Reimplemented from ilRegistrationGUI.

Definition at line 739 of file class.ilCourseRegistrationGUI.php.

{
include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
$this->waiting_list = new ilCourseWaitingList($this->container->getId());
}
ilCourseRegistrationGUI::isWaitingListActive ( )
protected
See Also
ilRegistrationGUI::isWaitingListActive()

Reimplemented from ilRegistrationGUI.

Definition at line 748 of file class.ilCourseRegistrationGUI.php.

References ilRegistrationGUI\getWaitingList().

Referenced by fillRegistrationType().

{
global $ilUser;
static $active = null;
if($active !== null)
{
return $active;
}
if(!$this->container->enabledWaitingList())
{
return $active = false;
}
if(!$this->container->getSubscriptionMaxMembers())
{
return $active = false;
}
$free = max(0,$this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
return $active = (!$free or $this->getWaitingList()->getCountUsers());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseRegistrationGUI::setAccepted (   $a_status)
private

Set Agreement accepted.

private

Parameters
bool

Definition at line 704 of file class.ilCourseRegistrationGUI.php.

References ilCourseDefinedFieldDefinition\_hasFields(), and ilCourseAgreement\setAccepted().

Referenced by add(), and validate().

{
global $ilUser;
include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
if(!$this->privacy->confirmationRequired() and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId()))
{
return true;
}
include_once('Modules/Course/classes/class.ilCourseAgreement.php');
$this->agreement = new ilCourseAgreement($ilUser->getId(),$this->container->getId());
$this->agreement->setAccepted($a_status);
$this->agreement->setAcceptanceTime(time());
$this->agreement->save();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseRegistrationGUI::showCourseDefinedFields ( )
protected

Show course defined fields.

protected

Definition at line 466 of file class.ilCourseRegistrationGUI.php.

References $_POST, ilCourseDefinedFieldDefinition\_getFields(), IL_CDF_TYPE_SELECT, IL_CDF_TYPE_TEXT, ilNonEditableValueGUI\setValue(), and ilUtil\stripSlashes().

Referenced by fillAgreement().

{
global $ilUser;
include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
if(!count($cdf_fields = ilCourseDefinedFieldDefinition::_getFields($this->container->getId())))
{
return true;
}
$cdf = new ilNonEditableValueGUI($this->lng->txt('ps_crs_user_fields'));
$cdf->setValue($this->lng->txt('ps_cdf_info'));
$cdf->setRequired(true);
foreach($cdf_fields as $field_obj)
{
$course_user_data = new ilCourseUserData($ilUser->getId(),$field_obj->getId());
switch($field_obj->getType())
{
$select = new ilSelectInputGUI($field_obj->getName(),'cdf['.$field_obj->getId().']');
$select->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
$select->setOptions($field_obj->prepareSelectBox());
if($field_obj->isRequired())
{
$select->setRequired(true);
}
$cdf->addSubItem($select);
break;
$text = new ilTextInputGUI($field_obj->getName(),'cdf['.$field_obj->getId().']');
$text->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
$text->setSize(32);
$text->setMaxLength(255);
if($field_obj->isRequired())
{
$text->setRequired(true);
}
$cdf->addSubItem($text);
break;
}
}
$this->form->addItem($cdf);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseRegistrationGUI::validate ( )
protected

Validate subscription request.

protected

Parameters
@return

Reimplemented from ilRegistrationGUI.

Definition at line 528 of file class.ilCourseRegistrationGUI.php.

References $_POST, $pass, IL_CRS_SUBSCRIPTION_PASSWORD, ilRegistrationGUI\isRegistrationPossible(), setAccepted(), ilUtil\stripSlashes(), validateAgreement(), and validateCourseDefinedFields().

{
global $ilUser;
if($ilUser->getId() == ANONYMOUS_USER_ID)
{
$this->join_error = $this->lng->txt('permission_denied');
return false;
}
// Set aggrement to not accepted
$this->setAccepted(false);
if(!$this->isRegistrationPossible())
{
$this->join_error = $this->lng->txt('mem_error_preconditions');
return false;
}
if($this->container->getSubscriptionType() == IL_CRS_SUBSCRIPTION_PASSWORD)
{
if(!strlen($pass = ilUtil::stripSlashes($_POST['grp_passw'])))
{
$this->join_error = $this->lng->txt('crs_password_required');
return false;
}
if(strcmp($pass,$this->container->getSubscriptionPassword()) !== 0)
{
$this->join_error = $this->lng->txt('crs_password_not_valid');
return false;
}
}
{
$this->join_error = $this->lng->txt('fill_out_all_required_fields');
return false;
}
if(!$this->validateAgreement())
{
$this->join_error = $this->lng->txt('crs_agreement_required');
return false;
}
return true;
}

+ Here is the call graph for this function:

ilCourseRegistrationGUI::validateAgreement ( )
private

Check Agreement.

protected

Definition at line 579 of file class.ilCourseRegistrationGUI.php.

References $_POST, and ilCourseDefinedFieldDefinition\_hasFields().

Referenced by validate().

{
global $ilUser;
if($_POST['agreement'])
{
return true;
}
include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
if(!$this->privacy->confirmationRequired() and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId()))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseRegistrationGUI::validateCourseDefinedFields ( )
private

Check required course fields.

protected

Definition at line 601 of file class.ilCourseRegistrationGUI.php.

References $_POST, ilCourseDefinedFieldDefinition\_getFields(), IL_CDF_TYPE_SELECT, IL_CDF_TYPE_TEXT, ilCourseUserData\setValue(), and ilUtil\stripSlashes().

Referenced by validate().

{
global $ilUser;
include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
$all_required = true;
foreach(ilCourseDefinedFieldDefinition::_getFields($this->container->getId()) as $field_obj)
{
switch($field_obj->getType())
{
$tmp_value = ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]);
$value = '';
foreach((array) $field_obj->getValues() as $v)
{
if($v == $tmp_value)
{
$value = $tmp_value;
break;
}
}
break;
$value = ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]);
break;
}
$course_user_data = new ilCourseUserData($ilUser->getId(),$field_obj->getId());
$course_user_data->setValue($value);
$course_user_data->update();
if($field_obj->isRequired() and (!strlen($value) or $value == -1))
{
$all_required = false;
}
}
return $all_required;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilCourseRegistrationGUI::$privacy = null
protected

Definition at line 40 of file class.ilCourseRegistrationGUI.php.


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