diff options
| author | Thomas Hackl <hackl@data-quest.de> | 2023-02-24 15:13:20 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2023-02-24 15:13:20 +0000 |
| commit | cbc298a53b58ae504f1dd23238a2eadd648e8050 (patch) | |
| tree | 376ceee29c3ab2f40e3279cf2750679458a26f36 /app/controllers/course/statusgroups.php | |
| parent | b4cddd0fb667295b83a34684f540df0b87dd8d39 (diff) | |
Resolve "Selbsteintrag in Gruppen wird nicht richtig gespeichert"
Closes #2211
Merge request studip/studip!1442
Diffstat (limited to 'app/controllers/course/statusgroups.php')
| -rw-r--r-- | app/controllers/course/statusgroups.php | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/app/controllers/course/statusgroups.php b/app/controllers/course/statusgroups.php index 9d40b8f..5e09f51 100644 --- a/app/controllers/course/statusgroups.php +++ b/app/controllers/course/statusgroups.php @@ -513,14 +513,29 @@ class Course_StatusgroupsController extends AuthenticatedController } } $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::int('exclusive', 0) !== 0 + || Request::get('selfassign_start', null) !== null + || Request::get('selfassign_end', null) !== null) { + 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'), $position, $this->course_id, Request::int('size', 0), - Request::int('selfassign', 0) + Request::int('exclusive', 0), - strtotime(Request::get('selfassign_start', 'now')), - Request::get('selfassign_end') ? strtotime(Request::get('selfassign_end')) : 0, + $selfassign, + Request::int('selfassign', 0) !== 0 + ? strtotime(Request::get('selfassign_start', 'now')) + : 0, + Request::int('selfassign', 0) && Request::get('selfassign_end') + ? strtotime(Request::get('selfassign_end')) + : 0, Request::int('makefolder', 0), Request::getArray('dates') ); |
