Bug 23843: Add mapping to Koha::Acquisition::Bookseller
This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/items.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/libraries.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/clubs_holds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/checkouts.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Now that we use ->to_api all the object attributes are returned, so the
original tests that didn't follow the FKs would pass, and now they
don't. If there is no budget linked to the fund, it will return undef,
which is not accepted on the API (though it accepts not returning the
attribute).
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch introduces full test coverage for the EmbedItems filter.
To test:
1. Apply this patchset
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Filter/EmbedItems.t
=> SUCCESS: Tests pass!
3. Sign off :-D
4. Use it to improve Koha!
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Wed, 16 Oct 2019 07:13:20 +0000 (09:13 +0200)]
Bug 22445: Replace %% with {}
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Tue, 22 Oct 2019 13:58:52 +0000 (14:58 +0100)]
Bug 22445: Add new pattern %normalized_isbn%
Quite bad to use C4::Koha from Koha::Biblio :-/
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Owen Leonard [Mon, 18 Mar 2019 17:44:30 +0000 (17:44 +0000)]
Bug 22445: (follow-up) Use CSS to set a max-width for images - Staff client
This patch adds some CSS and markup to staff client templates so that
custom cover images have a maximum width of 140px (to match the width of
generated local cover image thumbnails). This prevents oversized images
from displaying inconsistently compared to images from other services.
This patch also adds a missing </a> to fix display problems.
To test, apply the patch and regenerate the staff client CSS. Post an
oversized image which corresponds to a record in your catalog.
View the following pages to confirm that the image displays well:
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Tue, 22 Oct 2019 13:58:29 +0000 (14:58 +0100)]
Bug 22445: (follow-up) Use CSS to set a max-width for images - OPAC
This patch adds some CSS and markup to OPAC templates so that custom
cover images have a maximum width of 140px (to match the width of
generated local cover image thumbnails). This prevents oversized images
from displaying inconsistently compared to images from other services.
To test, apply the patch and regenerate the OPAC CSS. Post an oversized
image which corresponds to a record in your OPAC which can be added to a
user's checkouts and to a list.
View the following pages to confirm that the image displays well:
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Test plan:
Search for bibliographic records, the custom covers should be displayed.
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Thu, 28 Feb 2019 22:11:19 +0000 (19:11 -0300)]
Bug 22445: Custom cover images - detail (staff)
Test plan:
Staff side now, go the detail page of a bibliographic record
You should see the cover image.
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Tue, 22 Oct 2019 13:58:00 +0000 (14:58 +0100)]
Bug 22445: Custom cover images - opac user (checkout list)
Test plan:
- Check an item out to a patron
- At the OPAC loggin as this patron
On the checkout list you should see the cover image.
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Test plan:
Same as previous patch, then click on the feeds link
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Thu, 28 Feb 2019 21:55:38 +0000 (18:55 -0300)]
Bug 22445: Custom cover images - opac reviews
Test plan:
- enable OpacShowRecentComments
- make a comment (OPAC)
- approve it (staff)
- click 'Recent comments' (OPAC)
=> You should see the custom cover
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Thu, 28 Feb 2019 21:50:21 +0000 (18:50 -0300)]
Bug 22445: Custom cover images - opac shelves
Test plan:
Add a bibliographic record (that has a custom image) to a shelf,
view the shelf (OPAC).
You should see the image.
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Thu, 28 Feb 2019 21:39:59 +0000 (18:39 -0300)]
Bug 22445: Custom cover images - opac result (rss)
This cannot be tested, it seems that the template is broken.
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Fri, 1 Mar 2019 11:01:28 +0000 (08:01 -0300)]
Bug 22445: Custom cover images - opac detail
Test plan:
Go to the bibliographic record detail page at the OPAC, you should see
the custom cover image.
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Fri, 1 Mar 2019 11:01:05 +0000 (08:01 -0300)]
Bug 22445: Custom cover images - opac results
Test plan:
Search for bibliographic records at the OPAC, the custom cover should be
displayed
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Test plan:
Go to the detail page of a bibliographic record (at the OPAC)
and confirm the at custom cover images are displayed in the shelf
browser
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Tue, 22 Oct 2019 13:56:40 +0000 (14:56 +0100)]
Bug 22445: Allow marc fields as pattern
%tag$field%
There is a limitation here, only one replacement will work.
Let see if it is needed later to support several patterns
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Tue, 22 Oct 2019 13:56:25 +0000 (14:56 +0100)]
Bug 22445: Add tests for Koha::Biblio->custom_cover_image_url
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Fri, 1 Mar 2019 11:00:53 +0000 (08:00 -0300)]
Bug 22445: Add new method Koha::Biblio->custom_cover_image_url
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Fri, 1 Mar 2019 11:00:02 +0000 (08:00 -0300)]
Bug 22445: Add new prefs *CustomCoverImages*
This patch set adds a new method to display cover images for
bibliographic records.
The idea is to provide a flexible way allowing several use cases:
- local path
- remote url
- webservice
which would follow a given pattern.
So far only the following patterns are available:
- {isbn} will be replaced byt the isbn of the record
- {issn}
- using MARC subfields:
{024$a} to replace with the value in 024$a
(Note that the selector has been changed from %% to {} in a coming
patch)
For example
- /your/local/images/{isbn}.png
- https://covers.openlibrary.org/b/isbn/{isbn}-M.jpb
- etc.
There are 3 new sysprefs:
CustomCoverImagesURL
=> Define the path/url
CustomCoverImages
=> Turn on/off the display of the custom cover image in the staff client
OPACCustomCoverImages
=> Turn on/off the display of the custom cover image at the OPAC
Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Marcel de Rooy [Tue, 22 Oct 2019 12:29:40 +0000 (12:29 +0000)]
Bug 23867: Resolve "truncated incorrect double" for empty string
Updatedatabase, rev. 18.12.00.051
Solved by testing the value of the pref first.
Tested by copying the change in a new atomic update with XXX.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch aims to prove the behaviour does not differ. So you can run
the tests for the endpoints, and the behaviour remains.
The mappings and methods cannot be removed until $c->objects->search is
fixed to make use of them as well. That will happen once all used
Koha::Object-based classes implement the mappings.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/cities.t
=> SUCCESS: Tests pass!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 23770: (follow-up) Add tests for Koha::Objects->TO_JSON
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch introduces tests for the new to_api method introduced in
Koha::Object(s).
It uses Koha::City as a sample for simplicity. And it also uses
Koha::Illrequests to test the case in which there's no to_api_mapping
method defined on the class, to highlight that a fallback to calling
TO_JSON is done. [1]
[1] This is done under the assumption Illrequests controller code
doesn't use any kind of mapping as the rest of the API controllers do,
so there's little chance it would be added in a future.
To test:
1. Apply this patchset
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Object.t \
t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 23770: Add to_api_mapping method to Koha::City
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Generic method that changes the attribute names of an object in the
presence of the to_api_mapping method. It otherwise falls back to
returning the TO_JSON output.
This is WIP submitted early for scrutiny. Tests and example usage in an
API controller coming.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 23346: Add without-db-name parameter to koha-dump
Test plan:
Run koha-dump [yourdb]. Rename the files in var/spool/koha/[yourdb]
Run koha-dump --without-db-name [yourdb]
Run a diff between the unzipped sql files. The last dump should not
contain a CREATE DATABASE and USE statement. See BZ 15664 c4.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Julian Maurice [Tue, 14 May 2019 14:42:24 +0000 (16:42 +0200)]
Bug 22922: Allow to modify hold dates on reserve/request.pl
Test plan:
1. Place some holds
2. Go to the 'Holds' tab of the biblio record
3. Modify dates in the table and click on 'Update holds' button
4. Verify that dates have been correctly updated
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Owen Leonard [Thu, 17 Oct 2019 15:12:46 +0000 (15:12 +0000)]
Bug 23791: (follow-up) Add missing CSS changes
This patch adds OPAC CSS changes which were missing from the original
patch. It also adds a missing title attribute to the Twitter link.
To test, apply the patch and regenerate the OPAC SCSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
Follow the previous test plan.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Owen Leonard [Fri, 11 Oct 2019 18:32:19 +0000 (18:32 +0000)]
Bug 23791: Allow granular control of social networks enabled by SocialNetworks syspref
This patch updates the SocialNetworks system preference so that it
offers a choice of social networks (and email) which can be enabled in
the OPAC.
This patch also replaces the social network images with Font Awesome
icons styled so that the colors match the social networks' current
branding. The old social networks sprite image is removed.
To test, apply the patch and run the database update. Rebuild the OPAC
CSS:
https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client
- Go to Administration -> Global system preferences -> OPAC -> Features
and find the SocialNetworks preference.
- If your SocialNetworks preference was enabled, all choices should
be selected. Otherwise none should be selected.
- If none are selected, select them all and save.
- Locate a record in the OPAC and view the details page.
- The social network icons should appear as expected and function as
before.
- Return to system preferences in the staff client and try enabling and
disabling different options, verifying each time that the OPAC
reflects your choices.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Thu, 17 Oct 2019 16:28:15 +0000 (17:28 +0100)]
Bug 20086: (follow-up) No need to call ->new on Koha::Database
We should use the existing pattern of calling schema directly on
Koha::Database rather than creating a new object.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nick [Thu, 17 Oct 2019 14:31:27 +0000 (14:31 +0000)]
Bug 20086: Execute AddRenewal in a transaction to avoid partial success and doubled fines
This patch starts a transaction and only commits if renewal and fines
updates and charges are successful (partial in any cna be problematic)
There is no feedback (as currently there is none either) but if part
fails, all fails.
I didn't include stats and notifications in the transaction, but we
could. (Edit JD: not true, they are included)
To test:
1 - Apply patch
2 - prove t/db_dependent/Circulation.t
3 - Attempt circs and renewals should be no difference
4 - If possible make part of transaction fail and ensure all fails
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended: commit title and one indendation (return statement) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Magnus Enger [Mon, 30 Sep 2019 13:01:35 +0000 (15:01 +0200)]
Bug 23700: Fix output of koha-plack --restart
To test:
- Run "sudo koha-plack restart kohadev" and verify the output is
out of line.
- Apply the patch
- If you are on e.g. kohadevbox you need to copy koha-plack to
/usr/sbin/ thus:
sudo cp debian/scripts/koha-plack /usr/sbin/koha-plack
- Run "sudo koha-plack restart kohadev" again and check that you
get two lines of output, nicely aligned with the "OK" inside the
square brackets.
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Marcel de Rooy [Fri, 18 Oct 2019 12:34:43 +0000 (12:34 +0000)]
Bug 23712: (QA follow-up) Silence two other warns too
Caused by undefined method:
Use of uninitialized value in concatenation (.) or string at /usr/share/koha/Koha/Illrequest.pm line 857.
Use of uninitialized value in concatenation (.) or string at /usr/share/koha/Koha/Illrequest.pm line 859.
Test plan:
Run test again
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Magnus Enger [Tue, 1 Oct 2019 14:41:31 +0000 (16:41 +0200)]
Bug 23712: Silence warns from Koha/Illrequest/Logger.pm
To test:
- Run: $ sudo koha-shell -c "prove t/db_dependent/Illrequests.t" kohadev
- Observe the warnings about "no query in themelanguage"
- Apply the patch
- Run prove again
- Observe the lack of warnings about "no query in themelanguage"
(There will be a couple of other warnings, but they are not
related to the present bug.)
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch introduces tests for the Koha::Item->as_marc_field method. It
tries to cover all the use cases.
To test:
1. Apply this patchset
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS; Tests pass!
3. Sign off :-D
Signed-off-by: Jan Kolator <kolatorj@email.cz> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jan Kolator <kolatorj@email.cz> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Julian Maurice [Thu, 3 Oct 2019 15:34:56 +0000 (17:34 +0200)]
Bug 20434: Add missing fields
018 - [Reserved for other International Standard Numbers]
033 - Other System Persistent Record Identifier
183 - Coded Data Field: Type of Carrier
203 - Content Form and Media Type
231 - Digital File Characteristics
283 - Carrier Type
338 - Funding Information Note
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Julian Maurice [Wed, 2 Oct 2019 11:45:32 +0000 (13:45 +0200)]
Bug 20434: Update UNIMARC framework - script
Test plan:
1. Take a look at files in misc/migration_tools/ifla/data. It
contains all data that will be inserted into Koha. Its content is
based on the previous patches.
2. Run the script misc/migration_tools/ifla/update.pl and verify
that it effectively added the new fields, subfields, authorised
values and authority types.
3. Run the script again and see that it doesn't update existing fields
4. Run with --force and verify that it update existing fields (you can
modify unimarc_ifla.yml to see changes)
5. Run with --force --po-file misc/migration_tools/ifla/language/fr.po
and verify that the labels are now in french
There is a POT file in misc/migration_tools/ifla/language/template.pot,
use it to create PO files for other languages.
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Aleisha Amohia [Fri, 9 Aug 2019 03:34:45 +0000 (03:34 +0000)]
Bug 23435: Add multiple copies of an item when receiving in serials
This feature allows you to add multiple item records when receiving a
serial, if the subscription is set to 'create item record when receiving
serials'. Please note this is not the same as multi-receiving, more like
multi-adding!
To test:
1) Create a subscription, ensure the 'Create an item record when
receiving this serial' option is selected
2) Receive a serial
3) Expand the item form by selecting 'click to add item'
4) Fill in details, including a barcode. Leave 'number of copies' as 1
and Save.
5) Confirm the serial is received as expected.
6) In another tab, open the bibliographic record attached to this
subscription
7) Confirm the item record was created upon receiving the serial
8) Go back to the serial collection and receive next serial
9) Expand the item form by selecting 'click to add item'
10) Fill in details again, this time change 'number of copies' to a
different number e.g. 3, and Save
11) Confirm the serial is received as expected.
12) Check back at the biblio record that 3 item records were created and
the barcode was incremented for each additional item.
Sponsored-by: Brimbank City Council Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Wed, 16 Oct 2019 15:21:46 +0000 (16:21 +0100)]
Bug 23826: Correction for missing "F" -> "OVERDUE" change
When replacing F and FU with 'OVERDUE' + status in bug 22521 I missed
the cases inside the maninvoice template. This patch should correct
that mistake.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Wed, 16 Oct 2019 10:25:42 +0000 (12:25 +0200)]
Bug 23821: Remove new occurrence of create_helper_biblio
create_helper_biblio subroutines have been remove from bug 21798, but
one occurrence have been reintroduced by bug 7614. We must use
build_sample_biblio instead.
Test plan:
prove t/db_dependent/Koha/Libraries.t
should return green.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Owen Leonard [Tue, 15 Oct 2019 17:28:13 +0000 (17:28 +0000)]
Bug 23704: Typo in itemtypes.tt
This patch corrects a typo:
"for loans specifie in hours."
corrected to "for loans specified in hours."
To test, apply the patch and edit an existing item type. The description
of the "Hourly rental charge" field should be correct.
Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nick Clemens [Thu, 6 Jun 2019 19:18:19 +0000 (19:18 +0000)]
Bug 8260: user rank order instead of absolute rank to set dropdowns on routing.pl
When deleting a borrower on a routing list we leave a gap in the numbering. It appears to only be a problem when viewing
or editing the list in the staff client.
Rather than use the rank in the DB to set the values, we use the implicit order
To test:
1 - Create a subscription (or find one)
2 - Add a routing list
3 - Add five patrons
4 - Delete the patron who is third in the list
5 - Edit the routing list
6 - Note the priority for the last patron is 1
7 - Apply patch
8 - Reload the page
9 - Values look correct
10 - Confirm reordering works as expected
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Fri, 11 Oct 2019 13:18:58 +0000 (14:18 +0100)]
Bug 23804: Correctly catch remote itemtype images
Bug 20216 missed the mark and although it did start display a URL for
the itemtype image in use, it was not limited to remote urls and as such
broke the checked handling for displaying which local image was
selected.
Test plan:
1) Select a local image for an itemtype.
2) Check the correct image is displayed in the admin table.
3) Edit the itemtype checking that the correct image is checked.
4) Change to a remote image for the itemtype
5) Check the correct image is displayed in the admin table.
6) Edit the itemtype again and check that the URL still displays and is
checked in the 'Remote image' tab.
7) Signoff
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Fri, 4 Oct 2019 13:06:27 +0000 (14:06 +0100)]
Bug 23551: Fix AddRenewal call in circ/renew.pl
Without the patch, renewing from the renewal tab/page
led to wrong renewal/due dates.
To test:
- Check an item out to your patron account
- Renew it from the patron account
- Note the due date
- Return the item
- Check the item out again
- Renew it using the renewal tab
- Verify a different due date was calculated
- Apply patch
- Repeat test - due dates now should be the same
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Tue, 15 Oct 2019 15:49:07 +0000 (16:49 +0100)]
Bug 23129: (RM follow-up) Fix failing test
This patch corrects a test that was testing for the oposite behaviour to
that introduced in this patchset. We have agreed on the bug that the
new behaviour is desired and so I have updated the test to follow.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Mon, 3 Jun 2019 16:40:31 +0000 (11:40 -0500)]
Bug 23038: Hide expected warnings from tests
When tests are ran, there are 2 warnings that are expected and raised by
DBI.
As they are expected they must be correctly caught and not displayed.
We could have reconnect with PrintError turned off, but then reconnect
with it on.
Test plan:
% prove t/db_dependent/Circulation/MarkIssueReturned.t t/db_dependent/Suggestions.t
Must not display DBI warnings
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nick Clemens [Fri, 14 Jun 2019 18:18:03 +0000 (18:18 +0000)]
Bug 23129: Set holdingbranch to library that initiates transfer
To test:
1 - Find an item
2 - Check it in at anothe rbranch and initiate a transfer
3 - View the item details or check db - note that holdingbranch is set as the destination library
4 - Complete or cancel the transfer
5 - Apply patch
6 - Initiate a new transfer
7 - Note the holdingbranch is set to the initiating library
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>