diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-02-27 17:55:26 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2025-02-27 17:55:26 +0000 |
| commit | 33abebfc9a6d4d0ea7c831a3074ce97a73d5cda3 (patch) | |
| tree | 6c5a404cf3ddc9fe14cbce805ec85bbb3f1c2df6 /app/controllers/course | |
| parent | 66b21d36cf948d33e38bfc9542334cb93dcba76c (diff) | |
fix selecting exclude self assign and blubber in statusgroups, fixes #5188
Closes #5188
Merge request studip/studip!3899
Diffstat (limited to 'app/controllers/course')
| -rw-r--r-- | app/controllers/course/statusgroups.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/app/controllers/course/statusgroups.php b/app/controllers/course/statusgroups.php index 8c5d28a..293f542 100644 --- a/app/controllers/course/statusgroups.php +++ b/app/controllers/course/statusgroups.php @@ -556,33 +556,37 @@ class Course_StatusgroupsController extends AuthenticatedController } CSRFProtection::verifyUnsafeRequest(); + /* * Check if a valid end time was given. */ - if (Request::int('selfassign', 0)) { - $endtime = strtotime(Request::get('selfassign_end', 'now')); - $starttime = strtotime(Request::get('selfassign_start', 'now')); - if ($endtime <= $starttime) { - $endtime = 0; + $selfassign = Request::int('selfassign', 0); + $start_time = 0; + $end_time = 0; + if ($selfassign) { + $end_time = strtotime(Request::get('selfassign_end', 'now')); + $start_time = strtotime(Request::get('selfassign_start', 'now')); + if ($end_time <= $start_time) { + $end_time = 0; } } $position = 1; if (Statusgruppen::exists($group_id)) { $position = Statusgruppen::find($group_id)->position; } - $selfassign = Request::int('selfassign', 0); // Exclusive entry makes sense only when selfassign is set in general. if ($selfassign !== 0) { $selfassign += Request::int('exclusive', 0); // Selfassign is not set but exclusive selfassign or some timeframe -> show warning message } else if ( Request::bool('exclusive') - || Request::get('selfassign_start') - || Request::get('selfassign_end') + || $start_time + || $end_time ) { PageLayout::postWarning(_('Einstellungen zum Eintrag in eine Gruppe oder zum Eintragszeitraum können ' . 'nur gespeichert werden, wenn der Selbsteintrag aktiviert ist.')); } + $group = Statusgruppen::createOrUpdate( $group_id, Request::get('name'), @@ -590,12 +594,8 @@ class Course_StatusgroupsController extends AuthenticatedController $this->course_id, Request::int('size', 0), $selfassign, - $selfassign - ? strtotime(Request::get('selfassign_start', 'now')) - : 0, - $selfassign && Request::get('selfassign_end') - ? strtotime(Request::get('selfassign_end')) - : 0, + $start_time, + $end_time, Request::bool('makefolder', false), Request::getArray('dates'), Request::bool('blubber', false) |
