aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2024-05-27 11:52:23 +0000
committerMoritz Strohm <strohm@data-quest.de>2024-05-27 11:52:23 +0000
commit801a4916a263bed0aeecb6c62e8a25138ee5612a (patch)
treecf5476dc2ebca8c08a1940275c0c60800d55e166 /app
parent4f847abc09405f0cf848f7b4b5a5a283acc6131d (diff)
use current date when creating calendar dates, fixes #3920
Closes #3920 Merge request studip/studip!3043
Diffstat (limited to 'app')
-rw-r--r--app/controllers/calendar/calendar.php4
-rw-r--r--app/controllers/calendar/date.php8
2 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/calendar/calendar.php b/app/controllers/calendar/calendar.php
index 89421cb..fa33e2e 100644
--- a/app/controllers/calendar/calendar.php
+++ b/app/controllers/calendar/calendar.php
@@ -39,7 +39,7 @@ class Calendar_CalendarController extends AuthenticatedController
_('Termin anlegen'),
$this->url_for('calendar/date/add', $params),
Icon::create('add'),
- ['data-dialog' => 'size=auto']
+ ['data-dialog' => 'size=auto', 'class' => 'calendar-action']
);
}
@@ -446,7 +446,7 @@ class Calendar_CalendarController extends AuthenticatedController
_('Termin anlegen'),
$this->url_for('calendar/date/add/course_' . $course->id),
Icon::create('add'),
- ['data-dialog' => 'size=default']
+ ['data-dialog' => 'size=default', 'class' => 'calendar-action']
);
$actions->addLink(
_('Drucken'),
diff --git a/app/controllers/calendar/date.php b/app/controllers/calendar/date.php
index eda171b..cb61a7e 100644
--- a/app/controllers/calendar/date.php
+++ b/app/controllers/calendar/date.php
@@ -232,6 +232,14 @@ class Calendar_DateController extends AuthenticatedController
$this->date->repetition_end = $this->date->end;
} else {
$time = new DateTime();
+ if (Request::submitted('timestamp')) {
+ $time->setTimestamp(Request::int('timestamp'));
+ } elseif (Request::submitted('defaultDate')) {
+ $date_parts = explode('-', Request::get('defaultDate'));
+ if (count($date_parts) === 3) {
+ $time->setDate($date_parts[0], $date_parts[1], $date_parts[2]);
+ }
+ }
$time = $time->add(new DateInterval('PT1H'));
$time->setTime(intval($time->format('H')), 0, 0);
$this->date->begin = $time->getTimestamp();