diff options
| author | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
|---|---|---|
| committer | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
| commit | 4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch) | |
| tree | 5c07151ae61276d334e88f6309c30d439a85c12e /lib/models/ConsultationBlock.php | |
| parent | da0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff) | |
| parent | 97a188592c679890a25c37ab78463add76a52ff7 (diff) | |
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'lib/models/ConsultationBlock.php')
| -rw-r--r-- | lib/models/ConsultationBlock.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/models/ConsultationBlock.php b/lib/models/ConsultationBlock.php index e42daaf..cde8f77 100644 --- a/lib/models/ConsultationBlock.php +++ b/lib/models/ConsultationBlock.php @@ -25,6 +25,7 @@ * @property string $note database column * @property int $size database column * @property int|null $lock_time database column + * @property bool $consecutive database column * @property int $mkdate database column * @property int $chdate database column * @property SimpleORMapCollection|ConsultationSlot[] $slots has_many ConsultationSlot @@ -71,7 +72,7 @@ class ConsultationBlock extends SimpleORMap implements PrivacyObject if ($block->range instanceof User) { return $block->range->getFullName() . ' <' . $block->range->email . '>'; } - if ($block->range instanceof Course || $block->range instanceof Institute) { + if ($block->range instanceof Course) { return sprintf(_('Veranstaltung: %s'), $block->range->getFullName()); } @@ -211,6 +212,10 @@ class ConsultationBlock extends SimpleORMap implements PrivacyObject ); } + if (!$interval) { + break; + } + $current = strtotime("+{$interval} weeks", $current); } @@ -274,9 +279,9 @@ class ConsultationBlock extends SimpleORMap implements PrivacyObject } $slots[] = ConsultationSlot::build([ - 'block_id' => $this->id, - 'start_time' => $now, - 'end_time' => strtotime("+{$duration} minutes", $now), + 'block_id' => $this->id, + 'start_time' => $now, + 'end_time' => strtotime("+{$duration} minutes", $now), ]); $now = strtotime("+{$duration} minutes", $now); |
