ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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. More...
 
 getContainer ()
 Parent object. More...
 
 getRefId ()
 Get ref. More...
 
 cancel ()
 cancel subscription More...
 
 show (ilPropertyFormGUI $form=null)
 show registration form More...
 
 join ()
 join More...
 

Protected Member Functions

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

Protected Attributes

 $privacy = null
 
 $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 35 of file class.ilRegistrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilRegistrationGUI::__construct (   $a_container)

Constructor.

@access public

Parameters
objectCourse or Group object
Returns

Reimplemented in ilGroupRegistrationGUI.

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

66 {
67 global $DIC;
68
69 $lng = $DIC['lng'];
70 $ilCtrl = $DIC['ilCtrl'];
71 $tpl = $DIC['tpl'];
72
73 $this->lng = $lng;
74 $this->lng->loadLanguageModule('crs');
75 $this->lng->loadLanguageModule('grp');
76 $this->lng->loadLanguageModule('ps');
77 $this->lng->loadLanguageModule('membership');
78
79 $this->ctrl = $ilCtrl;
80 $this->tpl = $tpl;
81
82 $this->container = $a_container;
83 $this->ref_id = $this->container->getRefId();
84 $this->obj_id = ilObject::_lookupObjId($this->ref_id);
85 $this->type = ilObject::_lookupType($this->obj_id);
86
87 // Init participants
88 $this->initParticipants();
89
90 // Init waiting list
91 $this->initWaitingList();
92
93 $this->privacy = ilPrivacySettings::_getInstance();
94 }
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getInstance()
Get instance of ilPrivacySettings.
initParticipants()
Init participants object (course or group participants)
initWaitingList()
Init waiting list (course or group waiting list)
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addCommandButtons()

ilRegistrationGUI::addCommandButtons ( )
protected

Add command buttons.

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

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

607 {
608 global $DIC;
609
610 $ilUser = $DIC['ilUser'];
611
612 if ($this->isRegistrationPossible() and $this->isWaitingListActive() and !$this->getWaitingList()->isOnList($ilUser->getId())) {
613 $this->form->addCommandButton('join', $this->lng->txt('mem_add_to_wl'));
614 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
615 } elseif ($this->isRegistrationPossible() and !$this->getWaitingList()->isOnList($ilUser->getId())) {
616 $this->form->addCommandButton('join', $this->lng->txt('join'));
617 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
618 }
619 if ($this->getWaitingList()->isOnList($ilUser->getId())) {
621 sprintf(
622 $this->lng->txt($this->container->getType() . '_cancel_waiting_list'),
623 $this->container->getTitle()
624 )
625 );
626 $this->form->addCommandButton('leaveWaitingList', $this->lng->txt('leave_waiting_list'));
627 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
628 }
629 }
isWaitingListActive()
Check if the waiting list is active Maximum of members exceeded or any user on the waiting list.
getWaitingList()
Get waiting list object.
isRegistrationPossible()
check if registration is possible
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
$ilUser
Definition: imgupload.php:18

References $DIC, $ilUser, getWaitingList(), isRegistrationPossible(), isWaitingListActive(), and ilUtil\sendQuestion().

Referenced by initForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilRegistrationGUI::cancel ( )

cancel subscription

@access public

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

492 {
493 global $DIC;
494
495 $tree = $DIC['tree'];
496 $ilCtrl = $DIC['ilCtrl'];
497
498 $ilCtrl->setParameterByClass(
499 "ilrepositorygui",
500 "ref_id",
501 $tree->getParentId($this->container->getRefId())
502 );
503 $ilCtrl->redirectByClass("ilrepositorygui", "");
504 }

References $DIC, and $ilCtrl.

◆ cancelSubscriptionRequest()

ilRegistrationGUI::cancelSubscriptionRequest ( )
protected

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

654 {
655 global $DIC;
656
657 $ilUser = $DIC['ilUser'];
658 $tree = $DIC['tree'];
659 $ilCtrl = $DIC['ilCtrl'];
660
661 $this->participants->deleteSubscriber($ilUser->getId());
662 ilUtil::sendSuccess($this->lng->txt('sub_request_deleted'), true);
663
664 $ilCtrl->setParameterByClass(
665 "ilrepositorygui",
666 "ref_id",
667 $tree->getParentId($this->container->getRefId())
668 );
669 $ilCtrl->redirectByClass("ilrepositorygui", "");
670 }

References $DIC, $ilCtrl, and $ilUser.

◆ enableRegistration()

ilRegistrationGUI::enableRegistration (   $a_status)
protected

set registration disabled

@access protected

Parameters
bool
Returns

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

133 {
134 $this->registration_possible = $a_status;
135 }

Referenced by ilCourseRegistrationGUI\fillMaxMembers(), ilGroupRegistrationGUI\fillMaxMembers(), fillMembershipLimitation(), ilCourseRegistrationGUI\fillRegistrationPeriod(), ilGroupRegistrationGUI\fillRegistrationPeriod(), ilCourseRegistrationGUI\fillRegistrationType(), and ilGroupRegistrationGUI\fillRegistrationType().

+ Here is the caller graph for this function:

◆ fillAgreement()

ilRegistrationGUI::fillAgreement ( )
protected

Show user agreement.

@access protected

Returns

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

298 {
299 global $DIC;
300
301 $ilUser = $DIC['ilUser'];
302
303 if (!$this->isRegistrationPossible()) {
304 return true;
305 }
306
307 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
308 if (!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId())) {
309 return true;
310 }
311
312 $this->lng->loadLanguageModule('ps');
313
314 include_once('Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
315 $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->container->getId()));
316
317 if (!count($fields_info->getExportableFields())) {
318 return true;
319 }
320
322 $section->setTitle($this->lng->txt($this->type . '_usr_agreement'));
323 $this->form->addItem($section);
324
325 include_once './Services/Membership/classes/class.ilMemberAgreementGUI.php';
326 ilMemberAgreementGUI::addExportFieldInfo($this->form, $this->obj_id, $this->type);
327
328
329 ilMemberAgreementGUI::addCustomFields($this->form, $this->obj_id, $this->type);
330
331 // Checkbox agreement
332 if ($this->privacy->confirmationRequired($this->type)) {
333 ilMemberAgreementGUI::addAgreement($this->form, $this->obj_id, $this->type);
334 }
335 return true;
336 }
$section
Definition: Utf8Test.php:83
static _hasFields($a_container_id)
Check if there are any define fields.
static _getInstanceByType($a_type)
Get Singleton Instance.
This class represents a section header in a property form.
static addExportFieldInfo($form, $a_obj_id, $a_type)
Add export field info to form @global type $lng.
static addCustomFields($form, $a_obj_id, $a_type, $a_mode='user')
Add custom course fields.
static addAgreement($form, $a_obj_id, $a_type)
Add agreement to form.

References $DIC, $ilUser, $section, ilExportFieldsInfo\_getInstanceByType(), ilCourseDefinedFieldDefinition\_hasFields(), ilObject\_lookupType(), ilMemberAgreementGUI\addAgreement(), ilMemberAgreementGUI\addCustomFields(), ilMemberAgreementGUI\addExportFieldInfo(), and isRegistrationPossible().

Referenced by initForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillInformations()

ilRegistrationGUI::fillInformations ( )
abstractprotected

fill informations

@access protected

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ fillMaxMembers()

ilRegistrationGUI::fillMaxMembers ( )
abstractprotected

show informations about the maximum number of user.

@access protected

Parameters

return

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ fillMembershipLimitation()

ilRegistrationGUI::fillMembershipLimitation ( )
protected

Show membership limitations.

@access protected

Returns

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

242 {
243 global $DIC;
244
245 $ilAccess = $DIC['ilAccess'];
246 $ilCtrl = $DIC['ilCtrl'];
247
248 include_once('Modules/Course/classes/class.ilObjCourseGrouping.php');
249 if (!$items = ilObjCourseGrouping::_getGroupingItems($this->container)) {
250 return true;
251 }
252
253 $mem = new ilCustomInputGUI($this->lng->txt('groupings'));
254
255 $tpl = new ilTemplate('tpl.membership_limitation_form.html', true, true, 'Services/Membership');
256 $tpl->setVariable('LIMIT_INTRO', $this->lng->txt($this->type . '_grp_info_reg'));
257
258 foreach ($items as $ref_id) {
262
263 if ($ilAccess->checkAccess('visible', '', $ref_id, $type)) {
264 include_once('./Services/Link/classes/class.ilLink.php');
265 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
266 $tpl->setVariable(
267 'LINK_ITEM',
268 $ilCtrl->getLinkTargetByClass("ilrepositorygui", "")
269 );
270 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
271 $tpl->setVariable('ITEM_LINKED_TITLE', $title);
272 } else {
273 $tpl->setVariable('ITEM_TITLE');
274 }
275 $tpl->setCurrentBlock('items');
276 $tpl->setVariable('TYPE_ICON', ilObject::_getIcon($obj_id, 'tiny', $type));
277 $tpl->setVariable('ALT_ICON', $this->lng->txt('obj_' . $type));
278 $tpl->parseCurrentBlock();
279 }
280
281 $mem->setHtml($tpl->get());
282
283
285 $mem->setAlert($this->container->getMessage());
286 $this->enableRegistration(false);
287 }
288 $this->form->addItem($mem);
289 }
$_GET["client_id"]
This class represents a custom property in a property form.
static _checkGroupingDependencies(&$container_obj, $a_user_id=null)
static _getGroupingItems($container_obj)
Get courses/groups that are assigned to the same membership limitation.
static _lookupTitle($a_id)
lookup object title
enableRegistration($a_status)
set registration disabled
special template class to simplify handling of ITX/PEAR
$type

References $_GET, $DIC, $ilCtrl, $obj_id, $ref_id, $tpl, $type, ilObjCourseGrouping\_checkGroupingDependencies(), ilObjCourseGrouping\_getGroupingItems(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), and enableRegistration().

Referenced by initForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillRegistrationPeriod()

ilRegistrationGUI::fillRegistrationPeriod ( )
abstractprotected

show informations about the registration period

@access protected

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ fillRegistrationType()

ilRegistrationGUI::fillRegistrationType ( )
abstractprotected

show informations about registration procedure

@access protected

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ getContainer()

ilRegistrationGUI::getContainer ( )

Parent object.

Returns
ilObject

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

References $container.

Referenced by ilCourseRegistrationGUI\fillMaxMembers(), and ilGroupRegistrationGUI\fillMaxMembers().

+ Here is the caller graph for this function:

◆ getFormTitle()

ilRegistrationGUI::getFormTitle ( )
abstractprotected

Get title for property form.

@access protected

Returns
string title

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ getRefId()

ilRegistrationGUI::getRefId ( )

Get ref.

Returns
type

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

110 {
111 return $this->ref_id;
112 }

References $ref_id.

Referenced by ilCourseRegistrationGUI\executeCommand().

+ Here is the caller graph for this function:

◆ getWaitingList()

◆ initForm()

ilRegistrationGUI::initForm ( )
protected

init registration form

@access protected

Returns

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

570 {
571 global $DIC;
572
573 $ilUser = $DIC['ilUser'];
574
575 if (is_object($this->form)) {
576 return true;
577 }
578
579 include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
580 $this->form = new ilPropertyFormGUI();
581 $this->form->setFormAction($this->ctrl->getFormAction($this, 'join'));
582 $this->form->setTitle($this->getFormTitle());
583
584 $this->fillInformations();
586 if ($this->isRegistrationPossible()) {
587 $this->fillRegistrationPeriod();
588 }
589 if ($this->isRegistrationPossible() || $this->participants->isSubscriber($ilUser->getId())) {
590 $this->fillRegistrationType();
591 }
592 if ($this->isRegistrationPossible()) {
593 $this->fillMaxMembers();
594 }
595 if ($this->isRegistrationPossible()) {
596 $this->fillAgreement();
597 }
598 $this->addCommandButtons();
599 return $this->form;
600 }
This class represents a property form user interface.
fillRegistrationType()
show informations about registration procedure
getFormTitle()
Get title for property form.
fillRegistrationPeriod()
show informations about the registration period
fillAgreement()
Show user agreement.
addCommandButtons()
Add command buttons.
fillInformations()
fill informations
fillMembershipLimitation()
Show membership limitations.
fillMaxMembers()
show informations about the maximum number of user.

References $DIC, $form, $ilUser, addCommandButtons(), fillAgreement(), fillInformations(), fillMaxMembers(), fillMembershipLimitation(), fillRegistrationPeriod(), fillRegistrationType(), getFormTitle(), and isRegistrationPossible().

Referenced by join(), and show().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initParticipants()

ilRegistrationGUI::initParticipants ( )
abstractprotected

Init participants object (course or group participants)

@access protected

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ initWaitingList()

ilRegistrationGUI::initWaitingList ( )
abstractprotected

Init waiting list (course or group waiting list)

@access protected @abstract

Returns

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ isRegistrationPossible()

ilRegistrationGUI::isRegistrationPossible ( )
protected

check if registration is possible

@access protected

Returns
bool

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

121 {
122 return (bool) $this->registration_possible;
123 }

References $registration_possible.

Referenced by ilCourseRegistrationGUI\addCommandButtons(), ilGroupRegistrationGUI\addCommandButtons(), addCommandButtons(), fillAgreement(), initForm(), ilCourseRegistrationGUI\validate(), and ilGroupRegistrationGUI\validate().

+ Here is the caller graph for this function:

◆ isWaitingListActive()

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:

◆ join()

ilRegistrationGUI::join ( )

join

@access public

Parameters

return

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

534 {
535 $form = $this->initForm();
536
537 if (!$form->checkInput() || !$this->validate()) {
538 $form->setValuesByPost();
539 if ($this->join_error) {
540 ilUtil::sendFailure($this->join_error);
541 } else {
542 ilUtil::sendFailure($this->lng->txt('err_check_input'));
543 }
544 $this->show($form);
545 return false;
546 }
547
548 $this->add();
549 }
add()
Definition: add.php:2
initForm()
init registration form
show(ilPropertyFormGUI $form=null)
show registration form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $form, add(), initForm(), ilUtil\sendFailure(), and show().

+ Here is the call graph for this function:

◆ leaveWaitingList()

ilRegistrationGUI::leaveWaitingList ( )
protected

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

174 {
175 global $DIC;
176
177 $ilUser = $DIC['ilUser'];
178 $tree = $DIC['tree'];
179 $ilCtrl = $DIC['ilCtrl'];
180
181 $this->getWaitingList()->removeFromList($ilUser->getId());
182 $parent = $tree->getParentId($this->container->getRefId());
183
184 $message = sprintf(
185 $this->lng->txt($this->container->getType() . '_removed_from_waiting_list'),
186 $this->container->getTitle()
187 );
188 ilUtil::sendSuccess($message, true);
189
190 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent);
191 $ilCtrl->redirectByClass("ilrepositorygui", "");
192 }
$message
Definition: xapiexit.php:14

References $DIC, $ilCtrl, $ilUser, $message, and getWaitingList().

+ Here is the call graph for this function:

◆ setAccepted()

ilRegistrationGUI::setAccepted (   $a_status)
protected

Set Agreement accepted.

@access private

Parameters
bool

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

469 {
470 global $DIC;
471
472 $ilUser = $DIC['ilUser'];
473
474 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
475 if (!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId())) {
476 return true;
477 }
478
479 include_once('Services/Membership/classes/class.ilMemberAgreement.php');
480 $this->agreement = new ilMemberAgreement($ilUser->getId(), $this->container->getId());
481 $this->agreement->setAccepted($a_status);
482 $this->agreement->setAcceptanceTime(time());
483 $this->agreement->save();
484 }

References $DIC, $ilUser, and ilCourseDefinedFieldDefinition\_hasFields().

Referenced by ilCourseRegistrationGUI\add(), ilGroupRegistrationGUI\add(), and ilCourseRegistrationGUI\validate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show()

ilRegistrationGUI::show ( ilPropertyFormGUI  $form = null)

show registration form

@access public

Parameters

return

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

514 {
515 if (!$form instanceof ilPropertyFormGUI) {
516 $this->initForm();
517 }
518
519 if ($_SESSION["pending_goto"]) {
520 ilUtil::sendInfo($this->lng->txt("reg_goto_parent_membership_info"));
521 }
522
523 $this->tpl->setContent($this->form->getHTML());
524 }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_SESSION, $form, initForm(), and ilUtil\sendInfo().

Referenced by ilCourseRegistrationGUI\add(), and join().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCustomFields()

ilRegistrationGUI::showCustomFields ( )
protected

Show course defined fields.

@access protected

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

344 {
345 global $DIC;
346
347 $ilUser = $DIC['ilUser'];
348
349 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
350 include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
351
352 if (!count($cdf_fields = ilCourseDefinedFieldDefinition::_getFields($this->container->getId()))) {
353 return true;
354 }
355
356 $cdf = new ilNonEditableValueGUI($this->lng->txt('ps_crs_user_fields'));
357 $cdf->setValue($this->lng->txt($this->type . '_ps_cdf_info'));
358 $cdf->setRequired(true);
359
360 foreach ($cdf_fields as $field_obj) {
361 $course_user_data = new ilCourseUserData($ilUser->getId(), $field_obj->getId());
362
363 switch ($field_obj->getType()) {
365 $select = new ilSelectInputGUI($field_obj->getName(), 'cdf[' . $field_obj->getId() . ']');
366 $select->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
367 $select->setOptions($field_obj->prepareSelectBox());
368 if ($field_obj->isRequired()) {
369 $select->setRequired(true);
370 }
371
372 $cdf->addSubItem($select);
373
374
375 break;
376
377 case IL_CDF_TYPE_TEXT:
378 $text = new ilTextInputGUI($field_obj->getName(), 'cdf[' . $field_obj->getId() . ']');
379 $text->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
380 $text->setSize(32);
381 $text->setMaxLength(255);
382 if ($field_obj->isRequired()) {
383 $text->setRequired(true);
384 }
385 $cdf->addSubItem($text);
386 break;
387 }
388 }
389 $this->form->addItem($cdf);
390 return true;
391 }
$_POST["username"]
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.
This class represents a non editable value in a property form.
This class represents a selection list property in a property form.
This class represents a text property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $DIC, $ilUser, ilCourseDefinedFieldDefinition\_getFields(), IL_CDF_TYPE_SELECT, IL_CDF_TYPE_TEXT, and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ updateSubscriptionRequest()

ilRegistrationGUI::updateSubscriptionRequest ( )
protected

Update subscription message.

Returns
void

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

636 {
637 global $DIC;
638
639 $ilUser = $DIC['ilUser'];
640 $tree = $DIC['tree'];
641 $ilCtrl = $DIC['ilCtrl'];
642
643 $this->participants->updateSubject($ilUser->getId(), ilUtil::stripSlashes($_POST['subject']));
644 ilUtil::sendSuccess($this->lng->txt('sub_request_saved'), true);
645 $ilCtrl->setParameterByClass(
646 "ilrepositorygui",
647 "ref_id",
648 $tree->getParentId($this->container->getRefId())
649 );
650 $ilCtrl->redirectByClass("ilrepositorygui", "");
651 }

References $_POST, $DIC, $ilCtrl, $ilUser, and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ validate()

ilRegistrationGUI::validate ( )
protected

validate join request

@access protected

Returns
bool

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

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

559 {
560 return true;
561 }

◆ validateAgreement()

ilRegistrationGUI::validateAgreement ( )
protected

Check Agreement.

@access protected

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

400 {
401 global $DIC;
402
403 $ilUser = $DIC['ilUser'];
404
405 if ($_POST['agreement']) {
406 return true;
407 }
408 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
409 if (!$this->privacy->confirmationRequired($this->type)) {
410 return true;
411 }
412 return false;
413 }

References $_POST, $DIC, and $ilUser.

Referenced by ilCourseRegistrationGUI\validate(), and ilGroupRegistrationGUI\validate().

+ Here is the caller graph for this function:

◆ validateCustomFields()

ilRegistrationGUI::validateCustomFields ( )
protected

Check required course fields.

@access protected

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

422 {
423 global $DIC;
424
425 $ilUser = $DIC['ilUser'];
426
427
428 $required_fullfilled = true;
429 foreach (ilCourseDefinedFieldDefinition::_getFields($this->container->getId()) as $field_obj) {
430 switch ($field_obj->getType()) {
432
433 // Split value id from post
434 list($field_id, $option_id) = explode('_', $_POST['cdf_' . $field_obj->getId()]);
435
436 $open_answer_indexes = (array) $field_obj->getValueOptions();
437 if (in_array($option_id, $open_answer_indexes)) {
438 $value = $_POST['cdf_oa_' . $field_obj->getId() . '_' . $option_id];
439 } else {
440 $value = $field_obj->getValueById($option_id);
441 }
442 break;
443
444 case IL_CDF_TYPE_TEXT:
445 $value = $_POST['cdf_' . $field_obj->getId()];
446 break;
447 }
448
449 $course_user_data = new ilCourseUserData($ilUser->getId(), $field_obj->getId());
450 $course_user_data->setValue($value);
451 $course_user_data->update();
452
453 // #14220
454 if ($field_obj->isRequired() and $value == "") {
455 $required_fullfilled = false;
456 }
457 }
458
459 return $required_fullfilled;
460 }

References $_POST, $DIC, $ilUser, ilCourseDefinedFieldDefinition\_getFields(), IL_CDF_TYPE_SELECT, and IL_CDF_TYPE_TEXT.

Referenced by ilCourseRegistrationGUI\validate(), and ilGroupRegistrationGUI\validate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $container

ilRegistrationGUI::$container = null
protected

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

Referenced by getContainer().

◆ $ctrl

ilRegistrationGUI::$ctrl
protected

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

◆ $form

ilRegistrationGUI::$form
protected

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

Referenced by initForm(), join(), and show().

◆ $join_error

ilRegistrationGUI::$join_error = ''
protected

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

◆ $lng

ilRegistrationGUI::$lng
protected

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

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

◆ $obj_id

ilRegistrationGUI::$obj_id
protected

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

Referenced by fillMembershipLimitation().

◆ $participants

ilRegistrationGUI::$participants
protected

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

◆ $privacy

ilRegistrationGUI::$privacy = null
protected

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

◆ $ref_id

ilRegistrationGUI::$ref_id
protected

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

Referenced by fillMembershipLimitation(), and getRefId().

◆ $registration_possible

ilRegistrationGUI::$registration_possible = true
protected

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

Referenced by isRegistrationPossible().

◆ $tpl

◆ $waiting_list


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