ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCourseRegistrationGUI Class Reference

GUI class for course registrations. More...

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

Public Member Functions

 __construct ($a_container)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
- Public Member Functions inherited from ilRegistrationGUI
 __construct ($a_container)
 Constructor. More...
 
 getContainer ()
 Parent object. More...
 
 getRefId ()
 Get ref. More...
 
 cancel ()
 cancel subscription More...
 
 show ()
 show registration form More...
 
 join ()
 join More...
 

Protected Member Functions

 getFormTitle ()
 get form title More...
 
 fillInformations ()
 fill informations More...
 
 fillRegistrationPeriod ()
 show informations about the registration period More...
 
 fillMaxMembers ()
 fill max members More...
 
 fillRegistrationType ()
 fill registration type More...
 
 addCommandButtons ()
 Add group specific command buttons. More...
 
 validate ()
 Validate subscription request. More...
 
 add ()
 add user More...
 
 initParticipants ()
 Init course participants. More...
 
 initWaitingList ()
 
 isWaitingListActive ()
 
- Protected Member Functions inherited from ilRegistrationGUI
 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 ()
 

Additional Inherited Members

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

Detailed Description

GUI class for course registrations.

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

ilCourseRegistrationGUI:

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

Constructor & Destructor Documentation

◆ __construct()

ilCourseRegistrationGUI::__construct (   $a_container)

Constructor.

public

Parameters
objectcourse object

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

46  {
47  parent::__construct($a_container);
48  }

Member Function Documentation

◆ add()

ilCourseRegistrationGUI::add ( )
protected

add user

protected

Parameters

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

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

478  {
479  global $ilUser,$tree, $ilCtrl;
480 
481  // TODO: language vars
482 
483  // set aggreement accepted
484  $this->setAccepted(true);
485 
486  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
487  $free = max(0,$this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
488  $waiting_list = new ilCourseWaitingList($this->container->getId());
489  if($this->container->isSubscriptionMembershipLimited() and $this->container->enabledWaitingList() and (!$free or $waiting_list->getCountUsers()))
490  {
491  $waiting_list->addToList($ilUser->getId());
492  $info = sprintf($this->lng->txt('crs_added_to_list'),
493  $waiting_list->getPosition($ilUser->getId()));
494  ilUtil::sendSuccess($info,true);
495 
496  $this->participants->sendNotification($this->participants->NOTIFY_SUBSCRIPTION_REQUEST,$ilUser->getId());
497  $this->participants->sendNotification($this->participants->NOTIFY_WAITING_LIST,$ilUser->getId());
498  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
499  $tree->getParentId($this->container->getRefId()));
500  $ilCtrl->redirectByClass("ilrepositorygui", "");
501  }
502 
503  switch($this->container->getSubscriptionType())
504  {
506  $this->participants->addSubscriber($ilUser->getId());
507  $this->participants->updateSubscriptionTime($ilUser->getId(),time());
508  $this->participants->updateSubject($ilUser->getId(),ilUtil::stripSlashes($_POST['subject']));
509  $this->participants->sendNotification($this->participants->NOTIFY_SUBSCRIPTION_REQUEST,$ilUser->getId());
510 
511  ilUtil::sendSuccess($this->lng->txt("application_completed"),true);
512  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
513  $tree->getParentId($this->container->getRefId()));
514  $ilCtrl->redirectByClass("ilrepositorygui", "");
515  break;
516 
517  default:
518  $this->participants->add($ilUser->getId(),IL_CRS_MEMBER);
519  $this->participants->sendNotification($this->participants->NOTIFY_ADMINS,$ilUser->getId());
520  $this->participants->sendNotification($this->participants->NOTIFY_REGISTERED,$ilUser->getId());
521 
522  include_once './Modules/Forum/classes/class.ilForumNotification.php';
523  ilForumNotification::checkForumsExistsInsert($this->container->getRefId(), $ilUser->getId());
524 
525  if($this->container->getType() == "crs")
526  {
527  $this->container->checkLPStatusSync($ilUser->getId());
528  }
529 
530  if(!$_SESSION["pending_goto"])
531  {
532  ilUtil::sendSuccess($this->lng->txt("crs_subscription_successful"),true);
533  $this->ctrl->returnToParent($this);
534  }
535  else
536  {
537  $tgt = $_SESSION["pending_goto"];
538  unset($_SESSION["pending_goto"]);
539  ilUtil::redirect($tgt);
540  }
541  break;
542  }
543  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
const IL_CRS_SUBSCRIPTION_CONFIRMATION
global $ilCtrl
Definition: ilias.php:18
const IL_CRS_MEMBER
setAccepted($a_status)
Set Agreement accepted.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilUser
Definition: imgupload.php:15
static checkForumsExistsInsert($ref_id, $user_id=0)
static redirect($a_script)
http redirect to other script
addToList($a_usr_id)
add to list
+ Here is the call graph for this function:

◆ addCommandButtons()

ilCourseRegistrationGUI::addCommandButtons ( )
protected

Add group specific command buttons.

Returns

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

References $ilUser, IL_CRS_SUBSCRIPTION_CONFIRMATION, and ilRegistrationGUI\isRegistrationPossible().

387  {
388  global $ilUser;
389 
390  parent::addCommandButtons();
391 
392 
393  switch($this->container->getSubscriptionType())
394  {
396  if($this->participants->isSubscriber($ilUser->getId()))
397  {
398  $this->form->clearCommandButtons();
399  $this->form->addCommandButton('updateSubscriptionRequest', $this->lng->txt('crs_update_subscr_request'));
400  $this->form->addCommandButton('cancelSubscriptionRequest', $this->lng->txt('crs_cancel_subscr_request'));
401  }
402  elseif($this->isRegistrationPossible())
403  {
404  $this->form->clearCommandButtons();
405  $this->form->addCommandButton('join', $this->lng->txt('crs_join_request'));
406  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
407  }
408  break;
409  }
410  if(!$this->isRegistrationPossible())
411  {
412  return false;
413  }
414 
415  return true;
416  }
const IL_CRS_SUBSCRIPTION_CONFIRMATION
isRegistrationPossible()
check if registration is possible
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ executeCommand()

ilCourseRegistrationGUI::executeCommand ( )

Execute command.

public

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

References $cmd, $GLOBALS, $ilUser, ilRegistrationGUI\getRefId(), and ilRegistrationGUI\getWaitingList().

56  {
57  global $ilTabs,$ilUser;
58 
59  if($this->getWaitingList()->isOnList($ilUser->getId()))
60  {
61  $ilTabs->activateTab('leave');
62  }
63 
64  if(!$GLOBALS['ilAccess']->checkAccess('join','',$this->getRefId()))
65  {
66  $this->ctrl->returnToParent($this);
67  return FALSE;
68  }
69 
70  $next_class = $this->ctrl->getNextClass($this);
71  switch($next_class)
72  {
73  default:
74  $cmd = $this->ctrl->getCmd("show");
75  $this->$cmd();
76  break;
77  }
78  return true;
79  }
getWaitingList()
Get waiting list object.
$cmd
Definition: sahs_server.php:35
$GLOBALS['ct_recipient']
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ fillInformations()

ilCourseRegistrationGUI::fillInformations ( )
protected

fill informations

protected

Parameters

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

References ilUtil\makeClickable().

106  {
107  if($this->container->getImportantInformation())
108  {
109  $imp = new ilNonEditableValueGUI($this->lng->txt('crs_important_info'), "", true);
110  $value = nl2br(ilUtil::makeClickable($this->container->getImportantInformation(), true));
111  $imp->setValue($value);
112  $this->form->addItem($imp);
113  }
114 
115  if($this->container->getSyllabus())
116  {
117  $syl = new ilNonEditableValueGUI($this->lng->txt('crs_syllabus'), "", true);
118  $value = nl2br(ilUtil::makeClickable ($this->container->getSyllabus(), true));
119  $syl->setValue($value);
120  $this->form->addItem($syl);
121  }
122  }
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
This class represents a non editable value in a property form.
+ Here is the call graph for this function:

◆ fillMaxMembers()

ilCourseRegistrationGUI::fillMaxMembers ( )
protected

fill max members

protected

Parameters

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

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

201  {
202  global $ilUser;
203 
204  if(!$this->container->isSubscriptionMembershipLimited())
205  {
206  return true;
207  }
208  $tpl = new ilTemplate('tpl.max_members_form.html',true,true,'Services/Membership');
209  $tpl->setVariable('TXT_MAX',$this->lng->txt('mem_max_users'));
210  $tpl->setVariable('NUM_MAX',$this->container->getSubscriptionMaxMembers());
211 
212  $tpl->setVariable('TXT_FREE',$this->lng->txt('mem_free_places').":");
213  $free = max(0,$this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
214 
215  if($free)
216  $tpl->setVariable('NUM_FREE',$free);
217  else
218  $tpl->setVariable('WARN_FREE',$free);
219 
220 
221  include_once('./Modules/Course/classes/class.ilCourseWaitingList.php');
222  $waiting_list = new ilCourseWaitingList($this->container->getId());
223  if(
224  $this->container->isSubscriptionMembershipLimited() and
225  $this->container->enabledWaitingList() and
226  (!$free or $waiting_list->getCountUsers()))
227  {
228  if($waiting_list->isOnList($ilUser->getId()))
229  {
230  $tpl->setVariable('TXT_WAIT',$this->lng->txt('mem_waiting_list_position'));
231  $tpl->setVariable('NUM_WAIT',$waiting_list->getPosition($ilUser->getId()));
232 
233  }
234  else
235  {
236  $tpl->setVariable('TXT_WAIT',$this->lng->txt('mem_waiting_list'));
237  if($free and $waiting_list->getCountUsers())
238  $tpl->setVariable('WARN_WAIT',$waiting_list->getCountUsers());
239  else
240  $tpl->setVariable('NUM_WAIT',$waiting_list->getCountUsers());
241  }
242  }
243 
244  $alert = '';
245  if(
246  !$free and
247  !$this->container->enabledWaitingList())
248  {
249  // Disable registration
250  $this->enableRegistration(false);
251  ilUtil::sendFailure($this->lng->txt('mem_alert_no_places'));
252  #$alert = $this->lng->txt('mem_alert_no_places');
253  }
254  elseif(
255  $this->container->enabledWaitingList() and
256  $this->container->isSubscriptionMembershipLimited() and
257  $waiting_list->isOnList($ilUser->getId())
258  )
259  {
260  // Disable registration
261  $this->enableRegistration(false);
262  }
263  elseif(
264  !$free and
265  $this->container->enabledWaitingList() and
266  $this->container->isSubscriptionMembershipLimited())
267 
268  {
269  ilUtil::sendFailure($this->lng->txt('crs_warn_no_max_set_on_waiting_list'));
270  #$alert = $this->lng->txt('crs_warn_no_max_set_on_waiting_list');
271  }
272  elseif(
273  $free and
274  $this->container->enabledWaitingList() and
275  $this->container->isSubscriptionMembershipLimited() and
276  $this->getWaitingList()->getCountUsers())
277  {
278  ilUtil::sendFailure($this->lng->txt('crs_warn_wl_set_on_waiting_list'));
279  #$alert = $this->lng->txt('crs_warn_wl_set_on_waiting_list');
280  }
281 
282  $max = new ilCustomInputGUI($this->lng->txt('mem_participants'));
283  $max->setHtml($tpl->get());
284  if(strlen($alert))
285  {
286  $max->setAlert($alert);
287  }
288  $this->form->addItem($max);
289  return true;
290  }
setHtml($a_html)
Set Html.
getWaitingList()
Get waiting list object.
enableRegistration($a_status)
set registration disabled
special template class to simplify handling of ITX/PEAR
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a custom property in a property form.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ fillRegistrationPeriod()

ilCourseRegistrationGUI::fillRegistrationPeriod ( )
protected

show informations about the registration period

protected

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

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

130  {
131  include_once('./Services/Calendar/classes/class.ilDateTime.php');
132  $now = new ilDateTime(time(),IL_CAL_UNIX,'UTC');
133 
134  if($this->container->getSubscriptionUnlimitedStatus())
135  {
136  $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_period'));
137  $reg->setValue($this->lng->txt('mem_unlimited'));
138  $this->form->addItem($reg);
139  return true;
140  }
141  elseif($this->container->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_DEACTIVATED)
142  {
143  return true;
144  }
145 
146  $start = new ilDateTime($this->container->getSubscriptionStart(),IL_CAL_UNIX,'UTC');
147  $end = new ilDateTime($this->container->getSubscriptionEnd(),IL_CAL_UNIX,'UTC');
148 
149  if(ilDateTime::_before($now,$start))
150  {
151  $tpl = new ilTemplate('tpl.registration_period_form.html',true,true,'Services/Membership');
152  $tpl->setVariable('TXT_FIRST',$this->lng->txt('mem_start'));
153  $tpl->setVariable('FIRST',ilDatePresentation::formatDate($start));
154 
155  $tpl->setVariable('TXT_END',$this->lng->txt('mem_end'));
156  $tpl->setVariable('END',ilDatePresentation::formatDate($end));
157 
158  $warning = $this->lng->txt('mem_reg_not_started');
159  }
160  elseif(ilDateTime::_after($now,$end))
161  {
162  $tpl = new ilTemplate('tpl.registration_period_form.html',true,true,'Services/Membership');
163  $tpl->setVariable('TXT_FIRST',$this->lng->txt('mem_start'));
164  $tpl->setVariable('FIRST',ilDatePresentation::formatDate($start));
165 
166  $tpl->setVariable('TXT_END',$this->lng->txt('mem_end'));
167  $tpl->setVariable('END',ilDatePresentation::formatDate($end));
168 
169 
170  $warning = $this->lng->txt('mem_reg_expired');
171  }
172  else
173  {
174  $tpl = new ilTemplate('tpl.registration_period_form.html',true,true,'Services/Membership');
175  $tpl->setVariable('TXT_FIRST',$this->lng->txt('mem_end'));
176  $tpl->setVariable('FIRST',ilDatePresentation::formatDate($end));
177  }
178 
179  $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_period'));
180  $reg->setHtml($tpl->get());
181  if(strlen($warning))
182  {
183  // Disable registration
184  $this->enableRegistration(false);
185  ilUtil::sendFailure($warning);
186  #$reg->setAlert($warning);
187  }
188  $this->form->addItem($reg);
189  return true;
190  }
setHtml($a_html)
Set Html.
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
const IL_CAL_UNIX
enableRegistration($a_status)
set registration disabled
special template class to simplify handling of ITX/PEAR
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a custom property in a property form.
This class represents a non editable value in a property form.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:

◆ fillRegistrationType()

ilCourseRegistrationGUI::fillRegistrationType ( )
protected

fill registration type

protected

Returns

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

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

299  {
300  global $ilUser;
301 
302  if($this->container->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_DEACTIVATED)
303  {
304  $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_type'));
305  #$reg->setHtml($this->lng->txt('crs_info_reg_deactivated'));
306  $reg->setAlert($this->lng->txt('crs_info_reg_deactivated'));
307  #ilUtil::sendFailure($this->lng->txt('crs_info_reg_deactivated'));
308  #$reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
309  #$reg->setValue($this->lng->txt('crs_info_reg_deactivated'));
310  #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
311  $this->form->addItem($reg);
312 
313  // Disable registration
314  $this->enableRegistration(false);
315  return true;
316  }
317 
318  switch($this->container->getSubscriptionType())
319  {
321 
322  // no "request" info if waiting list is active
323  if($this->isWaitingListActive())
324  return true;
325 
326  $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
327  $txt->setValue($this->lng->txt('crs_info_reg_direct'));
328 
329  $this->form->addItem($txt);
330  break;
331 
333  $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
334  $txt->setValue($this->lng->txt('crs_subscription_options_password'));
335 
336 
337  $pass = new ilTextInputGUI($this->lng->txt('passwd'),'grp_passw');
338  $pass->setInputType('password');
339  $pass->setSize(12);
340  $pass->setMaxLength(32);
341  #$pass->setRequired(true);
342  $pass->setInfo($this->lng->txt('crs_info_reg_password'));
343 
344  $txt->addSubItem($pass);
345  $this->form->addItem($txt);
346  break;
347 
349 
350  // no "request" info if waiting list is active
351  if($this->isWaitingListActive())
352  return true;
353 
354  $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
355  $txt->setValue($this->lng->txt('crs_subscription_options_confirmation'));
356 
357  $sub = new ilTextAreaInputGUI($this->lng->txt('crs_reg_subject'),'subject');
358  $sub->setValue($_POST['subject']);
359  $sub->setInfo($this->lng->txt('crs_info_reg_confirmation'));
360  $sub->setCols(40);
361  $sub->setRows(5);
362  if($this->participants->isSubscriber($ilUser->getId()))
363  {
364  $sub_data = $this->participants->getSubscriberData($ilUser->getId());
365  $sub->setValue($sub_data['subject']);
366  $sub->setInfo('');
367  ilUtil::sendFailure($this->lng->txt('crs_reg_user_already_subscribed'));
368  $this->enableRegistration(false);
369  }
370  $txt->addSubItem($sub);
371  $this->form->addItem($txt);
372  break;
373 
374 
375  default:
376  return true;
377  }
378 
379  return true;
380  }
$_POST['username']
Definition: cron.php:12
setValue($a_value)
Set Value.
const IL_CRS_SUBSCRIPTION_CONFIRMATION
setAlert($a_alert)
Set Alert Text.
const IL_CRS_SUBSCRIPTION_PASSWORD
enableRegistration($a_status)
set registration disabled
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a custom property in a property form.
global $ilUser
Definition: imgupload.php:15
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
const IL_CRS_SUBSCRIPTION_DIRECT
const IL_CRS_SUBSCRIPTION_DEACTIVATED
+ Here is the call graph for this function:

◆ getFormTitle()

ilCourseRegistrationGUI::getFormTitle ( )
protected

get form title

protected

Returns
string title

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

References $ilUser, and ilRegistrationGUI\getWaitingList().

88  {
89  global $ilUser;
90 
91  if($this->getWaitingList()->isOnList($ilUser->getId()))
92  {
93  return $this->lng->txt('member_status');
94  }
95  return $this->lng->txt('crs_registration');
96  }
getWaitingList()
Get waiting list object.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ initParticipants()

ilCourseRegistrationGUI::initParticipants ( )
protected

Init course participants.

protected

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

References ilCourseParticipants\_getInstanceByObjId().

554  {
555  include_once('./Modules/Course/classes/class.ilCourseParticipants.php');
556  $this->participants = ilCourseParticipants::_getInstanceByObjId($this->obj_id);
557  }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
+ Here is the call graph for this function:

◆ initWaitingList()

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

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

565  {
566  include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
567  $this->waiting_list = new ilCourseWaitingList($this->container->getId());
568  }

◆ isWaitingListActive()

ilCourseRegistrationGUI::isWaitingListActive ( )
protected
See also
ilRegistrationGUI::isWaitingListActive()

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

References $ilUser, and ilRegistrationGUI\getWaitingList().

Referenced by fillRegistrationType().

574  {
575  global $ilUser;
576  static $active = null;
577 
578  if($active !== null)
579  {
580  return $active;
581  }
582  if(!$this->container->enabledWaitingList() or !$this->container->isSubscriptionMembershipLimited())
583  {
584  return $active = false;
585  }
586  if(!$this->container->getSubscriptionMaxMembers())
587  {
588  return $active = false;
589  }
590 
591  $free = max(0,$this->container->getSubscriptionMaxMembers() - $this->participants->getCountMembers());
592  return $active = (!$free or $this->getWaitingList()->getCountUsers());
593  }
getWaitingList()
Get waiting list object.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilCourseRegistrationGUI::validate ( )
protected

Validate subscription request.

protected

Parameters

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

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

426  {
427  global $ilUser;
428 
429  if($ilUser->getId() == ANONYMOUS_USER_ID)
430  {
431  $this->join_error = $this->lng->txt('permission_denied');
432  return false;
433  }
434 
435  // Set aggrement to not accepted
436  $this->setAccepted(false);
437 
438  if(!$this->isRegistrationPossible())
439  {
440  $this->join_error = $this->lng->txt('mem_error_preconditions');
441  return false;
442  }
443  if($this->container->getSubscriptionType() == IL_CRS_SUBSCRIPTION_PASSWORD)
444  {
445  if(!strlen($pass = ilUtil::stripSlashes($_POST['grp_passw'])))
446  {
447  $this->join_error = $this->lng->txt('crs_password_required');
448  return false;
449  }
450  if(strcmp($pass,$this->container->getSubscriptionPassword()) !== 0)
451  {
452  $this->join_error = $this->lng->txt('crs_password_not_valid');
453  return false;
454  }
455  }
456  if(!$this->validateCustomFields())
457  {
458  $this->join_error = $this->lng->txt('fill_out_all_required_fields');
459  return false;
460  }
461  if(!$this->validateAgreement())
462  {
463  $this->join_error = $this->lng->txt('crs_agreement_required');
464  return false;
465  }
466 
467  return true;
468  }
$_POST['username']
Definition: cron.php:12
validateAgreement()
Check Agreement.
setAccepted($a_status)
Set Agreement accepted.
const IL_CRS_SUBSCRIPTION_PASSWORD
isRegistrationPossible()
check if registration is possible
validateCustomFields()
Check required course fields.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

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