ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilRegistrationGUI Class Reference

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

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

Public Member Functions

 __construct ($a_container)
 Constructor. More...
 
 getContainer ()
 Parent object. More...
 
 getRefId ()
 Get ref. More...
 
 cancel ()
 cancel subscription More...
 
 show (ilPropertyFormGUI $form=null)
 show registration form More...
 
 join ()
 join More...
 

Protected Member Functions

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

Protected Attributes

 $privacy = null
 
 $container = null
 
 $ref_id
 
 $obj_id
 
 $participants
 
 $waiting_list = null
 
 $form
 
 $registration_possible = true
 
 $join_error = ''
 
 $tpl
 
 $lng
 
 $ctrl
 

Detailed Description

Base class for Course and Group registration.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilRegistrationGUI::__construct (   $a_container)

Constructor.

public

Parameters
objectCourse or Group object
Returns

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

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

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

Member Function Documentation

◆ addCommandButtons()

ilRegistrationGUI::addCommandButtons ( )
protected

Add command buttons.

Returns

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

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

Referenced by initForm().

614  {
615  global $ilUser;
616 
617  if($this->isRegistrationPossible() and $this->isWaitingListActive() and !$this->getWaitingList()->isOnList($ilUser->getId()))
618  {
619  $this->form->addCommandButton('join',$this->lng->txt('mem_add_to_wl'));
620  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
621  }
622  elseif($this->isRegistrationPossible() and !$this->getWaitingList()->isOnList($ilUser->getId()))
623  {
624  $this->form->addCommandButton('join',$this->lng->txt('join'));
625  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
626  }
627  if($this->getWaitingList()->isOnList($ilUser->getId()))
628  {
630  sprintf($this->lng->txt($this->container->getType().'_cancel_waiting_list'),
631  $this->container->getTitle())
632  );
633  $this->form->addCommandButton('leaveWaitingList', $this->lng->txt('leave_waiting_list'));
634  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
635  }
636  }
getWaitingList()
Get waiting list object.
isWaitingListActive()
Check if the waiting list is active Maximum of members exceeded or any user on the waiting list...
isRegistrationPossible()
check if registration is possible
$ilUser
Definition: imgupload.php:18
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilRegistrationGUI::cancel ( )

cancel subscription

public

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

References $ilCtrl.

496  {
497  global $tree, $ilCtrl;
498 
499  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
500  $tree->getParentId($this->container->getRefId()));
501  $ilCtrl->redirectByClass("ilrepositorygui", "");
502  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelSubscriptionRequest()

ilRegistrationGUI::cancelSubscriptionRequest ( )
protected

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

References $ilCtrl, $ilUser, and ilUtil\sendSuccess().

655  {
656  global $ilUser, $tree, $ilCtrl;
657 
658  $this->participants->deleteSubscriber($ilUser->getId());
659  ilUtil::sendSuccess($this->lng->txt('sub_request_deleted'),true);
660 
661  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
662  $tree->getParentId($this->container->getRefId()));
663  $ilCtrl->redirectByClass("ilrepositorygui", "");
664  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ enableRegistration()

ilRegistrationGUI::enableRegistration (   $a_status)
protected

set registration disabled

protected

Parameters
bool
Returns

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

References initParticipants(), initWaitingList(), and isWaitingListActive().

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

129  {
130  $this->registration_possible = $a_status;
131  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillAgreement()

ilRegistrationGUI::fillAgreement ( )
protected

Show user agreement.

protected

Returns

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

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

Referenced by initForm().

289  {
290  global $ilUser;
291 
292  if(!$this->isRegistrationPossible())
293  {
294  return true;
295  }
296 
297  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
298  if(!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId()))
299  {
300  return true;
301  }
302 
303  $this->lng->loadLanguageModule('ps');
304 
305  include_once('Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
306  $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->container->getId()));
307 
308  if(!count($fields_info->getExportableFields()))
309  {
310  return true;
311  }
312 
314  $section->setTitle($this->lng->txt($this->type.'_usr_agreement'));
315  $this->form->addItem($section);
316 
317  include_once './Services/Membership/classes/class.ilMemberAgreementGUI.php';
318  ilMemberAgreementGUI::addExportFieldInfo($this->form, $this->obj_id, $this->type);
319 
320 
321  ilMemberAgreementGUI::addCustomFields($this->form, $this->obj_id, $this->type);
322 
323  // Checkbox agreement
324  if($this->privacy->confirmationRequired($this->type))
325  {
326  ilMemberAgreementGUI::addAgreement($this->form, $this->obj_id, $this->type);
327  }
328  return true;
329  }
static addExportFieldInfo($form, $a_obj_id, $a_type)
Add export field info to form type $lng.
This class represents a section header in a property form.
static addCustomFields($form, $a_obj_id, $a_type, $a_mode='user')
Add custom course fields.
$section
Definition: Utf8Test.php:83
static _getInstanceByType($a_type)
Get Singleton Instance.
isRegistrationPossible()
check if registration is possible
static addAgreement($form, $a_obj_id, $a_type)
Add agreement to form.
$ilUser
Definition: imgupload.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
static _hasFields($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

protected

Returns

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.

protected

Parameters

Referenced by initForm(), and leaveWaitingList().

+ Here is the caller graph for this function:

◆ fillMembershipLimitation()

ilRegistrationGUI::fillMembershipLimitation ( )
protected

Show membership limitations.

protected

Returns

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

References $_GET, $ilCtrl, $obj_id, $ref_id, $title, $tpl, ilObjCourseGrouping\_checkGroupingDependencies(), ilObjCourseGrouping\_getGroupingItems(), ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), enableRegistration(), and ilCustomInputGUI\setHtml().

Referenced by initForm().

232  {
233  global $ilAccess, $ilCtrl;
234 
235  include_once('Modules/Course/classes/class.ilObjCourseGrouping.php');
236  if(!$items = ilObjCourseGrouping::_getGroupingItems($this->container))
237  {
238  return true;
239  }
240 
241  $mem = new ilCustomInputGUI($this->lng->txt('groupings'));
242 
243  $tpl = new ilTemplate('tpl.membership_limitation_form.html',true,true,'Services/Membership');
244  $tpl->setVariable('LIMIT_INTRO',$this->lng->txt($this->type.'_grp_info_reg'));
245 
246  foreach($items as $ref_id)
247  {
248  $obj_id = ilObject::_lookupObjId($ref_id);
251 
252  if($ilAccess->checkAccess('visible','',$ref_id,$type))
253  {
254  include_once('./Services/Link/classes/class.ilLink.php');
255  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
256  $tpl->setVariable('LINK_ITEM',
257  $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
258  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
259  $tpl->setVariable('ITEM_LINKED_TITLE',$title);
260  }
261  else
262  {
263  $tpl->setVariable('ITEM_TITLE');
264  }
265  $tpl->setCurrentBlock('items');
266  $tpl->setVariable('TYPE_ICON',ilObject::_getIcon($obj_id,tiny,$type));
267  $tpl->setVariable('ALT_ICON',$this->lng->txt('obj_'.$type));
268  $tpl->parseCurrentBlock();
269  }
270 
271  $mem->setHtml($tpl->get());
272 
273 
275  {
276  $mem->setAlert($this->container->getMessage());
277  $this->enableRegistration(false);
278  }
279  $this->form->addItem($mem);
280  }
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setHtml($a_html)
Set Html.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
enableRegistration($a_status)
set registration disabled
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static _lookupType($a_id, $a_reference=false)
lookup object type
static _checkGroupingDependencies(&$container_obj, $a_user_id=null)
This class represents a custom property in a property form.
static _getGroupingItems($container_obj)
Get courses/groups that are assigned to the same membership limitation.
+ 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

protected

Referenced by initForm(), and leaveWaitingList().

+ Here is the caller graph for this function:

◆ fillRegistrationType()

ilRegistrationGUI::fillRegistrationType ( )
abstractprotected

show informations about registration procedure

protected

Returns

Referenced by initForm(), and leaveWaitingList().

+ Here is the caller graph for this function:

◆ getContainer()

ilRegistrationGUI::getContainer ( )

Parent object.

Returns
ilObject

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

References $container.

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

97  {
98  return $this->container;
99  }
+ Here is the caller graph for this function:

◆ getFormTitle()

ilRegistrationGUI::getFormTitle ( )
abstractprotected

Get title for property form.

protected

Returns
string title

Referenced by initForm(), and leaveWaitingList().

+ Here is the caller graph for this function:

◆ getRefId()

ilRegistrationGUI::getRefId ( )

Get ref.

Returns
type

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

References $ref_id.

Referenced by ilCourseRegistrationGUI\executeCommand().

106  {
107  return $this->ref_id;
108  }
+ Here is the caller graph for this function:

◆ getWaitingList()

◆ initForm()

ilRegistrationGUI::initForm ( )
protected

init registration form

protected

Returns

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

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

Referenced by join(), and show().

574  {
575  global $ilUser;
576 
577  if(is_object($this->form))
578  {
579  return true;
580  }
581 
582  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
583  $this->form = new ilPropertyFormGUI();
584  $this->form->setFormAction($this->ctrl->getFormAction($this,'join'));
585  $this->form->setTitle($this->getFormTitle());
586 
587  $this->fillInformations();
588  $this->fillMembershipLimitation();
589  if($this->isRegistrationPossible())
590  {
591  $this->fillRegistrationPeriod();
592  }
593  if($this->isRegistrationPossible() || $this->participants->isSubscriber($ilUser->getId()))
594  {
595  $this->fillRegistrationType();
596  }
597  if($this->isRegistrationPossible())
598  {
599  $this->fillMaxMembers();
600  }
601  if($this->isRegistrationPossible())
602  {
603  $this->fillAgreement();
604  }
605  $this->addCommandButtons();
606  return $this->form;
607  }
fillAgreement()
Show user agreement.
This class represents a property form user interface.
fillRegistrationPeriod()
show informations about the registration period
fillRegistrationType()
show informations about registration procedure
getFormTitle()
Get title for property form.
isRegistrationPossible()
check if registration is possible
$ilUser
Definition: imgupload.php:18
fillMembershipLimitation()
Show membership limitations.
fillInformations()
fill informations
addCommandButtons()
Add command buttons.
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)

protected

Returns

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)

protected

Returns

Referenced by __construct(), and enableRegistration().

+ Here is the caller graph for this function:

◆ isRegistrationPossible()

ilRegistrationGUI::isRegistrationPossible ( )
protected

check if registration is possible

protected

Returns
bool

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

References $registration_possible.

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

117  {
118  return (bool) $this->registration_possible;
119  }
+ Here is the caller graph for this function:

◆ isWaitingListActive()

ilRegistrationGUI::isWaitingListActive ( )
abstractprotected

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

Returns

Referenced by addCommandButtons(), and enableRegistration().

+ Here is the caller graph for this function:

◆ join()

ilRegistrationGUI::join ( )

join

public

Parameters

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

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

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

◆ leaveWaitingList()

ilRegistrationGUI::leaveWaitingList ( )
protected

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

References $ilCtrl, $ilUser, fillInformations(), fillMaxMembers(), fillRegistrationPeriod(), fillRegistrationType(), getFormTitle(), getWaitingList(), and ilUtil\sendSuccess().

170  {
171  global $ilUser,$tree,$ilCtrl;
172 
173  $this->getWaitingList()->removeFromList($ilUser->getId());
174  $parent = $tree->getParentId($this->container->getRefId());
175 
176  $message = sprintf($this->lng->txt($this->container->getType().'_removed_from_waiting_list'),
177  $this->container->getTitle());
178  ilUtil::sendSuccess($message,true);
179 
180  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent);
181  $ilCtrl->redirectByClass("ilrepositorygui", "");
182  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getWaitingList()
Get waiting list object.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ setAccepted()

ilRegistrationGUI::setAccepted (   $a_status)
protected

Set Agreement accepted.

private

Parameters
bool

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

References $ilUser, ilCourseDefinedFieldDefinition\_hasFields(), ilMemberAgreement\setAccepted(), and time.

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

474  {
475  global $ilUser;
476 
477  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
478  if(!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId()))
479  {
480  return true;
481  }
482 
483  include_once('Services/Membership/classes/class.ilMemberAgreement.php');
484  $this->agreement = new ilMemberAgreement($ilUser->getId(),$this->container->getId());
485  $this->agreement->setAccepted($a_status);
486  $this->agreement->setAcceptanceTime(time());
487  $this->agreement->save();
488  }
setAccepted($a_status)
set accepted
$ilUser
Definition: imgupload.php:18
static _hasFields($a_container_id)
Check if there are any define fields.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show()

ilRegistrationGUI::show ( ilPropertyFormGUI  $form = null)

show registration form

public

Parameters

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

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

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

512  {
513  if(!$form instanceof ilPropertyFormGUI)
514  {
515  $this->initForm();
516  }
517 
518  if($_SESSION["pending_goto"])
519  {
520  ilUtil::sendInfo($this->lng->txt("reg_goto_parent_membership_info"));
521  }
522 
523  $this->tpl->setContent($this->form->getHTML());
524  }
$_SESSION["AccountId"]
This class represents a property form user interface.
initForm()
init registration form
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCustomFields()

ilRegistrationGUI::showCustomFields ( )
protected

Show course defined fields.

protected

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

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

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

◆ updateSubscriptionRequest()

ilRegistrationGUI::updateSubscriptionRequest ( )
protected

Update subscription message.

Returns
void

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

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

643  {
644  global $ilUser, $tree, $ilCtrl;
645 
646  $this->participants->updateSubject($ilUser->getId(),ilUtil::stripSlashes($_POST['subject']));
647  ilUtil::sendSuccess($this->lng->txt('sub_request_saved'),true);
648  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
649  $tree->getParentId($this->container->getRefId()));
650  $ilCtrl->redirectByClass("ilrepositorygui", "");
651 
652  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ validate()

ilRegistrationGUI::validate ( )
protected

validate join request

protected

Returns
bool

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

Referenced by join().

563  {
564  return true;
565  }
+ Here is the caller graph for this function:

◆ validateAgreement()

ilRegistrationGUI::validateAgreement ( )
protected

Check Agreement.

protected

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

References $_POST, and $ilUser.

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

396  {
397  global $ilUser;
398 
399  if($_POST['agreement'])
400  {
401  return true;
402  }
403  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
404  if(!$this->privacy->confirmationRequired($this->type))
405  {
406  return true;
407  }
408  return false;
409  }
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the caller graph for this function:

◆ validateCustomFields()

ilRegistrationGUI::validateCustomFields ( )
protected

Check required course fields.

protected

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

References $_POST, $GLOBALS, $ilUser, ilCourseDefinedFieldDefinition\_getFields(), array, IL_CDF_TYPE_SELECT, IL_CDF_TYPE_TEXT, and ilCourseUserData\setValue().

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

418  {
419  global $ilUser;
420 
421 
422  $required_fullfilled = true;
423  foreach(ilCourseDefinedFieldDefinition::_getFields($this->container->getId()) as $field_obj)
424  {
425  switch($field_obj->getType())
426  {
427  case IL_CDF_TYPE_SELECT:
428 
429  // Split value id from post
430  list($field_id,$option_id) = explode('_', $_POST['cdf_'.$field_obj->getId()]);
431 
432  #$GLOBALS['ilLog']->write(__METHOD__.': '.print_r($field_id,TRUE).' '.print_r($option_id,TRUE).' '.print_r($_POST,TRUE));
433 
434  $open_answer_indexes = (array) $field_obj->getValueOptions();
435  if(in_array($option_id, $open_answer_indexes))
436  {
437  $value = $_POST['cdf_oa_'.$field_obj->getId().'_'.$option_id];
438  }
439  else
440  {
441  $value = $field_obj->getValueById($option_id);
442  }
443  break;
444 
445  case IL_CDF_TYPE_TEXT:
446  $value = $_POST['cdf_'.$field_obj->getId()];
447  break;
448  }
449 
450  $GLOBALS['ilLog']->write(__METHOD__.': new value '. $value);
451 
452 
453  $course_user_data = new ilCourseUserData($ilUser->getId(),$field_obj->getId());
454  $course_user_data->setValue($value);
455  $course_user_data->update();
456 
457  // #14220
458  if($field_obj->isRequired() and $value == "")
459  {
460  $required_fullfilled = false;
461  }
462  }
463 
464  return $required_fullfilled;
465  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
$_POST["username"]
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $container

ilRegistrationGUI::$container = null
protected

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

Referenced by getContainer().

◆ $ctrl

ilRegistrationGUI::$ctrl
protected

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

◆ $form

ilRegistrationGUI::$form
protected

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

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

◆ $join_error

ilRegistrationGUI::$join_error = ''
protected

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

◆ $lng

ilRegistrationGUI::$lng
protected

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

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

◆ $obj_id

ilRegistrationGUI::$obj_id
protected

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

Referenced by fillMembershipLimitation().

◆ $participants

ilRegistrationGUI::$participants
protected

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

◆ $privacy

ilRegistrationGUI::$privacy = null
protected

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

◆ $ref_id

ilRegistrationGUI::$ref_id
protected

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

Referenced by fillMembershipLimitation(), and getRefId().

◆ $registration_possible

ilRegistrationGUI::$registration_possible = true
protected

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

Referenced by isRegistrationPossible().

◆ $tpl

◆ $waiting_list


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