Commit graph

35909 commits

Author SHA1 Message Date
430be3e9f3
Bug 23843: Add mapping to Koha::Library
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>
2019-10-23 18:03:11 +01:00
09ff41d9f1
Bug 23843: Add mapping to Koha::Hold
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>
2019-10-23 18:03:07 +01:00
af2cd5e303
Bug 23843: Add mapping to Koha::Club::Holds
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>
2019-10-23 18:03:03 +01:00
1957cb64ca
Bug 23843: Add mapping to Koha::Checkout
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>
2019-10-23 18:02:59 +01:00
f5f98af7be
Bug 23843: Add mapping to Koha::Account::Line
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>
2019-10-23 18:02:56 +01:00
ecf030b798
Bug 23843: Make funds endpoint tests more robust
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).

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_funds.t
=> SUCCESS: Tests pass!

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>
2019-10-23 18:02:47 +01:00
99a1a6db0f
Bug 23793: Unit tests
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>
2019-10-23 17:33:09 +01:00
6189f25dfa
Bug 23793: Add an EmbedItems RecordProcessor filter for MARC::Record objects
This patch introduces a RecordProcessor filter for MARC::Record objects
that embeds MARC::Field's for each item that is passed to the processor.

Target usage:

my $biblio = Koha::Biblios->find(
    $biblio_id,
    { prefetch => [ items, metadata ] }
);

my $opachiddenitems_rules;
eval {
    my $yaml = C4::Context->preference('OpacHiddenItems') . "\n\n";
    $opachiddenitems_rules = YAML::Load($yaml);
};

my @items  = grep { !$_->hidden_in_opac({ rules => $opachiddenitems_rules }) @{$biblio->items->as_list};
my $record = $biblio->metadata->record;

my $processor = Koha::RecordProcessor->new(
    {
        filters => ('EmbedItems'),
        options => {
            items        => \@items
        }
    }
);

$processor->process( $record );

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-23 17:33:07 +01:00
Ere Maijala
2b149c3d7a
Bug 13937: (follow-up) Fix searching with UTF-8 characters.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-23 15:01:44 +01:00
dd5d6b3281
Update docs/teams.yaml for 19.11.x development cycle
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-22 15:15:33 +01:00
768b067737
Bug 22445: DBRev 19.06.00.042
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-22 15:05:56 +01:00
5555c9d460
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>
2019-10-22 15:02:51 +01:00
03e4c0bf5d
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>
2019-10-22 15:02:51 +01:00
8c858f50a8
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:

 - Catalog search results
 - Bibliographic detail page

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>
2019-10-22 15:02:50 +01:00
538ca0fb4c
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:

 - OPAC search results
 - Bibliographic detail page
 - Shelf browser
 - List contents
 - Recent comments
 - "Your summary"

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>
2019-10-22 15:02:50 +01:00
43f9ad15e7
Bug 22445: Custom cover images - search resulta (staff)
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>
2019-10-22 15:02:50 +01:00
d8104c21b6
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>
2019-10-22 15:02:50 +01:00
56bccf6ad5
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>
2019-10-22 15:02:50 +01:00
958c3ae6df
Bug 22445: Custom cover images - opac reviews (rss)
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>
2019-10-22 15:02:49 +01:00
a5d3240594
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>
2019-10-22 15:02:49 +01:00
558929d85d
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>
2019-10-22 15:02:49 +01:00
fcfc6ec13d
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>
2019-10-22 15:02:49 +01:00
055dc2321b
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>
2019-10-22 15:02:49 +01:00
71b1afd06e
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>
2019-10-22 15:02:48 +01:00
2bf7ddd112
Bug 22445: Custom cover images - opac shelfbrowser
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>
2019-10-22 15:02:48 +01:00
e3b90c4cb9
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>
2019-10-22 15:02:48 +01:00
3df15701d6
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>
2019-10-22 15:02:48 +01:00
be16257197
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>
2019-10-22 15:02:48 +01:00
6f4994ff4d
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>
2019-10-22 15:02:47 +01:00
eb3a3df937
Update Developer Statistics
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-22 14:27:23 +01:00
6d1b3cf212
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>
2019-10-22 14:13:30 +01:00
f4936fd46a
Bug 23770: (follow-up) Use ->to_api in /cities
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>
2019-10-21 10:04:17 +01:00
1800a2e6b8
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>
2019-10-21 10:04:11 +01:00
7ce5cb0865
Bug 23770: Unit tests
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>
2019-10-21 10:03:59 +01:00
ab4a8755c2
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>
2019-10-21 10:03:53 +01:00
3c0c75e6af
Bug 23770: Add Koha::Object(s)->to_api method
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>
2019-10-21 10:03:44 +01:00
d7d5a40548
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>
2019-10-21 10:02:58 +01:00
6d8a26e575
Bug 22922: (follow-up) Markup corrections
This patch adds a "size" attribute to the datepicker input fields and
adds self-closing "/".

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-21 10:01:09 +01:00
Julian Maurice
08e7273c0f
Bug 22922: Use jQuery datepicker instead of <input type="date">
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>
2019-10-21 10:01:01 +01:00
Julian Maurice
95174eb36a
Bug 22922: Allow reservedate changes only if AllowHoldDateInFuture is on
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>
2019-10-21 10:00:49 +01:00
Julian Maurice
8d047f2a33
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>
2019-10-21 10:00:36 +01:00
2c10ac831b
Bug 23791: DBRev 19.06.00.041
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-21 09:57:06 +01:00
ee58a457ab
Bug 23791: Compiled CSS
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-21 09:52:56 +01:00
74165f986e
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>
2019-10-21 09:51:10 +01:00
Katrin Fischer
3c32adc051
Bug 23791: (follow-up) Fix database update description
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-21 09:51:04 +01:00
8fbc93e8b2
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>
2019-10-21 09:50:54 +01:00
194a49137f
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>
2019-10-21 09:46:46 +01:00
9658cd4d18
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>
2019-10-21 09:46:46 +01:00
Magnus Enger
8a243ffd94
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>
2019-10-21 09:46:40 +01:00
a473e231f7
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>
2019-10-21 09:43:24 +01:00