ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 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 62 of file class.ilRegistrationGUI.php.

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

63  {
64  global $lng,$ilCtrl,$tpl;
65 
66  $this->lng = $lng;
67  $this->lng->loadLanguageModule('crs');
68  $this->lng->loadLanguageModule('grp');
69  $this->lng->loadLanguageModule('ps');
70 
71  $this->ctrl = $ilCtrl;
72  $this->tpl = $tpl;
73 
74  $this->container = $a_container;
75  $this->ref_id = $this->container->getRefId();
76  $this->obj_id = ilObject::_lookupObjId($this->ref_id);
77  $this->type = ilObject::_lookupType($this->obj_id);
78 
79  // Init participants
80  $this->initParticipants();
81 
82  // Init waiting list
83  $this->initWaitingList();
84 
85  $this->privacy = ilPrivacySettings::_getInstance();
86  }
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 597 of file class.ilRegistrationGUI.php.

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

Referenced by initForm().

598  {
599  global $ilUser;
600 
601  if($this->isRegistrationPossible() and $this->isWaitingListActive() and !$this->getWaitingList()->isOnList($ilUser->getId()))
602  {
603  $this->form->addCommandButton('join',$this->lng->txt('mem_add_to_wl'));
604  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
605  }
606  elseif($this->isRegistrationPossible() and !$this->getWaitingList()->isOnList($ilUser->getId()))
607  {
608  $this->form->addCommandButton('join',$this->lng->txt('join'));
609  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
610  }
611  if($this->getWaitingList()->isOnList($ilUser->getId()))
612  {
614  sprintf($this->lng->txt($this->container->getType().'_cancel_waiting_list'),
615  $this->container->getTitle())
616  );
617  $this->form->addCommandButton('leaveWaitingList', $this->lng->txt('leave_waiting_list'));
618  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
619  }
620  }
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
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
global $ilUser
Definition: imgupload.php:15
+ 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 491 of file class.ilRegistrationGUI.php.

References $ilCtrl.

492  {
493  global $tree, $ilCtrl;
494 
495  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
496  $tree->getParentId($this->container->getRefId()));
497  $ilCtrl->redirectByClass("ilrepositorygui", "");
498  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelSubscriptionRequest()

ilRegistrationGUI::cancelSubscriptionRequest ( )
protected

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

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

639  {
640  global $ilUser, $tree, $ilCtrl;
641 
642  $this->participants->deleteSubscriber($ilUser->getId());
643  ilUtil::sendSuccess($this->lng->txt('sub_request_deleted'),true);
644 
645  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
646  $tree->getParentId($this->container->getRefId()));
647  $ilCtrl->redirectByClass("ilrepositorygui", "");
648  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ enableRegistration()

ilRegistrationGUI::enableRegistration (   $a_status)
protected

set registration disabled

protected

Parameters
bool
Returns

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

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

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

125  {
126  $this->registration_possible = $a_status;
127  }
+ 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 284 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().

285  {
286  global $ilUser;
287 
288  if(!$this->isRegistrationPossible())
289  {
290  return true;
291  }
292 
293  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
294  if(!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId()))
295  {
296  return true;
297  }
298 
299  $this->lng->loadLanguageModule('ps');
300 
301  include_once('Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
302  $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->container->getId()));
303 
304  if(!count($fields_info->getExportableFields()))
305  {
306  return true;
307  }
308 
310  $section->setTitle($this->lng->txt($this->type.'_usr_agreement'));
311  $this->form->addItem($section);
312 
313  include_once './Services/Membership/classes/class.ilMemberAgreementGUI.php';
314  ilMemberAgreementGUI::addExportFieldInfo($this->form, $this->obj_id, $this->type);
315 
316 
317  ilMemberAgreementGUI::addCustomFields($this->form, $this->obj_id, $this->type);
318 
319  // Checkbox agreement
320  if($this->privacy->confirmationRequired($this->type))
321  {
322  ilMemberAgreementGUI::addAgreement($this->form, $this->obj_id, $this->type);
323  }
324  return true;
325  }
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:84
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.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _hasFields($a_container_id)
Check if there are any define fields.
global $ilUser
Definition: imgupload.php:15
+ 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 227 of file class.ilRegistrationGUI.php.

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

Referenced by initForm().

228  {
229  global $ilAccess, $ilCtrl;
230 
231  include_once('Modules/Course/classes/class.ilObjCourseGrouping.php');
232  if(!$items = ilObjCourseGrouping::_getGroupingItems($this->container))
233  {
234  return true;
235  }
236 
237  $mem = new ilCustomInputGUI($this->lng->txt('groupings'));
238 
239  $tpl = new ilTemplate('tpl.membership_limitation_form.html',true,true,'Services/Membership');
240  $tpl->setVariable('LIMIT_INTRO',$this->lng->txt($this->type.'_grp_info_reg'));
241 
242  foreach($items as $ref_id)
243  {
244  $obj_id = ilObject::_lookupObjId($ref_id);
247 
248  if($ilAccess->checkAccess('visible','',$ref_id,$type))
249  {
250  include_once('./Services/Link/classes/class.ilLink.php');
251  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
252  $tpl->setVariable('LINK_ITEM',
253  $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
254  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
255  $tpl->setVariable('ITEM_LINKED_TITLE',$title);
256  }
257  else
258  {
259  $tpl->setVariable('ITEM_TITLE');
260  }
261  $tpl->setCurrentBlock('items');
262  $tpl->setVariable('TYPE_ICON',ilObject::_getIcon($obj_id,tiny,$type));
263  $tpl->setVariable('ALT_ICON',$this->lng->txt('obj_'.$type));
264  $tpl->parseCurrentBlock();
265  }
266 
267  $mem->setHtml($tpl->get());
268 
269 
271  {
272  $mem->setAlert($this->container->getMessage());
273  $this->enableRegistration(false);
274  }
275  $this->form->addItem($mem);
276  }
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
_checkGroupingDependencies(&$container_obj, $a_user_id=null)
This class represents a custom property in a property form.
_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 92 of file class.ilRegistrationGUI.php.

References $container.

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

93  {
94  return $this->container;
95  }
+ 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 101 of file class.ilRegistrationGUI.php.

References $ref_id.

Referenced by ilCourseRegistrationGUI\executeCommand().

102  {
103  return $this->ref_id;
104  }
+ Here is the caller graph for this function:

◆ getWaitingList()

◆ initForm()

ilRegistrationGUI::initForm ( )
protected

init registration form

protected

Returns

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

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

Referenced by join(), and show().

559  {
560  global $ilUser;
561 
562  if(is_object($this->form))
563  {
564  return true;
565  }
566 
567  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
568  $this->form = new ilPropertyFormGUI();
569  $this->form->setFormAction($this->ctrl->getFormAction($this,'join'));
570  $this->form->setTitle($this->getFormTitle());
571 
572  $this->fillInformations();
573  $this->fillMembershipLimitation();
574  if($this->isRegistrationPossible())
575  {
576  $this->fillRegistrationPeriod();
577  }
578  if($this->isRegistrationPossible())
579  {
580  $this->fillRegistrationType();
581  }
582  if($this->isRegistrationPossible())
583  {
584  $this->fillMaxMembers();
585  }
586  if($this->isRegistrationPossible())
587  {
588  $this->fillAgreement();
589  }
590  $this->addCommandButtons();
591  }
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
global $ilUser
Definition: imgupload.php:15
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 112 of file class.ilRegistrationGUI.php.

References $registration_possible.

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

113  {
114  return (bool) $this->registration_possible;
115  }
+ 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 526 of file class.ilRegistrationGUI.php.

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

527  {
528  $this->initForm();
529 
530  if(!$this->validate())
531  {
532  ilUtil::sendFailure($this->join_error);
533  $this->show();
534  return false;
535  }
536 
537  $this->add();
538  }
initForm()
init registration form
validate()
validate join request
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
show()
show registration form
+ Here is the call graph for this function:

◆ leaveWaitingList()

ilRegistrationGUI::leaveWaitingList ( )
protected

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

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

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

◆ setAccepted()

ilRegistrationGUI::setAccepted (   $a_status)
protected

Set Agreement accepted.

private

Parameters
bool

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

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

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

470  {
471  global $ilUser;
472 
473  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
474  if(!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId()))
475  {
476  return true;
477  }
478 
479  include_once('Services/Membership/classes/class.ilMemberAgreement.php');
480  $this->agreement = new ilMemberAgreement($ilUser->getId(),$this->container->getId());
481  $this->agreement->setAccepted($a_status);
482  $this->agreement->setAcceptanceTime(time());
483  $this->agreement->save();
484  }
setAccepted($a_status)
set accepted
static _hasFields($a_container_id)
Check if there are any define fields.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show()

ilRegistrationGUI::show ( )

show registration form

public

Parameters

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

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

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

508  {
509  $this->initForm();
510 
511  if($_SESSION["pending_goto"])
512  {
513  ilUtil::sendInfo($this->lng->txt("reg_goto_parent_membership_info"));
514  }
515 
516  $this->tpl->setContent($this->form->getHTML());
517  }
< 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']
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 332 of file class.ilRegistrationGUI.php.

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

333  {
334  global $ilUser;
335 
336  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
337  include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
338 
339  if(!count($cdf_fields = ilCourseDefinedFieldDefinition::_getFields($this->container->getId())))
340  {
341  return true;
342  }
343 
344  $cdf = new ilNonEditableValueGUI($this->lng->txt('ps_crs_user_fields'));
345  $cdf->setValue($this->lng->txt($this->type.'_ps_cdf_info'));
346  $cdf->setRequired(true);
347 
348  foreach($cdf_fields as $field_obj)
349  {
350  $course_user_data = new ilCourseUserData($ilUser->getId(),$field_obj->getId());
351 
352  switch($field_obj->getType())
353  {
354  case IL_CDF_TYPE_SELECT:
355  $select = new ilSelectInputGUI($field_obj->getName(),'cdf['.$field_obj->getId().']');
356  $select->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
357  $select->setOptions($field_obj->prepareSelectBox());
358  if($field_obj->isRequired())
359  {
360  $select->setRequired(true);
361  }
362 
363  $cdf->addSubItem($select);
364 
365 
366  break;
367 
368  case IL_CDF_TYPE_TEXT:
369  $text = new ilTextInputGUI($field_obj->getName(),'cdf['.$field_obj->getId().']');
370  $text->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
371  $text->setSize(32);
372  $text->setMaxLength(255);
373  if($field_obj->isRequired())
374  {
375  $text->setRequired(true);
376  }
377  $cdf->addSubItem($text);
378  break;
379  }
380  }
381  $this->form->addItem($cdf);
382  return true;
383  }
$_POST['username']
Definition: cron.php:12
This class represents a selection list property in a property form.
This class represents a text property in a property form.
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.
global $ilUser
Definition: imgupload.php:15
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 626 of file class.ilRegistrationGUI.php.

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

627  {
628  global $ilUser, $tree, $ilCtrl;
629 
630  $this->participants->updateSubject($ilUser->getId(),ilUtil::stripSlashes($_POST['subject']));
631  ilUtil::sendSuccess($this->lng->txt('sub_request_saved'),true);
632  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
633  $tree->getParentId($this->container->getRefId()));
634  $ilCtrl->redirectByClass("ilrepositorygui", "");
635 
636  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
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:

◆ validate()

ilRegistrationGUI::validate ( )
protected

validate join request

protected

Returns
bool

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

Referenced by join().

548  {
549  return true;
550  }
+ Here is the caller graph for this function:

◆ validateAgreement()

ilRegistrationGUI::validateAgreement ( )
protected

Check Agreement.

protected

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

References $_POST, and $ilUser.

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

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

◆ validateCustomFields()

ilRegistrationGUI::validateCustomFields ( )
protected

Check required course fields.

protected

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

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

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

414  {
415  global $ilUser;
416 
417 
418  $required_fullfilled = true;
419  foreach(ilCourseDefinedFieldDefinition::_getFields($this->container->getId()) as $field_obj)
420  {
421  switch($field_obj->getType())
422  {
423  case IL_CDF_TYPE_SELECT:
424 
425  // Split value id from post
426  list($field_id,$option_id) = explode('_', $_POST['cdf_'.$field_obj->getId()]);
427 
428  #$GLOBALS['ilLog']->write(__METHOD__.': '.print_r($field_id,TRUE).' '.print_r($option_id,TRUE).' '.print_r($_POST,TRUE));
429 
430  $open_answer_indexes = (array) $field_obj->getValueOptions();
431  if(in_array($option_id, $open_answer_indexes))
432  {
433  $value = $_POST['cdf_oa_'.$field_obj->getId().'_'.$option_id];
434  }
435  else
436  {
437  $value = $field_obj->getValueById($option_id);
438  }
439  break;
440 
441  case IL_CDF_TYPE_TEXT:
442  $value = $_POST['cdf_'.$field_obj->getId()];
443  break;
444  }
445 
446  $GLOBALS['ilLog']->write(__METHOD__.': new value '. $value);
447 
448 
449  $course_user_data = new ilCourseUserData($ilUser->getId(),$field_obj->getId());
450  $course_user_data->setValue($value);
451  $course_user_data->update();
452 
453  // #14220
454  if($field_obj->isRequired() and $value == "")
455  {
456  $required_fullfilled = false;
457  }
458  }
459 
460  return $required_fullfilled;
461  }
$_POST['username']
Definition: cron.php:12
$GLOBALS['ct_recipient']
global $ilUser
Definition: imgupload.php:15
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 53 of file class.ilRegistrationGUI.php.

◆ $form

ilRegistrationGUI::$form
protected

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

◆ $join_error

ilRegistrationGUI::$join_error = ''
protected

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

◆ $lng

ilRegistrationGUI::$lng
protected

Definition at line 52 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 43 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 47 of file class.ilRegistrationGUI.php.

Referenced by isRegistrationPossible().

◆ $tpl

◆ $waiting_list


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