Skip to content
Snippets Groups Projects
Commit e36aea08 authored by André Noack's avatar André Noack
Browse files

Resolve #3736 "Direkte Buchung: ausfallende Termine bei Wiederholungsbuchung...

Resolve #3736 "Direkte Buchung: ausfallende Termine bei Wiederholungsbuchung können doppelt gebucht werden"

Closes #3736

Merge request studip/studip!2601
parent 82a53e16
No related branches found
No related tags found
No related merge requests found
...@@ -930,6 +930,12 @@ class Resources extends \RESTAPI\RouteMap ...@@ -930,6 +930,12 @@ class Resources extends \RESTAPI\RouteMap
$this->halt(403, 'You do not have sufficient permissions to modify the interval!'); $this->halt(403, 'You do not have sufficient permissions to modify the interval!');
} }
if (
!$interval->takes_place
&& $resource->isAssigned(new \DateTime('@' . $interval->begin), new \DateTime('@' . $interval->end))
) {
$this->halt(409, 'Already booked');
}
//Switch the takes_place field: //Switch the takes_place field:
$interval->takes_place = $interval->takes_place ? '0' : '1'; $interval->takes_place = $interval->takes_place ? '0' : '1';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment