Skip to content

Commit

Permalink
Required additional fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Kysil authored and Roman Kysil committed Sep 13, 2024
1 parent 321ec12 commit 45301e2
Show file tree
Hide file tree
Showing 10 changed files with 240 additions and 112 deletions.
3 changes: 3 additions & 0 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ extends =
eggs +=
Products.PrintingMailHost
design.plone.ioprenoto

[versions]
docutils=0.21.2
2 changes: 1 addition & 1 deletion src/redturtle/prenotazioni/content/prenotazione.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class IPrenotazione(model.Schema):
required=False, title=_("label_booking_staff_notes", "Staff notes")
)

# Schema is defined in PrenotaizioneType ad an datagridfield, and here we save the data as an json
# Schema is defined in PrenotaizioneType as an datagridfield, and here we save the data as an json
# in base of selected type
additional_fields = schema.List(
title="Additional fields, not editable",
Expand Down
7 changes: 6 additions & 1 deletion src/redturtle/prenotazioni/content/prenotazione_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class IBookingAdditionalFieldsSchema(model.Schema):
default="",
description=_(
"booking_additional_field_name_help",
default="Identificativo del campo aggiuntivo, deve essere unico e non contenere spazi o caratteri speciali",
default="Additional field id must be unique",
),
)
label = schema.TextLine(
Expand All @@ -38,6 +38,11 @@ class IBookingAdditionalFieldsSchema(model.Schema):
required=True,
vocabulary="redturtle.prenotazioni.booking_additional_fields_types",
)
required = schema.Bool(
title=_("booking_additional_field_required", default="Required"),
required=False,
default=False,
)


class IPrenotazioneType(model.Schema):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-08-22 14:46+0000\n"
"POT-Creation-Date: 2024-09-13 10:03+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -32,7 +32,8 @@ msgid "Add"
msgstr ""

#: redturtle/prenotazioni/restapi/services/booking/add.py:213
msgid "Additional field '${additional_field_name}' value is missing."
#: redturtle/prenotazioni/restapi/services/booking/update.py:73
msgid "Additional field '${additional_field_name}' value is required."
msgstr ""

#: redturtle/prenotazioni/content/prenotazioni_folder.py:433
Expand Down Expand Up @@ -127,6 +128,7 @@ msgid "Could not send {gateway_type} message due to internal errors"
msgstr ""

#: redturtle/prenotazioni/restapi/services/booking/add.py:230
#: redturtle/prenotazioni/restapi/services/booking/update.py:90
msgid "Could not validate value for the ${field_name} due to: ${err_message}"
msgstr ""

Expand Down Expand Up @@ -164,7 +166,7 @@ msgstr ""
msgid "Email from"
msgstr ""

#: redturtle/prenotazioni/content/prenotazione.py:175
#: redturtle/prenotazioni/content/prenotazione.py:176
msgid "Expiration date booking"
msgstr ""

Expand All @@ -178,7 +180,7 @@ msgid "Friday"
msgstr ""

#: redturtle/prenotazioni/browser/templates/prenotazione.pt:107
#: redturtle/prenotazioni/content/prenotazione.py:170
#: redturtle/prenotazioni/content/prenotazione.py:171
msgid "Gate"
msgstr ""

Expand Down Expand Up @@ -357,20 +359,20 @@ msgstr ""
msgid "Select a day"
msgstr ""

#: redturtle/prenotazioni/adapters/booker.py:305
#: redturtle/prenotazioni/adapters/booker.py:301
#: redturtle/prenotazioni/restapi/services/booking/add.py:66
msgid "Sorry, this slot is not available anymore."
msgstr ""

#: redturtle/prenotazioni/adapters/booker.py:348
#: redturtle/prenotazioni/adapters/booker.py:344
msgid "Sorry, this slot is not available or does not fit your booking."
msgstr ""

#: redturtle/prenotazioni/adapters/booker.py:152
#: redturtle/prenotazioni/adapters/booker.py:151
msgid "Sorry, you can not book this slot for now."
msgstr ""

#: redturtle/prenotazioni/content/prenotazione.py:171
#: redturtle/prenotazioni/content/prenotazione.py:172
msgid "Sportello a cui presentarsi"
msgstr ""

Expand Down Expand Up @@ -462,11 +464,11 @@ msgstr ""
msgid "The phone number of the user who made the reservation."
msgstr ""

#: redturtle/prenotazioni/adapters/booker.py:397
#: redturtle/prenotazioni/adapters/booker.py:393
msgid "This day is not valid."
msgstr ""

#: redturtle/prenotazioni/adapters/booker.py:392
#: redturtle/prenotazioni/adapters/booker.py:388
msgid "This gate has some booking schedule in this time period."
msgstr ""

Expand All @@ -487,6 +489,7 @@ msgid "Uninstalls the redturtle.prenotazioni.demo add-on (demo site purpose only
msgstr ""

#: redturtle/prenotazioni/restapi/services/booking/add.py:200
#: redturtle/prenotazioni/restapi/services/booking/update.py:56
msgid "Unknown additional field '${additional_field_name}'."
msgstr ""

Expand Down Expand Up @@ -612,7 +615,7 @@ msgid "auto_confirm_manager_help"
msgstr ""

#. Default: "End date should be greater than start."
#: redturtle/prenotazioni/restapi/services/available_slots/get.py:63
#: redturtle/prenotazioni/restapi/services/available_slots/get.py:62
msgid "available_slots_wrong_dates"
msgstr ""

Expand All @@ -632,27 +635,42 @@ msgid "booked_prenotation_message"
msgstr ""

#. Default: "Descrizione"
#: redturtle/prenotazioni/content/prenotazione_type.py:21
#: redturtle/prenotazioni/content/prenotazione_type.py:32
msgid "booking_additional_field_description"
msgstr ""

#. Default: "Tipo"
#: redturtle/prenotazioni/content/prenotazione_type.py:26
msgid "booking_additional_field_type"
#. Default: "Label"
#: redturtle/prenotazioni/content/prenotazione_type.py:27
msgid "booking_additional_field_label"
msgstr ""

#. Default: "Name"
#: redturtle/prenotazioni/content/prenotazione_type.py:16
msgid "booking_additional_fieldname"
#. Default: "id"
#: redturtle/prenotazioni/content/prenotazione_type.py:18
msgid "booking_additional_field_name"
msgstr ""

#. Default: "Additional field id must be unique"
#: redturtle/prenotazioni/content/prenotazione_type.py:21
msgid "booking_additional_field_name_help"
msgstr ""

#. Default: "Required"
#: redturtle/prenotazioni/content/prenotazione_type.py:42
msgid "booking_additional_field_required"
msgstr ""

#. Default: "Tipo"
#: redturtle/prenotazioni/content/prenotazione_type.py:37
msgid "booking_additional_field_type"
msgstr ""

#. Default: "This schema is being used for the additional booking fields"
#: redturtle/prenotazioni/content/prenotazione_type.py:76
#: redturtle/prenotazioni/content/prenotazione_type.py:92
msgid "booking_additional_fields_schema_description"
msgstr ""

#. Default: "Booking additional fields schema"
#: redturtle/prenotazioni/content/prenotazione_type.py:70
#: redturtle/prenotazioni/content/prenotazione_type.py:86
msgid "booking_additional_fields_schema_title"
msgstr ""

Expand All @@ -677,12 +695,12 @@ msgid "booking_deleted_success"
msgstr ""

#. Default: "Booking detail help text"
#: redturtle/prenotazioni/content/prenotazione_type.py:62
#: redturtle/prenotazioni/content/prenotazione_type.py:78
msgid "booking_details_help_text_label"
msgstr ""

#. Default: "This field will be visualized as \"Details\" helptext during the booking steps"
#: redturtle/prenotazioni/content/prenotazione_type.py:63
#: redturtle/prenotazioni/content/prenotazione_type.py:79
msgid "booking_details_help_text_label_help"
msgstr ""

Expand All @@ -706,7 +724,7 @@ msgid "booking_refused"
msgstr ""

#. Default: "Duration value"
#: redturtle/prenotazioni/content/prenotazione_type.py:36
#: redturtle/prenotazioni/content/prenotazione_type.py:52
msgid "booking_type_duration_label"
msgstr ""

Expand All @@ -716,12 +734,12 @@ msgid "booking_type_name"
msgstr ""

#. Default: "List of requirements to recieve the service"
#: redturtle/prenotazioni/content/prenotazione_type.py:44
#: redturtle/prenotazioni/content/prenotazione_type.py:60
msgid "booking_type_requirements_help"
msgstr ""

#. Default: "Requirements"
#: redturtle/prenotazioni/content/prenotazione_type.py:43
#: redturtle/prenotazioni/content/prenotazione_type.py:59
msgid "booking_type_requirements_labled"
msgstr ""

Expand Down Expand Up @@ -929,12 +947,12 @@ msgid "delete_reservation_request"
msgstr ""

#. Default: "Unique booking code"
#: redturtle/prenotazioni/content/prenotazione.py:181
#: redturtle/prenotazioni/content/prenotazione.py:182
msgid "description_booking_code"
msgstr ""

#. Default: "If you work for a company, please specify its name."
#: redturtle/prenotazioni/content/prenotazione.py:161
#: redturtle/prenotazioni/content/prenotazione.py:162
msgid "description_company"
msgstr ""

Expand Down Expand Up @@ -1095,7 +1113,7 @@ msgid "invalid_date"
msgstr ""

#. Default: "Invalid email address"
#: redturtle/prenotazioni/content/prenotazione.py:32
#: redturtle/prenotazioni/content/prenotazione.py:33
msgid "invalid_email_address"
msgstr ""

Expand All @@ -1106,12 +1124,12 @@ msgid "invalid_end:search_date"
msgstr ""

#. Default: "Invalid fiscal code"
#: redturtle/prenotazioni/content/prenotazione.py:40
#: redturtle/prenotazioni/content/prenotazione.py:41
msgid "invalid_fiscalcode"
msgstr ""

#. Default: "Invalid phone number"
#: redturtle/prenotazioni/content/prenotazione.py:28
#: redturtle/prenotazioni/content/prenotazione.py:29
msgid "invalid_phone_number"
msgstr ""

Expand All @@ -1120,7 +1138,7 @@ msgid "invalid_time"
msgstr ""

#. Default: "This date is past"
#: redturtle/prenotazioni/content/prenotazione.py:36
#: redturtle/prenotazioni/content/prenotazione.py:37
msgid "is_not_future_date"
msgstr ""

Expand Down Expand Up @@ -1187,13 +1205,13 @@ msgstr ""

#. Default: "Staff notes"
#: redturtle/prenotazioni/browser/templates/prenotazione.pt:113
#: redturtle/prenotazioni/content/prenotazione.py:186
#: redturtle/prenotazioni/content/prenotazione.py:187
msgid "label_booking_staff_notes"
msgstr ""

#. Default: "Booking time"
#: redturtle/prenotazioni/browser/prenotazione_move.py:30
#: redturtle/prenotazioni/content/prenotazione.py:126
#: redturtle/prenotazioni/content/prenotazione.py:127
msgid "label_booking_time"
msgstr ""

Expand Down
Loading

0 comments on commit 45301e2

Please sign in to comment.