24 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
70 $this->lng->loadLanguageModule(
'crs');
71 $this->lng->loadLanguageModule(
'grp');
72 $this->lng->loadLanguageModule(
'ps');
73 $this->lng->loadLanguageModule(
'membership');
78 $this->container = $a_container;
79 $this->ref_id = $this->container->getRefId();
130 $this->registration_possible = $a_status;
174 $parent = $tree->getParentId($this->container->getRefId());
176 $message = sprintf($this->lng->txt($this->container->getType().
'_removed_from_waiting_list'),
177 $this->container->getTitle());
180 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $parent);
181 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
235 include_once(
'Modules/Course/classes/class.ilObjCourseGrouping.php');
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'));
252 if($ilAccess->checkAccess(
'visible',
'',$ref_id,$type))
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);
263 $tpl->setVariable(
'ITEM_TITLE');
265 $tpl->setCurrentBlock(
'items');
267 $tpl->setVariable(
'ALT_ICON',$this->lng->txt(
'obj_'.$type));
268 $tpl->parseCurrentBlock();
276 $mem->setAlert($this->container->getMessage());
279 $this->form->addItem($mem);
297 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
303 $this->lng->loadLanguageModule(
'ps');
305 include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
308 if(!count($fields_info->getExportableFields()))
314 $section->setTitle($this->lng->txt($this->type.
'_usr_agreement'));
317 include_once
'./Services/Membership/classes/class.ilMemberAgreementGUI.php';
324 if($this->privacy->confirmationRequired($this->type))
340 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
341 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
349 $cdf->
setValue($this->lng->txt($this->type.
'_ps_cdf_info'));
350 $cdf->setRequired(
true);
352 foreach($cdf_fields as $field_obj)
354 $course_user_data =
new ilCourseUserData($ilUser->getId(),$field_obj->getId());
356 switch($field_obj->getType())
359 $select =
new ilSelectInputGUI($field_obj->getName(),
'cdf['.$field_obj->getId().
']');
361 $select->setOptions($field_obj->prepareSelectBox());
362 if($field_obj->isRequired())
364 $select->setRequired(
true);
367 $cdf->addSubItem($select);
376 $text->setMaxLength(255);
377 if($field_obj->isRequired())
379 $text->setRequired(
true);
381 $cdf->addSubItem(
$text);
385 $this->form->addItem($cdf);
403 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
404 if(!$this->privacy->confirmationRequired($this->type))
422 $required_fullfilled =
true;
425 switch($field_obj->getType())
430 list($field_id,$option_id) = explode(
'_',
$_POST[
'cdf_'.$field_obj->getId()]);
432 #$GLOBALS['ilLog']->write(__METHOD__.': '.print_r($field_id,TRUE).' '.print_r($option_id,TRUE).' '.print_r($_POST,TRUE)); 434 $open_answer_indexes = (
array) $field_obj->getValueOptions();
435 if(in_array($option_id, $open_answer_indexes))
437 $value =
$_POST[
'cdf_oa_'.$field_obj->getId().
'_'.$option_id];
441 $value = $field_obj->getValueById($option_id);
446 $value =
$_POST[
'cdf_'.$field_obj->getId()];
450 $GLOBALS[
'ilLog']->write(__METHOD__.
': new value '. $value);
453 $course_user_data =
new ilCourseUserData($ilUser->getId(),$field_obj->getId());
454 $course_user_data->
setValue($value);
455 $course_user_data->update();
458 if($field_obj->isRequired()
and $value ==
"")
460 $required_fullfilled =
false;
464 return $required_fullfilled;
477 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
483 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
484 $this->agreement =
new ilMemberAgreement($ilUser->getId(),$this->container->getId());
486 $this->agreement->setAcceptanceTime(
time());
487 $this->agreement->save();
499 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
500 $tree->getParentId($this->container->getRefId()));
501 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
523 $this->tpl->setContent($this->form->getHTML());
539 $form->setValuesByPost();
540 if($this->join_error)
577 if(is_object($this->form))
582 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
584 $this->form->setFormAction($this->ctrl->getFormAction($this,
'join'));
619 $this->form->addCommandButton(
'join',$this->lng->txt(
'mem_add_to_wl'));
620 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
624 $this->form->addCommandButton(
'join',$this->lng->txt(
'join'));
625 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
630 sprintf($this->lng->txt($this->container->getType().
'_cancel_waiting_list'),
631 $this->container->getTitle())
633 $this->form->addCommandButton(
'leaveWaitingList', $this->lng->txt(
'leave_waiting_list'));
634 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
648 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
649 $tree->getParentId($this->container->getRefId()));
650 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
658 $this->participants->deleteSubscriber($ilUser->getId());
661 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
662 $tree->getParentId($this->container->getRefId()));
663 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
show(ilPropertyFormGUI $form=null)
show registration form
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
fillAgreement()
Show user agreement.
setValue($a_value)
Set Value.
static addExportFieldInfo($form, $a_obj_id, $a_type)
Add export field info to form type $lng.
cancelSubscriptionRequest()
initForm()
init registration form
getWaitingList()
Get waiting list object.
fillRegistrationPeriod()
show informations about the registration period
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
fillRegistrationType()
show informations about registration procedure
updateSubscriptionRequest()
Update subscription message.
static _lookupTitle($a_id)
lookup object title
isWaitingListActive()
Check if the waiting list is active Maximum of members exceeded or any user on the waiting list...
getFormTitle()
Get title for property form.
Base class for Course and Group registration.
static addCustomFields($form, $a_obj_id, $a_type, $a_mode='user')
Add custom course fields.
showCustomFields()
Show course defined fields.
setAccepted($a_status)
set accepted
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
validateAgreement()
Check Agreement.
setAccepted($a_status)
Set Agreement accepted.
initWaitingList()
Init waiting list (course or group waiting list)
enableRegistration($a_status)
set registration disabled
static _getInstanceByType($a_type)
Get Singleton Instance.
validate()
validate join request
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
isRegistrationPossible()
check if registration is possible
static addAgreement($form, $a_obj_id, $a_type)
Add agreement to form.
This class represents a text property in a property form.
validateCustomFields()
Check required course fields.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _hasFields($a_container_id)
Check if there are any define fields.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _checkGroupingDependencies(&$container_obj, $a_user_id=null)
cancel()
cancel subscription
This class represents a non editable value in a property form.
fillMembershipLimitation()
Show membership limitations.
fillInformations()
fill informations
addCommandButtons()
Add command buttons.
static _getGroupingItems($container_obj)
Get courses/groups that are assigned to the same membership limitation.
fillMaxMembers()
show informations about the maximum number of user.
__construct($a_container)
Constructor.
static _getInstance()
Get instance of ilPrivacySettings.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
getContainer()
Parent object.
initParticipants()
Init participants object (course or group participants)
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.