Skip to content

Commit

Permalink
#436 initial work for forcing assignment at reservation
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed May 26, 2018
1 parent a08598f commit f469b8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/alfio/controller/ReservationController.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ public String showPaymentPage(@PathVariable("eventName") String eventName,
return redirectReservation(Optional.of(reservation), eventName, reservationId);
}

Configuration.ConfigurationPathKey forceAssignmentKey = Configuration.from(event.getOrganizationId(), event.getId(), ConfigurationKeys.FORCE_TICKET_OWNER_ASSIGNMENT_AT_RESERVATION);
boolean forceAssignment = configurationManager.getBooleanConfigValue(forceAssignmentKey, false);

List<Ticket> ticketsInReservation = ticketReservationManager.findTicketsInReservation(reservationId);
if (Boolean.TRUE.equals(isPaypalSuccess) && paypalPayerID != null && paypalPaymentId != null) {
model.addAttribute("paypalPaymentId", paypalPaymentId)
Expand All @@ -126,11 +129,11 @@ public String showPaymentPage(@PathVariable("eventName") String eventName,
.addAttribute("hmac", hmac)
.addAttribute("postponeAssignment", Boolean.TRUE.equals(postponeAssignment))
.addAttribute("invoiceRequested", Boolean.TRUE.equals(invoiceRequested))
.addAttribute("showPostpone", Boolean.TRUE.equals(postponeAssignment));
.addAttribute("showPostpone", !forceAssignment && Boolean.TRUE.equals(postponeAssignment));
} else {
model.addAttribute("paypalCheckoutConfirmation", false)
.addAttribute("postponeAssignment", false)
.addAttribute("showPostpone", ticketsInReservation.size() > 1);
.addAttribute("showPostpone", !forceAssignment && ticketsInReservation.size() > 1);
}

try {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/alfio/model/system/ConfigurationKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public enum ConfigurationKeys {
ASSIGNMENT_REMINDER_INTERVAL("How long should be the 'quiet period' (in days) between the reminders? (default: 3 days)", false, SettingCategory.GENERAL, ComponentType.TEXT, false, EnumSet.of(SYSTEM, ORGANIZATION, EVENT), true),
OPTIONAL_DATA_REMINDER_ENABLED("Send a reminder for optional data? (default: true)", false, SettingCategory.GENERAL, ComponentType.BOOLEAN, false, EnumSet.of(SYSTEM, ORGANIZATION, EVENT), true),
RESERVATION_TIMEOUT("The amount of time, in MINUTES, that the user have to complete the reservation process (default: 25 min)", false, SettingCategory.GENERAL, ComponentType.TEXT, false, EnumSet.of(SYSTEM, ORGANIZATION, EVENT), true),
FORCE_TICKET_OWNER_ASSIGNMENT_AT_RESERVATION("Force ticket owner assignment at reservation time", false, SettingCategory.GENERAL, ComponentType.BOOLEAN, false, EnumSet.of(SYSTEM, ORGANIZATION, EVENT), true),

//
MAILER_TYPE("Mailer type (if not set, default will be disabled)", false, SettingCategory.MAIL, ComponentType.TEXT, true, EnumSet.of(SYSTEM), true),//valid values: smtp | mailgun
Expand Down

0 comments on commit f469b8b

Please sign in to comment.