diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/free/ui/FreeAccessConfigurationController.java b/src/main/java/org/olat/resource/accesscontrol/provider/free/ui/FreeAccessConfigurationController.java index 03010686383fcff11353b1c4bc03b22b1ef1a864..c7223c6cdac9bf7ff4a34a668b31fd84ffef1371 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/free/ui/FreeAccessConfigurationController.java +++ b/src/main/java/org/olat/resource/accesscontrol/provider/free/ui/FreeAccessConfigurationController.java @@ -103,4 +103,17 @@ public class FreeAccessConfigurationController extends AbstractConfigurationMeth link.setValidTo(dateTo.getDate()); return link; } + + @Override + protected boolean validateFormLogic(UserRequest ureq) { + boolean allOk = super.validateFormLogic(ureq); + + if (dateFrom.getValue() != null && dateTo.getValue() != null && dateFrom.getValue().compareTo(dateTo.getValue()) > 0) { + dateTo.setErrorKey("date.error", null); + dateFrom.setErrorKey(null, null); + allOk = false; + } + + return allOk; + } } diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/paypal/ui/PaypalAccessConfigurationController.java b/src/main/java/org/olat/resource/accesscontrol/provider/paypal/ui/PaypalAccessConfigurationController.java index e99f55ec3b7d042671556ea4dd8d2075f11f60b6..5466336c4c86e5ad134294bb04fb92b58b1e1497 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/paypal/ui/PaypalAccessConfigurationController.java +++ b/src/main/java/org/olat/resource/accesscontrol/provider/paypal/ui/PaypalAccessConfigurationController.java @@ -41,6 +41,7 @@ import org.olat.resource.accesscontrol.model.PriceImpl; import org.olat.resource.accesscontrol.provider.paypal.PaypalModule; import org.olat.resource.accesscontrol.ui.AbstractConfigurationMethodController; import org.olat.resource.accesscontrol.ui.AccessConfigurationController; +import org.olat.resource.accesscontrol.ui.PriceFormat; import org.springframework.beans.factory.annotation.Autowired; /** @@ -185,17 +186,26 @@ public class PaypalAccessConfigurationController extends AbstractConfigurationMe boolean allOk = super.validateFormLogic(ureq); String priceStr = priceEl.getValue(); + Double priceDbl = 0d; + priceEl.clearError(); try { - double priceDbl = Double.parseDouble(priceStr); + priceDbl = Double.parseDouble(priceStr); if(priceDbl <= 0.0d) { priceEl.setErrorKey("price.error", null); allOk = false; - } + } } catch(Exception e) { priceEl.setErrorKey("price.error", null); allOk = false; } + + try { + PriceFormat.format(BigDecimal.valueOf(priceDbl)); + } catch (Exception e) { + priceEl.setErrorKey("price.error", null); + allOk = false; + } currencyEl.clearError(); if(!currencyEl.isOneSelected()) { @@ -203,6 +213,12 @@ public class PaypalAccessConfigurationController extends AbstractConfigurationMe allOk = false; } + if (dateFrom.getValue() != null && dateTo.getValue() != null && dateFrom.getValue().compareTo(dateTo.getValue()) > 0) { + dateTo.setErrorKey("date.error", null); + dateFrom.setErrorKey(null, null); + allOk = false; + } + return allOk; } } diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/PaypalCheckoutAccessConfigurationController.java b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/PaypalCheckoutAccessConfigurationController.java index 0bfd75e1bd73f3d8607e42510ceae499bc91dc37..11bbeed9e279854e5d5026580e576a36a84415b0 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/PaypalCheckoutAccessConfigurationController.java +++ b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/PaypalCheckoutAccessConfigurationController.java @@ -162,17 +162,26 @@ public class PaypalCheckoutAccessConfigurationController extends AbstractConfigu boolean allOk = super.validateFormLogic(ureq); String priceStr = priceEl.getValue(); + Double priceDbl = 0d; + priceEl.clearError(); try { - double priceDbl = Double.parseDouble(priceStr); + priceDbl = Double.parseDouble(priceStr); if(priceDbl <= 0.0d) { priceEl.setErrorKey("price.error", null); allOk = false; - } + } } catch(Exception e) { priceEl.setErrorKey("price.error", null); allOk = false; } + + try { + PriceFormat.format(BigDecimal.valueOf(priceDbl)); + } catch (Exception e) { + priceEl.setErrorKey("price.error", null); + allOk = false; + } currencyEl.clearError(); if(!currencyEl.isOneSelected()) { @@ -180,6 +189,11 @@ public class PaypalCheckoutAccessConfigurationController extends AbstractConfigu allOk = false; } + if (datesEl.getDate() != null && datesEl.getSecondDate() != null && datesEl.getDate().compareTo(datesEl.getSecondDate()) > 0) { + datesEl.setErrorKey("date.error", null); + allOk = false; + } + return allOk; } diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_de.properties index e14c5392e09ffc5fc23f101fd7a5d39332796af4..c6818d2064be64055c3011674e1f55431d5a2ffa 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_de.properties @@ -9,6 +9,7 @@ checkout.config.title=Paypal Checkout konfigurieren config.disabled.warning=Das PayPal Bezahlungsmodul ist f\u00FCr dieses System nicht freigeschaltet. Um Buchungen \u00FCber PayPal abwickeln zu k\u00F6nnen, nehmen Sie bitte Kontakt auf mit <a href="mailto:{0}">{0}</a>. currency=W\u00E4hrung currency.error=Fehler in der W\u00E4hrungsauswahl +date.error=Anfangsdatum kann nicht nach dem Enddatum sein delivery=Einka\u00FCfer filter.canceled=Abgebrochen filter.completed=Erfolgreich abgeschlossen @@ -36,6 +37,7 @@ paypal.transaction.amount=Preis (in Paypal) paypal.transaction.title=Paypal Transaction "{0}" paypal.transactions.empty=Keine Transaktion gefunden price=Preis +price.error=Fehler in der Preisangabe show.all=Show all status.canceled=Abgebrochenn status.error=Unerwartete Fehler diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_en.properties index de4ee5d67c9f7a384ed1e34c0431a980fefa3921..df3ff08f4673c6edcc142ec168cc973d3a99d1d7 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_en.properties @@ -9,6 +9,7 @@ checkout.config.title=Configure Paypal Checkout config.disabled.warning=The PayPal payment module is not activated for this system. To handle bookings via PayPal can you please contact <a href="mailto:{0}">{0}</a>. currency=Currency currency.error=Currency error +date.error=Start date cannot be set after the end date delivery=Buyer filter.canceled=Cancelled filter.completed=Closed successfully @@ -36,6 +37,7 @@ paypal.transaction.amount=Price (Paypal) paypal.transaction.title=Paypal Transaction "{0}" paypal.transactions.empty=No transaction found price=Price +price.error=Price error show.all=Alle anzeigen status.canceled=Cancelled status.error=Unexpected error diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_fr.properties index e308d5fea8131389bf595d26fea9c35a4d52e6c9..dd129528ad50a6d32a3c7e7b3c3705e5d968a48b 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_fr.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_fr.properties @@ -37,6 +37,7 @@ paypal.transaction.amount=Prix (Paypal) paypal.transaction.title=Transaction Paypal "{0}" paypal.transactions.empty=Pas de transactions trouv\u00E9es price=Prix +price.error=Erreur dans l'indication du prix show.all=Tout afficher status.canceled=Annul\u00E9 status.error=Erreur inattendue diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_pt_BR.properties b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_pt_BR.properties index 8e491e759e71f9be8849299dbc3f8ffa08e78160..0449c52adf6b8c5b5efbea3beadadca79a765186 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_pt_BR.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/paypalcheckout/ui/_i18n/LocalStrings_pt_BR.properties @@ -36,6 +36,7 @@ paypal.transaction.amount=Pre\u00E7o (Paypal) paypal.transaction.title=Transa\u00E7\u00E3o Paypal \u201C{0}\u201D paypal.transactions.empty=Nenhuma transa\u00E7\u00E3o encontrada price=Pre\u00E7o +price.error=Price error show.all=Mostrar tudo status.canceled=Cancelado status.error=Erro inesperado diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/TokenAccessConfigurationController.java b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/TokenAccessConfigurationController.java index 7db2cfbeb36b6d45b9f4f4b40b7c63e4f56732e3..d55fb2570f3f5bdd5040da697a96b60389cec7eb 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/TokenAccessConfigurationController.java +++ b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/TokenAccessConfigurationController.java @@ -113,6 +113,12 @@ public class TokenAccessConfigurationController extends AbstractConfigurationMet allOk = false; } + if (dateFrom.getValue() != null && dateTo.getValue() != null && dateFrom.getValue().compareTo(dateTo.getValue()) > 0) { + dateTo.setErrorKey("date.error", null); + dateFrom.setErrorKey(null, null); + allOk = false; + } + return allOk && super.validateFormLogic(ureq); } } diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_de.properties index 8ed7996db0a0f473022908e35363fd56acb81a82..0726d72811c1bc81f90f22c36191d04074fa2f3c 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_de.properties @@ -5,6 +5,6 @@ access.token.desc=Diese Ressource ist mit einem Zugangscode gesch\u00fctzt. Gebe access.button=Buchen offer.description=$org.olat.resource.accesscontrol.ui\:offer.description token.method=Zugangscode -invalid.token.format=Der Zugangscode muss aus mindestens einem Zeichen bestehen +invalid.token.format=Der Zugangscode muss aus mindestens zwei Zeichen bestehen invalid.token=Falscher Zugangscode create=$org.olat.resource.accesscontrol.ui\:create diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_en.properties index e087da449b05575a5c47a623df545514f324ba98..b108b9042ed2b4c3ee681a8077cf6918dbc57866 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_en.properties @@ -6,5 +6,5 @@ accesscontrol.token=Access code offer.description=$org.olat.resource.accesscontrol.ui\:offer.description token.method=Access code invalid.token=Wrong access code -invalid.token.format=The access code must consist of at least one symbol +invalid.token.format=The access code must consist of at least two characters create=$org.olat.resource.accesscontrol.ui\:create \ No newline at end of file diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_fr.properties index c6ec298aced8a07b7de5134d26c6c63a5ebd3f84..7b5c63dc7e4ec00beb9e6e906575e9d78452c07e 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_fr.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_fr.properties @@ -5,6 +5,6 @@ access.token.title=Ressource prot\u00E9g\u00E9e accesscontrol.token=Code d'acc\u00E8s create=$org.olat.resource.accesscontrol.ui\:create invalid.token=Code d'acc\u00E8s incorrecte -invalid.token.format=Le code d'acc\u00E8s doit contenir au moins un caract\u00E8re. +invalid.token.format=Le code d'acc\u00E8s doit contenir au moins deux caract\u00E8res. offer.description=$org.olat.resource.accesscontrol.ui\:offer.description token.method=Code d'acc\u00E8s diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_it.properties b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_it.properties index 48bc4dfb6f942f29c263a418ba7cf7d2859c6221..a64af2f9a480544ec2d53723487afdd35865638f 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_it.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_it.properties @@ -5,6 +5,6 @@ access.token.title=Risorsa protetta accesscontrol.token=Codice di accesso create=$org.olat.resource.accesscontrol.ui\:create invalid.token=Codice di accesso errato -invalid.token.format=Il codice di accesso deve contenere almeno un carattere. +invalid.token.format=Il codice di accesso deve contenere almeno due caratteri. offer.description=$org.olat.resource.accesscontrol.ui\:offer.description token.method=Codice di accesso diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_pl.properties b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_pl.properties index 7d9150798f965bdbf57b1318eb3f5aa5f4f52d6a..9dadb2a51f4e38336f9ceeda8d4bf2d707bfb6b6 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_pl.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_pl.properties @@ -2,6 +2,6 @@ accesscontrol.token=Kod dost\u0119pu create=Utw\u00F3rz invalid.token=B\u0142\u0119dny kod dost\u0119pu -invalid.token.format=Kod dost\u0119pu musi zawiera\u0107 co najmniej jeden znak +invalid.token.format=Kod dost\u0119pu musi zawiera\u0107 co najmniej dwa znaki. offer.description=Opis token.method=Kod dost\u0119pu diff --git a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_pt_BR.properties b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_pt_BR.properties index da27773b7c92a14db232db174049981bbdb683f1..d5c51c505fc16075f204398cd1f7381999bdd0ba 100644 --- a/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_pt_BR.properties +++ b/src/main/java/org/olat/resource/accesscontrol/provider/token/ui/_i18n/LocalStrings_pt_BR.properties @@ -5,6 +5,6 @@ access.token.title=Conte\u00FAdo protegido accesscontrol.token=C\u00F3digo de acesso create=$org.olat.resource.accesscontrol.ui\:create invalid.token=C\u00F3digo de acesso errado -invalid.token.format=O c\u00F3digo de acesso deve ter pelo menos um s\u00EDmbolo +invalid.token.format=O c\u00F3digo de acesso deve ter pelo menos dois caracteres. offer.description=$org.olat.resource.accesscontrol.ui\:offer.description token.method=C\u00F3digo de acesso diff --git a/src/main/java/org/olat/resource/accesscontrol/ui/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/resource/accesscontrol/ui/_i18n/LocalStrings_de.properties index a9fdeaf9c92a6def4dcba2b99523033e06015337..45ff7203382ce1356075701740b6b6b0ca88eefb 100644 --- a/src/main/java/org/olat/resource/accesscontrol/ui/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/resource/accesscontrol/ui/_i18n/LocalStrings_de.properties @@ -42,6 +42,7 @@ cmd.title=Zugangskontrolle confirmation.email=Best\u00E4tigungsemail f\u00FCr selbst eingetragene Benutzer course.closed=$org.olat.course.run\:course.closed create=Erstellen +date.error=Anfangsdatum kann nicht nach dem Enddatum sein from=Von\: from.hint=Bis zum eingetragenen Datum bedeutet, bis zum Ende des gew\u00E4hlten Tages um 23:59:59 Uhr. info.membership.deleted=Der Benutzer wurde erfolgreich aus der Liste entfernt. diff --git a/src/main/java/org/olat/resource/accesscontrol/ui/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/resource/accesscontrol/ui/_i18n/LocalStrings_en.properties index f0be1239b7f88eaa3d8e3867cbae1879f2a95f8f..d00aff49e98579d00982e3706758517f2a5deab0 100644 --- a/src/main/java/org/olat/resource/accesscontrol/ui/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/resource/accesscontrol/ui/_i18n/LocalStrings_en.properties @@ -37,6 +37,7 @@ admin.desc=Here you can define if the access control mechanism for learning reso admin.menu.title=Access control admin.menu.title.alt=$\:admin.title admin.title=Access control and booking methods administration +date.error=Start date cannot be set after the end date