19 declare(strict_types=1);
28 protected ?
int $qualification_period,
30 protected ?
int $restart_period,
31 protected bool $restart_recheck
33 if (!is_null($qualification_period) && 0 > $qualification_period) {
35 'Numbers less than 0 are not allowed for qualification_period' 39 if (!is_null($restart_period) && 0 > $restart_period) {
41 'Numbers less than 0 are not allowed for restart_period' 45 $this->qualification_period = $qualification_period;
46 $this->qualification_date = $qualification_date;
47 $this->restart_period = $restart_period;
48 $this->restart_recheck = $restart_recheck;
53 return $this->qualification_period;
57 ?
int $qualification_period
59 if (!is_null($qualification_period) && 0 > $qualification_period) {
61 'Numbers less than 0 are not allowed' 65 $clone->qualification_period = $qualification_period;
72 return $this->qualification_date;
79 $clone->qualification_date = $qualification_date;
86 return $this->restart_period;
92 if (!is_null($restart_period) && 0 > $restart_period) {
94 'Numbers less than 0 are not allowed' 98 $clone->restart_period = $restart_period;
109 $format = $data_factory->
dateFormat()->germanShort();
110 $grp1 = $input->group([], $lng->
txt(
'prg_no_validity_qualification'));
111 $grp2 = $input->group(
113 'vq_period' => $input->numeric(
114 $lng->
txt(
'vq_period_label'),
115 $lng->
txt(
'validity_qualification_period_desc')
120 $lng->
txt(
'validity_qualification_period')
122 $grp3 = $input->group(
124 'vq_date' => $input->dateTime(
125 $lng->
txt(
'vq_date_label'),
126 $lng->
txt(
'validity_qualification_date_desc')
128 ->withFormat($format)
132 $lng->
txt(
'validity_qualification_date')
134 $grp4 = $input->group([], $lng->
txt(
'prg_no_restart'));
135 $grp5 = $input->group(
137 'vq_restart_period' => $input->numeric(
138 $lng->
txt(
'restart_period_label'),
139 $lng->
txt(
'restart_period_desc')
143 ->withRequired(
true),
145 'vq_restart_recheck' => $input->checkbox(
146 $lng->
txt(
'restart_recheck_label'),
147 $lng->
txt(
'restart_recheck_desc')
152 $lng->
txt(
'restart_period')
155 $sg1 = $input->switchableGroup(
157 'opt_no_validity_qualification' => $grp1,
158 'opt_validity_qualification_period' => $grp2,
159 'opt_validity_qualification_date' => $grp3
162 )->withLabel($lng->
txt(
'optgrp_label_validity'));
164 $sg2 = $input->switchableGroup(
166 'opt_no_restart' => $grp4,
167 'opt_restart_period' => $grp5,
170 )->withLabel($lng->
txt(
'optgrp_label_restart'));
172 $validity_qualification =
"opt_no_validity_qualification";
174 $validity_qualification =
'opt_validity_qualification_period';
178 $validity_qualification =
'opt_validity_qualification_date';
181 $restart_value =
'opt_no_restart';
183 $restart_value =
'opt_restart_period';
186 return $input->section(
188 'validity_qualification' => $sg1->withValue($validity_qualification),
189 'restart' => $sg2->withValue($restart_value)
191 $lng->
txt(
'prg_validity_of_qualification')
197 $restart_recheck =
false;
199 if (isset($vals[
'validity_qualification'][1][
'vq_period'])) {
200 $vq_period = (
int) $vals[
'validity_qualification'][1][
'vq_period'];
203 if (isset($vals[
'validity_qualification'][1][
'vq_date'])) {
204 $vq_date = $vals[
'validity_qualification'][1][
'vq_date'];
208 count($vals[
'restart'][1]) > 0 &&
209 !is_null($vals[
'restart'][1][
'vq_restart_period'])
211 $restart = (
int) $vals[
'restart'][1][
'vq_restart_period'];
212 $restart_recheck = (bool) $vals[
'restart'][1][
'vq_restart_recheck'];
226 return $this->restart_recheck;
231 $clone = clone $this;
232 $clone->restart_recheck = $restart_recheck;
withQualificationPeriod(?int $qualification_period)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Interface Observer Contains several chained tasks and infos about them.
__construct(protected ?int $qualification_period, protected ?DateTimeImmutable $qualification_date, protected ?int $restart_period, protected bool $restart_recheck)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
withRestartRecheck(bool $restart_recheck)
withQualificationDate(?DateTimeImmutable $qualification_date)
toFormInput(Field\Factory $input, ilLanguage $lng, Refinery $refinery, Factory $data_factory)
withRestartPeriod(?int $restart_period)