Commit graph

109 commits

Author SHA1 Message Date
7e991d0702
Bug 29939: Use the REST API for ratings
This patch replaces opac-ratings-ajax.pl with a new REST API route
POST /public/biblios/42/ratings

Note that we could go further and refactor the 'start_rating' select
code.

Test plan:
Test the "star ratings" feature at the OPAC, on the different page
where it's displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-22 11:31:15 -03:00
8f1f1cfd50
Bug 31040: jsTree image being used outside of jsTree plugin
This patch corrects OPAC templates which tried to use a jsTree image
asset which is missing following the jsTree upgrade (see Bug 11873).
Templates should use /images/spinner-small.gif instead.

To test, apply the patch and enable OpenLibrarySearch and populate
OverDrive and RecordedBooks preferences with credentials (they don't
have to be valid).

Perform a catalog search in the OPAC. When the search results page first
loads you should see messages about the services being queried:

Searching OpenLibrary...
Searching RecordedBoks...
Searching OverDrive...

Each should show a working "spinner" image while the queries are being
performed. If you have valid OverDrive credentials you can try clicking
through to the OverDrive search results page to confirm that the image
is working on that page too.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-07-05 09:18:20 -03:00
Aleisha Amohia
ed84d7d50a Bug 14242: (follow-up) Clear all text input fields
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-05-03 11:19:50 -10:00
Aleisha Amohia
bc89b1d6fd Bug 14242: (follow-up) Hide autofil when syspref disabled, clear ISBN
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-05-03 11:19:50 -10:00
Aleisha Amohia
9660b61158 Bug 14242: (follow-up) Format copyright date before plugged into form
This patch formats the copyright date so that only the year shows before
plugging the formatted version into the form.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-05-03 11:19:50 -10:00
Martin Stenberg
bdcf9a8a3f Bug 14242: Use ISBN-field to automatically fill out purchase suggestions
Add new jQuery plugin "autofill" which transforms selected element(s)
into search fields for Google Books API and automatically fills
requested fields with search result.

Use in OPAC purchase suggestions to automatically fill out fields when
entering ISBN-number.

Test plan:
1. Run updatedatabase.pl
2. Enable system precference "OPACSuggestionAutoFill"
3. Log into OPAC and go to purchase suggestions page
4. Write a valid ISBN (such as 0-9690745-2-2 or 978-1-78416-110-1) into
   the ISBN field and click the 'search google books' button, or unfocus
   the field.
5. Title, Author, Publisher, publication year and Item Type fields should now be filled
   automatically.
6. Press "clear form" to undo - should restore all fields that the API pull
   filled to empty

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-05-03 11:19:50 -10:00
84d1f3ce94 Bug 30136: (follow-up) CSS and accessibility update
This patch adds the new CSS to the global CSS file. Rebuild the OPAC CSS
to test.

The patch also moves the JavaScript for the button from opac-bottom.inc
into global.js and adds accessibility labels to the generated markup.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-04-27 11:20:45 -10:00
1ad3d2817d Bug 29066: (follow-up) Use tooltip when SearchMyLibraryFirst in effect
This patch proposes to add a Bootstrap tooltip to the OPAC masthead's
search field to indicate to the user when SearchMyLibraryFirst is in
effect. I think this lets the form layout stay clean-looking and is more
informative to the user because they don't have to look for the HTML
title tag tooltip.

To test, apply the patch and 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.
- Set the OpacAddMastheadLibraryPulldown preference to "Don't add."
- Set the SearchMyLibraryFirst preference to "Limit."
- Go to the OPAC and confirm that the main search field in the masthead
  has a filter icon in the background, indicating that searches will be
  limited.
- Hover your mouse over the search field and a tooltip should pop up,
  "Searching in <library> only"
- The message should also be triggered when you click inside the form
  field.
- Change the OpacAddMastheadLibraryPulldown and SearchMyLibraryFirst
  preferences again and the form should return to its normal behavior.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-04-13 15:55:38 +02:00
f81cd2a2b9 Bug 29845: add classes to overdrive results action buttons
To test:
1. You must have OverDrive credentials populated in the OverDrive
   system preferences
2. Go to the Overdrive results page and make sure you are logged in.
3. Use your browsers dev tools to look at the check-in, check-out,
   place hold, cancel hold buttons, none of them contain classes.
4. Apply patch
5. Repeat 3 again but this time they should all contain a class which
   makes them much easier to style.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-23 22:05:33 -10:00
1513cd66b6 Bug 29803: Prevent local cover image to be hidden if Coce is enabled
If Coce is enabled by no image are returned by the service, then no
other image will be displayed (actually un-hidden)

The getURL is returning early if no image is returned by the service and
the "done" flag is never set.

Test plan:
Add a local cover image to a bibliographic record (ktd biblionumber=14
is good)
Set CoceHost = http://coce.bywatersolutions.com
Select all CoceProviders
Enable OpacCoce

=> If no image is returned by Coce then the local image should be
displayed anyway

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-21 15:15:47 -10:00
915815ddae Bug 29603: Fix responsive behavior of facets menu in OPAC search results
The OPAC was originally featured a search results facets box that would
collapse at narrower browser widths and show a "Refine your search" link
under the breadcrumbs menu. At some point this broke, with the "Refine
your search" link appearing at the bottom instead.

This patch revises the page to restore the previous behavior.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Perform catalog search in the OPAC which will return multiple results.
- View the page at various browser widths. At narrower widths the facets
  menu should appear as a "collapsed" box with a "Refine your search"
  link.
- Clicking the link should toggle the facets menu visibility.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-16 21:52:51 -10:00
36b378ebab Bug 29960: (follow-up) Include enquire.js in print slip template
This patch adds enquire.js to the print slip template in order to
prevent a JS error.

Also removed is a line from global.js which was added in the previous
patch and which was an unwanted change.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-16 21:52:51 -10:00
ca6431e252 Bug 29960: Remove Modernizr dependency in the OPAC
This patch refactors the code around JavaScript-driven responsive
behavior in the OPAC. The use of Modernizr dropped and the dependency
removed.

This patch also adds a missing listing for Enquire.js licensing on the
"About" page.

To test, apply the patch and perform a catalog search in the OPAC.

- Narrow your browser window until its width falls below 609 pixels
  (Using your browser's Responsive Design Mode is helpful for this, e.g.
  https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode)
- The window should automatically scroll to the "main content" area, in
  this case the section headed by "Your search returned..."

- Change your browser window's width until it falls below 768 pixels.
- Scroll to the bottom of the search results where you should find the
  "Refine your search" facets box collapsed.
- As you increase your browser width above 768 pixels the facets box
  should expand.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-16 21:52:51 -10:00
985c32398f Bug 29960: (follow-up) Include enquire.js in print slip template
This patch adds enquire.js to the print slip template in order to
prevent a JS error.

Also removed is a line from global.js which was added in the previous
patch and which was an unwanted change.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-16 21:52:51 -10:00
6596f76817 Bug 29960: Remove Modernizr dependency in the OPAC
This patch refactors the code around JavaScript-driven responsive
behavior in the OPAC. The use of Modernizr dropped and the dependency
removed.

This patch also adds a missing listing for Enquire.js licensing on the
"About" page.

To test, apply the patch and perform a catalog search in the OPAC.

- Narrow your browser window until its width falls below 609 pixels
  (Using your browser's Responsive Design Mode is helpful for this, e.g.
  https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode)
- The window should automatically scroll to the "main content" area, in
  this case the section headed by "Your search returned..."

- Change your browser window's width until it falls below 768 pixels.
- Scroll to the bottom of the search results where you should find the
  "Refine your search" facets box collapsed.
- As you increase your browser width above 768 pixels the facets box
  should expand.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-16 21:52:51 -10:00
26fd5daf50 Bug 29949: Remove use of title-numeric sorting routine from OPAC datatables JS
This patch removes the use of a specific "title-numeric" sorting routine
from the DataTables configuration of the "Most popular" table. We can
use a "data-order" attribute instead.

The patch also removes the now unused code from our custom DataTables JS
file in both the OPAC and the staff interface (where it was unused).

To test, apply the patch and make sure the OpacTopissue system
preference is enabled.

- In the OPAC, view the "Most popular" page.
- Change the filter settings, if necessary, to get multiple results.
- In the results table, confirm that sorting by number of checkouts
  still works correctly.

A search of the code for instances of "title-numeric" should return only
one in a comment in the official DataTables library.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-31 21:55:40 -10:00
4413276810 Bug 29320: Update OverDrive availability to V2
This patch updates the call to overdrive_proxy to allow passing a version
and updates the code to use V2 for availability

To test:
1 - Enable OverDrive integration by setting the sysprefs
2 - Log in to your overdrive account in the Koha opac
3 - Perform a search and note availability display
4 - Confirm you can checkout/hold/return books
5 - Apply patch
6 - Repeat search and test functionality
7 - Note that title with '0 out of 0 copies available' now say 'Currently unavailable'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 21:52:54 -10:00
46d3d63e46 Bug 29686: Adapt Koha to use new fulfillment API for OverDrive
This patch modifies the checkout_download_url routine in
WebSerivce::ILS::OverDrive::Patron

We now directly hit the fulfillment endpoint with redirects disabled
and fetch the URL

The overdrive.js is modified to use a single 'Get item' button for all
checked out items and to refer to the fulfillment page

To test:
1 - Enable all OverDrive system preferences
2 - Search on opac and confirm OD results returned
3 - Checkout an item
4 - Confirm you have the new 'Get item' button on 'OverDrive account'
    tab on opac-user.pl
5 - Confirm the 'Get item' button works

NOTE:
Most items will also show the 'Get item' button in results, however,
magazines may not as each checkout has a unique 'reserve id' and the
'parent' id is not checked in our current code

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-01-28 11:09:06 -10:00
6ce700923e Bug 28537: (follow-up) Correct and improve OverDrive checkout modal
This patch corrects the markup of the modal which is displayed when the
user clicks the "Download as" button in their list of OverDrive
checkouts. The modal markup had not been updated in the conversion to
Bootstrap 4.

I have also modified the markup generated when listing the download
format options so that they use some standard Bootstrap 4 classes,
improving the layout a little.

To test you must have valid credentials entered in system preferences
for the OverDrive API. You should test using a patron who has holds and
current checkouts in OverDrive.

Apply the patch and log in to the OPAC.

- On the "Your summary" page, open the "OverDrive Account" tab.
  - Log in to your OverDrive account.
  - In the list of current checkouts, click the "Download as" button for
    one of the titles.
    - A modal window should display with a list of radio buttons for
      each available format.
      - Confirm that the format text acts as the label for the radio
        button.
      - Confirm that closing the modal without making a selection works
        correctly.
      - Confirm that making a selection and submitting the form closes
        the modal and submits your choice.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
883accab08 Bug 28537: Improve HTML generated by OverDrive integration
This patch makes changes to the way HTML is generated when showing
output from OverDrive integration:

- Buttons have Bootstrap button classes
- Layout of information is improved.
- Handling of cover image thumbnails is improved, especially in cases
  where images were much larger than expected.
- An OverDrive-specific CSS file is added.

To test you must have valid credentials entered in system preferences
for the OverDrive API. You should test using a patron who has holds and
current checkouts in OverDrive.

Apply the patch and log in to the OPAC.

- On the "Your summary" page, open the "OverDrive Account" tab.
  - Log in to your OverDrive account.
  - The contents of the tab should display well, with item
    thumbnails showing in a column to the left, and item information
    showing to the right.
  - Controls should be styled with standard Bootstrap style.
  - Confirm that operations work correctly: Acessing titles, checking
    in, canceling holds, etc.

- Perform a catalog search which will return results also found in your
  OverDrive collection.
  - Open the OverDrive results page.
  - The page should display correctly, especially thumbnails.
  - Confirm that operations work correctly: Checking out and placing
    holds.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
2de22db29c Bug 28901: showCart incorrectly calculates position if content above navbar
This patch makes changes to the OPAC Cart's CSS and JS so that the cart
pop-up message display more consistently. The CSS is changed to use
position "fixed" instead of "absolute." This allows the message to
display without recalculating the position every time, and keeps the
appearance we expect.

The z-index of the message is also increase to prevent it from being
hidden behind a floating toolbar.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Perform a catalog search in the OPAC which will return multiple
   results.
 - In the list of search results, click the "Add to cart" link next to
   several search results. Each time you should see a message appear in
   the upper left corner of the screen, "The item has been added to the
   cart."
 - The position of the messages should be consistent no matter how far
   down the page you scroll.
 - Test again after adding content to the OpacHeader region. One way to
   do this is to add the following to the OpacUserJS preference:

   $(document).ready(function(){
     $("#wrapper").prepend('<img src="https://generative-placeholders.glitch.me/image?width=900&height=200&style=triangles&gap=30">');
   });

 - Test at various browser widths, from a phone-sized screen width up to
   wide desktop-sized.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:06:51 +01:00
60e60cad6e Bug 28910: Correct eslint errors in OPAC basket.js
This patch corrects eslint errors in the OPAC copy of basket.js:
Indentation inconsistencies, undeclared variables, unused functions,
etc.

To test, apply the patch and test the "Cart" functionality in the
OPAC:

- In the OPAC, add an item to the cart.
- A popup message should appear telling you the item has been added.
- The "Add to cart" link should update to read "In your cart."
- The count if cart items in the header should be updated.
- The "In your cart (remove)" link should work correctly.
- Test this process from both the search results and
  detail pages.
- Open the cart.
- The cart should open correctly.
- In the cart, test all the controls:
  - More details
  - Send
  - Download
  - Empty and close
  - Hide window
  - Print
  - Select all / clear all
  - With checked items:
    - Remove
    - Add to list
    - Place hold
    - Tag

The following unused functions were removed: readCookieValue,
AllAreChecked, SelectAll, and quit. A search of the Koha codebase should
return no results from the opac-tmpl directory.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:06:51 +01:00
819095aa21 Bug 28180: Correctly guess if images have been loaded
window.load won't assure us that the images loaded using JS code are
correctly loaded.

This patch adds a flag to the different providers when the images are
fully loaded.

Note that the img.naturalHeight check is not working for google jackets
and is actually not needed (test with a bib record with and without
google jacket and confirm that it's working as expected).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-21 12:24:04 +02:00
00e09e3f96 Bug 28180: (follow-up) Updates to styling of lightbox controls
This patch adds style changes like the ones made in Bug 28179. It also
addresses a bug with the way the verify_images() function was firing.
I've moved the function outside of document.ready() and added a call to
it on window load, consistent with how it works in the staff client.

I've removed a redundant call to verify_images() from the footer include
file, opac-bottom.inc.

The cosmetic changes replace the Chocolat image icons with new SVG
assets based on Bootstrap Icons (https://icons.getbootstrap.com/). The
color changes I think help the controls to be more visible.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-21 12:24:04 +02:00
112168cfd5 Bug 28180: Reintroduce and adjust OpenLibrary
1. Turn on OpenLibraryCovers
2. Display the cover images in the gallery

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)

Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-21 12:24:04 +02:00
511720999a Bug 28180: Reintroduce and adjust Google Jackets
Test plan:
1. Turn on GoogleJackets
2. Display the cover images in the gallery

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)

Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-21 12:24:04 +02:00
fad97080e9 Bug 28180: Add a lightbox gallery to display cover images - detail page, OPAC interface
This patch is the OPAC version of
  Bug 28179: Add a lightbox gallery to display cover images - detail page, staff interface

But there were several difficulties as the staff and OPAC code diverged
a lot.
First we are going to apply the different enhancements that have been
made staff-side:
- Display all the local cover image on the bibliographic detail pages
(before this patch only the first one was displayed)
- The slider functionality added by bug 25031

Test plan:
All the cover images are affected, all the different sources will be
tested.
All the steps will be done on the same bibliographic record.
1. Local cover images
 a. Turn on OPACLocalCoverImages and AllowMultipleCover
 b. Add several local cover images to a bibliographic record
 c. Add several local cover images to an item
 d. Click on an image and confirm that it is displayed in a gallery and
 you can navigate see all the images attached to the bibliographic
 record
 e. Same for items
2. Adlibris
 a. Turn on AdlibrisCoversEnabled
 b. Edit the biliographic record and add an ISBN that will return a
 cover image for this service (9780670026623 for instance)
 c. Display the cover images in the gallery
 d. Note the link to the adlibris.com website at the bottom
3. Amazon
 a. Turn on OPACAmazonCoverImages
 b. Display the cover images in the gallery
4. Coce
 a. Turn on OpacCoce, set CoceHost to "http://coce.tamil.fr:8080"
 and select some values for CoceProviders.
 b. Display the cover images in the gallery
5. Custom cover images
 a. Turn on OPACCustomCoverImages and set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpg
 of anything else meaningful
 b. Display the cover images in the gallery

QA Note: Other sources have been removed by this patch but will be
re-added by follow-ups

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)

Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-21 12:24:04 +02:00
9c2f4ed6bf Bug 28536: Move translatable strings into overdrive.js
This patch takes strings defined as variables in opac-bottom.inc for use
in overdrive.js and moves them to overdrive.js, wrapped in the
double-underscore translation function.

To test you must have valid credentials entered in system preferences
for the OverDrive API. Ideally you should test using a patron who has
holds and current checkouts in OverDrive.

Apply the patch and log in to the OPAC.

- On the "Your summary" page, open the "OverDrive Account" tab.
  - Log in to your OverDrive account.
  - The contents of the tab should display correctly, with correct
    labels for controls like "Log out of your OverDrive account", "Check
    in", "On hold", etc.
- Perform a catalog search which will return results also found in your
  OverDrive collection.
  - Open the OverDrive results page.
  - The page should display correctly, with correct labels on controls
    like "Check out" and "Place hold."

To test that the correct strings are translatable. In this example I'm
testing fr-FR:

 - Update a translation:

  > gulp po:update
  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for the strings pulled from
  JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from bootstrap/js/overdrive.js for
  translation, e.g.:

  koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js:124
  msgid "OverDrive account page"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing)
- Install the updated translation:

  > perl translate install fr-FR

In the OPAC, switch to the language you're testing. Confirm that your
translated strings appear. In the above example, the string should
appear at the top of the "Overdrive Account" tab.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-09-21 20:22:57 +02:00
Andrew Isherwood
567557117a Bug 27170: Fix bug fix
<sigh> This commit fixes the incorrect bug fix from the previous commit

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Barry Cannon <bc@interleaf.ie>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-09-21 20:22:57 +02:00
Andrew Isherwood
7811505506 Bug 27170: Fix bug with undefined 'links'
If a row object doesn't have a 'links' property, calling 'length' on it
will fail. This commit fixes this.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Barry Cannon <bc@interleaf.ie>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-09-21 20:22:57 +02:00
Andrew Isherwood
045a59a358 Bug 27170: Add support for new 'links' property
This commit adds support for the new 'links' property that will allow an
availability plugin to return an array of links for a result. These
links are parsed and appended to the title field of a results record.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Barry Cannon <bc@interleaf.ie>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-09-21 20:22:57 +02:00
da2d583591 Bug 28018: Replace obsolete title-string sorting: OPAC templates
This patch modifies OPAC templates to replace the use of the
"title-string" DataTables sorting method with the newer "data-order"
attribute.

To test, apply the patch and view the following pages to confirm that
columns containing dates sort correctly when using any setting of the
"dateformat" system preference:

- As a logged-in user, (proper testing will depend on having the
  relevant data associated with your user, e.g. holds, searches, ill
  requests, etc.):
  - Your summary
    - Checkouts
    - Overdues
    - Holds
  - Your charges
  - Your search history
  - Your checkout history
  - Your holds history
  - Your interlibrary loan requests
  - Your tags
- Bibliographic detail page
  - With a non-serial record: Holdings
  - With a serial record: Latest issues
    - More details -> Full history: Test multiple years if possible
- Course reserves -> Course details
- Self checkout -> Check out to a patron with checkouts

Signed-off-by: Amit Gupta <amitddng135@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-06 15:56:31 +02:00
7ddb60e292 Bug 27353: Set X-Base-Total-Count header for REST API
We already set X-Total-Count to the total number of filtered rows,
but we don't have the total number of non-filtered rows.

Test plan:
This is easy to test on top of bug 27352 or bug 27251, apply them if not
pushed yet.
1. Create 40 items with public notes = "xxx" for biblionumber=4
then, using Postman (or whatever you prefer):
http://kohadev-intra.mydnsname.org:8081/api/v1/biblios/4/items?_page=1&_per_page=20&q=[{"me.public_notes"%3A{"like"%3A"%25x%25"}}]&_match=contains
Check the headers and confirm you see X-Total-Count=40 and
X-Base-Total-Count=44

2. go to /cgi-bin/koha/tools/quotes.pl
You see "Showing 1 to 20 of 28 entries"
Search "he"
Showing 1 to 20 of 22 entries (filtered from 28 total entries)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-28 16:41:21 +01:00
7bfd83d21b Bug 25775: Add DataTables controls to user's checkouts table in OPAC
This patch updates the "your summary" page in the OPAC so that tables on
the logged-in user's page have DataTables controls. The patch also
tweaks the DataTable configuration of some other pages to make them all
more consistent.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Log in to the OPAC as a user who has checkouts, overdues, and holds.
- On the "your summary" page, confirm that the checkouts table has
  controls at the top: A search form and link-style buttons: Clear
  filter, Copy, CSV, Print, iCal, Renew selected, and Renew all.
- Confirm that each work correctly.
- At the bottom of the page, the style of the "Renew selected" and
  "Renew all" buttons should now be side by side.
- Confirm that both buttons work correctly.
- If necessary, enable the UseCourseReserves system preference.
- Go to the OPAC course reserves page.
- Confirm that there is a working "Search courses" field at the top of
  the table.
- View the contents of a course reserve.
- There should be a "Search course reserves" field at the top of the
  table.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-14 10:11:37 +01:00
e12e0ef016 Bug 27200: (follow-up) Browse search interface update
This patch updates the browse search interface to confirm to new
interface patterns in the Bootstrap 4 framework, especially in the form
markup.

The results list has been changed to a Bootstrap "Collapse" component
configured as an accordion
(https://getbootstrap.com/docs/4.5/components/collapse/#accordion-example).

Instead of loading the bibliographic record results below the list of
terms returned, the bibliographic results are now displayed in the
"panel" expanded below the selected term. Subtitle has been added to the
information displayed about the bibliographic record.

To test you must be using ElasticSearch and the OpacBrowseSearch
preference must be enabled. Apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Open the "Browse search" page in the OPAC.
- Test various searches: Author, Subject, and Title.
- When results are found, the should be displayed as a Bootstrap-styled
  accordion widget. Clicking any individual result should expand the
  panel containing the corresponding records.
- Clicking the record link should open the bibliographic detail page in
  a new window.
- When no results are found, a Bootstrap-style "alert" box should
  appear.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-12-26 17:58:43 +01:00
fc2c86ba78 Bug 27200: (bug 20168 follow-up) Fix 'Browse search'
The 'hidden' class has been replaced by 'd-none' on bug 20168

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-12-26 17:58:43 +01:00
f11659c48b Bug 26148: OpenLibrary "Preview" link target is unclear to patrons
This patch makes changes to the display of the Open Library "read" links
in the OPAC search results and detail page. The link is now grouped with
other details about the record ("Publisher," "Location(s)," etc. On the
detail page, the "Preview" link will no longer appear under the cover
image.

The label is changed to "Found in Open Library," and the link now opens
the Open Library reader in a new window.

The patch also changes the Open Library button image links so that they
use https and makes it so that the "Found in Open Library" information
is hidden until the availability information has loaded.

To test, apply the patch and enable the OpenLibrarySearch system
preference.

 - Perform a search in the OPAC which will return results found in Open
   Library, e.g. "poetry" in the sample data.
 - Confirm that the "Read now" images from Open Library appear on some
   search results.
 - View the detail page for one of these titles.
 - Confirm that the "Read now" button appears in the same format on the
   detail page.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-05 15:24:20 +01:00
7ea60c0bd9 Bug 26695: Add modal "shown" event to set cursor focus
This patch attaches a focus() call to the login modal's "shown.bs.modal"
event so that the cursor focus is set to the username field when the
login modal is displayed.

To test, apply the patch and confirm that your OPAC uses the regular
login process--not casAuthentication or GoogleOpenIDConnect.

Click the "Log in to your account" link in the header. A the login form
should appear in a modal dialog, and the focus should be on the username
field.

The same should be true if you trigger the modal from other
locations, for instance: "Log in to add tags" on the bibliographic
detail page or the tag cloud page.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-03 10:57:35 +01:00
b08444d31c Bug 26753: Set focus for cursor to password field on Overdrive login popup on OPAC
This patch modifies the OverDrive login process so that clicking the
"Log in to your OverDrive account" link automatically puts the focus on
the password field when the modal displays.

Unrelated change: A redundant "document.ready" function has been
removed.

To test you must have OverDrive credentials set in system preferences.

 - Log in to the OPAC.
 - On the "Your summary" page, open the "OverDrive account" tab.
 - Click the "Log in to your OverDrive account" link.
 - A modal dialog should appear, and the cursor focus should
   automatically be on the password field.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-03 10:57:35 +01:00
599a6cb92e Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode
This patch adds the "Print" string to datatables.js so that it can be
picked up for translation.

To test, apply the patch and add some items to the cart in the OPAC.

- Open the cart. You should see a button labeled "Print."
- The print button should work correctly.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings,
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/opac-tmpl/bootstrap/js/datatables.js for translation:

  msgid "Print"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

   > perl translate install fr-FR

- Switch to your newly translated language in the OPAC and
  repeat the test plan above. The translated strings should appear.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-26 00:14:42 +01:00
549d033cb1 Bug 26145: Display the cover image at the OPAC
Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-12 11:28:41 +02:00
ae21c3adb1 Bug 26505: Suspend hold modal broken in the OPAC
This patch makes corrections to the markup for the suspend hold modal in
the OPAC. It hadn't been updated during the upgrade to Bootstrap 4.

The JavaScript controlling the "suspend until" datepicker has been
modified because the datepicker pop-up was not positioned correctly in
this new version.

Unrelated: The markup for confirmation modals has been updated to
replace Bootstrap 3's "btn-default" with Bootstrap 4's "btn-secondary."

To test, apply the patch and make sure the SuspendHoldsOpac and
AutoResumeSuspendedHolds system preferences are enabled.

- Log in to the OPAC as a user who has holds.
- On the "Your summary" page open the "Holds" tab.
- In the list of holds, click the "Suspend" button.
- The modal should appear and look correct.
- Test the "Suspend until" field: Clicking in the form field should
  trigger the datepicker. It should be positioned correctly under the
  form field.
- Confirm that the datepicker populates the field.
- Submit the suspension and confirm that the hold is suspended.
- Click the "Cancel" button for a hold. Confirm that the confirmation
  dialog appears correctly.

Edit: Updated class of hidden submit button. Test the page with JS
disabled to test that the "Suspend until" form works correctly.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-28 11:08:03 +02:00
7d78cae284 Bug 26262: (follow-up) Fix course details page, default configuration
Bug 25287 changed the default DataTable configuration in the OPAC so
that tables are paginated by default. This is inconsistent with the way
we currently use DataTables in the OPAC, and the change was probably
unintentional. This patch returns the default pagination configuration
to what it was before: Off.

The patch also updates opac-course-details.tt with the same DOM
configuration as opac-course-reserves.tt.

To test, apply the patch and view the list of course reserves and the
list of titles attached to a course. In both cases there should be no
pagination controls, and the tables should show all results.

Signed-off-by: Alexis Ripetti <alexis.ripetti@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-18 11:08:35 +02:00
9cb89b4639 Bug 20168: Update of the OPAC bootstrap template to bootstrap v4
This patch updates the version of Bootstrap in the OPAC from 2.3.1 to
4.5.0. The Bootstrap JavaScript files have been replaced with custom
builds of the 4.5.0 JavaScript source files. The Bootstrap CSS is now
built into the OPAC CSS by loading the required Bootstrap 4.5.0 SCSS
files in node_modules.

OPAC SCSS now starts with Bootstrap customizations:

/* Bootstrap variable customizations */
$headings-color: #727272;
...

Followed by loading the necessary Bootstrap SCSS files:

/* Bootstrap imports */
@import "../../../../../node_modules/bootstrap/scss/functions";
@import "../../../../../node_modules/bootstrap/scss/variables";
...

Followed by our CSS. The build process for generating compiled CSS now
creates a file which bundles Bootstrap CSS and ours. Removed from the
Koha source: Bootstrap CSS files, Bootstrap "glyphicons" images.

The upgrade to Bootstrap 4 involved a lot of markup changes to conform
with new Bootstrap classes, especially in classes related to the grid.
Besides duplicating the grid we used before, this upgrade adds some new
features made possible by Bootstrap 4.5's use of flexbox as a layout
tool. This includes custom ordering of columns based on class names:
https://getbootstrap.com/docs/4.5/layout/grid/#order-classes.

Other areas where the most changes have been made: Navigation menus,
breadcrumb menus, buttons, dropdowns.

Bootstrap's JavaScript file is now "bootstrap.bundle.min.js" to reflect
the fact that a required JavaScript asset is now distributed separately
in Bootstrap 4. The "bundle" version includes Popper.js.

Unrelated changes: Indentation corrections, removal of invalid
"//<![CDATA[" markers, removal of invalid script type attributes.

To test, apply the patch and run 'yarn install' to install Bootstrap as
an npm module. Run 'yarn build --view opac' to regenerate the OPAC CSS.

Test as many aspect of the OPAC as possible, viewing pages at various
browser widths to confirm that everything adjusts well. Test with
various OPAC interface system preferences enabled and disabled.

Test self checkout and self checkin.

Known issues: RTL support has not been updated.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-09 14:13:03 +02:00
ce7f4d16d6 Bug 26324: Fix spelling resizable vs resizeable in Dopop
The correct spelling of the parameter is resizable
https://developer.mozilla.org/fr/docs/Web/API/Window/open

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-02 12:13:25 +02:00
5bad8da970 Bug 26037: openlibrary.org is hit on every Koha requests
This patch moves the inclusion of Open Library JavaScript from
opac-bottom.inc to the three templates where it might be used.

In addition, the Open Library JS has been modified to check for the
existence of the relevant markup on the page before executing a query.

Unrelated: The Open Library label is now hidden when the status returned
is "Not found." Previously this information was displayed.

To test, apply the patch and enable the OpenLibrarySearch system
preference.

 - Perform a search in the OPAC which will return results from Open
   Library. Some ISBNs: 0140423826, 0395082552, 0679436405.
   - On the search result page there should be an Open Library "Read
     now" button for each result that can be opened for reading in Open
     Library.
 - Add these titles to a list and view the list.
   - The "Read now" button should appear on the list page.
 - View the details for one of these titles.
   - The "Read now" button should appear on the page below the holdings.
 - Watch the browser's developer tools on these and other pages in the
   OPAC. There should be no errors in the console and no 404 errors in
   the network tab.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-08-06 11:37:07 +02:00
9b9e8fd328 Bug 26070: Remove GoogleIndicTransliteration system preference
The Google Transliterate API was deprecated on May 26, 2011. This patch
removes the feature and associated system preference.

To test, apply the patch and run the database update process.

 - Go to Administration -> System preferences and search for
   'GoogleIndicTransliteration.' There should be no results.
 - Search the Koha codebase for references to
   'GoogleIndicTransliteration.' There should be no current references..

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-07-30 17:44:27 +02:00
7c8276bf0e Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js
This patch adds the necessary JavaScript includes to the OPAC to
enable translation of strings in JavaScript. It also updates the
translation of cart-related strings by removing the strings from
opac-bottom.inc and putting them in basket.js where they are used.

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

 - Update a translation:

   > cd misc/translator
   > perl translate update fr-FR

 - Open the corresponding .po file for the strings pulled from
   JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
 - Locate strings pulled from bootstrap/js/basket.js for
   translation, e.g.:

   #: koha-tmpl/opac-tmpl/bootstrap/js/basket.js:89
   msgid "Your cart is currently empty"
   msgstr ""

 - Edit the "msgstr" string however you want (it's just for testing)
 - Install the updated translation:

   > perl translate install fr-FR

In the OPAC, switch to the language you're testing. Confirm that your
translated string appears. In the above example, by clicking the "Cart"
icon in the header when there are no items in the cart.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-07-30 17:44:27 +02:00
981b601c39
Bug 25909: Recent change to datatables JS in the OPAC causes errors
This patch reverts some changes made by Bug 25287 which prematurely
introduced the double-underscore i18n function. The i18n features
haven't been fully implemented in the OPAC.

Some lines are reverts to the previous version, and some are additions,
for instance where Bug 25287 introduced new DataTables features and a
new string translation is required.

In addition to i18n changes, the patch also reverts the default
configuration of DataTables in the OPAC so that the "dom" configuration
option is set back to "t." This turns off features like pagination
buttons, filters, etc. which were previously disabled by default.

Enabling these features requires revision to the OPAC CSS in order for
them to display well.

To test, apply the patch and view a page in the OPAC which includes a
DataTable. For instance: checkouts on the "your summary" page, serial
issues on the "full subscription history" page.

Tables should display correctly and sorting should work correctly. There
should be no other DataTables controls visible.

To test translatability:

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

    - Update a translation:

      > cd misc/translator
      > perl translate update fr-FR

    - Open the corresponding .po file for the strings pulled from
      the templates  e.g.  misc/translator/po/fr-FR-opac-bootstrap.po
    - Locate strings pulled from bootstrap/en/includes/datatables.inc
      for translation, e.g.:

      #. SCRIPT
      #: opac-tmpl/bootstrap/en/includes/datatables.inc:4
      msgid "Copy to clipboard"
      msgstr ""

    - Edit the "msgstr" string however you want (it's just for testing)
    - Install the updated translation:

      > perl translate install fr-FR

Open the translated copy of datatables.inc and confirm that the
translated string appears.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-07-16 15:33:29 +01:00
6f5dc3dc0d Bug 25287: Add columns_settings capabilities to API datatables wrapper
This patch adds the code that is used for handling columns settings on
datatables and allows passing the columns_settings information to the
API-centric datatable. To test, you need bug 25288, which uses this features.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Works with bug 24561. Make working bug 25288

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-06-24 15:15:41 +02:00