aboutsummaryrefslogtreecommitdiff
path: root/lib/models
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2024-12-03 15:20:59 +0000
committerMoritz Strohm <strohm@data-quest.de>2024-12-03 15:20:59 +0000
commit2835b3b966dc60ebcf85e7bb77be9d85e24d9920 (patch)
treee2580e6295d48672af1142ec751dd5a1a3e0c049 /lib/models
parent60c88b927ed3d9409660832d16dadb527bd4506c (diff)
added GUI improvements to schedule, re #4421
Merge request studip/studip!3578
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/calendar/ScheduleEntry.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/models/calendar/ScheduleEntry.php b/lib/models/calendar/ScheduleEntry.php
index f1e23fd..638f9e7 100644
--- a/lib/models/calendar/ScheduleEntry.php
+++ b/lib/models/calendar/ScheduleEntry.php
@@ -17,6 +17,7 @@
* @property string $start_time database column
* @property string $end_time database column
* @property string $dow database column
+ * @property string $colour_id database column
* @property string $label database column
* @property string $content database column
* @property string $user_id database column
@@ -216,7 +217,7 @@ class ScheduleEntry extends SimpleORMap implements Event
*/
public function getDescription(): string
{
- return $this->content;
+ return $this->getValue('content');
}
/**
@@ -298,13 +299,24 @@ class ScheduleEntry extends SimpleORMap implements Event
*/
public function toEventData(string $user_id): \Studip\Calendar\EventData
{
+ $title = $this->label;
+
+ $description = $this->getDescription();
+ if ($description) {
+ if ($this->label) {
+ $title = $this->label . ': ' . $description;
+ } else {
+ $title = $description;
+ }
+ }
+ $event_classes = ['schedule-entry'];
return new \Studip\Calendar\EventData(
$this->getBegin(),
$this->getEnd(),
- $this->label,
- ['schedule-entry'],
- '#000000',
- '#ffffff',
+ $title,
+ $event_classes,
+ $GLOBALS['PERS_TERMIN_KAT'][$this->colour_id]['fgcolor'] ?? '#000000',
+ $GLOBALS['PERS_TERMIN_KAT'][$this->colour_id]['bgcolor'] ?? '#ffffff',
$this->isWritable($user_id),
self::class,
$this->id,
@@ -317,7 +329,7 @@ class ScheduleEntry extends SimpleORMap implements Event
],
[],
'',
- '#000000',
+ $GLOBALS['PERS_TERMIN_KAT'][$this->colour_id]['border_color'] ?? '#000000',
$this->isAllDayEvent()
);
}