ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCourseRegistrationGUI Class Reference

GUI class for course registrations. More...

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

Public Member Functions

 __construct (ilObject $a_container, object $a_parent_gui)
 
 executeCommand ()
 
- Public Member Functions inherited from ilRegistrationGUI
 __construct (ilObject $a_container)
 
 getContainer ()
 
 getRefId ()
 
 cancel ()
 cancel subscription More...
 
 show (?ilPropertyFormGUI $form=null)
 
 join ()
 

Protected Member Functions

 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...
 
 addCommandButtons ()
 
 validate ()
 
 add ()
 
 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...
 
- Protected Member Functions inherited from ilRegistrationGUI
 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 ()
 

Private Attributes

object $parent_gui
 

Additional Inherited Members

- Protected Attributes inherited from ilRegistrationGUI
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

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$ \ @ilCtrl_Calls ilCourseRegistrationGUI:

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

Constructor & Destructor Documentation

◆ __construct()

ilCourseRegistrationGUI::__construct ( ilObject  $a_container,
object  $a_parent_gui 
)

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

32 {
33 parent::__construct($a_container);
34 $this->parent_gui = $a_parent_gui;
35 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilCourseRegistrationGUI::add ( )
protected

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

349 {
350 // set aggreement accepted
351 $this->setAccepted(true);
352
353 $free = max(0, $this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
354 $waiting_list = new ilCourseWaitingList($this->container->getId());
355 if ($this->container->isSubscriptionMembershipLimited() && $this->container->enabledWaitingList() && (!$free || $waiting_list->getCountUsers())) {
356 $waiting_list->addToList($this->user->getId());
357 $info = sprintf(
358 $this->lng->txt('crs_added_to_list'),
359 $waiting_list->getPosition($this->user->getId())
360 );
361 $this->tpl->setOnScreenMessage('success', $info, true);
362
363 $this->participants->sendNotification(
365 $this->user->getId()
366 );
367 $this->participants->sendNotification(
369 $this->user->getId()
370 );
371 $this->ctrl->setParameterByClass(
372 "ilrepositorygui",
373 "ref_id",
374 $this->tree->getParentId($this->container->getRefId())
375 );
376 $this->ctrl->redirectByClass("ilrepositorygui", "");
377 }
378
379 switch ($this->container->getSubscriptionType()) {
381 $this->participants->addSubscriber($this->user->getId());
382 $this->participants->updateSubscriptionTime($this->user->getId(), time());
383
384 $subject = $this->http->wrapper()->post()->retrieve(
385 'subject',
386 $this->refinery->kindlyTo()->string()
387 );
388 $this->participants->updateSubject($this->user->getId(), $subject);
389 $this->participants->sendNotification(
391 $this->user->getId()
392 );
393
394 $this->tpl->setOnScreenMessage('success', $this->lng->txt("application_completed"), true);
395 $this->ctrl->setParameterByClass(
396 "ilrepositorygui",
397 "ref_id",
398 $this->tree->getParentId($this->container->getRefId())
399 );
400 $this->ctrl->redirectByClass("ilrepositorygui", "");
401 break;
402
403 default:
404
405 if ($this->container->isSubscriptionMembershipLimited() && $this->container->getSubscriptionMaxMembers()) {
406 $success = $GLOBALS['DIC']['rbacadmin']->assignUserLimited(
407 ilParticipants::getDefaultMemberRole($this->container->getRefId()),
408 $this->user->getId(),
409 $this->container->getSubscriptionMaxMembers(),
410 array(ilParticipants::getDefaultMemberRole($this->container->getRefId()))
411 );
412 if (!$success) {
413 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('crs_subscription_failed_limit'));
414 $this->show();
415 return;
416 }
417 }
418
419 $this->participants->add($this->user->getId(), ilParticipants::IL_CRS_MEMBER);
420 $this->participants->sendNotification(ilCourseMembershipMailNotification::TYPE_NOTIFICATION_ADMINS, $this->user->getId());
421 $this->participants->sendNotification(ilCourseMembershipMailNotification::TYPE_SUBSCRIBE_MEMBER, $this->user->getId());
422
423 ilForumNotification::checkForumsExistsInsert($this->container->getRefId(), $this->user->getId());
424
425 if ($this->container->getType() == "crs") {
426 $this->container->checkLPStatusSync($this->user->getId());
427 }
428 $pending_goto = ilSession::get('pending_goto');
429 if (!$pending_goto) {
430 $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscription_successful"), true);
431 $this->ctrl->returnToParent($this);
432 } else {
433 $tgt = $pending_goto;
434 ilSession::clear('pending_goto');
435 ilUtil::redirect($tgt);
436 }
437 break;
438 }
439 }
static checkForumsExistsInsert(int $ref_id, int $user_id)
static getDefaultMemberRole(int $a_ref_id)
show(?ilPropertyFormGUI $form=null)
static get(string $a_var)
static clear(string $a_var)
static redirect(string $a_script)
addToList(int $a_usr_id)
getPosition(int $a_usr_id)
$info
Definition: entry_point.php:21
static http()
Fetches the global http state from ILIAS.
$GLOBALS["DIC"]
Definition: wac.php:54

References $GLOBALS, $info, ilRegistrationGUI\$waiting_list, ilWaitingList\addToList(), ilForumNotification\checkForumsExistsInsert(), ilSession\clear(), ILIAS\Repository\ctrl(), ilSession\get(), ilWaitingList\getCountUsers(), ilParticipants\getDefaultMemberRole(), ilWaitingList\getPosition(), ILIAS\FileDelivery\http(), ilParticipants\IL_CRS_MEMBER, ilCourseConstants\IL_CRS_SUBSCRIPTION_CONFIRMATION, ILIAS\Repository\lng(), ilUtil\redirect(), ILIAS\Repository\refinery(), ilRegistrationGUI\setAccepted(), ilRegistrationGUI\show(), ilCourseMembershipMailNotification\TYPE_NOTIFICATION_ADMINS, ilCourseMembershipMailNotification\TYPE_NOTIFICATION_ADMINS_REGISTRATION_REQUEST, ilCourseMembershipMailNotification\TYPE_SUBSCRIBE_MEMBER, ilCourseMembershipMailNotification\TYPE_WAITING_LIST_MEMBER, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ addCommandButtons()

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

Reimplemented from ilRegistrationGUI.

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

282 : void
283 {
284 parent::addCommandButtons();
285 switch ($this->container->getSubscriptionType()) {
287 if ($this->participants->isSubscriber($this->user->getId())) {
288 $this->form->clearCommandButtons();
289 $this->form->addCommandButton(
290 'updateSubscriptionRequest',
291 $this->lng->txt('crs_update_subscr_request')
292 );
293 $this->form->addCommandButton(
294 'cancelSubscriptionRequest',
295 $this->lng->txt('crs_cancel_subscr_request')
296 );
297 } elseif ($this->isRegistrationPossible()) {
298 $this->form->clearCommandButtons();
299 $this->form->addCommandButton('join', $this->lng->txt('crs_join_request'));
300 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
301 }
302 break;
303 }
304 if (!$this->isRegistrationPossible()) {
305 }
306 }
form( $class_path, string $cmd, string $submit_caption="")

References ILIAS\Repository\form(), ilCourseConstants\IL_CRS_SUBSCRIPTION_CONFIRMATION, ilRegistrationGUI\isRegistrationPossible(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ executeCommand()

ilCourseRegistrationGUI::executeCommand ( )

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

38 {
39 if ($this->getWaitingList()->isOnList($this->user->getId())) {
40 $this->tabs->activateTab('leave');
41 }
42
43 if (!$this->access->checkAccess('join', '', $this->getRefId())) {
44 $this->ctrl->setReturn($this->parent_gui, 'infoScreen');
45 $this->ctrl->returnToParent($this);
46 return;
47 }
48
49 $next_class = $this->ctrl->getNextClass($this);
50 switch ($next_class) {
51 default:
52 $cmd = $this->ctrl->getCmd("show");
53 $this->$cmd();
54 break;
55 }
56 }
getWaitingList()
Get waiting list object.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilRegistrationGUI\getWaitingList(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ fillInformations()

ilCourseRegistrationGUI::fillInformations ( )
protected

fill informations

Reimplemented from ilRegistrationGUI.

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

66 : void
67 {
68 if ($this->container->getImportantInformation()) {
69 $imp = new ilNonEditableValueGUI($this->lng->txt('crs_important_info'), "", true);
70 $value = nl2br(ilUtil::makeClickable($this->container->getImportantInformation(), true));
71 $imp->setValue($value);
72 $this->form->addItem($imp);
73 }
74
75 if ($this->container->getSyllabus()) {
76 $syl = new ilNonEditableValueGUI($this->lng->txt('crs_syllabus'), "", true);
77 $value = nl2br(ilUtil::makeClickable($this->container->getSyllabus(), true));
78 $syl->setValue($value);
79 $this->form->addItem($syl);
80 }
81 }
This class represents a non editable value in a property form.
static makeClickable(string $a_text, bool $detectGotoLinks=false, ?string $ilias_http_path=null)

References ILIAS\Repository\form(), ILIAS\Repository\lng(), and ilUtil\makeClickable().

+ Here is the call graph for this function:

◆ fillMaxMembers()

ilCourseRegistrationGUI::fillMaxMembers ( )
protected

show informations about the maximum number of user.

Reimplemented from ilRegistrationGUI.

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

135 : void
136 {
137 if (!$this->container->isSubscriptionMembershipLimited()) {
138 return;
139 }
140 $tpl = new ilTemplate('tpl.max_members_form.html', true, true, 'components/ILIAS/Membership');
141
142 $alert = '';
143 if ($this->container->getSubscriptionMinMembers()) {
144 $tpl->setVariable('TXT_MIN', $this->lng->txt('mem_min_users') . ':');
145 $tpl->setVariable('NUM_MIN', $this->container->getSubscriptionMinMembers());
146 }
147
148 if ($this->container->getSubscriptionMaxMembers()) {
149 $tpl->setVariable('TXT_MAX', $this->lng->txt('mem_max_users'));
150 $tpl->setVariable('NUM_MAX', $this->container->getSubscriptionMaxMembers());
151
152 $tpl->setVariable('TXT_FREE', $this->lng->txt('mem_free_places') . ":");
154 $free = $reg_info['reg_info_free_places'];
155
156 if ($free) {
157 $tpl->setVariable('NUM_FREE', $free);
158 } else {
159 $tpl->setVariable('WARN_FREE', $free);
160 }
161
162 $waiting_list = new ilCourseWaitingList($this->container->getId());
163 if (
164 $this->container->isSubscriptionMembershipLimited() && $this->container->enabledWaitingList() && (!$free || $waiting_list->getCountUsers())) {
165 if ($waiting_list->isOnList($this->user->getId())) {
166 $tpl->setVariable('TXT_WAIT', $this->lng->txt('mem_waiting_list_position'));
167 $tpl->setVariable('NUM_WAIT', $waiting_list->getPosition($this->user->getId()));
168 } else {
169 $tpl->setVariable('TXT_WAIT', $this->lng->txt('mem_waiting_list'));
170 if ($free && $waiting_list->getCountUsers()) {
172 } else {
174 }
175 }
176 }
177 if (
178 !$free && !$this->container->enabledWaitingList()) {
179 // Disable registration
180 $this->enableRegistration(false);
181 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('mem_alert_no_places'));
182 #$alert = $this->lng->txt('mem_alert_no_places');
183 } elseif (
184 $this->container->enabledWaitingList() && $this->container->isSubscriptionMembershipLimited() && $waiting_list->isOnList($this->user->getId())
185 ) {
186 // Disable registration
187 $this->enableRegistration(false);
188 } elseif (
189 !$free && $this->container->enabledWaitingList() && $this->container->isSubscriptionMembershipLimited()) {
190 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('crs_warn_no_max_set_on_waiting_list'));
191 #$alert = $this->lng->txt('crs_warn_no_max_set_on_waiting_list');
192 } elseif (
193 $free && $this->container->enabledWaitingList() && $this->container->isSubscriptionMembershipLimited() && $this->getWaitingList()->getCountUsers()) {
194 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('crs_warn_wl_set_on_waiting_list'));
195 #$alert = $this->lng->txt('crs_warn_wl_set_on_waiting_list');
196 }
197 }
198
199 $max = new ilCustomInputGUI($this->lng->txt('mem_participants'));
200 $max->setHtml($tpl->get());
201 if (strlen($alert)) {
202 $max->setAlert($alert);
203 }
204 $this->form->addItem($max);
205 }
This class represents a custom property in a property form.
static lookupRegistrationInfo(int $a_obj_id)
ilGlobalTemplateInterface $tpl
enableRegistration(bool $a_status)
special template class to simplify handling of ITX/PEAR
isOnList(int $a_usr_id)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References ilRegistrationGUI\$tpl, ilRegistrationGUI\$waiting_list, ilRegistrationGUI\enableRegistration(), ILIAS\Repository\form(), ILIAS\UICore\GlobalTemplate\get(), ilRegistrationGUI\getContainer(), ilWaitingList\getCountUsers(), ILIAS\Survey\Mode\getId(), ilWaitingList\getPosition(), ilWaitingList\isOnList(), ILIAS\Repository\lng(), ilObjCourseAccess\lookupRegistrationInfo(), and ILIAS\UICore\GlobalTemplate\setVariable().

+ Here is the call graph for this function:

◆ fillRegistrationPeriod()

ilCourseRegistrationGUI::fillRegistrationPeriod ( )
protected

show informations about the registration period

Reimplemented from ilRegistrationGUI.

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

83 : void
84 {
85 $now = new ilDateTime(time(), IL_CAL_UNIX, 'UTC');
86
87 if ($this->container->getSubscriptionUnlimitedStatus()) {
88 $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_period'));
89 $reg->setValue($this->lng->txt('mem_unlimited'));
90 $this->form->addItem($reg);
91 return;
92 } elseif ($this->container->getSubscriptionLimitationType() == ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED) {
93 return;
94 }
95
96 $start = new ilDateTime($this->container->getSubscriptionStart(), IL_CAL_UNIX, 'UTC');
97 $end = new ilDateTime($this->container->getSubscriptionEnd(), IL_CAL_UNIX, 'UTC');
98
99 $warning = '';
100 if (ilDateTime::_before($now, $start)) {
101 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'components/ILIAS/Membership');
102 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
104
105 $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
107
108 $warning = $this->lng->txt('mem_reg_not_started');
109 } elseif (ilDateTime::_after($now, $end)) {
110 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'components/ILIAS/Membership');
111 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_start'));
113
114 $tpl->setVariable('TXT_END', $this->lng->txt('mem_end'));
116
117 $warning = $this->lng->txt('mem_reg_expired');
118 } else {
119 $tpl = new ilTemplate('tpl.registration_period_form.html', true, true, 'components/ILIAS/Membership');
120 $tpl->setVariable('TXT_FIRST', $this->lng->txt('mem_end'));
122 }
123
124 $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_period'));
125 $reg->setHtml($tpl->get());
126 if (strlen($warning)) {
127 // Disable registration
128 $this->enableRegistration(false);
129 $this->tpl->setOnScreenMessage('failure', $warning);
130 #$reg->setAlert($warning);
131 }
132 $this->form->addItem($reg);
133 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.

References ilRegistrationGUI\$tpl, ilDateTime\_after(), ilDateTime\_before(), ilRegistrationGUI\enableRegistration(), ILIAS\Repository\form(), ilDatePresentation\formatDate(), ILIAS\UICore\GlobalTemplate\get(), IL_CAL_UNIX, ilCourseConstants\IL_CRS_SUBSCRIPTION_DEACTIVATED, ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setVariable().

+ Here is the call graph for this function:

◆ fillRegistrationType()

ilCourseRegistrationGUI::fillRegistrationType ( )
protected

show informations about registration procedure

Reimplemented from ilRegistrationGUI.

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

207 : void
208 {
209 if ($this->container->getSubscriptionLimitationType() == ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED) {
210 $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_type'));
211 #$reg->setHtml($this->lng->txt('crs_info_reg_deactivated'));
212 $reg->setAlert($this->lng->txt('crs_info_reg_deactivated'));
213 #ilUtil::sendFailure($this->lng->txt('crs_info_reg_deactivated'));
214 #$reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
215 #$reg->setValue($this->lng->txt('crs_info_reg_deactivated'));
216 #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
217 $this->form->addItem($reg);
218
219 // Disable registration
220 $this->enableRegistration(false);
221 return;
222 }
223
224 switch ($this->container->getSubscriptionType()) {
226
227 // no "request" info if waiting list is active
228 if ($this->isWaitingListActive()) {
229 return;
230 }
231
232 $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
233 $txt->setValue($this->lng->txt('crs_info_reg_direct'));
234
235 $this->form->addItem($txt);
236 break;
237
239 $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
240 $txt->setValue($this->lng->txt('crs_subscription_options_password'));
241
242 $pass = new ilTextInputGUI($this->lng->txt('passwd'), 'grp_passw');
243 $pass->setInputType('password');
244 $pass->setSize(12);
245 $pass->setMaxLength(32);
246 #$pass->setRequired(true);
247 $pass->setInfo($this->lng->txt('crs_info_reg_password'));
248
249 $txt->addSubItem($pass);
250 $this->form->addItem($txt);
251 break;
252
254
255 // no "request" info if waiting list is active
256 if ($this->isWaitingListActive()) {
257 return;
258 }
259
260 $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
261 $txt->setValue($this->lng->txt('crs_subscription_options_confirmation'));
262
263 $sub = new ilTextAreaInputGUI($this->lng->txt('crs_reg_subject'), 'subject');
264 $sub->setInfo($this->lng->txt('crs_info_reg_confirmation'));
265 $sub->setCols(40);
266 $sub->setRows(5);
267 if ($this->participants->isSubscriber($this->user->getId())) {
268 $sub_data = $this->participants->getSubscriberData($this->user->getId());
269 $sub->setValue($sub_data['subject']);
270 $sub->setInfo('');
271 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('crs_reg_user_already_subscribed'));
272 $this->enableRegistration(false);
273 }
274 $txt->addSubItem($sub);
275 $this->form->addItem($txt);
276 break;
277
278 default:
279 }
280 }
isWaitingListActive()
Check if the waiting list is active Maximum of members exceeded or any user on the waiting list.
This class represents a text area property in a property form.
This class represents a text property in a property form.
$txt
Definition: error.php:31

References $txt, ilRegistrationGUI\enableRegistration(), ILIAS\Repository\form(), ilCourseConstants\IL_CRS_SUBSCRIPTION_CONFIRMATION, ilCourseConstants\IL_CRS_SUBSCRIPTION_DEACTIVATED, ilCourseConstants\IL_CRS_SUBSCRIPTION_DIRECT, ilCourseConstants\IL_CRS_SUBSCRIPTION_PASSWORD, isWaitingListActive(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getFormTitle()

ilCourseRegistrationGUI::getFormTitle ( )
protected

Get title for property form.

Reimplemented from ilRegistrationGUI.

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

58 : string
59 {
60 if ($this->getWaitingList()->isOnList($this->user->getId())) {
61 return $this->lng->txt('member_status');
62 }
63 return $this->lng->txt('crs_registration');
64 }

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

+ Here is the call graph for this function:

◆ initParticipants()

ilCourseRegistrationGUI::initParticipants ( )
protected

Init participants object (course or group participants)

Reimplemented from ilRegistrationGUI.

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

442 {
443 $this->participants = ilCourseParticipants::_getInstanceByObjId($this->obj_id);
444 return $this->participants;
445 }
static _getInstanceByObjId(int $a_obj_id)
Base class for course and group participants.

References ilRegistrationGUI\$participants, and ilCourseParticipants\_getInstanceByObjId().

+ Here is the call graph for this function:

◆ initWaitingList()

ilCourseRegistrationGUI::initWaitingList ( )
protected

Init waiting list (course or group waiting list)

Reimplemented from ilRegistrationGUI.

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

448 {
449 $this->waiting_list = new ilCourseWaitingList($this->container->getId());
450 return $this->waiting_list;
451 }
Base class for course and group waiting lists.

References ilRegistrationGUI\$waiting_list.

◆ isWaitingListActive()

ilCourseRegistrationGUI::isWaitingListActive ( )
protected

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

Reimplemented from ilRegistrationGUI.

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

453 : bool
454 {
455 static $active = null;
456
457 if ($active !== null) {
458 return $active;
459 }
460 if (!$this->container->enabledWaitingList() || !$this->container->isSubscriptionMembershipLimited()) {
461 return $active = false;
462 }
463 if (!$this->container->getSubscriptionMaxMembers()) {
464 return $active = false;
465 }
466
467 $free = max(0, $this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
468 return $active = (!$free || $this->getWaitingList()->getCountUsers());
469 }

References ilRegistrationGUI\getWaitingList().

Referenced by fillRegistrationType().

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

◆ validate()

ilCourseRegistrationGUI::validate ( )
protected

Reimplemented from ilRegistrationGUI.

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

308 : bool
309 {
310 if ($this->user->getId() == ANONYMOUS_USER_ID) {
311 $this->join_error = $this->lng->txt('permission_denied');
312 return false;
313 }
314
315 // Set aggrement to not accepted
316 $this->setAccepted(false);
317
318 if (!$this->isRegistrationPossible()) {
319 $this->join_error = $this->lng->txt('mem_error_preconditions');
320 return false;
321 }
322 if ($this->container->getSubscriptionType() == ilCourseConstants::IL_CRS_SUBSCRIPTION_PASSWORD) {
323 $pass = $this->http->wrapper()->post()->retrieve(
324 'grp_passw',
325 $this->refinery->kindlyTo()->string()
326 );
327 if ((string) $pass === '') {
328 $this->join_error = $this->lng->txt('crs_password_required');
329 return false;
330 }
331 if (strcmp($pass, $this->container->getSubscriptionPassword()) !== 0) {
332 $this->join_error = $this->lng->txt('crs_password_not_valid');
333 return false;
334 }
335 }
336 if (!$this->validateCustomFields()) {
337 $this->join_error = $this->lng->txt('fill_out_all_required_fields');
338 return false;
339 }
340 if (!$this->validateAgreement()) {
341 $this->join_error = $this->lng->txt('crs_agreement_required');
342 return false;
343 }
344
345 return true;
346 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

References ANONYMOUS_USER_ID, ILIAS\FileDelivery\http(), ilCourseConstants\IL_CRS_SUBSCRIPTION_PASSWORD, ilRegistrationGUI\isRegistrationPossible(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilRegistrationGUI\setAccepted(), ILIAS\Repository\user(), ilRegistrationGUI\validateAgreement(), and ilRegistrationGUI\validateCustomFields().

+ Here is the call graph for this function:

Field Documentation

◆ $parent_gui

object ilCourseRegistrationGUI::$parent_gui
private

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


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