ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\Calendar\Recurrence\Input\BuilderImpl Class Reference
+ Inheritance diagram for ILIAS\Calendar\Recurrence\Input\BuilderImpl:
+ Collaboration diagram for ILIAS\Calendar\Recurrence\Input\BuilderImpl:

Public Member Functions

 __construct (protected ilCalendarRecurrence $recurrence, protected UIFactory $ui_factory, protected Refinery $refinery, protected ilLanguage $lng, protected ilCalendarUserSettings $user_settings)
 
 withoutUnlimitedRecurrences (bool $without=true)
 
 withoutDaily (bool $without=true)
 
 withoutWeekly (bool $without=true)
 
 withoutMonthly (bool $without=true)
 
 withoutYearly (bool $without=true)
 
 hasUnlimitedRecurrences ()
 
 hasDaily ()
 
 hasWeekly ()
 
 hasMonthly ()
 
 hasYearly ()
 
 get ()
 

Protected Member Functions

 getRuleInput ()
 
 getDailyGroup ()
 
 getWeeklyGroup ()
 
 getMonthlyByDayGroup ()
 
 getMonthlyByDateGroup ()
 
 getYearlyByDayGroup ()
 
 getYearlyByDateGroup ()
 
 getEndInput ()
 
 getIntervalInput (string $label)
 
 getDayInput ()
 
 getWeekInput ()
 
 getDayOfMonthInput ()
 
 getMonthInput ()
 
 getOutputTransformation ()
 

Protected Attributes

const string RULE = 'rule'
 
const string END = 'end'
 
const string NO_RECURRENCE = 'none'
 
const string DAILY = 'daily'
 
const string WEEKLY = 'weekly'
 
const string MONTHLY_BY_DAY = 'monthly_by_day'
 
const string MONTHLY_BY_DATE = 'monthly_by_date'
 
const string YEARLY_BY_DAY = 'yearly_by_day'
 
const string YEARLY_BY_DATE = 'yearly_by_date'
 
const string INTERVAL = 'interval'
 
const string MONTH = 'month'
 
const string WEEK = 'week'
 
const string DAY = 'day'
 
const string DAY_OF_MONTH = 'day_of_month'
 
const string NO_UNTIL = 'no_until'
 
const string COUNT = 'count'
 
const string UNTIL_COUNT = 'until_count'
 
const string END_DATE = 'end_date'
 
const string UNTIL_END_DATE = 'until_end_date'
 
bool $unlimited_recurrences = true
 
bool $daily = true
 
bool $weekly = true
 
bool $monthly = true
 
bool $yearly = true
 

Detailed Description

Definition at line 39 of file BuilderImpl.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::__construct ( protected ilCalendarRecurrence  $recurrence,
protected UIFactory  $ui_factory,
protected Refinery  $refinery,
protected ilLanguage  $lng,
protected ilCalendarUserSettings  $user_settings 
)

Definition at line 75 of file BuilderImpl.php.

81  {
82  }

Member Function Documentation

◆ get()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::get ( )

Implements ILIAS\Calendar\Recurrence\Input\Builder.

Definition at line 144 of file BuilderImpl.php.

References ILIAS\Calendar\Recurrence\Input\BuilderImpl\getOutputTransformation(), and ILIAS\Calendar\Recurrence\Input\BuilderImpl\getRuleInput().

144  : Group
145  {
146  return $this->ui_factory->input()->field()->group([
147  self::RULE => $this->getRuleInput()
148  ])->withAdditionalTransformation($this->getOutputTransformation());
149  }
+ Here is the call graph for this function:

◆ getDailyGroup()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getDailyGroup ( )
protected

Definition at line 186 of file BuilderImpl.php.

References ILIAS\Calendar\Recurrence\Input\BuilderImpl\getEndInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getIntervalInput(), and ILIAS\Repository\lng().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getRuleInput().

186  : Group
187  {
188  return $this->ui_factory->input()->field()->group(
189  [
190  self::INTERVAL => $this->getIntervalInput($this->lng->txt('cal_recurrence_day_interval')),
191  self::END => $this->getEndInput()
192  ],
193  $this->lng->txt('cal_daily')
194  );
195  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDayInput()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getDayInput ( )
protected

Definition at line 329 of file BuilderImpl.php.

References ilCalendarUtil\_numericDayToString(), ILIAS\Repository\lng(), ILIAS\Calendar\Recurrence\SATURDAY, and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthlyByDayGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getWeeklyGroup(), and ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDayGroup().

329  : Input
330  {
331  $days = [
332  0 => Weekday::SUNDAY->value,
333  1 => Weekday::MONDAY->value,
334  2 => Weekday::TUESDAY->value,
335  3 => Weekday::WEDNESDAY->value,
336  4 => Weekday::THURSDAY->value,
337  5 => Weekday::FRIDAY->value,
338  6 => Weekday::SATURDAY->value,
339  7 => Weekday::SUNDAY->value
340  ];
341  $options = [];
342  for ($i = $this->user_settings->getWeekStart(); $i < 7 + $this->user_settings->getWeekStart(); $i++) {
343  $options[$days[$i]] = ilCalendarUtil::_numericDayToString($i);
344  }
345 
346  $values = [];
347  foreach ($this->recurrence->getBYDAYList() as $byday) {
348  // BYDAY can also contain ordinance numbers in front of the days
349  $v = substr($byday, -2);
350  if (in_array($v, $days)) {
351  $values[] = $v;
352  }
353  }
354 
355  return $this->ui_factory->input()->field()->multiSelect(
356  $this->lng->txt('cal_day_s'),
357  $options
358  )->withValue($values)->withRequired(true);
359  }
static _numericDayToString(int $a_day, bool $a_long=true, ?ilLanguage $lng=null)
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDayOfMonthInput()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getDayOfMonthInput ( )
protected

Definition at line 384 of file BuilderImpl.php.

References ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthlyByDateGroup(), and ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDateGroup().

384  : Input
385  {
386  $value = (int) $this->recurrence->getBYMONTHDAY();
387  if ($value < 1 || $value > 31) {
388  $value = 1;
389  }
390  return $this->ui_factory->input()->field()->numeric($this->lng->txt('cal_day_of_month'))
391  ->withValue($value)
392  ->withRequired(true)
393  ->withAdditionalTransformation(
394  $this->refinery->in()->series([
395  $this->refinery->int()->isGreaterThanOrEqual(1),
396  $this->refinery->int()->isLessThanOrEqual(31),
397  ])
398  );
399  }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEndInput()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getEndInput ( )
protected

Definition at line 261 of file BuilderImpl.php.

References ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getDailyGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthlyByDateGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthlyByDayGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getWeeklyGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDateGroup(), and ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDayGroup().

261  : Input
262  {
263  $groups = [];
264 
265  if ($this->unlimited_recurrences) {
266  $groups[self::NO_UNTIL] = $this->ui_factory->input()->field()->group(
267  [],
268  $this->lng->txt('cal_no_ending')
269  );
270  }
271 
272  $count_value = $this->recurrence->getFrequenceUntilCount();
273  if ($count_value < 1 || $count_value > 100) {
274  $count_value = 1;
275  }
276  $count = $this->ui_factory->input()->field()->numeric($this->lng->txt('cal_recurrence_count'))
277  ->withValue($count_value)
278  ->withRequired(true)
279  ->withAdditionalTransformation(
280  $this->refinery->in()->series([
281  $this->refinery->int()->isGreaterThanOrEqual(1),
282  $this->refinery->int()->isLessThanOrEqual(100),
283  ])
284  );
285  $groups[self::UNTIL_COUNT] = $this->ui_factory->input()->field()->group(
286  [self::COUNT => $count],
287  $this->lng->txt('cal_recurrence_until_count')
288  );
289 
290  $end_date = $this->ui_factory->input()->field()->dateTime(
291  $this->lng->txt('cal_recurrence_end_date'),
292  $this->lng->txt('cal_recurrence_end_date_info')
293  )->withTimezone('UTC')
294  ->withUseTime(false)
295  ->withRequired(true);
296  if ($this->recurrence->getFrequenceUntilDate()) {
297  $end_date = $end_date->withValue(
298  new DateTimeImmutable('@' . $this->recurrence->getFrequenceUntilDate()->getUnixTime())
299  );
300  }
301  $groups[self::UNTIL_END_DATE] = $this->ui_factory->input()->field()->group(
302  [self::END_DATE => $end_date],
303  $this->lng->txt('cal_recurrence_until_end_date')
304  );
305 
306  $value = self::NO_UNTIL;
307  if ($this->recurrence->getFrequenceUntilDate()) {
308  $value = self::UNTIL_END_DATE;
309  }
310  if ($this->recurrence->getFrequenceUntilCount()) {
311  $value = self::UNTIL_COUNT;
312  }
313  return $this->ui_factory->input()->field()->switchableGroup(
314  $groups,
315  $this->lng->txt('cal_recurrence_until')
316  )->withValue($value);
317  }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIntervalInput()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getIntervalInput ( string  $label)
protected

Definition at line 319 of file BuilderImpl.php.

References ILIAS\Repository\refinery(), and ILIAS\UI\Component\Input\Input\withValue().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getDailyGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthlyByDateGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthlyByDayGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getWeeklyGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDateGroup(), and ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDayGroup().

319  : Input
320  {
321  return $this->ui_factory->input()->field()->numeric($label)
322  ->withValue($this->recurrence->getInterval())
323  ->withRequired(true)
324  ->withAdditionalTransformation(
325  $this->refinery->int()->isGreaterThanOrEqual(1)
326  );
327  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMonthInput()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getMonthInput ( )
protected

Definition at line 401 of file BuilderImpl.php.

References ilCalendarUtil\_numericMonthToString(), ILIAS\Calendar\Recurrence\DECEMBER, ILIAS\Repository\lng(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDateGroup(), and ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDayGroup().

401  : Input
402  {
403  $months = [
404  1 => Month::JANUARY->value,
405  2 => Month::FEBRUARY->value,
406  3 => Month::MARCH->value,
407  4 => Month::APRIL->value,
408  5 => Month::MAY->value,
409  6 => Month::JUNE->value,
410  7 => Month::JULY->value,
411  8 => Month::AUGUST->value,
412  9 => Month::SEPTEMBER->value,
413  10 => Month::OCTOBER->value,
414  11 => Month::NOVEMBER->value,
415  12 => Month::DECEMBER->value
416  ];
417  $options = [];
418  foreach ($months as $month => $key) {
419  $options[$key] = ilCalendarUtil::_numericMonthToString($month);
420  }
421 
422  $value = $this->recurrence->getBYMONTH();
423  if (!in_array($value, $options)) {
424  $value = Month::JANUARY->value;
425  }
426  return $this->ui_factory->input()->field()->select(
427  $this->lng->txt('month'),
428  $options
429  )->withValue($value)->withRequired(true);
430  }
static _numericMonthToString(int $a_month, bool $a_long=true, ?ilLanguage $lng=null)
numeric month to string
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMonthlyByDateGroup()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getMonthlyByDateGroup ( )
protected

Definition at line 222 of file BuilderImpl.php.

References ILIAS\Calendar\Recurrence\Input\BuilderImpl\getDayOfMonthInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getEndInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getIntervalInput(), and ILIAS\Repository\lng().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getRuleInput().

222  : Group
223  {
224  return $this->ui_factory->input()->field()->group(
225  [
226  self::INTERVAL => $this->getIntervalInput($this->lng->txt('cal_recurrence_month_interval')),
227  self::DAY_OF_MONTH => $this->getDayOfMonthInput(),
228  self::END => $this->getEndInput()
229  ],
230  $this->lng->txt('cal_monthly_by_date')
231  );
232  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMonthlyByDayGroup()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getMonthlyByDayGroup ( )
protected

Definition at line 209 of file BuilderImpl.php.

References ILIAS\Calendar\Recurrence\Input\BuilderImpl\getDayInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getEndInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getIntervalInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getWeekInput(), and ILIAS\Repository\lng().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getRuleInput().

209  : Group
210  {
211  return $this->ui_factory->input()->field()->group(
212  [
213  self::INTERVAL => $this->getIntervalInput($this->lng->txt('cal_recurrence_month_interval')),
214  self::WEEK => $this->getWeekInput(),
215  self::DAY => $this->getDayInput(),
216  self::END => $this->getEndInput()
217  ],
218  $this->lng->txt('cal_monthly_by_day')
219  );
220  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOutputTransformation()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getOutputTransformation ( )
protected

Definition at line 432 of file BuilderImpl.php.

References ilCalendarRecurrence\FREQ_DAILY, ilCalendarRecurrence\FREQ_MONTHLY, ilCalendarRecurrence\FREQ_WEEKLY, ilCalendarRecurrence\FREQ_YEARLY, ILIAS\Calendar\Recurrence\Input\BuilderImpl\hasDaily(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\hasMonthly(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\hasUnlimitedRecurrences(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\hasWeekly(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\hasYearly(), IL_CAL_UNIX, and ILIAS\Repository\refinery().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\get().

432  : Transformation
433  {
434  $recurrence = clone $this->recurrence;
435  $with_daily = $this->hasDaily();
436  $with_weekly = $this->hasWeekly();
437  $with_monthly = $this->hasMonthly();
438  $with_yearly = $this->hasYearly();
439  $with_unlimited = $this->hasUnlimitedRecurrences();
440 
441  return $this->refinery->custom()->transformation(function ($values) use (
442  $recurrence,
443  $with_daily,
444  $with_weekly,
445  $with_monthly,
446  $with_yearly,
447  $with_unlimited
448  ) {
449  $recurrence->reset();
450 
451  $rule_data = $values[self::RULE];
452  switch ($rule_data[0]) {
453  case self::DAILY:
454  $recurrence->setFrequenceType(ilCalendarRecurrence::FREQ_DAILY);
455  $recurrence->setInterval((int) $rule_data[1][self::INTERVAL]);
456  break;
457 
458  case self::WEEKLY:
459  $recurrence->setFrequenceType(ilCalendarRecurrence::FREQ_WEEKLY);
460  $recurrence->setInterval((int) $rule_data[1][self::INTERVAL]);
461  if (is_array($rule_data[1][self::DAY]) && $rule_data[1][self::DAY] !== []) {
462  $recurrence->setBYDAY(implode(',', $rule_data[1][self::DAY]));
463  }
464  break;
465 
466  case self::MONTHLY_BY_DAY:
467  $recurrence->setFrequenceType(ilCalendarRecurrence::FREQ_MONTHLY);
468  $recurrence->setInterval((int) $rule_data[1][self::INTERVAL]);
469  if (is_array($rule_data[1][self::DAY]) && $rule_data[1][self::DAY] !== []) {
470  $index = $rule_data[1][self::WEEK];
471  $recurrence->setBYDAY($index . implode(',' . $index, $rule_data[1][self::DAY]));
472  }
473  break;
474 
475  case self::MONTHLY_BY_DATE:
476  $recurrence->setFrequenceType(ilCalendarRecurrence::FREQ_MONTHLY);
477  $recurrence->setInterval((int) $rule_data[1][self::INTERVAL]);
478  $recurrence->setBYMONTHDAY((string) $rule_data[1][self::DAY_OF_MONTH]);
479  break;
480 
481  case self::YEARLY_BY_DAY:
482  $recurrence->setFrequenceType(ilCalendarRecurrence::FREQ_YEARLY);
483  $recurrence->setInterval((int) $rule_data[1][self::INTERVAL]);
484  $recurrence->setBYMONTH((string) $rule_data[1][self::MONTH]);
485  if (is_array($rule_data[1][self::DAY]) && $rule_data[1][self::DAY] !== []) {
486  $index = $rule_data[1][self::WEEK];
487  $recurrence->setBYDAY($index . implode(',' . $index, $rule_data[1][self::DAY]));
488  }
489  break;
490 
491  case self::YEARLY_BY_DATE:
492  $recurrence->setFrequenceType(ilCalendarRecurrence::FREQ_YEARLY);
493  $recurrence->setInterval((int) $rule_data[1][self::INTERVAL]);
494  $recurrence->setBYMONTH((string) $rule_data[1][self::MONTH]);
495  $recurrence->setBYMONTHDAY((string) $rule_data[1][self::DAY_OF_MONTH]);
496  break;
497 
498  default:
499  case self::NO_RECURRENCE:
500  break;
501  }
502 
503  $end_data = $rule_data[1][self::END];
504  if ($end_data[0] === self::UNTIL_COUNT) {
505  $recurrence->setFrequenceUntilCount($end_data[1][self::COUNT]);
506  }
507  if ($end_data[0] === self::UNTIL_END_DATE) {
508  $recurrence->setFrequenceUntilDate(new ilDate(
509  $end_data[1][self::END_DATE]->getTimestamp(),
511  ));
512  }
513 
514  return $recurrence;
515  });
516  }
const IL_CAL_UNIX
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRuleInput()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getRuleInput ( )
protected

Definition at line 151 of file BuilderImpl.php.

References ilCalendarRecurrence\FREQ_DAILY, ilCalendarRecurrence\FREQ_MONTHLY, ilCalendarRecurrence\FREQ_WEEKLY, ilCalendarRecurrence\FREQ_YEARLY, ILIAS\Calendar\Recurrence\Input\BuilderImpl\getDailyGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthlyByDateGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthlyByDayGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getWeeklyGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDateGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDayGroup(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\hasDaily(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\hasMonthly(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\hasWeekly(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\hasYearly(), ILIAS\Repository\lng(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\get().

151  : Input
152  {
153  $groups = [];
154  $groups[self::NO_RECURRENCE] = $this->ui_factory->input()->field()->group(
155  [],
156  $this->lng->txt('cal_no_recurrence')
157  );
158  if ($this->hasDaily()) {
159  $groups[self::DAILY] = $this->getDailyGroup();
160  }
161  if ($this->hasWeekly()) {
162  $groups[self::WEEKLY] = $this->getWeeklyGroup();
163  }
164  if ($this->hasMonthly()) {
165  $groups[self::MONTHLY_BY_DAY] = $this->getMonthlyByDayGroup();
166  $groups[self::MONTHLY_BY_DATE] = $this->getMonthlyByDateGroup();
167  }
168  if ($this->hasYearly()) {
169  $groups[self::YEARLY_BY_DAY] = $this->getYearlyByDayGroup();
170  $groups[self::YEARLY_BY_DATE] = $this->getYearlyByDateGroup();
171  }
172 
173  $value = match ($this->recurrence->getFrequenceType()) {
174  ilCalendarRecurrence::FREQ_DAILY => self::DAILY,
175  ilCalendarRecurrence::FREQ_WEEKLY => self::WEEKLY,
176  ilCalendarRecurrence::FREQ_MONTHLY => $this->recurrence->getBYDAY() ? self::MONTHLY_BY_DAY : self::MONTHLY_BY_DATE,
177  ilCalendarRecurrence::FREQ_YEARLY => $this->recurrence->getBYDAY() ? self::YEARLY_BY_DAY : self::YEARLY_BY_DATE,
178  default => self::NO_RECURRENCE
179  };
180  return $this->ui_factory->input()->field()->switchableGroup(
181  $groups,
182  $this->lng->txt('cal_recurrences')
183  )->withValue($value);
184  }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWeekInput()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getWeekInput ( )
protected

Definition at line 361 of file BuilderImpl.php.

References ILIAS\Calendar\Recurrence\LAST, ILIAS\Repository\lng(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthlyByDayGroup(), and ILIAS\Calendar\Recurrence\Input\BuilderImpl\getYearlyByDayGroup().

361  : Input
362  {
363  $options = [
364  Ordinal::FIRST->value => $this->lng->txt('cal_first'),
365  Ordinal::SECOND->value => $this->lng->txt('cal_second'),
366  Ordinal::THIRD->value => $this->lng->txt('cal_third'),
367  Ordinal::FOURTH->value => $this->lng->txt('cal_fourth'),
368  Ordinal::FIFTH->value => $this->lng->txt('cal_fifth'),
369  Ordinal::LAST->value => $this->lng->txt('cal_last')
370  ];
371 
372  // The last two characters of any BYDAY entry are the day, the remainder is the ordinal.
373  $value = substr($this->recurrence->getBYDAYList()[0] ?? '', 0, -2);
374  if ($value === '') {
375  $value = Ordinal::FIRST->value;
376  }
377 
378  return $this->ui_factory->input()->field()->select(
379  $this->lng->txt('week'),
380  $options
381  )->withValue($value)->withRequired(true);
382  }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWeeklyGroup()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getWeeklyGroup ( )
protected

Definition at line 197 of file BuilderImpl.php.

References ILIAS\Calendar\Recurrence\Input\BuilderImpl\getDayInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getEndInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getIntervalInput(), and ILIAS\Repository\lng().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getRuleInput().

197  : Group
198  {
199  return $this->ui_factory->input()->field()->group(
200  [
201  self::INTERVAL => $this->getIntervalInput($this->lng->txt('cal_recurrence_week_interval')),
202  self::DAY => $this->getDayInput(),
203  self::END => $this->getEndInput()
204  ],
205  $this->lng->txt('cal_weekly')
206  );
207  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getYearlyByDateGroup()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getYearlyByDateGroup ( )
protected

Definition at line 248 of file BuilderImpl.php.

References ILIAS\Calendar\Recurrence\Input\BuilderImpl\getDayOfMonthInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getEndInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getIntervalInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthInput(), and ILIAS\Repository\lng().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getRuleInput().

248  : Group
249  {
250  return $this->ui_factory->input()->field()->group(
251  [
252  self::INTERVAL => $this->getIntervalInput($this->lng->txt('cal_recurrence_year_interval')),
253  self::MONTH => $this->getMonthInput(),
254  self::DAY_OF_MONTH => $this->getDayOfMonthInput(),
255  self::END => $this->getEndInput()
256  ],
257  $this->lng->txt('cal_yearly_by_date')
258  );
259  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getYearlyByDayGroup()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::getYearlyByDayGroup ( )
protected

Definition at line 234 of file BuilderImpl.php.

References ILIAS\Calendar\Recurrence\Input\BuilderImpl\getDayInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getEndInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getIntervalInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getMonthInput(), ILIAS\Calendar\Recurrence\Input\BuilderImpl\getWeekInput(), and ILIAS\Repository\lng().

Referenced by ILIAS\Calendar\Recurrence\Input\BuilderImpl\getRuleInput().

234  : Group
235  {
236  return $this->ui_factory->input()->field()->group(
237  [
238  self::INTERVAL => $this->getIntervalInput($this->lng->txt('cal_recurrence_year_interval')),
239  self::MONTH => $this->getMonthInput(),
240  self::WEEK => $this->getWeekInput(),
241  self::DAY => $this->getDayInput(),
242  self::END => $this->getEndInput()
243  ],
244  $this->lng->txt('cal_yearly_by_day')
245  );
246  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasDaily()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::hasDaily ( )

◆ hasMonthly()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::hasMonthly ( )

◆ hasUnlimitedRecurrences()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::hasUnlimitedRecurrences ( )

◆ hasWeekly()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::hasWeekly ( )

◆ hasYearly()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::hasYearly ( )

◆ withoutDaily()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::withoutDaily ( bool  $without = true)

Implements ILIAS\Calendar\Recurrence\Input\Builder.

Definition at line 91 of file BuilderImpl.php.

91  : Builder
92  {
93  $clone = clone $this;
94  $clone->daily = !$without;
95  return $clone;
96  }

◆ withoutMonthly()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::withoutMonthly ( bool  $without = true)

Implements ILIAS\Calendar\Recurrence\Input\Builder.

Definition at line 105 of file BuilderImpl.php.

105  : Builder
106  {
107  $clone = clone $this;
108  $clone->monthly = !$without;
109  return $clone;
110  }

◆ withoutUnlimitedRecurrences()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::withoutUnlimitedRecurrences ( bool  $without = true)

Implements ILIAS\Calendar\Recurrence\Input\Builder.

Definition at line 84 of file BuilderImpl.php.

84  : Builder
85  {
86  $clone = clone $this;
87  $clone->unlimited_recurrences = !$without;
88  return $clone;
89  }

◆ withoutWeekly()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::withoutWeekly ( bool  $without = true)

Implements ILIAS\Calendar\Recurrence\Input\Builder.

Definition at line 98 of file BuilderImpl.php.

98  : Builder
99  {
100  $clone = clone $this;
101  $clone->weekly = !$without;
102  return $clone;
103  }

◆ withoutYearly()

ILIAS\Calendar\Recurrence\Input\BuilderImpl::withoutYearly ( bool  $without = true)

Implements ILIAS\Calendar\Recurrence\Input\Builder.

Definition at line 112 of file BuilderImpl.php.

112  : Builder
113  {
114  $clone = clone $this;
115  $clone->yearly = !$without;
116  return $clone;
117  }

Field Documentation

◆ $daily

bool ILIAS\Calendar\Recurrence\Input\BuilderImpl::$daily = true
protected

◆ $monthly

bool ILIAS\Calendar\Recurrence\Input\BuilderImpl::$monthly = true
protected

◆ $unlimited_recurrences

bool ILIAS\Calendar\Recurrence\Input\BuilderImpl::$unlimited_recurrences = true
protected

◆ $weekly

bool ILIAS\Calendar\Recurrence\Input\BuilderImpl::$weekly = true
protected

◆ $yearly

bool ILIAS\Calendar\Recurrence\Input\BuilderImpl::$yearly = true
protected

◆ COUNT

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::COUNT = 'count'
protected

Definition at line 64 of file BuilderImpl.php.

◆ DAILY

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::DAILY = 'daily'
protected

Definition at line 47 of file BuilderImpl.php.

◆ DAY

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::DAY = 'day'
protected

Definition at line 58 of file BuilderImpl.php.

◆ DAY_OF_MONTH

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::DAY_OF_MONTH = 'day_of_month'
protected

Definition at line 59 of file BuilderImpl.php.

◆ END

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::END = 'end'
protected

Definition at line 43 of file BuilderImpl.php.

◆ END_DATE

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::END_DATE = 'end_date'
protected

Definition at line 66 of file BuilderImpl.php.

◆ INTERVAL

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::INTERVAL = 'interval'
protected

Definition at line 55 of file BuilderImpl.php.

◆ MONTH

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::MONTH = 'month'
protected

Definition at line 56 of file BuilderImpl.php.

◆ MONTHLY_BY_DATE

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::MONTHLY_BY_DATE = 'monthly_by_date'
protected

Definition at line 50 of file BuilderImpl.php.

◆ MONTHLY_BY_DAY

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::MONTHLY_BY_DAY = 'monthly_by_day'
protected

Definition at line 49 of file BuilderImpl.php.

◆ NO_RECURRENCE

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::NO_RECURRENCE = 'none'
protected

Definition at line 46 of file BuilderImpl.php.

◆ NO_UNTIL

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::NO_UNTIL = 'no_until'
protected

Definition at line 63 of file BuilderImpl.php.

◆ RULE

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::RULE = 'rule'
protected

Definition at line 42 of file BuilderImpl.php.

◆ UNTIL_COUNT

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::UNTIL_COUNT = 'until_count'
protected

Definition at line 65 of file BuilderImpl.php.

◆ UNTIL_END_DATE

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::UNTIL_END_DATE = 'until_end_date'
protected

Definition at line 67 of file BuilderImpl.php.

◆ WEEK

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::WEEK = 'week'
protected

Definition at line 57 of file BuilderImpl.php.

◆ WEEKLY

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::WEEKLY = 'weekly'
protected

Definition at line 48 of file BuilderImpl.php.

◆ YEARLY_BY_DATE

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::YEARLY_BY_DATE = 'yearly_by_date'
protected

Definition at line 52 of file BuilderImpl.php.

◆ YEARLY_BY_DAY

const string ILIAS\Calendar\Recurrence\Input\BuilderImpl::YEARLY_BY_DAY = 'yearly_by_day'
protected

Definition at line 51 of file BuilderImpl.php.


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