]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 27251: Add missing html filter
Jonathan Druart [Mon, 18 Jan 2021 10:21:26 +0000 (11:21 +0100)]
Bug 27251: Add missing html filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27251: Don't export the actions column
Jonathan Druart [Mon, 18 Jan 2021 10:18:55 +0000 (11:18 +0100)]
Bug 27251: Don't export the actions column

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27251: Fix sort by displayed_on
Jonathan Druart [Mon, 18 Jan 2021 10:14:09 +0000 (11:14 +0100)]
Bug 27251: Fix sort by displayed_on

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27251: Don't hide the table on delete if empty
Jonathan Druart [Wed, 6 Jan 2021 09:40:12 +0000 (10:40 +0100)]
Bug 27251: Don't hide the table on delete if empty

If we filtered the result, delete the only row displayed then the table
was hidden. This is a nice behaviour, especially if there was no filter.
However we must show it again if the filters are removed.
I am suggesting to simply to not hide the table and avoid adding more JS
code to deal with this very specific use case.

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>
3 years agoBug 27251: Rewrite QOTD with the Koha REST API
Jonathan Druart [Wed, 16 Dec 2020 11:34:43 +0000 (12:34 +0100)]
Bug 27251: Rewrite QOTD with the Koha REST API

This patch replace the QOTD editor with our new way to CRUD the
adminitration page (like libraries and STMP servers)

Test plan:
Play with the QOTD by adding, removing, updating quotes
Try to find bugs :)

Bug 27251: Fix capitalization

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>
3 years agoBug 27352: Missed case in bug 25032
Tomas Cohen Arazi [Wed, 6 Jan 2021 16:11:34 +0000 (13:11 -0300)]
Bug 27352: Missed case in bug 25032

Probably because of the order things got pushed.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27352: Unit tests
Tomas Cohen Arazi [Wed, 6 Jan 2021 16:10:12 +0000 (13:10 -0300)]
Bug 27352: Unit tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27352: Add GET /biblios/:biblio_id/items
Tomas Cohen Arazi [Wed, 6 Jan 2021 15:00:40 +0000 (12:00 -0300)]
Bug 27352: Add GET /biblios/:biblio_id/items

This patch adds a route to fetch the items for a biblio. It relies
entirely on already existing methods.

To test:
1. Use your favourite REST tool
2. Play with the new route.
=> SUCCESS: It works as expected!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27034: (follow-up) Remove unneeded params tweak
Tomas Cohen Arazi [Mon, 4 Jan 2021 15:23:46 +0000 (12:23 -0300)]
Bug 27034: (follow-up) Remove unneeded params tweak

As $c->objects->search doesn't consider path params anymore, there's no
need to manually tweak the query parameters.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: 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>
3 years agoBug 27034: Do not use path parameters on building the query
Tomas Cohen Arazi [Mon, 4 Jan 2021 10:55:09 +0000 (07:55 -0300)]
Bug 27034: Do not use path parameters on building the query

This patch simply removes the use of path parameters on building the
query in $c->objects->search.

The sample usage in the original tests considers a specific use case in
which the 'nested' resultset has the path param in its attributes:

GET /patrons/:patron_id/holds

In this case, $c->objects->search would be passed a Koha::Holds
resultset into which it would build a query. As the patron_id param can
be mapped into a Koha::Hold attribute, this works.

We don't actually use this approach in code. What we do is searching for
the patron, and properly return a 404 if the patron doesn't exist [1]. If it
exists, we actually call $patron->holds to get the related resultset, so
there's no gain in having the path param on the query afterwards.

That said, if we wanted to build:

GET /holds/:hold_id/pickup_locations

as the latter is a calculated value, from a resultset that doesn't
actually include a (mapped to some attribute) hold_id attribute, there's
no way to use it if it will automatically add the hold_id to the
pickup_locations resultset. It will give errors about hold_id not being
an attribute of Koha::Library (Branches.pm actually).

So this patch removes the automatic use of path parameters in
$c->objects->search. We can extract them in the controller and add them
to the passed resultset if required. But this patch removes a constraint
we have for building routes controllers right now.

[1] If we didn't return the 404, and we just passed a fresh Koha::Holds
resultset to be feeded with the patron_id, we would always return an
empty array in cases where the patron doesn't exist. This would be
misleading, but I'm open to discuss it. Design-wise.

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>
3 years agoBug 27486: DBRev 20.12.00.007
Jonathan Druart [Fri, 29 Jan 2021 08:01:04 +0000 (08:01 +0000)]
Bug 27486: DBRev 20.12.00.007

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27486: Replace one missing occurrence
Jonathan Druart [Fri, 29 Jan 2021 07:11:54 +0000 (08:11 +0100)]
Bug 27486: Replace one missing occurrence

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27486: (QA follow-up) Fix occurence in aqplan.pl
Katrin Fischer [Sun, 24 Jan 2021 15:51:03 +0000 (15:51 +0000)]
Bug 27486: (QA follow-up) Fix occurence in aqplan.pl

There was another mention of the old system preference name in the
budget planning code. This patch replaces it with the new name.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27486: Rename system preference delimiter to CSVDelimiter
Mazen Khallaf [Thu, 21 Jan 2021 01:40:50 +0000 (01:40 +0000)]
Bug 27486: Rename system preference delimiter to CSVDelimiter

Test Plan:

1. Go to Administration
2. Go to System Preferences
3. Find 'delimiter' (note the name)
4. Apply patch
5. Repeat step 1 and 2
6. Find 'CSVDelimiter' (note the name)

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27487: DBRev 20.12.00.006
Jonathan Druart [Fri, 29 Jan 2021 08:01:04 +0000 (08:01 +0000)]
Bug 27487: DBRev 20.12.00.006

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27487: Rename system preference reviewson to OPACComments
James O'Keeffe [Thu, 21 Jan 2021 05:23:31 +0000 (05:23 +0000)]
Bug 27487: Rename system preference reviewson to OPACComments

This patch renames the reviewson system pref to OPACComments

Test Plan:
1. In Koha Administration, search for the reviewson system preferance
2. Note the presence of the reviewson system preferance
3. Apply the patch and run updatedatabase.pl
4. Repeat steps 1 and 2. The reviewson preferenace should be gone
5. Seach for and note the OPACComments system preferance
6. Ensure that the OPACComments system preferance operates correctly, as
if it were reviewson

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=27484

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27440: Compiled CSS
Jonathan Druart [Thu, 28 Jan 2021 08:32:09 +0000 (09:32 +0100)]
Bug 27440: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27440: Improve structure and style of result toolbars in the OPAC
Owen Leonard [Fri, 15 Jan 2021 15:41:39 +0000 (15:41 +0000)]
Bug 27440: Improve structure and style of result toolbars in the OPAC

This patch makes markup and CSS changes to areas of the OPAC classed
with "selections-toolbar," an area of controls found at the top of some
lists of titles: The cart, search results, search history, lists, and
suggestions.

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).

- Perform a search in the OPAC. On the search results page, confirm that
  the various controls work correctly:
  - With OpacHighlightedWords enabled, hightlight and unhighlight links
  - Select all and clear all links
  - Selecting one or more checkboxes should enable the "Select titles
    to..." menu.
    - Test that adding items to the cart and lists works correctly.
    - Test that placing multiple holds work.
    - Test that tagging multiple items works.
- From the search results page, add multiple items to the cart.
  - Open the cart and confirm that the the controls described above
    continue to work correctly.
- Open the search history page, confirm that the toolbar controls work
  correctly for all four categories: Current session catalog searches;
  previous session catalog searches; current session authority searches;
  previous session authority searches.
- On the purchase suggestions page, confirm that "select all" and "clear
  all" work, and that deleting multiple suggestions from the toolbar
  link works.
- On the list contents page test the same controls: selection,
  multi-hold, tagging, and "Remove from list."

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>
3 years agoBug 26755: Make the guarantor search popup taller
Owen Leonard [Fri, 22 Jan 2021 15:20:00 +0000 (15:20 +0000)]
Bug 26755: Make the guarantor search popup taller

This patch changes the dimensions of the popup window in which
guarantors are chosen during the patron edit process.

The patch also removes an obsolete function delcaration for "Dopop"
which is unused.

To test, apply the patch and open a "child" type patron account for
editing.

Click the "Add guarantor" button. This should trigger a popup window.
Eyeball the size of the window, you'll be able to tell that it is
exactly 800 pixels wide.

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>
3 years agoBug 21851: Compiled CSS
Jonathan Druart [Thu, 28 Jan 2021 08:32:43 +0000 (09:32 +0100)]
Bug 21851: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 21851: Improve style of sidebar forms
Owen Leonard [Sat, 26 Sep 2020 19:44:25 +0000 (19:44 +0000)]
Bug 21851: Improve style of sidebar forms

This patch makes minor changes to staff client CSS in order to improve
the style of forms in sidebars. It adjusts the style of nested fieldsets
and gives more room to list items (and the form fields they contain).

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

 - View pages with forms in the left-hand sidebar, especially:
   - Circulation -> Overdues
   - Patrons -> Patrons search results
   - Acquisitions -> Invoices
   - Acquisitions -> Order search results
   - Tools -> Tags

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>
3 years agoBug 27493: Compiled CSS
Jonathan Druart [Thu, 28 Jan 2021 08:31:41 +0000 (09:31 +0100)]
Bug 27493: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27493: (follow-up) Remove redundant class
Owen Leonard [Thu, 28 Jan 2021 12:45:09 +0000 (12:45 +0000)]
Bug 27493: (follow-up) Remove redundant class

This patch modifies the templates so that instances of "class='select
selectcol' are replaced with "class='selectcol'". I could find no
instances of the "select" class being used in CSS or JS.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27493: Add styling for hidden columns
Martin Renvoize [Wed, 20 Jan 2021 12:42:58 +0000 (12:42 +0000)]
Bug 27493: Add styling for hidden columns

I'm sure adding a 'hidden' class to a table column used to remove it
from display entirely.. seems that's no longer the case so we add the
CSS back in here.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27493: Set column width for checkbox only columns
Martin Renvoize [Wed, 20 Jan 2021 09:19:21 +0000 (09:19 +0000)]
Bug 27493: Set column width for checkbox only columns

This patch updates the global OPAC css such that selectcol type columns
in tables are fixed width at 1ch to ensure these columns do not get
unneccessarily wide.

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).

Test plan
PAGES: opac-basket, opac-messaging, opac-results, opac-search-history,
opac-suggestions and opac-tags.
1/ Notice that the column containing a checkbox on each of the above
pages is of a mised width, often much larger than required
2/ Apply the patch and rebuild the css file as described above
3/ Notices that the column containing a checkbox on each fo the above
pages is now of a standard, sensible, width.
4/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27395: Add a warning to PatronSelfRegistrationDefaultCategory
Eden Bacani [Tue, 19 Jan 2021 21:21:51 +0000 (21:21 +0000)]
Bug 27395: Add a warning to PatronSelfRegistrationDefaultCategory

This patch adds a warning to the PatronSelfRegistrationDefaultCategory system
preference to not use a regular patron category for self registration.

If a regular patron category code is used and the cleanup_database cronjob is setup
to delete unverified and unfinished OPAC self registrations, it permanently and
and unrecoverably deletes all patrons that have registered more than
PatronSelfRegistrationExpireTemporaryAccountsDelay days ago.

It also removes unnecessary apostrophes at the end of two self registration
and modification system preference descriptions.

Test plan:
1. Apply the patch.
2. Check that the warning message for the PatronSelfRegistrationDefaultCategory
   system preference is clear and makes sense.
3. Sign off!

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>
3 years agoBug 20238: Display description of ITEMTYPECAT in search category
Amy King [Thu, 21 Jan 2021 22:41:09 +0000 (22:41 +0000)]
Bug 20238: Display description of ITEMTYPECAT in search category

When adding or editing item types (Koha administration > Basic
parameters > Item types) the drop down list currently displays
the ITEMTYPECAT authorized value description. However, on the
item types page the authorized value is displayed in the search
category column.

This enhancement changes the item types page so that the search
category column displays the authorized value's description
instead of the authorized value code.

Test plan:
1. Go to Staff interface home page > Koha administration > Basic
   parameters > Authorized values.
2. Find ITEMTYPECAT and add a new authorized value - make sure it
   has a description.
3. Go to the Basic parameters > Item types page.
4. Edit an item type.
5. For the search category, select the new authorized value you
   created. The desciption should be shown in the dropdown list.
6. Save the changes.
7. In the search category column for the item type you edited, it
   should now display the description instead of the code.
8. Sign off!

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>
3 years agoBug 20212: Restore price formatting for ecost and replacement_price
Jonathan Druart [Thu, 28 Jan 2021 15:07:29 +0000 (16:07 +0100)]
Bug 20212: Restore price formatting for ecost and replacement_price

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20212: Filter on publisher and notes
Jonathan Druart [Thu, 28 Jan 2021 08:08:22 +0000 (09:08 +0100)]
Bug 20212: Filter on publisher and notes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 20212: Remove fix_query and assume ugliness
Jonathan Druart [Wed, 13 Jan 2021 10:53:15 +0000 (11:53 +0100)]
Bug 20212: Remove fix_query and assume ugliness

It seems better to do things in an ugly way but simple than complicated.
This patch removes the fix_query method that deals with ean and isbn and
explicitly tell that it's a trick that must not be reused somewhere
else.
It should only be used by Koha internally and we should not advertised
it until it's ready.
This problem will have to be fixed properly when the GET /biblios route
will be implemented.

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>
3 years agoBug 20212: Fix query for the global filter
Jonathan Druart [Wed, 13 Jan 2021 10:39:27 +0000 (11:39 +0100)]
Bug 20212: Fix query for the global filter

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>
3 years agoBug 20212: Re-add EAN for UNIMARC
Jonathan Druart [Wed, 13 Jan 2021 10:17:48 +0000 (11:17 +0100)]
Bug 20212: Re-add EAN for UNIMARC

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>
3 years agoBug 20212: Use the DT column filtering provided by the wrapper
Jonathan Druart [Mon, 11 Jan 2021 14:42:18 +0000 (15:42 +0100)]
Bug 20212: Use the DT column filtering provided by the wrapper

Bug 27402 is adding it, we do not longer need the query_from_filters JS
function.

This patch also remove the filters on the left. As we have DT
remembering the filter on the table we don't need them anymore.

Technical note:
Prior to this patch, the search on biblio.author, biblio.title and
biblio.isbn was done by adding hidden columns. Now we are using:
  "data": "biblio.author:biblio.title:biblio.isbn"
to tell the wrapper we are going to build a search on these 3
attributes.

Another trick is to pass a default_filters parameters to the wrapper, to
tell it we want to filter on the orders of a given vendor (this is a
bugfix, the original implementation was returning all the orders).
However We should not use /acq/orders?vendor_id=42 but /acq/vendor/42/orders instead (which does not exist yet),
otherwise (with bug 27353 ) we are going to display the wrong number of non-filtering rows.

The change in Orders.pm is only formatting to match what's done in
  Bug 27353: Set X-Base-Total-Count header for REST API

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>
3 years agoBug 20212: Remove fixedHeader
Jonathan Druart [Tue, 12 Jan 2021 08:55:36 +0000 (09:55 +0100)]
Bug 20212: Remove fixedHeader

It's an extension that needs to be added.

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>
3 years agoBug 20212: Search on fund's name instead of id
Jonathan Druart [Fri, 8 Jan 2021 14:04:32 +0000 (15:04 +0100)]
Bug 20212: Search on fund's name instead of id

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>
3 years agoBug 20212: (follow-up) Avoid pagination on full resultset test
Tomas Cohen Arazi [Fri, 8 Jan 2021 13:33:26 +0000 (10:33 -0300)]
Bug 20212: (follow-up) Avoid pagination on full resultset test

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>
3 years agoBug 20212: Use functions to escape variables
Jonathan Druart [Fri, 8 Jan 2021 13:15:07 +0000 (14:15 +0100)]
Bug 20212: Use functions to escape variables

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>
3 years agoBug 20212: Fix test after 25670 follow-up
Tomas Cohen Arazi [Fri, 8 Jan 2021 13:13:05 +0000 (10:13 -0300)]
Bug 20212: Fix test after 25670 follow-up

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>
3 years agoBug 20212: (QA follow-up) Fix escaping
Tomas Cohen Arazi [Thu, 7 Jan 2021 19:45:36 +0000 (16:45 -0300)]
Bug 20212: (QA follow-up) Fix escaping

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>
3 years agoBug 20212: (QA follow-up) Spelling typo fix
Martin Renvoize [Tue, 22 Dec 2020 15:50:02 +0000 (15:50 +0000)]
Bug 20212: (QA follow-up) Spelling typo fix

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: (QA follow-up) Restore missing comma
Martin Renvoize [Tue, 22 Dec 2020 15:45:13 +0000 (15:45 +0000)]
Bug 20212: (QA follow-up) Restore missing comma

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: Make all biblioitems.* fields searchable
Tomas Cohen Arazi [Fri, 6 Nov 2020 19:44:25 +0000 (16:44 -0300)]
Bug 20212: Make all biblioitems.* fields searchable

Prior to this bug, only a few bilbio fields were actually searchable through
the orders API. This patch adds all of them to the mapping, so other
pages can take advantage of them.

My first approach was to add things as needed. But this is trivial to
make complete.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: (QA follow-up) Resurrect column filtering
Tomas Cohen Arazi [Fri, 6 Nov 2020 18:16:00 +0000 (15:16 -0300)]
Bug 20212: (QA follow-up) Resurrect column filtering

This patch adds per-column filtering to the order receiving table.

The order cost column proved difficult to filter, because of the syntax
DBIC requires for comparing replacement_cost * quantity, and passing
that all the way down from the API request to DBIC itself.

I'm still looking for options.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: (QA follow-up) Restore table filter sticky
Tomas Cohen Arazi [Wed, 4 Nov 2020 12:33:40 +0000 (09:33 -0300)]
Bug 20212: (QA follow-up) Restore table filter sticky

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: Controller changes regression tests
Tomas Cohen Arazi [Mon, 2 Nov 2020 22:51:38 +0000 (19:51 -0300)]
Bug 20212: Controller changes regression tests

This patchset did a copy and paste of the objects->search helper inside
the controller, to handle a very special case that wasn't worth
generalizing: the fact that the biblio object (that this patchset makes
embeddable) is actually built from two tables, and we want to filter by
fields in both tables.

This requires us to translate:
- Any filter reference to fields in biblioitems we allow to search on, through
  an allow list.
- For filtering to work, we need to tweak the stashed 'embed' object so
  the prefetch is done correctly

This patchset also adds a new query parameter: only_active. It is used
to only request active orders (see the spec for more details).

This patch adds tests for:
- Filtering by a column in bilbioitems (this implies correctly
  prefetching the bilbio => biblioitems relation, and translating the
  filtering parameter.
- Using the only_active query parameter to retrieve only active orders

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> SUCCESS: Tests pass!
3. Verify the tests check for the explained behaviours.
=> SUCCESS: They do!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: (QA follow-up) Remember current filter
Tomas Cohen Arazi [Mon, 2 Nov 2020 20:15:31 +0000 (17:15 -0300)]
Bug 20212: (QA follow-up) Remember current filter

This patch restores the original behaviour: if you jump into receiving
an order, and then go back to receiving, you want the page to remember
your filters.

This feature was overlooked. On fixing it, I wrapped some JS code in a
function for reusing it and simplified it a bit as well.

To test:
1. Enter a search term in either of the search fields
2. Add a note, receive or do another action
=> SUCCESS: The search term is kept
3. Apply this patch set
4. Repeat 2
=> SUCCESS: The search term is kept

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: Use API to render orders datatable
Tomas Cohen Arazi [Tue, 10 Mar 2020 19:03:50 +0000 (16:03 -0300)]
Bug 20212: Use API to render orders datatable

This patch makes the pending orders datatable render using the API
instead of hte old controller script. It implements native server-side
pagination thanks to the API and the datatables wrapper.

On polishing it, we found that data can contain many null values, and it
got dirtier in the process.

This code with all the checks that are done on the data is the result of
testing this dev with real-life production databases, huge ones with
thousands of orderlines.

To test:
1. You should compare the behaviour between this table, and the original
   one in master.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: Add missing relation in Biblio
Tomas Cohen Arazi [Mon, 27 Apr 2020 20:47:14 +0000 (17:47 -0300)]
Bug 20212: Add missing relation in Biblio

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: Clean parcel.pl
Tomas Cohen Arazi [Wed, 11 Mar 2020 20:10:10 +0000 (17:10 -0300)]
Bug 20212: Clean parcel.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 20212: Add more embeddable objects to orders
Tomas Cohen Arazi [Fri, 17 Jan 2020 16:05:24 +0000 (13:05 -0300)]
Bug 20212: Add more embeddable objects to orders

This patch adds options to embed more related objects based on the needs
by parcel.tt.

For filtering by biblioitems fields (ISBN and EAN) I had to make the
'list' method a modified version of the objects->search helper. I
thought of doing it in a more generic way but I didn't find any other
use cases and it would certainly make an already complex piece of code
even more complex.

So this is quite similar, but at some steps the biblio.<biblioitem
field> gets translated into the proper relation names, and the same
happens for prefetching.

A new parameter is also added: only_active. It makes the controller use
Koha::Acquisition::Orders->filter_by_active, avoiding the need to build
complex queries in the UI.

The same handling is done when the order_id parameter is passed (outside
the q= parameters). In this case using Koha::Acquisition::Orders->filter_by_id_including_transfers

This is all respecting the C4::Acquisitions::SearchOrders behaviour.

TL;DR:

This patch adapts the code from the list() sub so it manipulates the
query parameters and the embed header so:
- the biblioitem relationship is prefetch
- any queries on biblio.isbn and biblio.ean are correctly translated into search on the
  biblioitems table.
- Adds an only_active parameter to the /acquisitions/orders route to
  easily request only the active orders.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
3 years agoBug 27402: Reverse search filter texts
Jonathan Druart [Thu, 28 Jan 2021 15:17:38 +0000 (16:17 +0100)]
Bug 27402: Reverse search filter texts

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27402: Column filters must AND, not OR
Jonathan Druart [Mon, 11 Jan 2021 12:36:14 +0000 (13:36 +0100)]
Bug 27402: Column filters must AND, not OR

Test plan:
Use the column filters and the global filter
Confirm that the rows are filtered as you expect

QA Note: There is more code on top of this, see bug 20212.

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>
3 years agoBug 27402: Move to datatables.js
Jonathan Druart [Mon, 11 Jan 2021 13:19:23 +0000 (14:19 +0100)]
Bug 27402: Move to datatables.js

To make it reusable we need to move the code to datatables.js

So far only the cities table is using the column filters so there is no other
view to test.

Note that the existing implementation didn't work at all, and were base
on what is done on the detail.pl page (using table_filters.js)

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>
3 years agoBug 27402: Add DT column filtering to the cities admin page
Jonathan Druart [Fri, 8 Jan 2021 11:10:22 +0000 (12:10 +0100)]
Bug 27402: Add DT column filtering to the cities admin page

Bug 24561 added a wrapper to use easily all the DataTables functionalities when a REST API route was used within Koha.

The filtering method used is working for the global search filter, but not if we have a filter on top of each column.

This patchset is going to, first, add the filters on top of each column
of the cities table, then the code will be moved to the DT REST API wrapper to make it reusable easily.

Test plan:

Generate some cities:
  use Koha::Cities;
  for ( 1 .. 42 ) {
      Koha::City->new({city_name => "name_$_", city_state => "state_$_", city_country => "country_$_", city_zipcode => "zipcode_$_" })->store;
  }
Hit /admin/cities.pl
Use the filters

The general filter must do a OR query on each of the cities' attributes,
when column filters must use AND

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>
3 years agoBug 27353: (QA follow-up) Fix number of tests
Tomas Cohen Arazi [Mon, 25 Jan 2021 17:50:20 +0000 (14:50 -0300)]
Bug 27353: (QA follow-up) Fix number of tests

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>
3 years agoBug 27353: Set X-Base-Total-Count header for REST API
Jonathan Druart [Wed, 6 Jan 2021 15:34:23 +0000 (16:34 +0100)]
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>
3 years agoBug 27353: Add tests
Jonathan Druart [Wed, 6 Jan 2021 16:11:30 +0000 (17:11 +0100)]
Bug 27353: Add tests

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>
3 years agoBug 27544: Simplify GET /checkouts implementation
Tomas Cohen Arazi [Mon, 25 Jan 2021 13:35:20 +0000 (10:35 -0300)]
Bug 27544: Simplify GET /checkouts implementation

This patch makes the list() controller method simpler, by removing the
checked_in parameter, and passing the appropriate restulset.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/checkouts.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass! (no behaviour change)
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25670: New orders included only if standing
Tomas Cohen Arazi [Thu, 7 Jan 2021 19:16:00 +0000 (16:16 -0300)]
Bug 25670: New orders included only if standing

The original implementation included new orders regardless they were
standing orders.

This patch makes the query respect that conditions found on
C4::Acquisitions::SearchOrders.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Orders.t
=> FAIL: More orders than expected are returned
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! New orders are only considered if the basket
they are attached to, is marked as standing!
5. Verify the tests make sense
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25670: Regression tests
Tomas Cohen Arazi [Thu, 7 Jan 2021 19:15:54 +0000 (16:15 -0300)]
Bug 25670: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25670: Add filter_by_active and filter_by_id_including_transfers
Tomas Cohen Arazi [Wed, 3 Jun 2020 19:58:33 +0000 (16:58 -0300)]
Bug 25670: Add filter_by_active and filter_by_id_including_transfers

This patch introduces a method to filter on the ordernumber, looking for
it on the aqorders_transfers table ('ordernumber_from' field).

It also adds a method for filtering on active orders.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Orders.t
=> SUCCESS: Tests pass!
3. Sign off :-D

lib

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>
3 years agoBug 25670: Unit tests
Tomas Cohen Arazi [Wed, 3 Jun 2020 19:58:25 +0000 (16:58 -0300)]
Bug 25670: Unit tests

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>
3 years agoBug 14004: Set the syspref's value to an empty string
Jonathan Druart [Wed, 27 Jan 2021 11:03:33 +0000 (12:03 +0100)]
Bug 14004: Set the syspref's value to an empty string

It's tested with "defined" in C4::Context->preference

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 14004: Add OpacAdditionalStylesheet and opaclayoutstylesheet
Fridolin Somers [Thu, 21 Jan 2021 16:09:27 +0000 (17:09 +0100)]
Bug 14004: Add OpacAdditionalStylesheet and opaclayoutstylesheet

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>
3 years agoBug 14004: Add ability to temporarily disable JS/CSS sysprefs
Fridolin Somers [Tue, 12 Jan 2021 10:15:25 +0000 (11:15 +0100)]
Bug 14004: Add ability to temporarily disable JS/CSS sysprefs

It would be *super* handy if intranetuserjs and/or opacuserjs could be
temporarily disabled via a check-box or syspref.
Right now, debugging issues in intranetuserjs usuaally starts with
copying the contents into a text file, blanking the syspref and re-testing.

This patch adds this feature by setting syspref via ENV
OVERRIDE_SYSPREF like override via Apache config.

Implemented only for preferences :
OPACUserCSS OPACUserJS IntranetUserCSS IntranetUserJS
=> replaced with ' '
intranetcolorstylesheet intranetstylesheet
=> replaced with 0

Test plan :
1) Set some CSS in IntranetUserCSS like : #breadcrumbs{color:red}
2) Go to staff interface home page like : /cgi-bin/koha/mainpage.pl
3) See CSS impact is visible
4) Edit URL : /cgi-bin/koha/mainpage.pl?DISABLE_SYSPREF_IntranetUserCSS=1
5) See CSS impact is not visible
6) Check with the other preferences

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>
3 years agoBug 23302: (QA follow-up) Fix filters
Nick Clemens [Mon, 11 Jan 2021 13:49:33 +0000 (13:49 +0000)]
Bug 23302: (QA follow-up) Fix filters

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23302: Less clicks on Z3950 search results
Marcel de Rooy [Wed, 12 Aug 2020 14:47:47 +0000 (14:47 +0000)]
Bug 23302: Less clicks on Z3950 search results

Functional change: Instead of requiring two clicks for each option in
the Actions menu, we add a default action based on previous activity.

NOTE: In order to prioritize MARC and Card preview actions, we will only
remember Import and Order when it is not preceded by a preview. In other
words: If you directly click Import, Import comes back. If you click Card
and Import, Card comes back.

Technical changes:
[1] Combine Preview and Order button on Acquisition Z3950 search.
[2] Use Actions link as default action and add button with caret to open the dropdown.
[3] Keep last action in localStorage (sessionStorage makes not much sense for the popups), prioritizing previews.
[4] Where needed, add title attributes to dropdown links. Use class 'chosen' to differentiate preview popups from import/order actions.
[5] Replace previewMARC by previewData in Authority Z3950 search. Remove duplicate code.
[6] Use link href from template instead of constructing link in javascript.
[7] Removing unused linktools markup from acqui template.

Test plan:
[1] Start on acqui Z3950. Choose Card once from the menu and then Order.
[2] Start auth Z3950. Verify that Default is MARC now. Close popup.
    (Since Card is no option here.)
[3] Start cataloguing Z3950. Verify that you have Card as default.
    Click Import rightaway.
[4] Back to auth Z3950. Verify that Import is default. Click Import.
[5] Back to acqui Z3950. Verify that MARC is default (no Import here).
    Click Order. Go back and verify that Order is now default.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11257: (QA follow-up) Add thank you
Katrin Fischer [Thu, 21 Jan 2021 22:38:57 +0000 (22:38 +0000)]
Bug 11257: (QA follow-up) Add thank you

Even if we are grumpy because they still have not returned the items,
we should be nice :)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11257: (followup) Document <<items.content>> for DUEDGST and PREDUEDGST and updat...
James O'Keeffe [Thu, 21 Jan 2021 05:53:46 +0000 (05:53 +0000)]
Bug 11257: (followup) Document <<items.content>> for DUEDGST and PREDUEDGST and update sample notices

This patch changes the default text for the DUEDGST sample notice to the
following:
    Dear <<borrowers.firstname>> <<borrowers.surname>>,
    The following item(s) are due:
    <<items.content>>
(it does not include an atomic update)

Test plan:
1. Select "edit" on DUEDGST in the notices and slips page (Home ->
        tools -> Notices and slips)
2. Open "email", and note the default text.
3. Apply the patch, and peform a fresh install of Koha.
4. Navigate to the same page. The default text should have changed.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11257: PREDUEDST should have more useful default text
James O'Keeffe [Tue, 19 Jan 2021 22:47:53 +0000 (22:47 +0000)]
Bug 11257: PREDUEDST should have more useful default text

This patch changes the default text of PEDUEDST to the following:
    Dear <<borrowers.firstname>> <<borrowers.surname>>,
    The following item(s) will be due soon:
    <<items.content>>

Note: I dont beleive ive done everything requesting in the bug, ie there
was a request to add  <<items.content>> to the documentation of
sample_notices.yml, but I couldn't find documentation for it. If there's
things I missed, please tell me so I can make the appropraite changes,
or feel free to make the changes yourself.

Test plan:
1. Select "edit" on PREDUEDST in the notices and slips page (Home -> tools
        -> Notices and slips)
2. Open "email", and note the default text.
3. Apply the patch, and peform a fresh install of Koha.
4. Navigate to the same page. The default text should have changed.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: Remove double spaces in PREDUEDST

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27029: Add a selenium regression test
Jonathan Druart [Wed, 27 Jan 2021 10:35:35 +0000 (11:35 +0100)]
Bug 27029: Add a selenium regression test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27029: (QA follow-up) Adding html filter
Marcel de Rooy [Fri, 22 Jan 2021 10:58:06 +0000 (10:58 +0000)]
Bug 27029: (QA follow-up) Adding html filter

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27029: Add data-biblionumber attribute to OPAC detail page
David Cook [Mon, 16 Nov 2020 00:31:21 +0000 (00:31 +0000)]
Bug 27029: Add data-biblionumber attribute to OPAC detail page

This patch adds a data-biblionumber attribute to the
div#catalogue_detail_biblio elements on opac-detail.pl, so that
Javascript running on the page can easily fetch and use the
record's biblionumber.

Signed-off-by: Mark Hofstetter <mark@hofstetter.at>, <koha@trust-box.at>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27525: Replace "wich" with "with" in batch delete template
Owen Leonard [Fri, 22 Jan 2021 11:22:30 +0000 (11:22 +0000)]
Bug 27525: Replace "wich" with "with" in batch delete template

This patch corrects two typos: "wich" -> "with."

To test, apply the patch and check the batch delete template
(batchMod-del.tt) and confirm that the two instances of this sentence
are correct:

"Last item for bibliographic record with biblio-level hold on it"

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>
3 years agoBug 27547: Typo in parcel.tt
Caroline Cyr La Rose [Mon, 25 Jan 2021 14:59:57 +0000 (09:59 -0500)]
Bug 27547: Typo in parcel.tt

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>
3 years agoBug 27471: Change auth merge success link text and don't redirect
Amy King [Thu, 21 Jan 2021 21:21:24 +0000 (21:21 +0000)]
Bug 27471: Change auth merge success link text and don't redirect

Test Plan:
1. Follow the steps above to reproduce
2. Notice how there is no message telling the user that the merge was
successsful
3. Apply patch
4. Repeat step 1
5. Now notice how the user is redirected to a page with a message that
says that the merge was successful, and there is a link with helpful
text to view the merged record

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27446: (QA follow-up) Add missing filters
Katrin Fischer [Sun, 24 Jan 2021 02:30:29 +0000 (02:30 +0000)]
Bug 27446: (QA follow-up) Add missing filters

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27446: Markup errors in suggestion/suggestion.tt
Owen Leonard [Mon, 25 Jan 2021 11:30:30 +0000 (11:30 +0000)]
Bug 27446: Markup errors in suggestion/suggestion.tt

This patch makes various corrections to the suggestions template in the
staff interface:

 - Correct indentation
 - Fix unclosed tags
 - Fix non-unique IDs
 - Add comments to highlight markup structure

To test, apply the patch and test the suggestions interface in the staff
client:

 - Viewing the list of suggestions
 - Viewing the details of a single suggestion
 - Filtering suggestions
 - Organizing suggestions

Test that labels on form controls work correctly, including under each
tab.

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>
3 years agoBug 27508: do nothing if tag label elements don't exist
Petro Vashchuk [Thu, 21 Jan 2021 12:11:24 +0000 (14:11 +0200)]
Bug 27508: do nothing if tag label elements don't exist

When JavaScript make copy of DOM set for MARC tag, it tries to reassign
label elements to another id, the problem is there is no check for
existence of that label element, so in case when option
"advancedMARCeditor" is set to "Don't display", labels were absent
which caused JavaScript to crush in the middle of process with uncaught
exception.

This patch wraps this label assignment in try/catch hook like it's done
in the code around for other elements, to allow the script to proceed
when description labels are not present.

To test:
1) Check in the system preferences interface subsection that
   "advancedMARCeditor" is set to "Display".
2) Go to the "Add MARC record" cataloguing section and press "Repeat
   this tag" button near the MARC tag record to ensure that it makes
   duplicate in the interface as expected.
3) Then again in the system preferences interface subsection change
   "advancedMARCeditor" to "Don't display".
4) Return back to the "Add MARC record" interface, refresh the page to
   have no MARC field labels displayed, and try duplicating the tag
   again.
5) Ensure that it doesn't work, also you can notice a JavaScript error
   "Cannot read property "setAttribute" of undefined..." in the
   JavaScript console of your browser.
6) Apply the patch.
7) Repeat the test sequence (changes will be in the step 5), ensure that
   the tag gets duplicated even when description labels are not present.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27531: Remove type attribute from script tags: Cataloging plugins
Owen Leonard [Fri, 22 Jan 2021 16:43:58 +0000 (16:43 +0000)]
Bug 27531: Remove type attribute from script tags: Cataloging plugins

This patch removes the no-longer-valid "type" attribute from script tags
found in cataloging plugin templates.

I don't think testing each plugin individually is a reasonable thing to
ask for a test. I think a visual verification of the changes in the
patch should be enough.

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>
3 years agoBug 25614: Move ILL request keyword filter to sidebar
Owen Leonard [Tue, 27 Oct 2020 12:23:45 +0000 (12:23 +0000)]
Bug 25614: Move ILL request keyword filter to sidebar

On the ILL request list page there are two filters for the table: One in
the sidebar and one configured automatically by the DataTables plugin. I
think these two systems are conflicting somehow to prevent the "clear
filter" button in the table toolbar from working correctly.

This patch doesn't fix the bug but avoids it: Since the filter field in
the table toolbar is duplicating the functionality of the form in the
sidebar, we could hide it and rely on the sidebar filter instead.

To test, apply the patch and go to the ILL requests page in the staff
interface.

 - The table of requests should display without a search form or "clear
   filter" button at the top.
 - The left-hand sidebar form should now have a "keyword" filter option
   which searches any column in the table.
 - Other filter fields should work as before.

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>
3 years agoBug 11344: (QA follow-up) Fix empty section warning
Marcel de Rooy [Fri, 22 Jan 2021 09:04:07 +0000 (09:04 +0000)]
Bug 11344: (QA follow-up) Fix empty section warning

*** WARNING: empty section in previous paragraph at line 28 in file misc/cronjobs/advance_notices.pl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 11344: Perldoc issues in misc/cronjobs/advance_notices.pl
James O'Keeffe [Tue, 19 Jan 2021 21:16:49 +0000 (21:16 +0000)]
Bug 11344: Perldoc issues in misc/cronjobs/advance_notices.pl

This patch removes the double ups in the perldoc of the above file,
     deleting the less clear double ups. The missing "-c" in OPTIONS
     appears to have been fixed in an earlier patch (it is there
             already).

Task Plan:
1. Run perldoc misc/cronjobs/advance_notices.pl in the terminal. Note
the double ups of NAME, SYNOPSIS, and DESCRIPTION
2. Apply the patch
3. Run the command again. The double ups should be gone, with the more
clear version of each of NAME, SYNOPSIS, and DESCRIPTION remaining.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27333: Throw the right exceptions
Tomas Cohen Arazi [Mon, 4 Jan 2021 14:10:12 +0000 (11:10 -0300)]
Bug 27333: Throw the right exceptions

If parameters are missing, we need to throw
Koha::Exceptions::MissingParameter exceptions.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Club/Hold.t
=> FAIL: Tests fail because the method doesn't throw the right
exceptions
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27333: Regression tests
Tomas Cohen Arazi [Mon, 4 Jan 2021 14:09:54 +0000 (11:09 -0300)]
Bug 27333: Regression tests

Test for the right exceptions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27327: Get rid of indirect object notation in Koha::Club::Hold
Tomas Cohen Arazi [Mon, 4 Jan 2021 13:35:37 +0000 (10:35 -0300)]
Bug 27327: Get rid of indirect object notation in Koha::Club::Hold

This patch makes the code follow the PERL29 coding guideline. Period.

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>
3 years agoBug 27543: Compiled CSS
Jonathan Druart [Wed, 27 Jan 2021 09:45:51 +0000 (10:45 +0100)]
Bug 27543: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27543: Tooltip on opac-messaging.pl obscured by table headers
Owen Leonard [Mon, 25 Jan 2021 12:30:55 +0000 (12:30 +0000)]
Bug 27543: Tooltip on opac-messaging.pl obscured by table headers

This patch corrects which Bootstrap assets are compiled with the OPAC
CSS -- The file for Bootstrap tooltips should be included.

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).

1)  Log into the OPAC.
2)  Go to 'your messaging' (opac-messaging.pl).
3)  Hover over the Digests only tooltip.
4)  Note that the tooltip looks correct.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26048: Use ErrorDocument middleware for Plack HTTP errors
David Cook [Thu, 21 Jan 2021 01:02:49 +0000 (01:02 +0000)]
Bug 26048: Use ErrorDocument middleware for Plack HTTP errors

This patch uses the ErrorDocument middleware to use Koha's
custom error pages instead of generic Plack error responses

Test plan:
0. Apply patch
1. vi /usr/sbin/koha-plack (and change "development" to "deployment")
2. vi ./opac/opac-main.pl
3. Add "die" to line 2
4. vi ./mainpage.pl
5. Add "die" to line 2
6. cp ./debian/templates/plack.psgi /etc/koha/sites/kohadev/plack.psgi
7. koha-plack --restart kohadev
8. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl
9. See a beautiful OPAC 500 error instead of "Internal Server Error"
10. Go to http://localhost:8080/cgi-bin/koha/blah.pl
11. See a beautiful OPAC 404 error instead of "not found"
12. Go to http://localhost:8081/cgi-bin/koha/mainpage.pl
13. See a beautiful Staff interface 500 error instead of "Internal Server Error"
14. Go to http://localhost:8081/cgi-bin/koha/blah.pl
15. See a beautiful Staff interface 404 error instead of "not found"

For bonus points:
16. koha-plack --disable kohadev
17. koha-plack --stop kohadev
18. service apache restart
19. Repeat the above test plan to show CGI still works for 404 (although 500
will show "Software Error" due to C4::Context needing some improvements)
20. Using the "Network" tab on your developer tools, make sure 404 and 500
are returned by the appropriate error pages

Signed-off-by: Eden Bacani <eden.bacani@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27491: Fix t/Languages.t
Jonathan Druart [Mon, 25 Jan 2021 09:52:02 +0000 (10:52 +0100)]
Bug 27491: Fix t/Languages.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 7143: Update about page for new devs
Jonathan Druart [Fri, 22 Jan 2021 13:52:07 +0000 (14:52 +0100)]
Bug 7143: Update about page for new devs

Eden Bacani
Ella Wipatene
Ava Li

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22150: (follow-up) ensuring superlibrarian flag not checked when select all
Jonathan Druart [Fri, 22 Jan 2021 13:19:54 +0000 (14:19 +0100)]
Bug 22150: (follow-up) ensuring superlibrarian flag not checked when select all

Use #flag-0 to select the superlibrarian checkbox

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27478: Improved link text when viewing ILL reqested item
ava li [Wed, 20 Jan 2021 21:38:15 +0000 (21:38 +0000)]
Bug 27478: Improved link text when viewing ILL reqested item

TEST PLAN:
1) Follow

https://koha-community.org/manual/20.11/hi/html/ILL_requests.html
and
https://wiki.koha-community.org/wiki/ILL_backends
to enable Interlibrary loans if you haven't already.

2)In the Koha staff website or OPAC website, make an ILL request.
(if in the Koha staff website, use your own card barcode)

3) Go the the OPAC website, your account (top right), 'your
interlibrary loan requests', view request

4) The text should be as follows "Requested item: View the requested
item" If so the patch has worked.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27469: (follow-up) Correct terminology
Owen Leonard [Wed, 20 Jan 2021 14:02:43 +0000 (14:02 +0000)]
Bug 27469: (follow-up) Correct terminology

We should use "vendor" instead of "bookseller."

https://wiki.koha-community.org/wiki/Terminology

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27469: Improve link text when returning to booksellers page
Ella Wipatene [Wed, 20 Jan 2021 00:29:00 +0000 (00:29 +0000)]
Bug 27469: Improve link text when returning to booksellers page

This is to make the link more accessible for screen readers.
1. (Without patch) go to 'Acquisitions' and then 'Basket'
2. The link for the booksellers page should say 'Click here to go back
to booksellers page'
3. Add patch
4. The link should now just say 'Go back to booksellers page', i.e.
there is now no 'Click here'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27415: Add note to ILLHiddenRequestStatuses
Ella Wipatene [Tue, 19 Jan 2021 03:34:08 +0000 (03:34 +0000)]
Bug 27415: Add note to ILLHiddenRequestStatuses

1. (Before adding patch) Go to 'Koha administration' - then to 'Global
system preferences'
2. On the left-hand side of the screen, go to 'Circulation' and then
'Interlibrary loans'
3. Look at the ILLHiddenRequestStatuses preferance - it should not have
any text talking about request codes in ILLSTATUS
4. Add the patch
5. Redo steps 1-3
6. The ILLHiddenRequestStatuses preferance should now have the sentance
'The request code can be found in the ILLSTATUS authorizes value
category.' under the value column.

Sponsored.by: Catalyst IT

JD Amended patch: fix commit title

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27495: Added Accessibility advocate role in team page
Eden Bacani [Wed, 20 Jan 2021 22:24:05 +0000 (22:24 +0000)]
Bug 27495: Added Accessibility advocate role in team page

Test Plan
1. Click on 'About Koha' from the home page
2.Check on the  Koha Team page that the role Accessibility advocate is
listed under the Koha release teams and that the name of the person with
the role  appears.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27098: Renames Relatives fines to Relative charges
Eden Bacani [Tue, 19 Jan 2021 02:21:32 +0000 (02:21 +0000)]
Bug 27098: Renames Relatives fines to Relative charges

1. Check on website that users that are guarantor see charges under
Relative charges instead of Relatives' fines

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25802: Change addDate to addDuration
Eden Bacani [Tue, 19 Jan 2021 01:44:12 +0000 (01:44 +0000)]
Bug 25802: Change addDate to addDuration

1. Check using git grep command that addDate does not exist
2. Check the patch that addDuration is spelt right
3. Check that tests pass t/Calendar.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 22152: Hide tools navigation when printing reports
Eden Bacani [Tue, 19 Jan 2021 20:14:32 +0000 (20:14 +0000)]
Bug 22152: Hide tools navigation when printing reports

1. Go to reports and print any report
2. Check that navigation does not show up when report is printed.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>