Skip to content

Commit

Permalink
location: restrict library pickup location to one.
Browse files Browse the repository at this point in the history
This commit adds check to limit to only one pickup location for a library.

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
  • Loading branch information
zannkukai committed May 7, 2020
1 parent c7d118d commit 7c2cf20
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 188 deletions.
Expand Up @@ -58,7 +58,22 @@
"title": "Is pickup location",
"type": "boolean",
"default": false,
"description": "Qualify this location as a pickup location."
"description": "Qualify this location as a pickup location.",
"form": {
"validation": {
"validators": {
"valueAlreadyExists": {
"limitToValues": [
true
],
"filter": "'library.pid:' + model.library.pid"
}
},
"messages": {
"alreadyTakenMessage": "There is already one pickup location in this library."
}
}
}
},
"is_online": {
"title": "Is online location",
Expand Down
43 changes: 20 additions & 23 deletions rero_ils/translations/ar/LC_MESSAGES/messages.po
Expand Up @@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: rero-ils 0.7.0\n"
"Report-Msgid-Bugs-To: software@rero.ch\n"
"POT-Creation-Date: 2020-05-05 08:25+0200\n"
"POT-Creation-Date: 2020-05-06 16:32+0200\n"
"PO-Revision-Date: 2018-09-03 13:16+0000\n"
"Last-Translator: Aly Badr <aly.badr@rero.ch>, 2020\n"
"Language: ar\n"
Expand Down Expand Up @@ -365,9 +365,8 @@ msgstr "المبلغ المخصص لحساب التزويد"
#: rero_ils/modules/acq_invoices/jsonschemas/acq_invoices/acq_invoice-v0.0.1.json:283
#: rero_ils/modules/acq_orders/jsonschemas/acq_orders/acq_order-v0.0.1.json:203
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:49
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:56
#: rero_ils/modules/libraries/jsonschemas/libraries/library-v0.0.1.json:4
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:106
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:121
#: rero_ils/modules/patron_transaction_events/jsonschemas/patron_transaction_events/patron_transaction_event-v0.0.1.json:61
#: rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json:161
#: rero_ils/modules/patrons/templates/rero_ils/patron_profile.html:108
Expand All @@ -378,7 +377,7 @@ msgstr "مكتبة"
#: rero_ils/modules/acq_invoices/jsonschemas/acq_invoices/acq_invoice-v0.0.1.json:287
#: rero_ils/modules/acq_orders/jsonschemas/acq_orders/acq_order-v0.0.1.json:207
#: rero_ils/modules/circ_policies/jsonschemas/circ_policies/circ_policy-v0.0.1.json:122
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:110
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:125
#: rero_ils/modules/patron_transaction_events/jsonschemas/patron_transaction_events/patron_transaction_event-v0.0.1.json:65
#: rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json:169
msgid "Library URI"
Expand Down Expand Up @@ -446,7 +445,6 @@ msgstr "URI لحساب التزويد"
#: rero_ils/modules/acq_order_lines/jsonschemas/acq_order_lines/acq_order_line-v0.0.1.json:147
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:43
#: rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json:78
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:45
msgid "Document"
msgstr "المستند"

Expand Down Expand Up @@ -914,21 +912,21 @@ msgid "Item type URI"
msgstr "URI لتصنيف النسخة"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:276
#: rero_ils/modules/documents/views.py:362
#: rero_ils/modules/documents/views.py:363
msgid "available"
msgstr "متاح"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:276
#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:278
#: rero_ils/modules/documents/views.py:364
#: rero_ils/modules/documents/views.py:365
msgid "not available"
msgstr "غيرمتاح"

#: rero_ils/modules/documents/views.py:371 rero_ils/modules/items/views.py:133
#: rero_ils/modules/documents/views.py:372 rero_ils/modules/items/views.py:133
msgid "due until"
msgstr "مستحق الى"

#: rero_ils/modules/documents/views.py:373
#: rero_ils/modules/documents/views.py:374
msgid "requested"
msgstr "مطلوب"

Expand Down Expand Up @@ -966,7 +964,6 @@ msgstr "PID المستند"
#: rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1_src.json:781
#: rero_ils/modules/holdings/jsonschemas/holdings/holding-v0.0.1.json:113
#: rero_ils/modules/item_types/jsonschemas/item_types/item_type-v0.0.1.json:58
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:43
#: rero_ils/modules/patron_transaction_events/jsonschemas/patron_transaction_events/patron_transaction_event-v0.0.1.json:48
msgid "Type"
msgstr "تصنيف"
Expand Down Expand Up @@ -6412,15 +6409,15 @@ msgstr "النسخ"
msgid "item"
msgstr "النسخة"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:336
#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:331
msgid "Request"
msgstr "طلب"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:341
#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:336
msgid "Select a Pickup Location"
msgstr "اختيار مكان الإستلام"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:370
#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:365
msgid "Export Formats"
msgstr "تنسيقات التصدير"

Expand All @@ -6445,7 +6442,6 @@ msgstr ""
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:40
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:72
#: rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json:56
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:40
msgid "Call number"
msgstr "رقم استدعاء"

Expand All @@ -6460,7 +6456,6 @@ msgstr ""
#: rero_ils/modules/holdings/jsonschemas/holdings/holding-v0.0.1.json:60
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:50
#: rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json:61
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:52
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:4
msgid "Location"
msgstr "مكان"
Expand Down Expand Up @@ -6602,7 +6597,6 @@ msgstr "نوع الاعارة"
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:55
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:78
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:80
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:60
msgid "Availability"
msgstr "الإتاحة"

Expand All @@ -6618,7 +6612,6 @@ msgstr "ID"

#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:73
#: rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json:37
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:32
#: rero_ils/modules/patrons/templates/rero_ils/_patron_profile_personal.html:23
msgid "Barcode"
msgstr "باركود"
Expand Down Expand Up @@ -6940,27 +6933,31 @@ msgstr "هل مكان إستلام"
msgid "Qualify this location as a pickup location."
msgstr "تحديد المكان كمكان إستلام"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:64
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:73
msgid "There is already one pickup location in this library."
msgstr ""

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:79
msgid "Is online location"
msgstr "هل مكان مباشر"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:67
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:82
msgid "Qualify this location as an online location."
msgstr "تحديد المكان كمكان مباشر"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:79
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:94
msgid "There is already one online location in this library."
msgstr "يوجد مكان مباشر آخر في هذه المكتبة"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:85
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:100
msgid "Pickup location name"
msgstr "إسم مكان الإستلام"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:87
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:102
msgid "Displayed pickup location name, if different from the location name."
msgstr "إسم مكان الإستلام إذا كان مختلف عن إسم المكان."

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:100
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:115
msgid "The pickup location name is already taken."
msgstr "اسم مكان الإستلام محجوز"

Expand Down
43 changes: 20 additions & 23 deletions rero_ils/translations/de/LC_MESSAGES/messages.po
Expand Up @@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: rero-ils 0.7.0\n"
"Report-Msgid-Bugs-To: software@rero.ch\n"
"POT-Creation-Date: 2020-05-05 08:25+0200\n"
"POT-Creation-Date: 2020-05-06 16:32+0200\n"
"PO-Revision-Date: 2018-09-03 13:16+0000\n"
"Last-Translator: Peter Weber <peter.weber@rero.ch>, 2020\n"
"Language: de\n"
Expand Down Expand Up @@ -370,9 +370,8 @@ msgstr "Zugewiesener Betrag"
#: rero_ils/modules/acq_invoices/jsonschemas/acq_invoices/acq_invoice-v0.0.1.json:283
#: rero_ils/modules/acq_orders/jsonschemas/acq_orders/acq_order-v0.0.1.json:203
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:49
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:56
#: rero_ils/modules/libraries/jsonschemas/libraries/library-v0.0.1.json:4
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:106
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:121
#: rero_ils/modules/patron_transaction_events/jsonschemas/patron_transaction_events/patron_transaction_event-v0.0.1.json:61
#: rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json:161
#: rero_ils/modules/patrons/templates/rero_ils/patron_profile.html:108
Expand All @@ -383,7 +382,7 @@ msgstr "Bibliothek"
#: rero_ils/modules/acq_invoices/jsonschemas/acq_invoices/acq_invoice-v0.0.1.json:287
#: rero_ils/modules/acq_orders/jsonschemas/acq_orders/acq_order-v0.0.1.json:207
#: rero_ils/modules/circ_policies/jsonschemas/circ_policies/circ_policy-v0.0.1.json:122
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:110
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:125
#: rero_ils/modules/patron_transaction_events/jsonschemas/patron_transaction_events/patron_transaction_event-v0.0.1.json:65
#: rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json:169
msgid "Library URI"
Expand Down Expand Up @@ -451,7 +450,6 @@ msgstr "URI des Kontos"
#: rero_ils/modules/acq_order_lines/jsonschemas/acq_order_lines/acq_order_line-v0.0.1.json:147
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:43
#: rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json:78
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:45
msgid "Document"
msgstr "Dokument"

Expand Down Expand Up @@ -921,21 +919,21 @@ msgid "Item type URI"
msgstr "URI des Exemplartypen"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:276
#: rero_ils/modules/documents/views.py:362
#: rero_ils/modules/documents/views.py:363
msgid "available"
msgstr "verfügbar"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:276
#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:278
#: rero_ils/modules/documents/views.py:364
#: rero_ils/modules/documents/views.py:365
msgid "not available"
msgstr "nicht verfügbar"

#: rero_ils/modules/documents/views.py:371 rero_ils/modules/items/views.py:133
#: rero_ils/modules/documents/views.py:372 rero_ils/modules/items/views.py:133
msgid "due until"
msgstr "Fällig am"

#: rero_ils/modules/documents/views.py:373
#: rero_ils/modules/documents/views.py:374
msgid "requested"
msgstr "Bestellt"

Expand Down Expand Up @@ -973,7 +971,6 @@ msgstr "PID des Dokuments"
#: rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1_src.json:781
#: rero_ils/modules/holdings/jsonschemas/holdings/holding-v0.0.1.json:113
#: rero_ils/modules/item_types/jsonschemas/item_types/item_type-v0.0.1.json:58
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:43
#: rero_ils/modules/patron_transaction_events/jsonschemas/patron_transaction_events/patron_transaction_event-v0.0.1.json:48
msgid "Type"
msgstr "Typ"
Expand Down Expand Up @@ -6434,15 +6431,15 @@ msgstr "Exemplare"
msgid "item"
msgstr "Exemplar"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:336
#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:331
msgid "Request"
msgstr "Bestellung"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:341
#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:336
msgid "Select a Pickup Location"
msgstr "Abholort wählen"

#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:370
#: rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html:365
msgid "Export Formats"
msgstr "Exportformate"

Expand All @@ -6467,7 +6464,6 @@ msgstr "Permanenter Identifikator"
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:40
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:72
#: rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json:56
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:40
msgid "Call number"
msgstr "Signatur"

Expand All @@ -6482,7 +6478,6 @@ msgstr "URI der Ausleihkategorie"
#: rero_ils/modules/holdings/jsonschemas/holdings/holding-v0.0.1.json:60
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:50
#: rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json:61
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:52
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:4
msgid "Location"
msgstr "Standort"
Expand Down Expand Up @@ -6639,7 +6634,6 @@ msgstr "Ausleihkategorie"
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:55
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:78
#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:80
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:60
msgid "Availability"
msgstr "Verfügbarkeit"

Expand All @@ -6655,7 +6649,6 @@ msgstr "ID"

#: rero_ils/modules/holdings/templates/rero_ils/detailed_view_holdings.html:73
#: rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json:37
#: rero_ils/modules/items/templates/rero_ils/detailed_view_items.html:32
#: rero_ils/modules/patrons/templates/rero_ils/_patron_profile_personal.html:23
msgid "Barcode"
msgstr "Strichcode"
Expand Down Expand Up @@ -6979,29 +6972,33 @@ msgstr "Ist Abholort"
msgid "Qualify this location as a pickup location."
msgstr "Diesen Standort als Abholort definieren"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:64
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:73
msgid "There is already one pickup location in this library."
msgstr ""

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:79
msgid "Is online location"
msgstr "Ist Online-Standort"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:67
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:82
msgid "Qualify this location as an online location."
msgstr "Diesen Standort als Online-Standort definieren"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:79
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:94
msgid "There is already one online location in this library."
msgstr "Es gibt bereits einen Online-Standort für diese Bibliothek."

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:85
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:100
msgid "Pickup location name"
msgstr "Abholortname"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:87
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:102
msgid "Displayed pickup location name, if different from the location name."
msgstr ""
"Angezeigter Name des Abholortes, falls vom Namen des Standortes "
"unterschiedlich"

#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:100
#: rero_ils/modules/locations/jsonschemas/locations/location-v0.0.1.json:115
msgid "The pickup location name is already taken."
msgstr "Der Name des Abhole-Standortes ist bereits vergeben."

Expand Down

0 comments on commit 7c2cf20

Please sign in to comment.