Commit graph

18258 commits

Author SHA1 Message Date
a91325387b Bug 29478: (follow-up) Today should select now for pastinclusive
This is getting ugly. We need to add 1 minute for the minDate or the
'Today' link may not work.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:48:47 +01:00
03884cc9f9 Bug 29478: Today should select now for pastinclusive
If Today is clicked when we only allow dates in the past and today/now,
we should select the current date/time
We need to update the maxDate to make it up-to-date, or the maxDate may
be set to the minute before and clicking Today will blank the input.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:48:46 +01:00
58cec67dbd Bug 29478: (follow-up) Provide default style for shortcut buttons
This patch adds some CSS to _flatpickr.scss in order to give a deafult
style to the "yesterday," "today," and "tomorrow" controls added by the
shortcut plugin.

A missed translatable string is now wrapped in the __() function:
__("or").

The patch also updates the date calculation for those shortcuts to use
Flatpickr's date calculation shorthand. This isn't strictly necessary
but I think it makes the code more readable.

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

In the staff client, view some pages with date-picker widgets. A
calendar widget time selection:

- Circulation -> Check out -> Checkout settings -> Select date:
  - The calendar widget should have "yesterday," "today," and "tomorrow"
    controls styled like links appearing after the time selector. The
    controls should be centered, with the "or" label on the same line.

A calendar widget without time selection:

- Tools -> Log viewer -> Display from.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:48:46 +01:00
622b4c019b Bug 29478: Flatpickr - Restore 'Today' button
It's not implemented, looks like we need to use a plugin for that

https://github.com/flatpickr/flatpickr/issues/576

https://github.com/jcsmorais/shortcut-buttons-flatpickr

Test plan:
Confirm that flatpickr instances now have a yesterday, today and
tomorrow buttons.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:48:46 +01:00
6cc3e618d8 Bug 29500: Flatpickr - accept original date in the past and not others
Bug 29241 was supposed to fix this but it didn't properly.
We are accepting other dates in the past when we should only accept the
original one (the one from the DB) AND dates in future.

Test plan:
Retry test plan for 29241 and confirm that you cannot set manually another
date in the past.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:48:46 +01:00
4f5670c889 Bug 29394: Remove futuredate for renew
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:48:45 +01:00
7ed705056d Bug 29394: adjust request.tt
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:48:45 +01:00
8fb01c0453 Bug 29394: (follow-up) Pass correct time format and other corrections
This patch makes a few corrections, including adding the
correct Flatpickr date format option when the timepicker is enabled.

Besides past and future date options, I've added a "pastinclusive"
option which allows dates in the past OR today. This option was
previously applied to the checkin page.

The patch also corrects a couple of places where the wrong date field
was modified with the new data attributes.

To test, apply the patch and test the datepickers on the batch checkout
and renew pages. When you select a date and time the "TimeFormat" system
preference should be correctly applied.

The calendar widget on the checkin page should allow you to select
today's date.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:48:45 +01:00
bcfd3849a9 Bug 29394: Remove flatpickr instantiations from most of the tt files
We must reduce the instantiations as much as possible to take advantages
of the default values and specific behaviours we have defined in
calendar.inc

This patch is suggesting to have a .flatpickr class and using the data
attributes:
- flatpickr-futuredate
- flatpickr-pastdate
- flatpickr-enable-time
- flatpickr-on-close-focus

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:48:45 +01:00
Katrin Fischer
106f791e61 Bug 29010: (QA follow-up) Change inputmode from numeric to decimal
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-22 11:13:10 +01:00
Thomas Klausner
0673c73c5f Bug 29010: fix pattern in search_field.weight
search_field.weight is of type NUMERIC(5,2) in the database, and values
are rendered as floats in /admin/searchengine/elasticsearch/mappings.pl

But the field validation only accepts INTs. This patch fixes the pattern
to accept NUMERIC(ish) values

- Enable Elasticsearch (but no need to actually index anyting)
- go to cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
- Enter an integer (eg "8") into any "weight" column and click save
- Koha now displays the value as NUMERIC, eg. "8.00"
- Change nothing, and click save again
- Save does not work, you get a warning by the browser that the input
  does not match the requested format (because in the html field only
  ints are allowed, but the DB stored the value as numeric and returns
  it as such)
- Workaround: Change all the values back to ints (i.e. remove ".00"),
  but this is very cumbersome if you have several weights

- Apply the patch
- Now try to save again (without changing eg "8.00" to "8". It works
- Add a new weight (eg "4"), save, it's turned into "4.00", but saving
  again still works

Sponsored-by: Steiermärkische Landesbibliothek

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>
2021-11-22 11:13:10 +01:00
Katrin Fischer
e6cdda9b01 Bug 29456: Add Hold_Reminder description to patron categories overview page
This was missed when initially adding the notice.

To test:
- Go to Administraiton > patron categories
- Edit a patron category and check "Hold reminder" in messaging
  preferences, save.
- Go to the overview page and verify it shows as 'Unknown'.
- Apply patch.
- Descrpition should now display.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-19 15:23:27 +01:00
d50aad2a91 Bug 29456: (bug 18532 follow-up) handle Auto_Renewals messages in category
The new message appears in the list on the edit view, but the list view
is showing "unknown"

Test plan:
Set AutoRenewalNotices to "according to patron messaging prefs"
Edit a patron category
Tick all the checkboxes
On the category list view you should see a correct display in the
"Messaging" column

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-19 15:23:27 +01:00
c483fecc63 Bug 5229: Remove from searching.pref
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-19 15:23:27 +01:00
90090a3601 Bug 29496: (bug 27526 follow-up) Fix item form validation
The validation of the forms were blocked with "X item mandatory fields
empty" when at least one dropdown list subfield was marked as mandatory.

We need to add the 'input_marceditor' class to the select (does it
actually make sense? select vs input...)

Caused by
  commit 6ed29bccef
  Bug 27526: Fix mandatory and important checks
Which lamentably failed as it was stating:
"Using .input_marceditor let us fix the additem.tt form and prevent to break the other ones"

Signed-off-by: Marion Durand <marion.durand@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-19 15:07:10 +01:00
Marion Durand
294741b1df Bug 29496: CheckMandatorySubfields don't work properly with select field in serials-edit.tt
Since one of the patches of BZ 27526 (Bug 27526: Fix mandatory and
important checks), CheckMandatorySubfields use the class
"input_marceditor" but in file serials-edit.tt this class is not set for
all field (it is present on text input but not on select input) 5
9- Check that no error appear and that your item has been created.

In consequence if a select field is set as mandatory, it is detected as
missing even if it is filed and so you can't submit the form and receive
the new serial.

Test plan:
0- Be sure to be in a version of koha where the patch that introduces
   the bug is present (it is present in master since Jul 8 2021 (it is
   present in 21.06.00.046) and will be pushed in 21.11.00)
1- Create (or find) a subscription for a biblio record and select the
   option "Create an item record when receiving this serial"
2- Be sure to have at least one mandatory subfield that is filed with a
   select input in the framework used by the biblio record. (ex: 995$b,
   995$c or 995$e in unimarc; 952$a, 952$b or 952$c in marc21)
3- From the subscription-detail page click on "Receive"
4- Change the status to "Arrived" and fill the item form that appears.
5- Click on "Save"
6- Check that an error box appear with the message " Form not submitted
   because of the following problem(s) 1 mandatory fields empty
   (highlighted)" (the number can be different according to the number of
   concerned subfields)
7- Apply the patch
8- Repeat step 3 to 5
9- Check that no error appear and that your item has been created

JD amended patch: remove comma to separate classes

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-19 15:07:10 +01:00
7bddfeb412 Bug 29270: start_for is actually date_to
The attribute has been renamed in the meanwhile..

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-17 09:32:42 +01:00
ad50d6ad6f Bug 29477: Flatpickr - default to 23:59 for the time part
It was defaulting to 12:00 which was an unexpected change in behaviour
caused by flatpickr switch.

Test plan:
On the circulation view, check some items out and play with the time
part and "Remember for session". The behaviour must be correct, ie. the
same as prior to flatpickr switch.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-17 09:04:49 +01:00
34422de230 Bug 29270: Expiration date must be in future
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-17 09:04:39 +01:00
ff2fbfe35f Bug 28816: (follow-up) Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-16 13:59:57 +01:00
de75673d8a Bug 29408: Add JSDoc documentation for kohaTable function
This patch adds some JSDoc formatted parameter documentation for the
kohaTable function.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-15 12:38:39 +01:00
030db7cc8d Bug 29408: Update all existing uses of .api to .kohaTable
This patch goes through the codebase and updates existing revelant calls
to .api referencing the Koha REST dataTables wrapper to use the name
name 'kohaTable'.

Test plan.
1) Ensure the tables on the following pages all continue to work as
   expected
   a) acqui/parcel
   b) admin/branches
   c) admin/cities
   d) admin/smtp_servers
   e) pos/register
   f) tools/quotes

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-15 12:38:39 +01:00
db4cec8498 Bug 29408: Rename Koha dataTables wrapper
This patch renames the Koha REST JS dataTables wrapper from the
ambigious 'api' to the clearer 'kohaTable'.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-15 12:38:39 +01:00
c7e2837c4e Bug 28627: Calculate unitprice if not set
On bug 23376 the developer was too clever by half. Instead of passing
values to the template we moved to simply passing the order object.

The calculations that populated the unitprice, however, were simply dropped.

This patch restores the behaviour of setting unitprice to the estimated cost
by default. We do this conditionally in the template

To test:
 1 - Create a basket and adding items to it. Set the 'Vendor price' to
    '20', do not add an 'Actual cost'
 2 - Close the basket
 3 - Select 'Receive shipment'
 4 - Set a value for vendor invoice
 5 - Receive the order you created
 6 - Observe 'Actual cost' is = 0.00
 7 - Apply patch
 8 - Refresh the order receival page, and confirm the 'Actual cost' =
    20.00
 9 - Cancel receipt - reopen basket - edit order - add an actual cost - close
10 - Receive the order again
11 - Confirm the actual price is used
12 - Repeat this whole plan, but ensure the vendor has a different value for
     Invoice prices: Include tax

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

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-15 12:38:39 +01:00
b1fbae1580 Bug 28374: Convert printreceipt to use GetPreparedLetter
This patch converts the point of sale receipt printer controller to
using GetPreparedLetter instead of calling getletter directly.

Test plan
1. Setup for testing:
   i.   Enable EnablePointOfSale and UseCashRegisters system preferences
   ii.  Add a new cash register
        (Administration > Accounting > Cash registers)
   iii. Add one or two products for sale
        (Administration > Accounting > Debit types, make sure 'Can be sold?' is ticked)
2. Go to Home > Point of sale
3. Add some items for purchase to a sale
4. Click confirm
5. Click on 'Print receipt' and save the PDF file somewhere
6. Apply patches
7. Update database: updatedatabase
8. Repeat steps 2-5
9. Compare receipt PDFs - should be no changes
10. Check that the default RECEIPT is updated - for print, HTML should be ticked
11. Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-15 12:38:39 +01:00
5b5b443d6c Bug 29459: Replace some missed datetimepickers in circulation templates with Flatpickr
This patch updates a few more instances of jQueryUI datepickers which
were missed initially, replacing them with Flatpickr widgets.

Also changed: A few datetime input fields are updated to have a size of
20, consistent with other datetime input fields.

To test, apply the patch and go to Circulation.

Check in:

- With the 'SpecifyReturnDate' system preference enabled, go to Check
  in.
- Click the "Checkin settings" link.
- Test the "Specify return date" field. Clicking it should trigger a
  Flatpickr widget with a time picker. It should limit your selection to
  dates in the past.
- Check the "Remember return date" checkbox and confirm that the date is
  preserved over page reloads.
- Check and uncheck the "Box drop mode" checkbox to confirm that the
  return date field is disabled and enabled correctly.

Check out:

- With the 'AllowRenewalOnHoldOverride' preference enabled, check out to
  a patron who has a checkout which is on hold for another patron.
- At the bottom of the table of checkouts, click the "Override renewal
  restrictions" checkbox.
- The on-hold checkouts should now have a checkbox in the "Renew"
  column. Check one or more of these checkboxes.
- In the table footer you should now see two date inputs, "Renewal due
  date" and "On hold due date." These should both trigger Flatpickr
  widgets with time pickers.
- Confirm that your date selections are submitted correctly when you
  renew items.

ILL checkout:

- Create a new ILL request with the type "book," filling in at least
  title, patron, and destination library.
- On the "Manage ILL request" page, click "Confirm request" and "Confirm
  request" on the next confirmation page.
- There should now be a "Check out" button in the "Manage ILL request"
  toolbar. Click it.
- Test the "Due date" field. It should trigger a Flatpickr widget with a
  time picker.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-15 12:38:39 +01:00
c44edf6f1c Bug 28376: (follow-up) Replace jQueryUI date/timepicker with Flatpickr
Remove uneeded include of flatpickr.min.js (we load it from
calendar.inc)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-15 12:38:39 +01:00
a9b5c861b2 Bug 29195: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-08 12:15:58 +01:00
c3a91082e9 Bug 29195: Fix highlighting on odd rows in circ-patron-search-results
This patch adds "!important" to the CSS rule governing the background
color of table cells when hovered. It only applies to tables with the
"selections-table" class.

Although "!important" is not usually recommended, in this case the
appliation is narrow enough that I think it outweighs the complicated
selector that would be required to make it work otherwise.

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

- Locate a record in the catalog and being the process of placing a
  hold.
- When you're asked to enter a card number or search by name, search
  using a name which will return multiple results.
- In the table of results, hovering the mouse over the table should
  highlight the row in yellow.
- Perform the same test when searching for a club by name.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-08 12:12:01 +01:00
d28f934282 Bug 29407: Make the pickup locations dropdown JS reusable
This patch generates a function to be used in places where select2
dropdowns are usesd for choosing pickup locations. This cleans
repeated/almost identical code introduced by different bugs.

To test:
1. Make sure choosing pickup locations works
2. Apply this patch
3. Repeat 1
=> SUCCESS: No functional changes
4. Sign off :-D

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-08 11:42:07 +01:00
7af1a0f052 Bug 29404: Add infinite scrolling to pickup location dropdowns
This patch adds infinite scrolling to the pickup locations select2
dropdowns on the staff interface.

It does so by adding a new transport function (in select2.js) to read
the response headers Koha's API sends back, and converting to the right
data structure Select2 expects for the feature to work.

This is manually used in the different pickup locations dropdowns.
There's a separate bug that will introduce a select2 wrapper that will probably embed this function in it.

To test:
1. Run the [DO NOT PUSH] script inside koha-shell to generate random
   pickup locations:
   $ kshell
  k$ perl generate_pickup_locations.pl
2. Try placing holds. Notice the visible pickup locations dropdowns
   display some pickup locations based on the matches you got. They are
   all fetched once
=> SUCCESS: It works
3. Repeat for the current holds page and the patron holds listing
=> SUCCESS: Same behavior
4. Apply this patch
5. Repeat 2 and 3
=> SUCCESS: Things work, but pickup locations are retrieved as needed,
while you scroll.
6. Sign off :-D

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-08 11:42:07 +01:00
e4efbe396a Bug 29430: Table cell click doesn't activate buttons in patron search
Bug 15812 included a change which allows a click on the patron
search results table cell to toggle the checkbox it contains. This patch
modifies that click event so that it fires the change() event which is
required for toggling the "Add to patron list" and "Merge patrons"
buttons.

To reproduce this problem, perform a patron search in the staff client
which will return multiple results.
 - In the first column containing checkboxes, click in the empty part of
   the table cell. The checkbox should be checked.
   - However, the "Add to patron list" button remains disabled.
  - Clicking a table cell to check another checkbox should result in the
    "Merge selected patrons" button being enabled, but it doesn't.

To test, apply the patch and repeat the process above. The behavior of
the buttons should be the same whether you're clicking the checkbox
itself or the table cell it's in.

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

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-08 11:42:07 +01:00
8473254ec3 Bug 24224: Convert OpacNavBottom system preference to additional content
This patch builds on Bug 22318 to move the OpacNavBottom system
preference into the "Additional contents" system, making it possible to
have language- and library-specific content.

To test you should have some content in the OpacNavBottom system
preference. To make testing easier it's also a good idea to have content
in the OpacNav preference.

- Apply the patch and run the database update process.
- In the staff client, go to Tools -> HTML customizations and verify
  that the content from OpacNavBottom is now stored there. When you
  edit the entry you should see content from the OpacNavBottom system
  preference under the "default" tab.
  - The publication date for the entry should be today's date.
  - Confirm that the previous contents of OpacNavBottom were added
    correctly.
- Go to Administration -> System preferences -> OPAC and verify that
  the OpacNavBottom preference has been removed.
- Update and reinstall active translations (for instance fr-FR):
  - cd misc/translator/
  - perl translate update fr-FR
  - perl translate install fr-FR
- View the OPAC and confirm that the contents of the OpacNavBottom
  system preference displays in the left-hand sidebar.
- Test as many pages as possible to confirm that wherever the
  OpacNavBottom content is displayed, OpacNavBottom is also displayed.
- Test also using the updated translation.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-08 11:41:48 +01:00
1d0a023b6f Bug 24223: (follow-up) Do not add id 'opacnav' in navigation.inc
Id attribut will be defined by 'koha_news_block'.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-08 11:33:14 +01:00
4577950900 Bug 24223: Convert OpacNav system preference to additional content
This patch builds on Bug 22318 to move the OpacNav system
preference into the "Additional contents" system, making it possible to
have language- and library-specific content.

To test you should have some content in the OpacNav system
preference. To make testing easier it's also a good idea to have content
in the OpacNavBottom preference.

 - Apply the patch and run the database update process.
 - In the staff client, go to Tools -> HTML customizations and verify
   that the content from OpacNav is now stored there. When you
   edit the entry you should see content for each of the enabled
   translations in your system under each tab.
   - Confirm that the previous contents of OpacNav were added
     correctly.
 - Go to Administration -> System preferences -> OPAC and verify that
   the OpacNav preference has been removed.
 - Update and reinstall active translations (for instance fr-FR):
   - cd misc/translator/
   - perl translate update fr-FR
   - perl translate install fr-FR
 - View the OPAC and confirm that the contents of the OpacNav system
   preference displays in the left-hand sidebar.
 - Test as many pages as possible to confirm that wherever the
   OpacNavBottom content is displayed, OpacNav is also displayed.
 - Test also using the updated translation.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 24223: (follow-up) Add date to OpacNav additional content entries

This follow-up modifies the atomic update so that it inserts today's
date as the "Published on" date. Without that information the system
considers the item unpublished and will not display the content.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 24223: (follow-up) Make logged-in user's branchcode available to template

This patch makes a couple of corrections for problems I discovered
while working on Bug 24224: The variables required for correct display
of news items by branch and language were not consistently available to
the templates.

In opac-readingrecord.pl, the "lang" variable was being overwritten. On
this and other pages the logged-in patron's brachcode was not made
available. I've corrected instances of KohaNews.get() to use the
globally-available "logged_in_user.branchcode" instead.

To test, apply the patch and follow the original test plan, with the
addition of instances of the OpacNav additional contents item which
have a specific library selected.

Confirm that such items are correctly displayed according to the
logged-in user's home library. If there is no logged-in user the
library-specific OpacNav should not display.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 24223: (follow-up) Updates to conform to new practices

- The patch now works with new "Additional contents" system
- The database update follows new skeleton.pl
- Add "OpacNav" option to the additional contents template

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 24223: (follow-up) Add missing "return" to atomicupdate

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 24223: (QA follow-up) Link OpacNav to HTML customizations now

In the pref description of OpacNavBottom. (Before obsoleting that
one too somewhere soon.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-08 11:18:39 +01:00
Andreas Roussos
4ba18f5f44 Bug 29123: Add Dataly Tech to About page
This patch adds Dataly Tech to the list of "Contributing companies
and institutions" in the About page.

Test plan:
1) View the About page, notice how Dataly Tech is missing
2) Apply this patch
3) Reload the About page, this time "Dataly Tech, Greece" is listed

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-05 12:17:08 +01:00
cc3a129db8 Bug 29411: Redirect to circulation if circsearch is true
TO test:
 1 - Have a patron with a unique surname i.e. Acosta
 2 - Enter the surename into 'Search patrons' box on staff homepage
 3 - You are redirected to 'members/moremember.pl'
 4 - Enter the surname into 'Check out' box at top of page
 5 - You are redirected to 'members/moremember.pl'
 6 - Apply patch
 7 - Enter the surename into 'Search patrons' box on staff homepage
 8 - You are redirected to 'members/moremember.pl'
 9 - Enter the surname into 'Check out' box at top of page
10 - You are redirected to 'circ/circulation.pl'

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-05 12:17:08 +01:00
9bf0672360 Bug 28768: Fix borrowernumber from opac-readingrecord.tt
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-05 12:17:08 +01:00
70485bf1cc Bug 29180: Rename syspref RequestOnOpac with OPACHoldRequests
It is a confusing name because we have 'Article Request' as a feature,
and this does not follow Koha terminology.

Test plan:
`updatedatabase` and confirm that the syspref has been renamed
`git grep RequestOnOpac` => No occurrence in the code

QA: The syspref's value is always retrieved using Koha.Preference from
.tt files, we don't need to send it from controllers or C4::Auth

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-05 12:13:25 +01:00
588cb367ba Bug 29265: Add missing category parameter
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-05 12:02:17 +01:00
91d1d3daeb Bug 29261: Add missing html filters
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-04 09:24:59 +01:00
c7ba914861 Bug 29265: Add option to pick editor when creating a new content entry
This patch changes the "New entry" button on the additional contents
page to be a split button which offers the alternative of the
non-default editor (as defined by AdditionalContentsEditor).

Also changed: I moved some of the template logic around to consolidate
handling of the editor variables.

To test, apply the patch and go to Tools -> HTML customizations.

 - At the top of the page there should be a split button. The dropdown
   option should offer the non-default editor.
 - If AdditionalContentsEditor is set to "text editor," clicking the
   "main" part of the button should take you to an entry page which uses
   the text editor.
   - The dropdown part of the button should say "New entry using
      WYSIWYG editor."
 - Switch the AdditionalContentsEditor preference and confirm that the
   button reflects the change.
 - Confirm that the individual "Edit" buttons for each existing content
   entry still works correctly according to the system preference.

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-03 15:41:03 +01:00
d14c1f15a4 Bug 29201: Add option to insert biblio_framework runtime parameter in SQL report
This patch modifies the SQL report creation process so that the list of
runtime parameters includes an option for bibliographic framework.

To test, apply the patch and go to Reports -> Create from SQL.

- Click the "Insert runtime parameter" menu button and select
  "Bibliographic framework."
- You should be shown a modal dialog in which you can change the label
  on the framework input.
- Click "Insert parameter." The SQL field should now contain the correct
  parameter, e.g. <<Framework|biblio_framework>>
- Use the parameter to define an SQL query, e.g.

  "SELECT * FROM biblio WHERE frameworkcode =
  <<Framework|biblio_framework>> LIMIT 10"

- Run the report. You should be asked to choose a framework. Confirm
  that the report runs correctly.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:53 +01:00
3bc141ae7d Bug 28982: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:53 +01:00
c709354319 Bug 28982: (follow-up) Ensure that date format is correctly checked
This patch modifies the global calendar include so that it doesn't use
the potentially-undefined template variable "dateformat."

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:53 +01:00
b313584807 Bug 28982: Use Flatpickr on onboarding pages
This patch replaces the use of jQueryUI's datepicker in the onboarding
templates. The addition of calendar.inc to the template requires that
some additions be made to the installer's header files, adding the i18n
JavaScript assets.

jQueryUI-specific CSS is removed from installer.scss, and inclusion of
Flatpickr's SCSS is added.

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

- Start the installation process.
- Continue through the installation process until you reach the stage in
  onboarding where you are creating a patron category.
- The "Enrollment period -> Until" field should be a Flatpickr calendar
  widget. The widget should look and work correctly.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:53 +01:00
0a67a732c2 Bug 28816: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:53 +01:00
087cb956e0 Bug 28816: Improve the display of multiple holds during hold process
This patch updates the appearance of the "confirm holds" page, shown
during the process of placing a hold for someone in the staff interface.

Most of the changes affect the appearance of the page when placing
multiple holds on titles which have one or more holds on them already.

The changes are intended to make the page clearer and easier to scan,
especially when placing multiple holds at once.

Also changed: The page heading when placing multiple holds now changes
based on whether you've selected a patron or not. It says "Search
patrons or clubs" when it's waiting for a patron/club selection. It says
"Place holds" after the patron/club has been selected. This is instead
of "Confirm holds" on both pages.

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

- Go to Administration -> System preferences and set HoldsSplitQueue to
  "nothing."
- Perform a search in the staff client catalog and place multiple holds
  titles from that result set on hold for a patron.
- Perform the same search and select one or more of the titles you
  selected before in addition to one or more titles with no holds.
- After clicking the "Place hold" button you should see a page with the
  heading "Search patrons or clubs" showing information about existing
  holds. This section of the page should be clear and readable, with
  clear distinction between each section of information about each hold.
- Test this page again under each different option for the
  "HoldsSplitQueue" system preference by changing the preference and
  reloading the 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>
2021-11-03 15:40:53 +01:00
d5215670c9 Bug 28694: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:53 +01:00
6fe42caeb9 Bug 28694: Check alert in cataloguing should be a static message
This patch modifies the basic cataloging interface so that form
validation errors are collected in a static "dialog" at the top of the
page instead of showing in a transient JavaScript alert.

The text of the message is roughly the same as it was in the alert, and
links have been added so that the user can click to jump directly to the
field referenced.

If the user scrolls down away from the static error message, a button
appears in the floating toolbar to jump back to the message.

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

- Go to Cataloging and create a new record using the basic cataloging
  editor and a framework which has multiple mandatory fields defined
  (e.g. an unmodified default framework)
- Without entering anything in mandatory fields, click the "Save"
  button.
- You should see a message box appear at the top of the page.
  - It should list each missing mandatory subfield and tag, each with a
    "Go to field" link next to it.
  - Clicking the "Go to field" link should switch you to the correct tab
    and scroll the mandatory field into view.
- When you have scrolled down far enough for the error messages to be
  offscreen, an "Errors" button should appear in the floating toolbar.
  Clicking it should scroll the box back into view.
- The JS function for scrolling to a particular element on the screen
  has been modified, so test that the links in the toolbar for
  individual tags still work 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>
2021-11-03 15:40:52 +01: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
7a368c4e43 Bug 28450: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
a1f074ee8d Bug 28450: Make Account summary print tables configurable
This patch adds table settings for the three tables which appear on the
patron's "Print summary" view. This will allow the administrator to
set a default configuration for columns on the print summary page.

To test, apply the patch and restart-all to load the revised columns
settings YAML. Rebuild the staff interface SCSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Go to Administration -> Table settings -> Circulation.
- Under the "Circulation tables" heading you should see a "Jump to" link
  to "print_summary."
- In the settings for the print_summary page you should see three
  tables: print-summary-checkouts, print-summary-fines, and
  print-summary-holds.
- Locate a patron account which has checkouts, fines, and holds.
  - From the patron detail view click "Print -> Print summary."
  - A new window should open with the print summary view. All tables
    should display correctly.
  - Test that the "Columns" buttons work correctly to show and hide
    columns.
- Make changes to the default settings for these tables to confirm that
  they work on the print summary page.

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-11-03 15:40:52 +01:00
13375107ce Bug 27823: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
9e9aa42685 Bug 27823: List upcoming steps during installation process
This patch adds text to each step of the installation process showing
which steps have been completed, which step is current, and which steps
come next. This helps the user know where they are in the process.

To test, apply the patch and begin the process of installing Koha. In my
testing environment I drop the Koha database and create it again.

On each step of the installation process, confirm that the list of steps
is correct, showing the right stage in the process.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
2d8df2e5a5 Bug 27296: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
e6a8a2d624 Bug 27296: Return claims should be filtered by default to show unresolved claims
This patch modifies the DataTables configuration of the return claims
table on the checkout and patron detail pages. Using the footerCallback
function, the count of resolved and unresolved claims is calculated and
used to filter the list of claims to show only unresolved claims by
default.

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

- If necessary, Enable claims returned functionality by defining a value
  in the ClaimReturnedLostValue system preference.
- Open for checkout a patron who has items checked out.
- From the table of checkouts, click "Claim returned" for one or more
  items.
  - As you mark items "Clamed returned," the the items should appear
    under the "Claims" tab. The corresonding filter links should be
    updated accordingly, "Show all X claims."
  - Mark one or more claims resolved. As you do so they should disappear
    from the list of claims. The filter links should be updated to
    reflect that there are some resolved and some unresolved claims.
  - Clicking each filter link should trigger the correct filter.
  - Test this process when the count of unresolved claims is zero and
    when the cound of resolved claims is zero.

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, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/checkouts.js for
  translation, e.g.:

  #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:1086
  msgid "Show 1 claim"
  msgid_plural "Show all {count} claims"
  msgstr[0] ""
  msgstr[1] ""

- Edit the "msgstr" strings 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 staff client 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>
2021-11-03 15:40:52 +01:00
6d3cd34ffe Bug 29015: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
Katrin Fischer
b2e15f0cac Bug 29015: (QA follow-up) Change collection code to be just collection
We did some clean-up in that area a little while ago, agreeing that
as we acutally display the descriptions, the label should be just
"collection".

This patch also removes some ():

Before:
4 items found for Centerville and item type:(Books) and collection: (Reference) and shelving location: (General Stacks)

Now:
4 items found for Centerville and item type: Books and collection: Reference and shelving location: General Stacks

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
00ff7216fd Bug 29015: (follow-up) Default to logged in branch unless viewing queue
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>
2021-11-03 15:40:52 +01:00
4a87ff8703 Bug 29015: (follow-up) Show sidebar filter form with results
This patch adds the new filter form in the sidebar when showing results.
To do so the form markup is moved into a BLOCK so that it can be reused.

This patch also adds pre-selection of submitted options on the filter
form so that it reflects the user's choices.

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

- Go to Circulation -> Holds queue.
- Submit the form with one or more filters selected.
- On the results page the queue should be correctly filtered and the
  sidebar should show your search fields preselected.
- Test with the CircSidebar preference enabled and disabled. The
  circulation menu should appear correctly, with the filter form only
  displaying in the sidebar after submitting the form.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
2a6af1a6bd Bug 29015: Add options for itemtype, collection, and shelving location to view_holdsqueue.pl
This patch makes the code for itemtypeslimit work, and adds options for shelving location and collection code

This also remove the 'post' method from the form to allow easy bookmarking

To test:
1 - Add holds to your system
2 - Run the holds queue builder
3 - Browse to Circulation->Holds queue
4 - Note the library dropdown
5 - Apply patch
6 - Reload and note new options
7 - Test that both limits and 'All' options work as expected
8 - Note that description at top includes options when selected
    "### items found for All libraries and item type:(Books)"

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>
2021-11-03 15:40:52 +01:00
Katrin Fischer
9176a7835f Bug 27360: Add hint to input field
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
e6e4d74b0f Bug 27360: Use 'public' to filter libraries for opac display
This patch adds the ability to set a library as 'public' or not; this
allows librarians to hide back office library branches from the opac.

Test plan
1/ Set a library as public from `admin > libraries`.
2/ Navigate to the `Libraries` page in the OPAC
3/ Note that only `public` libraries are displayed.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
dcf93633b3 Bug 25883: Replace 'holdingbranch' with 'transfer to' in returns
This patch replaces the "Holding library" column in the returns table
with a 'Transfer to' column that displays the destination for the item
awaiting transfer if a transfer exists.

Signed-off-by: Ben Daeuber <bdaeuber@fargolibrary.org>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
Katrin Fischer
aa2d8b024f Bug 24406: Wrap patron category type code in a span on patron search results
The patron category type code (A, C, O, ...) is currently displayed in the
patron module search and the patron card creator and acquisition patron searches.

This information is not useful for most users, as these are internal codes
that cannot be easily "decoded". And while you might be able to guess A as
Adult in English, it doesn't translate to other languages.

This patch wraps a span around the patron category type code shown
in () after the patron category.

To test:
- Verify for each of the following three searches, that the patron category code
  displays in the search results, but is wrapped in a span with the class
  patron_category_type
- Tools > Patron card creator
  - New > New card batch > Add patrons
  - Search for patrons
- Patrons
  - Search for patrons
- Acquisitions
  - Add a budget
  - Add a fund for the budget
  - Search for a user or owner to add

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
320b162827 Bug 28879: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
Andrew Isherwood
b286d9be41 Bug 28879: Fix display of request metadata
This commit adjusts the CSS surrounding the display of request
metadata, it improves the display for metadata with long key names.

Test plan:

- Do not apply patch
- Create a FreeForm ILL request with a custom metadata field with a long
  name
- View the created request
- Observe that the long metadata name breaks the display of the metadata
- Apply the patch
- View the created request
  => TEST: Observe that the display is no longer broken

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>
2021-11-03 15:40:52 +01:00
4f57531d14 Bug 29261: (bug 15812 follow-up 3) Fix translation issue in include file
This is getting messy. No idea how I tested the previous patches but it
was not working, the problem still persisted.

This patch is using the I18N TT plugin to make things easier and fix the
original problem.

Test plan:
Apply the patch
perl translate update fi-FI
Edit misc/translator/po/fi-FI-messages.po
Locate and translate "Check out"
 61 #: koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt:20
 62 msgid "Check out"
 63 msgstr "Laina"
Locate and transate "View"
 182 #: koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt:22
 183 msgid "View"
 184 msgstr "Nayta"
Apply the change to the fi-FI templates
perl translate install fi-FI

Now enable the fi-FI in the lang syspref, search for patron and confirm
that the result view is displayed correctly.
Note that the "Check out" and "View" strings are correctly translated
(when you hover the cardnumbers or patron's names)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 15:40:52 +01:00
fab97c6d38 Bug 28901: (follow-up) Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-03 13:36:04 +01:00
b2e4b90f99 Bug 28904: Fix typo and display
Fix typo in template: Newletter => Newsletter
Fix latest newsletter editor definition.. it's a has not an array.

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:50:01 +01:00
b6c1fbb08a Bug 28904: Add newsletter editor to about page display
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:50:01 +01:00
036d7bd428 Bug 29329: Remove stray character in opac-detail.tt
1. Have  OpacBrowseResults on.
2. Make search with many results.
3. Go to the record detail page
4. Click 'Browse results'
5. At the bottom of the container notice the stray "s".
6. apply patch
7. Try again, the "s" is gone!

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:50:01 +01:00
51f42b8734 Bug 29356: Pickup location dropdowns should perform 'contains' searches
When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville.

On the Libraries page in Admin, however, the search box both left- and
right-truncates, so one can type "en" and find Centerville.

This patch makes the search perform 'contains' searches.

To test:
1. Try placing a hold. Make sure your rules allow Centerville to be a
   valid pickup location.
2. Search 'cen'
=> SUCCESS: Centerville shows
3. Search 'en
=> FAIL: Centerville doesn't show
4. Apply this patch and reload
5. Repeat 2
=> SUCCESS: Works!
6. Repeat 3
=> SUCCSS: Centerville shows!
7. Sign off :-D

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
413d882488 Bug 29355: Make pickup location dropdowns RESTdefaultPageSize agnostic
This patch makes the select2 dropdowns for pickup locations not be
limited to the RESTdefaultPageSize syspref limit.

To test:
1. Have less than 20 libraries in your system as valid pickup locations
2. Place a hold via the staff client
=> SUCCESS: See that all your libraries appear in the pickup location dropdowns at the bib and item level
3. Update RESTdefaultPageSize, set the value to something lower than your count of pickup libraries
4. place another hold
=> FAIL: Your pickup location list gets cut off and only shows as many locations as RESTdefaultPageSize allows
5. Apply this patch
6. Repeat 4
=> SUCCESS: All your pickup locations show
7. Sign off :-D

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +01:00
07464b53ed Bug 29351: Add missing cn_source parameter to reports parameter menu
This patch adds an option to insert "Source of classification or
shelving scheme" as a runtime parameter in SQL reports. The ability to
use cn_source as a parameter seems to have always been part of this
feature but wasn't documented.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select
   "Classification source."
 - Customize the parameter label if you wish and click "Insert
   parameter."
 - The parameter should be inserted like this:

   <<Source of classification or shelving scheme|cn_source>>

 - Use it to create a valid SQL report, for example:

   SELECT * FROM items WHERE cn_source = <<Source of classification or
   shelving scheme|cn_source>> LIMIT 10

 - Confirm that upon running the report you are prompted to select a
   classification source.
 - Confirm that the report runs correctly.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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:50:01 +01:00
ca6c81ec5c Bug 29352: Runtime parameter labels should not be said to be optional
This patch alters the form shown when using the "Insert runtime
parameter" button in SQL reports. It makes the label field required and
removes "optional" from the field hint.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select "Authorized
   value."
 - Clear the "parameter label" field and click "Insert parameter."
 - The form should display an error asking you to fill in the label
   field.
 - Test that the category field is also required.
 - Close the modal and select a different runtime parameter.
 - Test again that the label field is required.
 - Test that the form submits correctly when the label field is
   populated.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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:50:01 +01:00
c0a000d5df Bug 29328: Add missing list parameter to reports parameter menu
This patch adds an option to insert "list" as a runtime parameter in SQL
reports (As added by Bug 27380).

To test, apply the patch and go to Reports -> Create from SQL.

- Click the "Insert runtime parameter" button and select
  "List."
- Customize the parameter label if you wish and click "Insert
  parameter."
- The parameter should be inserted like this:

  <<List of values|list>>

- Use it to create a valid SQL report, for example:

  SELECT * FROM borrowers WHERE categorycode IN  <<List of values|list>>
  LIMIT 10

- Confirm that upon running the report you are shown a textarea. Enter
  two or more values in the textarea, each on a separate line.
- Confirm that the report runs correctly. The SQL above would show you
  this when you click "Show SQL code":

  SELECT * FROM borrowers WHERE categorycode IN  ('A','S')  LIMIT 10

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.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:50:01 +01:00
e9c4fe3d9f Bug 29242: Flatpickr - Should autocomplete be turned off?
This patch adds a step to Flatpickr initialization to add an
autocomplete attribute set to "off" so that browsers' built-in
autocomplete menus do not obscure the calendar.

To test you must be using a browser which has form history enabled.

Locate a form that includes a Flatpickr input field, e.g.  Reports
-> Catalog statistics.

Fill the date fields and submit the form. Go back to the form and click
one of the form fields you previously filled out (once in Chrome, twice
in Firefox). The browser should not show its native form history
dropdown.

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:50:01 +01:00
9210f71836 Bug 28901: Compiled CSS
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 16:50:01 +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
Jérémy Breuillard
36d2111d70 Bug 29075: 'OPAC info' removed in branches.pl
In Administration › Libraries, we see content of OPAC info as escaped HTML.
This content may be long and seeing HTML tags is strange.

We should not show it in this table.
Or maybe create a modal preview of it (not escaped HTML).

To test :
1) Home > Administration > Libraries
2) In 'Address' column notice the 'OPAC info' field (if this one is
filled) with visible HTML tags
3) Apply patch
4) Repeat 1) and 'OPAC info' field should be gone

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 15:58:04 +01:00
0011eca7e6 Bug 28913: Note cronjob on automatic return settings in itemtypes
To test:
1 - go to itemtype config in Admin
2 - confirm it doesn't mention the automatic_return cron
3 - apply patch and restart
4 - confirm note now says "This feature requires the misc/cronjobs/automatic_checkin.pl cronjob. Ask your system administrator to schedule it."

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>
2021-11-02 14:57:25 +01:00
153ff795ab Bug 24370: (QA follow-up) Make new suggestions default to the library you re viewing
It looks like this problem was caused by code from bug 25033, we were attempting to have the
dropdown either be the current branch filter, or the suggestion's branch code, but the variables here are confusing and it didn't work

This explicitly sets the branchcode when creating a new suggestion to allow fixing current behaviour and
show the correct value when creating new

To test:
1 - Be signed in as branch A
2 - Browse to suggestions and limit to branch "Any"
3 - Click 'New suggestion"
4 - Defaults to Any
5 - Cancel and limit to branch B
6 - New suggestion defaults to branch B

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:04 +01:00
Katrin Fischer
02adde9a43 Bug 24370: Don't reset library when editing a suggestion
When editing a suggestion, the library will be reset to the currently
logged in librarian's homebranch, no matter what the libray was before.

This fixes this, the library selection will remain at the db value when
edited.

To test:
- Create a suggestion with Any library.
- Edit the suggestion - it will show your homebranch as library
- Change to any library but your homebranch
- The summary should show the correct value after saving
- Edit the suggestoin again - it's set back to your homebranch again
- Apply patch
- Repeat the steps, the pull down should now show the correct library
  at all times.

Caveat: I think there is a somewhat separate issue/bug in that once a library
was saved, you cannot switch back to "Any". I haven't been able to fix this and
suggest to maybe file a separate bug.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:04 +01:00
George Veranis
ef335f252a Bug 28573: Replace authority record with Z39.50/SRU creates new authority record
When trying to replace an authority record with Z39.50/SRU then a new authority
record is created without deleting the old one and not link the new one with
any record.

This patch fixes that.

Test plan:

1) Try to catalogue a new authority record from cataloguing form.
2) Try to replace that authority record with Z39.50/SRU, then a new authority
record is created and also you have that one that you tried to replace.
3) Apply the patch.
4) Try to replace the authority from step1 with Z39.50/SRU, then is working as
expected.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-02 14:57:00 +01:00
d821cf9c9c Bug 28959: Fix other cases
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:47:38 +02:00
35d03d6cf6 Bug 28959: (follow-up) Adjust more places in which 'category' was used
Some links still had category.

I propose we use explicit public=1 and public=0 when links to public/private are side by side.
Otherwise whe just use /cgi-bin/koha/opac-shelves.pl?op=list using default value 0.

Signed-off-by: David Nind <david@davidnind.com>
JK: Adjust commit title
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:47:38 +02:00
0c72031539 Bug 28959: Add virtualshelves.public as a boolean
This patchset moves the 'category' attribute for virtual shelves, that
takes values of 1 and 2 (private and public respectively) into a boolean
for public.

The DBRev is trivial, and the changes to the code are as well.

To test:
1. have some known public and private lists
2. Apply this patches
3. Run:
   $ updatedatabase
=> SUCCESS: Public lists have public=1, private have public=0
4. Run:
   $ kshell
  k$ prove t/db_dependent/Utils/Datatables_Virtualshelves.t \
           t/db_dependent/Virtualshelves.t
=> SUCCESS: Tests pass!
5. Try the feature in staff and OPAC
=> SUCCESS: All good
6. Sign off :-D

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

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:47:38 +02:00
16e988301c Bug 28859: Correctly handle 'Checked out by' visibility
We must have the column in the table and let DT deal with the
visibility.

This patch hides the "Checked out by" column by default if
RecordStaffUserOnCheckout is off, but the DT column settings is aware of
its existence and the end user can still display the column.

IMO that's the most optimal situation considering both maintenance and ergonomic.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
712be5b41f Bug 29229: (follow-up) Update method for linking flatpickr fields
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
675224ebc9 Bug 29229: Use Flatpickr in suggestion search sidebar filter
This patch corrects the date field configurations for the suggestions
sidebar filter. These fields are now linked Flatpickr widgets instead of
jQueryUI datepickers.

To test, apply the patch and go to Suggestions.

- In the sidebar, click "Suggestion information" to expand the form.
- Test these linked date fields:
  - "Suggested date from" and "to"
  - "Managed date from" and "to"
  - "Accepted by from" and "to"
- Each should trigger Flatpickr calendars which are linked, i.e. you
  can't select a "to" date which is before a "from" date.
- Test that the dates submit correctly to filter as expected.

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-10-28 17:32:34 +02:00
204ded1950 Bug 29261: (bug 15812 follow-up 2) Fix translation issue in include file
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 17:32:34 +02:00
67398811d4 Bug 29301: Display error with serials search flatpickr when searching Mana
This patch changes the way certain serials search fields are hidden when
a standalone search of Mana is being performed (from the "Search on
Mana" link). Instead of targeting specific labels and inputs to hide we
can hide list items by class.

Unrelated: This patch updates the page heading so that it is different
depending on whether you're searching Koha subscriptions or Mana
subscriptions.

To test, apply the patch and enable Mana.

- Go to Serials -> Advanced search (in the search header).
- The search form should include all fields, including call number,
  vendor, library, location, and "Expires before."
- Click "Search on Mana" in the sidebar.
- This page should have the heading "Mana subscriptions search," and
  there should only be three fields visible: ISSN, Title, and Publisher.
- When you perform a Mana search which returns results the page should
  have the heading "Mana subscriptions (X found).

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 12:28:33 +02:00
4d1bed2b60 Bug 29299: (follow-up) Add markup comments
This patch adds comments to the template to highlight the markup
structure.

This patch should have no effect on the page's appearance or
functionality.

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-10-28 12:28:33 +02:00
42158f3c06 Bug 29299: Reindent serials search template
This patch updates the serials search template to give it consistent
indentation.

The patch also moves one section of markup: The <tfoot> section is moved
to after <tbody> in order to conform to current standards.

To test, apply the patch and go to Serials -> Search subscriptions (in
the header).

- Serials search should work correctly and the page should look correct.
- With Mana enabled, click on the "Search on Mana" link in the sidebar.
- Searches of Mana should work correctly too.
- If you view the diff while ignoring whitespace the only changes should
  be the move of <tfoot> and places  where line breaks were introduced.

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-10-28 12:28:33 +02:00
deea41e9ef Bug 29218: Rename .hidden class for DT visibility
.hidden get the CSS that interferes with DT behaviour

.hidden {
    display: none !important;
}

Test this patch with bug 28859.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 12:20:12 +02:00
de6a373126 Bug 28349: (bug 26234 follow-up) Correct wrong array merge
Bug 26234 allowed to remove the different classes we use in aoColumnDefs
for sorting columns of table using DT.

However there is a terrible mistake, the merge of existing aoColumnDefs
array with the default one is totally wrong:
  $.extend(true, new_parameters, default_column_defs);
When we actually wanted to do:
  $.extend(true, new_parameters["aoColumnDefs"], default_column_defs);

But it's still wrong, extend is doing a deep copy and the array will be
replaced by the other one, whereas we want to append.

We want to merge default_column_defs with the existing aocolumnDefs,
this patch is doing it explicitely.

This bug only exists when there is an existing aocolumnDefs.

See commit d3f3a55e0b
It happens on:
 * cataloguing/z3950_search.tt
 * reports/guided_reports_start.tt
 * serials/subscription-detail.tt
 * opac-course-reserves.tt
 * opac-detail.tt

However this bug has been hidden as we have in master related bug from
bug 27945, which removes title-string.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 12:16:37 +02:00