mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-21 15:54:22 +01:00
(bug) admin can't move/cancel event reservation
This commit is contained in:
parent
507420f96c
commit
e3b62df7d4
@ -1,6 +1,7 @@
|
|||||||
# Changelog Fab-manager
|
# Changelog Fab-manager
|
||||||
|
|
||||||
- Script to download translations from Crowdin
|
- Script to download translations from Crowdin
|
||||||
|
- Fix a bug: admin and managers can't cancel or move event reservations
|
||||||
|
|
||||||
## v5.4.17 2022 September 06
|
## v5.4.17 2022 September 06
|
||||||
|
|
||||||
|
@ -483,6 +483,8 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', '
|
|||||||
* @param reservation {Reservation}
|
* @param reservation {Reservation}
|
||||||
*/
|
*/
|
||||||
$scope.reservationCanModify = function (reservation) {
|
$scope.reservationCanModify = function (reservation) {
|
||||||
|
if (AuthService.isAuthorized(['admin', 'manager'])) return true;
|
||||||
|
|
||||||
const slotStart = moment(reservation.slots_reservations_attributes[0].slot_attributes.start_at);
|
const slotStart = moment(reservation.slots_reservations_attributes[0].slot_attributes.start_at);
|
||||||
const now = moment();
|
const now = moment();
|
||||||
|
|
||||||
@ -498,6 +500,8 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', '
|
|||||||
* @param reservation {Reservation}
|
* @param reservation {Reservation}
|
||||||
*/
|
*/
|
||||||
$scope.reservationCanCancel = function(reservation) {
|
$scope.reservationCanCancel = function(reservation) {
|
||||||
|
if (AuthService.isAuthorized(['admin', 'manager'])) return true;
|
||||||
|
|
||||||
const slotStart = moment(reservation.slots_reservations_attributes[0].slot_attributes.start_at);
|
const slotStart = moment(reservation.slots_reservations_attributes[0].slot_attributes.start_at);
|
||||||
const now = moment();
|
const now = moment();
|
||||||
return $scope.enableBookingCancel && slotStart.diff(now, "hours") >= $scope.cancelBookingDelay;
|
return $scope.enableBookingCancel && slotStart.diff(now, "hours") >= $scope.cancelBookingDelay;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user