ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilRegistrationGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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)

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

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().

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 _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
initWaitingList()
Init waiting list (course or group waiting list)
static _lookupType(int $id, bool $reference=false)
initParticipants()
Init participants object (course or group participants)
+ Here is the call graph for this function:

Member Function Documentation

◆ addCommandButtons()

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

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

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

Referenced by initForm().

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

◆ cancel()

ilRegistrationGUI::cancel ( )

cancel subscription

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

References ILIAS\Repository\ctrl().

380  : void
381  {
382  $this->ctrl->setParameterByClass(
383  "ilrepositorygui",
384  "ref_id",
385  $this->tree->getParentId($this->container->getRefId())
386  );
387  $this->ctrl->redirectByClass("ilrepositorygui", "");
388  }
+ Here is the call graph for this function:

◆ cancelSubscriptionRequest()

ilRegistrationGUI::cancelSubscriptionRequest ( )
protected

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

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

500  : void
501  {
502  $this->participants->deleteSubscriber($this->user->getId());
503  $this->tpl->setOnScreenMessage('success', $this->lng->txt('sub_request_deleted'), true);
504 
505  $this->ctrl->setParameterByClass(
506  "ilrepositorygui",
507  "ref_id",
508  $this->tree->getParentId($this->container->getRefId())
509  );
510  $this->ctrl->redirectByClass("ilrepositorygui", "");
511  }
+ 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.

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

Referenced by initForm().

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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static addCustomFields(ilPropertyFormGUI $form, int $a_obj_id, string $a_type, string $a_mode='user')
static addExportFieldInfo(ilPropertyFormGUI $form, int $a_obj_id, string $a_type)
static addAgreement(ilPropertyFormGUI $form, int $a_obj_id, string $a_type)
form( $class_path, string $cmd)
static _getInstanceByType(string $a_type)
Get Singleton Instance.
static _lookupType(int $id, bool $reference=false)
static _hasFields(int $a_container_id)
Check if there are any define fields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillInformations()

ilRegistrationGUI::fillInformations ( )
abstractprotected

fill informations

Referenced by initForm(), and leaveWaitingList().

+ Here is the caller graph for this function:

◆ fillMaxMembers()

ilRegistrationGUI::fillMaxMembers ( )
abstractprotected

show informations about the maximum number of user.

Referenced by initForm(), and leaveWaitingList().

+ Here is the caller graph for this function:

◆ fillMembershipLimitation()

ilRegistrationGUI::fillMembershipLimitation ( )
protected

Show membership limitations.

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

References ilObjCourseGrouping\_checkGroupingDependencies(), ilObjCourseGrouping\_getGroupingItems(), ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), enableRegistration(), ILIAS\Repository\form(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilCustomInputGUI\setHtml().

Referenced by initForm().

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, 'Services/Membership');
175  $tpl->setVariable('LIMIT_INTRO', $this->lng->txt($this->type . '_grp_info_reg'));
176  foreach ($items as $ref_id) {
177  $obj_id = ilObject::_lookupObjId($ref_id);
180 
181  if ($this->access->checkAccess('visible', '', $ref_id, $type)) {
182  $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
183  $tpl->setVariable(
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));
203  $tpl->parseCurrentBlock();
204  }
205  $mem->setHtml($tpl->get());
206  if (!ilObjCourseGrouping::_checkGroupingDependencies($this->container)) {
207  $mem->setAlert($this->container->getMessage());
208  $this->enableRegistration(false);
209  }
210  $this->form->addItem($mem);
211  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _checkGroupingDependencies(ilObject $container_obj, ?int $a_user_id=null)
static _getGroupingItems(ilObject $container_obj)
Get courses/groups that are assigned to the same membership limitation.
static _lookupObjId(int $ref_id)
static http()
Fetches the global http state from ILIAS.
enableRegistration(bool $a_status)
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $obj_id)
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
+ 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

Referenced by initForm(), and leaveWaitingList().

+ Here is the caller graph for this function:

◆ fillRegistrationType()

ilRegistrationGUI::fillRegistrationType ( )
abstractprotected

show informations about registration procedure

Referenced by initForm(), and leaveWaitingList().

+ Here is the caller graph for this function:

◆ getContainer()

ilRegistrationGUI::getContainer ( )

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

References $container.

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

81  : ilObject
82  {
83  return $this->container;
84  }
+ Here is the caller graph for this function:

◆ getFormTitle()

ilRegistrationGUI::getFormTitle ( )
abstractprotected

Get title for property form.

Referenced by initForm(), and leaveWaitingList().

+ Here is the caller graph for this function:

◆ getRefId()

ilRegistrationGUI::getRefId ( )

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

References $ref_id.

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

◆ getWaitingList()

ilRegistrationGUI::getWaitingList ( )
protected

◆ initForm()

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

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

References $form, addCommandButtons(), ILIAS\Repository\ctrl(), fillAgreement(), fillInformations(), fillMaxMembers(), fillMembershipLimitation(), fillRegistrationPeriod(), fillRegistrationType(), ILIAS\Repository\form(), getFormTitle(), and isRegistrationPossible().

Referenced by join(), and show().

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

Referenced by __construct(), and enableRegistration().

+ Here is the caller graph for this function:

◆ initWaitingList()

ilRegistrationGUI::initWaitingList ( )
abstractprotected

Init waiting list (course or group waiting list)

Referenced by __construct(), and enableRegistration().

+ 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.

Referenced by addCommandButtons(), and enableRegistration().

+ Here is the caller graph for this function:

◆ join()

ilRegistrationGUI::join ( )

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

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

402  : void
403  {
404  $form = $this->initForm();
405  if (!$form->checkInput() || !$this->validate()) {
407  if ($this->join_error) {
408  $this->tpl->setOnScreenMessage('failure', $this->join_error);
409  } else {
410  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
411  }
412  $this->show($form);
413  return;
414  }
415  $this->add();
416  }
show(?ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

◆ leaveWaitingList()

ilRegistrationGUI::leaveWaitingList ( )
protected

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

References $message, ILIAS\Repository\ctrl(), fillInformations(), fillMaxMembers(), fillRegistrationPeriod(), fillRegistrationType(), getFormTitle(), getWaitingList(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

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  }
getWaitingList()
Get waiting list object.
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:

◆ setAccepted()

ilRegistrationGUI::setAccepted ( bool  $a_status)
protected

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

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

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

365  : void
366  {
367  if (!$this->privacy->confirmationRequired($this->type) && !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId())) {
368  return;
369  }
370 
371  $agreement = new ilMemberAgreement($this->user->getId(), $this->container->getId());
372  $agreement->setAccepted($a_status);
373  $agreement->setAcceptanceTime(time());
374  $agreement->save();
375  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setAccepted(bool $a_status)
set accepted
static _hasFields(int $a_container_id)
Check if there are any define fields.
+ 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 390 of file class.ilRegistrationGUI.php.

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

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

390  : void
391  {
392  if (!$form instanceof ilPropertyFormGUI) {
393  $this->initForm();
394  }
395  $pending_goto = (string) ilSession::get('pending_goto');
396  if ($pending_goto) {
397  $this->tpl->setOnScreenMessage('info', $this->lng->txt("reg_goto_parent_membership_info"));
398  }
399  $this->tpl->setContent($this->form->getHTML());
400  }
static get(string $a_var)
form( $class_path, string $cmd)
+ 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.

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

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.
static http()
Fetches the global http state from ILIAS.
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ updateSubscriptionRequest()

ilRegistrationGUI::updateSubscriptionRequest ( )
protected

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

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

480  : void
481  {
482  $subject = $this->http->wrapper()->post()->retrieve(
483  'subject',
484  $this->refinery->byTrying([
485  $this->refinery->kindlyTo()->string(),
486  $this->refinery->always('')
487  ])
488  );
489 
490  $this->participants->updateSubject($this->user->getId(), ilUtil::stripSlashes($subject));
491  $this->tpl->setOnScreenMessage('success', $this->lng->txt('sub_request_saved'), true);
492  $this->ctrl->setParameterByClass(
493  "ilrepositorygui",
494  "ref_id",
495  $this->tree->getParentId($this->container->getRefId())
496  );
497  $this->ctrl->redirectByClass("ilrepositorygui", "");
498  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ validate()

ilRegistrationGUI::validate ( )
protected

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

Referenced by join().

418  : bool
419  {
420  return true;
421  }
+ Here is the caller graph for this function:

◆ validateAgreement()

ilRegistrationGUI::validateAgreement ( )
protected

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

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

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

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  }
static http()
Fetches the global http state from ILIAS.
+ 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.

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

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

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 = (int) ($cdf_parts[1] ?? 0);
327 
328  $open_answer_indexes = $field_obj->getValueOptions();
329  if (in_array($option_id, $open_answer_indexes)) {
330  $value = $this->http->wrapper()->post()->retrieve(
331  'cdf_oa_' . $field_obj->getId() . '_' . $option_id,
332  $this->refinery->byTrying([
333  $this->refinery->kindlyTo()->string(),
334  $this->refinery->always('')
335  ])
336  );
337  } else {
338  $value = $field_obj->getValueById((int) $option_id);
339  }
340  break;
341 
343  $value = $this->http->wrapper()->post()->retrieve(
344  'cdf_' . $field_obj->getId(),
345  $this->refinery->byTrying([
346  $this->refinery->kindlyTo()->string(),
347  $this->refinery->always('')
348  ])
349  );
350  break;
351  }
352 
353  $course_user_data = new ilCourseUserData($this->user->getId(), $field_obj->getId());
354  $course_user_data->setValue($value);
355  $course_user_data->update();
356 
357  // #14220
358  if ($field_obj->isRequired() && $value === "") {
359  $required_fullfilled = false;
360  }
361  }
362  return $required_fullfilled;
363  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setValue(string $a_value)
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
static http()
Fetches the global http state from ILIAS.
+ 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().

◆ $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.

◆ $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 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.

◆ $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: