From fd8d498c81b7b0d6ec57d8f4d32eb0a5e1421235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Mari=C3=A9thoz?= Date: Thu, 7 Nov 2019 08:49:14 +0100 Subject: [PATCH] instance: fix several bugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixes item types type validation. * Fixes validation message for patron phone number. * Adds opening hours to the library of the 3th organisation. * Fixes document detailed view for patrons with organisation without pickup locations. Closes: #598. * Fixes import document using EAN from the BNF server. Closes: #607. * Improves logs to BNF document importation. * Fixes logged user initial user menu. * Fixes reset password links in the user email when a librarian create a patron. Closes: #608. * Forces instance jinja templates to be loaded before all other templates. Co-Authored-by: Johnny MariƩthoz --- data/libraries.json | 56 ++++++++++- rero_ils/config.py | 2 +- .../documents/document-v0.0.1.json | 2 +- .../rero_ils/detailed_view_documents.html | 4 +- rero_ils/modules/documents/views.py | 95 ++++++++++++------- rero_ils/modules/ext.py | 11 +++ .../form_patrons/patron-v0.0.1.json | 5 +- .../jsonschemas/patrons/patron-v0.0.1.json | 3 +- .../security/email/reset_instructions.html | 21 ++++ .../security/email/reset_instructions.txt | 3 + rero_ils/views.py | 22 ++--- tests/api/test_patrons_rest.py | 6 +- tests/ui/patrons/test_patrons_api.py | 2 + .../select-item-type-type.component.ts | 2 +- 14 files changed, 176 insertions(+), 58 deletions(-) create mode 100644 rero_ils/templates/security/email/reset_instructions.html create mode 100644 rero_ils/templates/security/email/reset_instructions.txt diff --git a/data/libraries.json b/data/libraries.json index 3d2a30b40b..a49272bea3 100644 --- a/data/libraries.json +++ b/data/libraries.json @@ -544,6 +544,58 @@ "name": "Biblioth\u00e8que cantonale", "organisation": { "$ref": "https://ils.rero.ch/api/organisations/3" - } + }, + "opening_hours": [ + { + "day": "monday", + "is_open": true, + "times": [ + { + "start_time": "07:00", + "end_time": "19:00" + } + ] + }, + { + "day": "tuesday", + "is_open": false, + "times": [] + }, + { + "day": "wednesday", + "is_open": false, + "times": [] + }, + { + "day": "thursday", + "is_open": true, + "times": [ + { + "start_time": "07:00", + "end_time": "19:00" + } + ] + }, + { + "day": "friday", + "is_open": false, + "times": [] + }, + { + "day": "saturday", + "is_open": false, + "times": [] + }, + { + "day": "sunday", + "is_open": true, + "times": [ + { + "start_time": "14:00", + "end_time": "18:00" + } + ] + } + ] } -] \ No newline at end of file +] diff --git a/rero_ils/config.py b/rero_ils/config.py index ff78fb48bb..359008ebf0 100644 --- a/rero_ils/config.py +++ b/rero_ils/config.py @@ -1031,7 +1031,7 @@ def _(x): RERO_ILS_APP_IMPORT_BNF_EAN = 'http://catalogue.bnf.fr/api/SRU?'\ 'version=1.2&operation=searchRetrieve'\ '&recordSchema=unimarcxchange&maximumRecords=1'\ - '&startRecord=1&query=bib.ean%%20all%%20"%s"' + '&startRecord=1&query=bib.ean all "{}"' RERO_ILS_APP_HELP_PAGE = ( 'https://github.com/rero/rero-ils/wiki/Public-demo-help' diff --git a/rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1.json index f4c880f69c..f450ef5164 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1.json @@ -562,7 +562,7 @@ "title": "Authors", "description": "Author(s) of the resource. Can be either persons or organisations.", "type": "array", - "minItems": 0, + "minItems": 1, "items": { "type": "object", "required": [ diff --git a/rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html b/rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html index 97873c3658..964980e43a 100644 --- a/rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html +++ b/rero_ils/modules/documents/templates/rero_ils/detailed_view_documents.html @@ -265,7 +265,8 @@

{{ item.call_number }} {% endif %} - {% if item|can_request %} + {% set locations = item|item_library_pickup_locations %} + {% if item|can_request and locations %}