ILIAS  trunk Revision v12.0_alpha-1329-g1094ddb0c33
ilRegistrationGUI Class Reference

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

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

Public Member Functions

 __construct (ilObject $a_container)
 
 getContainer ()
 
 getRefId ()
 
 cancel ()
 cancel subscription More...
 
 show (?ilPropertyFormGUI $form=null)
 
 join ()
 

Protected Member Functions

 isRegistrationPossible ()
 
 enableRegistration (bool $a_status)
 
 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 ()
 
 showCustomFields ()
 
 validateAgreement ()
 
 validateCustomFields ()
 
 setAccepted (bool $a_status)
 
 validate ()
 
 initForm ()
 
 addCommandButtons ()
 
 updateSubscriptionRequest ()
 
 cancelSubscriptionRequest ()
 

Protected Attributes

int $ref_id
 
int $obj_id
 
string $type
 
string $join_error = ''
 
bool $registration_possible = true
 
ILIAS HTTP GlobalHttpState $http
 
ILIAS Refinery Factory $refinery
 
ilPrivacySettings $privacy
 
ilObject $container
 
ilParticipants $participants
 
ilWaitingList $waiting_list
 
ilPropertyFormGUI $form = null
 
ilObjUser $user
 
ilTabsGUI $tabs
 
ilTree $tree
 
ilRbacReview $rbacreview
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilAccessHandler $access
 

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

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

Constructor & Destructor Documentation

◆ __construct()

ilRegistrationGUI::__construct ( ilObject  $a_container)

Reimplemented in ilGroupRegistrationGUI.

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

50 {
51 global $DIC;
52
53 $this->user = $DIC->user();
54 $this->tabs = $DIC->tabs();
55 $this->tree = $DIC->repositoryTree();
56 $this->rbacreview = $DIC->rbac()->review();
57
58 $this->lng = $DIC->language();
59 $this->lng->loadLanguageModule('crs');
60 $this->lng->loadLanguageModule('grp');
61 $this->lng->loadLanguageModule('ps');
62 $this->lng->loadLanguageModule('membership');
63
64 $this->ctrl = $DIC->ctrl();
65 $this->tpl = $DIC->ui()->mainTemplate();
66 $this->access = $DIC->access();
67
68 $this->container = $a_container;
69 $this->ref_id = $this->container->getRefId();
70 $this->obj_id = ilObject::_lookupObjId($this->ref_id);
71 $this->type = ilObject::_lookupType($this->obj_id);
72
73 $this->initParticipants();
74 $this->initWaitingList();
75
76 $this->privacy = ilPrivacySettings::getInstance();
77 $this->http = $DIC->http();
78 $this->refinery = $DIC->refinery();
79 }
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
initParticipants()
Init participants object (course or group participants)
initWaitingList()
Init waiting list (course or group waiting list)
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilPrivacySettings\getInstance(), ilObject\getRefId(), ILIAS\FileDelivery\http(), initParticipants(), initWaitingList(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addCommandButtons()

ilRegistrationGUI::addCommandButtons ( )
protected
Todo:
get rid of $this->form

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

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

460 : void
461 {
462 if (
463 $this->isRegistrationPossible() &&
464 $this->isWaitingListActive() &&
465 !$this->getWaitingList()->isOnList($this->user->getId())
466 ) {
467 $this->form->addCommandButton('join', $this->lng->txt('mem_add_to_wl'));
468 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
469 } elseif ($this->isRegistrationPossible() && !$this->getWaitingList()->isOnList($this->user->getId())) {
470 $this->form->addCommandButton('join', $this->lng->txt('join'));
471 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
472 }
473 if ($this->getWaitingList()->isOnList($this->user->getId())) {
474 $this->tpl->setOnScreenMessage('question', sprintf(
475 $this->lng->txt($this->container->getType() . '_cancel_waiting_list'),
476 $this->container->getTitle()
477 ));
478 $this->form->addCommandButton('leaveWaitingList', $this->lng->txt('leave_waiting_list'));
479 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
480 }
481 }
isWaitingListActive()
Check if the waiting list is active Maximum of members exceeded or any user on the waiting list.
getWaitingList()
Get waiting list object.
form(?array $class_path, string $cmd, string $submit_caption="")

References ILIAS\Repository\form(), getWaitingList(), isRegistrationPossible(), isWaitingListActive(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by initForm().

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

◆ cancel()

ilRegistrationGUI::cancel ( )

cancel subscription

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

383 : void
384 {
385 $this->ctrl->setParameterByClass(
386 "ilrepositorygui",
387 "ref_id",
388 $this->tree->getParentId($this->container->getRefId())
389 );
390 $this->ctrl->redirectByClass("ilrepositorygui", "");
391 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSubscriptionRequest()

ilRegistrationGUI::cancelSubscriptionRequest ( )
protected

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

503 : void
504 {
505 $this->participants->deleteSubscriber($this->user->getId());
506 $this->tpl->setOnScreenMessage('success', $this->lng->txt('sub_request_deleted'), true);
507
508 $this->ctrl->setParameterByClass(
509 "ilrepositorygui",
510 "ref_id",
511 $this->tree->getParentId($this->container->getRefId())
512 );
513 $this->ctrl->redirectByClass("ilrepositorygui", "");
514 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ enableRegistration()

ilRegistrationGUI::enableRegistration ( bool  $a_status)
protected

◆ fillAgreement()

ilRegistrationGUI::fillAgreement ( )
protected

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

213 : void
214 {
215 if (!$this->isRegistrationPossible()) {
216 return;
217 }
218
219 if (!$this->privacy->confirmationRequired($this->type) && !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId())) {
220 return;
221 }
222
223 $this->lng->loadLanguageModule('ps');
224
225 $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->container->getId()));
226
227 if (!count($fields_info->getExportableFields())) {
228 return;
229 }
230 $section = new ilFormSectionHeaderGUI();
231 $section->setTitle($this->lng->txt($this->type . '_usr_agreement'));
232 $this->form->addItem($section);
233
234 ilMemberAgreementGUI::addExportFieldInfo($this->form, $this->obj_id, $this->type);
235
236 ilMemberAgreementGUI::addCustomFields($this->form, $this->obj_id, $this->type);
237
238 // Checkbox agreement
239 if ($this->privacy->confirmationRequired($this->type)) {
240 ilMemberAgreementGUI::addAgreement($this->form, $this->obj_id, $this->type);
241 }
242 }
static _hasFields(int $a_container_id)
Check if there are any define fields.
static _getInstanceByType(string $a_type)
Get Singleton Instance.
This class represents a section header in a property form.
static addCustomFields(ilPropertyFormGUI $form, int $a_obj_id, string $a_type, string $a_mode='user')
static addAgreement(ilPropertyFormGUI $form, int $a_obj_id, string $a_type)
static addExportFieldInfo(ilPropertyFormGUI $form, int $a_obj_id, string $a_type)

References ilExportFieldsInfo\_getInstanceByType(), ilCourseDefinedFieldDefinition\_hasFields(), ilObject\_lookupType(), ilMemberAgreementGUI\addAgreement(), ilMemberAgreementGUI\addCustomFields(), ilMemberAgreementGUI\addExportFieldInfo(), ILIAS\Repository\form(), isRegistrationPossible(), and ILIAS\Repository\lng().

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

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.

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ fillMembershipLimitation()

ilRegistrationGUI::fillMembershipLimitation ( )
protected

Show membership limitations.

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

168 : void
169 {
170 if (!$items = ilObjCourseGrouping::_getGroupingItems($this->container)) {
171 return;
172 }
173 $mem = new ilCustomInputGUI($this->lng->txt('groupings'));
174 $tpl = new ilTemplate('tpl.membership_limitation_form.html', true, true, 'components/ILIAS/Membership');
175 $tpl->setVariable('LIMIT_INTRO', $this->lng->txt($this->type . '_grp_info_reg'));
176 foreach ($items as $ref_id) {
180
181 if ($this->access->checkAccess('visible', '', $ref_id, $type)) {
182 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
184 'LINK_ITEM',
185 $this->ctrl->getLinkTargetByClass("ilrepositorygui", "")
186 );
187 $get_ref_id = $this->http->wrapper()->query()->retrieve(
188 'ref_id',
189 $this->refinery->byTrying([
190 $this->refinery->kindlyTo()->int(),
191 $this->refinery->always(0)
192 ])
193 );
194
195 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $get_ref_id);
196 $tpl->setVariable('ITEM_LINKED_TITLE', $title);
197 } else {
198 $tpl->setVariable('ITEM_TITLE');
199 }
200 $tpl->setCurrentBlock('items');
201 $tpl->setVariable('TYPE_ICON', ilObject::_getIcon($obj_id, 'tiny', $type));
202 $tpl->setVariable('ALT_ICON', $this->lng->txt('obj_' . $type));
204 }
205 $mem->setHtml($tpl->get());
207 $mem->setAlert($this->container->getMessage());
208 $this->enableRegistration(false);
209 }
210 $this->form->addItem($mem);
211 }
This class represents a custom property in a property form.
static _getGroupingItems(ilObject $container_obj)
Get courses/groups that are assigned to the same membership limitation.
static _checkGroupingDependencies(ilObject $container_obj, ?int $a_user_id=null)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupTitle(int $obj_id)
ilGlobalTemplateInterface $tpl
enableRegistration(bool $a_status)
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References $obj_id, $ref_id, $tpl, $type, ilObjCourseGrouping\_checkGroupingDependencies(), ilObjCourseGrouping\_getGroupingItems(), ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), enableRegistration(), ILIAS\Repository\form(), ILIAS\UICore\GlobalTemplate\get(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ILIAS\Repository\refinery(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), and ILIAS\UICore\GlobalTemplate\setVariable().

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

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

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ getContainer()

ilRegistrationGUI::getContainer ( )

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

81 : ilObject
82 {
83 return $this->container;
84 }
Class ilObject Basic functions for all objects.

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.

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ getRefId()

ilRegistrationGUI::getRefId ( )

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

86 : int
87 {
88 return $this->ref_id;
89 }

References $ref_id.

◆ getWaitingList()

◆ initForm()

ilRegistrationGUI::initForm ( )
protected
Todo:
get rid $this->form

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

430 {
431 if (is_object($this->form)) {
432 return $this->form;
433 }
434
435 $this->form = new ilPropertyFormGUI();
436 $this->form->setFormAction($this->ctrl->getFormAction($this, 'join'));
437 $this->form->setTitle($this->getFormTitle());
438
439 $this->fillInformations();
441 if ($this->isRegistrationPossible()) {
442 $this->fillRegistrationPeriod();
443 }
444 if ($this->isRegistrationPossible() || $this->participants->isSubscriber($this->user->getId())) {
445 $this->fillRegistrationType();
446 }
447 if ($this->isRegistrationPossible()) {
448 $this->fillMaxMembers();
449 }
450 if ($this->isRegistrationPossible()) {
451 $this->fillAgreement();
452 }
453 $this->addCommandButtons();
454 return $this->form;
455 }
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
fillInformations()
fill informations
fillMembershipLimitation()
Show membership limitations.
fillMaxMembers()
show informations about the maximum number of user.

References $form, addCommandButtons(), ILIAS\Repository\ctrl(), fillAgreement(), fillInformations(), fillMaxMembers(), fillMembershipLimitation(), fillRegistrationPeriod(), fillRegistrationType(), ILIAS\Repository\form(), 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)

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)

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ isRegistrationPossible()

ilRegistrationGUI::isRegistrationPossible ( )
protected

◆ isWaitingListActive()

ilRegistrationGUI::isWaitingListActive ( )
abstractprotected

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

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

Referenced by addCommandButtons().

+ Here is the caller graph for this function:

◆ join()

ilRegistrationGUI::join ( )

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

405 : void
406 {
407 $form = $this->initForm();
408 if (!$form->checkInput() || !$this->validate()) {
410 if ($this->join_error) {
411 $this->tpl->setOnScreenMessage('failure', $this->join_error);
412 } else {
413 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
414 }
415 $this->show($form);
416 return;
417 }
418 $this->add();
419 }
show(?ilPropertyFormGUI $form=null)

References $form, ILIAS\UI\examples\Symbol\Glyph\Add\add(), ilPropertyFormGUI\checkInput(), initForm(), ILIAS\Repository\lng(), ilPropertyFormGUI\setValuesByPost(), and show().

+ Here is the call graph for this function:

◆ leaveWaitingList()

ilRegistrationGUI::leaveWaitingList ( )
protected

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

126 : void
127 {
128 $this->getWaitingList()->removeFromList($this->user->getId());
129 $parent = $this->tree->getParentId($this->container->getRefId());
130
131 $message = sprintf(
132 $this->lng->txt($this->container->getType() . '_removed_from_waiting_list'),
133 $this->container->getTitle()
134 );
135 $this->tpl->setOnScreenMessage('success', $message, true);
136 $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $parent);
137 $this->ctrl->redirectByClass("ilrepositorygui", "");
138 }

References ILIAS\Repository\ctrl(), getWaitingList(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ setAccepted()

ilRegistrationGUI::setAccepted ( bool  $a_status)
protected

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

368 : void
369 {
370 if (!$this->privacy->confirmationRequired($this->type) && !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId())) {
371 return;
372 }
373
374 $agreement = new ilMemberAgreement($this->user->getId(), $this->container->getId());
375 $agreement->setAccepted($a_status);
376 $agreement->setAcceptanceTime(time());
377 $agreement->save();
378 }

References ilCourseDefinedFieldDefinition\_hasFields(), and ILIAS\Repository\user().

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)

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

393 : void
394 {
395 if (!$form instanceof ilPropertyFormGUI) {
396 $this->initForm();
397 }
398 $pending_goto = (string) ilSession::get('pending_goto');
399 if ($pending_goto) {
400 $this->tpl->setOnScreenMessage('info', $this->lng->txt("reg_goto_parent_membership_info"));
401 }
402 $this->tpl->setContent($this->form->getHTML());
403 }
static get(string $a_var)

References $form, ILIAS\Repository\form(), ilSession\get(), initForm(), and ILIAS\Repository\lng().

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

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

244 : void
245 {
246 if (!count($cdf_fields = ilCourseDefinedFieldDefinition::_getFields($this->container->getId()))) {
247 return;
248 }
249
250 $cdf_values = $this->http->wrapper()->post()->retrieve(
251 'cdf',
252 $this->refinery->byTrying([
253 $this->refinery->kindlyTo()->dictOf(
254 $this->refinery->kindlyTo()->string()
255 ),
256 $this->refinery->always([])
257 ])
258 );
259
260 $cdf = new ilNonEditableValueGUI($this->lng->txt('ps_crs_user_fields'));
261 $cdf->setValue($this->lng->txt($this->type . '_ps_cdf_info'));
262 $cdf->setRequired(true);
263 foreach ($cdf_fields as $field_obj) {
264 switch ($field_obj->getType()) {
266 $select = new ilSelectInputGUI($field_obj->getName(), 'cdf[' . $field_obj->getId() . ']');
267 $select->setValue($cdf_values[$field_obj->getId()] ?? '');
268 $select->setOptions($field_obj->prepareSelectBox());
269 if ($field_obj->isRequired()) {
270 $select->setRequired(true);
271 }
272 $cdf->addSubItem($select);
273 break;
274
276 $text = new ilTextInputGUI($field_obj->getName(), 'cdf[' . $field_obj->getId() . ']');
277 $text->setValue($cdf_values[$field_obj->getId()] ?? '');
278 $text->setSize(32);
279 $text->setMaxLength(255);
280 if ($field_obj->isRequired()) {
281 $text->setRequired(true);
282 }
283 $cdf->addSubItem($text);
284 break;
285 }
286 }
287 $this->form->addItem($cdf);
288 }
static _getFields(int $a_container_id, $a_sort=self::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.
$text
Definition: xapiexit.php:21

References $text, ilCourseDefinedFieldDefinition\_getFields(), ILIAS\Repository\form(), ILIAS\FileDelivery\http(), ilCourseDefinedFieldDefinition\IL_CDF_TYPE_SELECT, ilCourseDefinedFieldDefinition\IL_CDF_TYPE_TEXT, ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ updateSubscriptionRequest()

ilRegistrationGUI::updateSubscriptionRequest ( )
protected

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

483 : void
484 {
485 $subject = $this->http->wrapper()->post()->retrieve(
486 'subject',
487 $this->refinery->byTrying([
488 $this->refinery->kindlyTo()->string(),
489 $this->refinery->always('')
490 ])
491 );
492
493 $this->participants->updateSubject($this->user->getId(), ilUtil::stripSlashes($subject));
494 $this->tpl->setOnScreenMessage('success', $this->lng->txt('sub_request_saved'), true);
495 $this->ctrl->setParameterByClass(
496 "ilrepositorygui",
497 "ref_id",
498 $this->tree->getParentId($this->container->getRefId())
499 );
500 $this->ctrl->redirectByClass("ilrepositorygui", "");
501 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilUtil\stripSlashes(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ validate()

ilRegistrationGUI::validate ( )
protected

Reimplemented in ilCourseRegistrationGUI, and ilGroupRegistrationGUI.

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

421 : bool
422 {
423 return true;
424 }

◆ validateAgreement()

ilRegistrationGUI::validateAgreement ( )
protected

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

290 : bool
291 {
292 $agreement = $this->http->wrapper()->post()->retrieve(
293 'agreement',
294 $this->refinery->byTrying([
295 $this->refinery->kindlyTo()->string(),
296 $this->refinery->always(null)
297 ])
298 );
299
300 if ($agreement) {
301 return true;
302 }
303 if (!$this->privacy->confirmationRequired($this->type)) {
304 return true;
305 }
306 return false;
307 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

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

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

◆ validateCustomFields()

ilRegistrationGUI::validateCustomFields ( )
protected

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

309 : bool
310 {
311 $required_fullfilled = true;
312 $value = '';
313 foreach (ilCourseDefinedFieldDefinition::_getFields($this->container->getId()) as $field_obj) {
314 switch ($field_obj->getType()) {
316 $cdf_value = $this->http->wrapper()->post()->retrieve(
317 'cdf_' . $field_obj->getId(),
318 $this->refinery->byTrying([
319 $this->refinery->kindlyTo()->string(),
320 $this->refinery->always('')
321 ])
322 );
323
324 // Split value id from post
325 $cdf_parts = explode('_', $cdf_value);
326 $option_id = $cdf_parts[1] ?? null;
327
328 $open_answer_indexes = $field_obj->getValueOptions();
329
330 if ($option_id === null) {
331 $value = '';
332 } elseif (in_array($option_id, $open_answer_indexes)) {
333 $value = $this->http->wrapper()->post()->retrieve(
334 'cdf_oa_' . $field_obj->getId() . '_' . $option_id,
335 $this->refinery->byTrying([
336 $this->refinery->kindlyTo()->string(),
337 $this->refinery->always('')
338 ])
339 );
340 } else {
341 $value = $field_obj->getValueById((int) $option_id);
342 }
343 break;
344
346 $value = $this->http->wrapper()->post()->retrieve(
347 'cdf_' . $field_obj->getId(),
348 $this->refinery->byTrying([
349 $this->refinery->kindlyTo()->string(),
350 $this->refinery->always('')
351 ])
352 );
353 break;
354 }
355
356 $course_user_data = new ilCourseUserData($this->user->getId(), $field_obj->getId());
357 $course_user_data->setValue($value);
358 $course_user_data->update();
359
360 // #14220
361 if ($field_obj->isRequired() && $value === "") {
362 $required_fullfilled = false;
363 }
364 }
365 return $required_fullfilled;
366 }

References ilCourseDefinedFieldDefinition\_getFields(), ILIAS\FileDelivery\http(), ilCourseDefinedFieldDefinition\IL_CDF_TYPE_SELECT, ilCourseDefinedFieldDefinition\IL_CDF_TYPE_TEXT, and ILIAS\Repository\user().

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

◆ $access

ilAccessHandler ilRegistrationGUI::$access
protected

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

◆ $container

ilObject ilRegistrationGUI::$container
protected

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

Referenced by getContainer().

◆ $ctrl

ilCtrl ilRegistrationGUI::$ctrl
protected

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

◆ $form

ilPropertyFormGUI ilRegistrationGUI::$form = null
protected

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

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

◆ $http

ILIAS HTTP GlobalHttpState ilRegistrationGUI::$http
protected

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

◆ $join_error

string ilRegistrationGUI::$join_error = ''
protected

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

◆ $lng

ilLanguage ilRegistrationGUI::$lng
protected

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

◆ $obj_id

int ilRegistrationGUI::$obj_id
protected

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

Referenced by fillMembershipLimitation().

◆ $participants

ilParticipants ilRegistrationGUI::$participants
protected

◆ $privacy

ilPrivacySettings ilRegistrationGUI::$privacy
protected

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

◆ $rbacreview

ilRbacReview ilRegistrationGUI::$rbacreview
protected

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

◆ $ref_id

int ilRegistrationGUI::$ref_id
protected

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

Referenced by fillMembershipLimitation(), and getRefId().

◆ $refinery

ILIAS Refinery Factory ilRegistrationGUI::$refinery
protected

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

◆ $registration_possible

bool ilRegistrationGUI::$registration_possible = true
protected

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

Referenced by isRegistrationPossible().

◆ $tabs

ilTabsGUI ilRegistrationGUI::$tabs
protected

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

◆ $tpl

◆ $tree

ilTree ilRegistrationGUI::$tree
protected

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

◆ $type

string ilRegistrationGUI::$type
protected

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

Referenced by fillMembershipLimitation().

◆ $user

ilObjUser ilRegistrationGUI::$user
protected

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

◆ $waiting_list


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