19declare(strict_types=1);
33 protected \ILIAS\HTTP\GlobalHttpState
$http;
53 $this->
user = $DIC->user();
54 $this->
tabs = $DIC->tabs();
55 $this->tree =
$DIC->repositoryTree();
56 $this->rbacreview =
$DIC->rbac()->review();
58 $this->
lng = $DIC->language();
59 $this->
lng->loadLanguageModule(
'crs');
60 $this->
lng->loadLanguageModule(
'grp');
61 $this->
lng->loadLanguageModule(
'ps');
62 $this->
lng->loadLanguageModule(
'membership');
64 $this->
ctrl = $DIC->ctrl();
65 $this->tpl =
$DIC->ui()->mainTemplate();
66 $this->
access = $DIC->access();
68 $this->container = $a_container;
69 $this->ref_id = $this->container->
getRefId();
77 $this->
http = $DIC->http();
98 $this->registration_possible = $a_status;
129 $parent = $this->tree->getParentId($this->container->getRefId());
132 $this->
lng->txt($this->container->getType() .
'_removed_from_waiting_list'),
133 $this->container->getTitle()
135 $this->tpl->setOnScreenMessage(
'success',
$message,
true);
136 $this->
ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $parent);
137 $this->
ctrl->redirectByClass(
"ilrepositorygui",
"");
174 $tpl =
new ilTemplate(
'tpl.membership_limitation_form.html',
true,
true,
'components/ILIAS/Membership');
181 if ($this->
access->checkAccess(
'visible',
'', $ref_id,
$type)) {
182 $this->
ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $ref_id);
185 $this->
ctrl->getLinkTargetByClass(
"ilrepositorygui",
"")
187 $get_ref_id = $this->
http->wrapper()->query()->retrieve(
190 $this->refinery->kindlyTo()->int(),
191 $this->refinery->always(0)
195 $this->
ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $get_ref_id);
207 $mem->setAlert($this->container->getMessage());
210 $this->
form->addItem($mem);
223 $this->
lng->loadLanguageModule(
'ps');
227 if (!count($fields_info->getExportableFields())) {
231 $section->setTitle($this->
lng->txt($this->type .
'_usr_agreement'));
232 $this->
form->addItem($section);
239 if ($this->privacy->confirmationRequired($this->type)) {
250 $cdf_values = $this->
http->wrapper()->post()->retrieve(
253 $this->refinery->kindlyTo()->dictOf(
254 $this->refinery->kindlyTo()->string()
256 $this->refinery->always([])
261 $cdf->setValue($this->
lng->txt($this->type .
'_ps_cdf_info'));
262 $cdf->setRequired(
true);
263 foreach ($cdf_fields as $field_obj) {
264 switch ($field_obj->getType()) {
266 $select =
new ilSelectInputGUI($field_obj->getName(),
'cdf[' . $field_obj->getId() .
']');
267 $select->setValue($cdf_values[$field_obj->getId()] ??
'');
268 $select->setOptions($field_obj->prepareSelectBox());
269 if ($field_obj->isRequired()) {
270 $select->setRequired(
true);
272 $cdf->addSubItem($select);
276 $text =
new ilTextInputGUI($field_obj->getName(),
'cdf[' . $field_obj->getId() .
']');
277 $text->setValue($cdf_values[$field_obj->getId()] ??
'');
279 $text->setMaxLength(255);
280 if ($field_obj->isRequired()) {
281 $text->setRequired(
true);
283 $cdf->addSubItem($text);
287 $this->
form->addItem($cdf);
292 $agreement = $this->
http->wrapper()->post()->retrieve(
295 $this->refinery->kindlyTo()->string(),
296 $this->refinery->always(
null)
303 if (!$this->privacy->confirmationRequired($this->type)) {
311 $required_fullfilled =
true;
314 switch ($field_obj->getType()) {
316 $cdf_value = $this->
http->wrapper()->post()->retrieve(
317 'cdf_' . $field_obj->getId(),
318 $this->refinery->byTrying([
319 $this->refinery->kindlyTo()->string(),
320 $this->refinery->always(
'')
325 $cdf_parts = explode(
'_', $cdf_value);
326 $option_id = (
int) ($cdf_parts[1] ?? 0);
328 $open_answer_indexes = $field_obj->getValueOptions();
329 if (in_array($option_id, $open_answer_indexes)) {
330 $value = $this->
http->wrapper()->post()->retrieve(
331 'cdf_oa_' . $field_obj->getId() .
'_' . $option_id,
333 $this->
refinery->kindlyTo()->string(),
334 $this->refinery->always(
'')
338 $value = $field_obj->getValueById((
int) $option_id);
343 $value = $this->
http->wrapper()->post()->retrieve(
344 'cdf_' . $field_obj->getId(),
346 $this->
refinery->kindlyTo()->string(),
347 $this->refinery->always(
'')
354 $course_user_data->setValue($value);
355 $course_user_data->update();
358 if ($field_obj->isRequired() && $value ===
"") {
359 $required_fullfilled =
false;
362 return $required_fullfilled;
372 $agreement->setAccepted($a_status);
373 $agreement->setAcceptanceTime(time());
382 $this->
ctrl->setParameterByClass(
385 $this->tree->getParentId($this->container->getRefId())
387 $this->
ctrl->redirectByClass(
"ilrepositorygui",
"");
397 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"reg_goto_parent_membership_info"));
399 $this->tpl->setContent($this->
form->getHTML());
405 if (!$form->
checkInput() || !$this->validate()) {
407 if ($this->join_error) {
408 $this->tpl->setOnScreenMessage(
'failure', $this->join_error);
410 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
428 if (is_object($this->
form)) {
433 $this->
form->setFormAction($this->
ctrl->getFormAction($this,
'join'));
464 $this->
form->addCommandButton(
'join', $this->
lng->txt(
'mem_add_to_wl'));
465 $this->
form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
467 $this->
form->addCommandButton(
'join', $this->
lng->txt(
'join'));
468 $this->
form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
471 $this->tpl->setOnScreenMessage(
'question', sprintf(
472 $this->
lng->txt($this->container->getType() .
'_cancel_waiting_list'),
473 $this->container->getTitle()
475 $this->
form->addCommandButton(
'leaveWaitingList', $this->
lng->txt(
'leave_waiting_list'));
476 $this->
form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
482 $subject = $this->
http->wrapper()->post()->retrieve(
485 $this->refinery->kindlyTo()->string(),
486 $this->refinery->always(
'')
491 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'sub_request_saved'),
true);
492 $this->
ctrl->setParameterByClass(
495 $this->tree->getParentId($this->container->getRefId())
497 $this->
ctrl->redirectByClass(
"ilrepositorygui",
"");
502 $this->participants->deleteSubscriber($this->
user->getId());
503 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'sub_request_deleted'),
true);
505 $this->
ctrl->setParameterByClass(
508 $this->tree->getParentId($this->container->getRefId())
510 $this->
ctrl->redirectByClass(
"ilrepositorygui",
"");
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
static _hasFields(int $a_container_id)
Check if there are any define fields.
Class ilCtrl provides processing control methods.
static _getInstanceByType(string $a_type)
Get Singleton Instance.
static addCustomFields(ilPropertyFormGUI $form, int $a_obj_id, string $a_type, string $a_mode='user')
static addAgreement(ilPropertyFormGUI $form, int $a_obj_id, string $a_type)
static addExportFieldInfo(ilPropertyFormGUI $form, int $a_obj_id, string $a_type)
This class represents a non editable value in a property form.
static _getGroupingItems(ilObject $container_obj)
Get courses/groups that are assigned to the same membership limitation.
static _checkGroupingDependencies(ilObject $container_obj, ?int $a_user_id=null)
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
Base class for course and group participants.
Singleton class that stores all privacy settings.
class ilRbacReview Contains Review functions of core Rbac.
Base class for Course and Group registration.
ilWaitingList $waiting_list
fillRegistrationType()
show informations about registration procedure
ilGlobalTemplateInterface $tpl
initParticipants()
Init participants object (course or group participants)
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.
updateSubscriptionRequest()
bool $registration_possible
setAccepted(bool $a_status)
fillRegistrationPeriod()
show informations about the registration period
ILIAS Refinery Factory $refinery
ilPrivacySettings $privacy
__construct(ilObject $a_container)
cancel()
cancel subscription
cancelSubscriptionRequest()
ilParticipants $participants
fillInformations()
fill informations
fillMembershipLimitation()
Show membership limitations.
ILIAS HTTP GlobalHttpState $http
show(?ilPropertyFormGUI $form=null)
getWaitingList()
Get waiting list object.
initWaitingList()
Init waiting list (course or group waiting list)
enableRegistration(bool $a_status)
fillMaxMembers()
show informations about the maximum number of user.
static get(string $a_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
Base class for course and group waiting lists.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
static http()
Fetches the global http state from ILIAS.
form( $class_path, string $cmd, string $submit_caption="")