Commit Graph

37226 Commits

Author SHA1 Message Date
Katrin Fischer c1ef8a49de Bug 11994: OpenSearch plugins needs to be delivered with Content-Type application/opensearchdescription+xml
https://developer.mozilla.org/en-US/docs/Web/OpenSearch
Your server should serve OpenSearch plugins using
Content-Type: application/opensearchdescription+xml.

To test:
- Verify the Content-Type the file is delivered with
  is correct, for example using wget
  http://127.0.0.1:8080/cgi-bin/koha/opac-search.pl?format=opensearchdescription

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>
(cherry picked from commit f090c1d2cb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e15992e4eb)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 14:19:15 +12:00
Owen Leonard 8019711adf Bug 11994: Fix OpenSearch discovery in the OPAC
This patch corrects the markup for the OpenSearchDescription XML
document and adds (back) the link in the OPAC header which points to it.
This will enable compatible browsers to offer the addition of the OPAC's
keyword search as a search engine option.

I've found documentation suggesting this feature is available (or at
least was at one time) in Chrome and Safari, but in my test it only
works in Firefox.

To test, apply the patch and make sure the OPACBaseURL preference is
set correctly.

 - Open the OPAC in Firefox (these instructions assume the latest
   version, currently v.75).
 - On the right side of the address bar you should see ". . ." Click it
   to trigger the menu.
 - You should see an "Add search engine" entry with your OPAC's icon.
 - Click to add the search engine.

 - Type a keyword to search in the address bar
 - A box should pop up below the address bar showing icons at the bottom
   for performing a search in various search engines. One of these icons
   should be the icon for your Koha OPAC.
 - Click the Koha OPAC icon and confirm that it triggers a keyword
   search in your OPAC.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
(cherry picked from commit 0ef7b3db4c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6f9b44c95a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 14:19:04 +12:00
Owen Leonard fa610981b7 Bug 24352: Correct location and collection labels in OPAC search results
This patch modifies the OPAC's MARC21 search results XSLT so that
OPAC search result information is correctly labeled
based on the OpacItemLocation preference.

Previously, search results showed the label "Location(s)" whether the
setting was "collection code" or "location."

To test, apply the patch and set the OPACXSLTResultsDisplay system
preference to 'default.'

On the OPAC search results page, each result with items should show
information in this format:

   With the OpacItemLocation preference set to 'call number only,'
    - "Availability: Items available for loan: {library} [Call number:
      {call number} ]

   With the OpacItemLocation preference set to 'collection code,'
     - "Availability: Items available for loan: {library}
        Collection(s): {collection description} [{ call number }]"

   With the OpacItemLocation preference set to 'location,'
     - "Availability: Items available for loan: {library}
        Location(s): {shelving location} [{ call number }]"

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>
(cherry picked from commit 897948cff5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0aa981c913)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 13:55:37 +12:00
David Cook 46b96996c1 Bug 25509: Remove useless libjs-jquery dependency
We don't use the libjs-jquery package, so we should remove
the dependency.

To Test:
1) Build package (out of scope of test plan)
2) Install package
3) Note that libjs-jquery is marked by apt as no longer required
4) Remove libjs-jquery package from system and note how it
doesn't take koha-common with it

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>
(cherry picked from commit 9e923e57ed)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 898bd1256a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 10:51:15 +12:00
Tomas Cohen Arazi afcd1902c0 Bug 25570: (follow-up) Fix tests
This patch fixes the libraries tests, that expected the old behaviour

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

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>
(cherry picked from commit b115dfeca6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 18051cb02a)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 10:47:02 +12:00
Tomas Cohen Arazi 55fba12275 Bug 25570: Paginate results by default in objects->search
This patch makes the helper paginate the resultsif no pagination
parameters are passed.

Page number defaults to 1, and the page size to the RESTdefaultPageSize
syspref value.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Pagination is not enforced by default
3. Apply this patch
4. Repeat 2
=> SUCCESS: Results are paginated
5. Sign off :-D

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>
(cherry picked from commit 451ae76431)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 16530f0968)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 10:46:45 +12:00
Tomas Cohen Arazi 429d56d389 Bug 25570: Regression tests
This tests verify that the default behaviour is to paginate the results.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: $c->objects->search doesn't paginate results by default

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>
(cherry picked from commit 2220ce4d50)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit fc8bde4178)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 10:46:14 +12:00
Kyle M Hall c21ae5e517 Bug 25769: Patron self modification triggers change request for date of birth to null
If PatronSelfModificationBorrowerUnwantedField contains dateofbirth, all
patron self modification requests will attempt to set dateofbirth to
null instead of ignoring the field.

Test Plan:
1) Add dateofbirth to PatronSelfModificationBorrowerUnwantedField
2) Run a patron self modification
3) Note the request sets dateofbirth to null on the staff side
4) Apply this patch
5) Restart all the things!
6) Run another self-modification
7) Note of the staff side that dateofbirth is unaffected

Signed-off-by: Emmi Takkinen <emmi.takkinen@outlook.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 73c421a516)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 41ad2ba4db)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 10:23:58 +12:00
Jonathan Druart 99a27050d8 Bug 25553: Make date columns sortable on the edit items table
When editing items, the table at the top contain several columns that
have date values, but they cannot be sorted by dates correctly.

Test plan:
Have several items with different dates in columns that contain dates,
like items.dateaccessioned, items.datelastseen)
Sort the column and confirm that with this patch the lines are sorted
correctly

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 31800ba46b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ca74f037d8)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 10:07:41 +12:00
Owen Leonard f208817b13 Bug 25447: Terminology: Fix button text "Edit biblio"
This patch changes the cataloging main page so that in the menu for
reach search result the "Edit biblio" link is now "Edit record."

To test, apply the patch and do a search in cataloging. In the list of
search results verify that the "Actions" menu contains a link labeled
"Edit record."

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>
(cherry picked from commit 679dcd1574)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f918bee5f6)
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-13 09:59:16 +12:00
Aleisha Amohia 6ca279130e Bug 25861: Removing non-existent 'important' field from SQL
Bug 17232 updated some SQL queries used when adding new MARC
bibliographic frameworks. When backported to 19.11.x, it referenced a
column `important` that does not exist in marc_tag_structure or
marc_subfield_structure in 19.11.x. This patch removes the references to
`important` so that adding new bibliographic frameworks works again.

To test:
1) Ensure you have checked out 19.11.x branch
2) Go to Admin -> MARC bibliographic frameworks
3) Add a new framework and save
4) Go to Actions -> MARC structure for your new framework
5) Use the 'create framework using' dropdown to import the structure
from an existing framework
6) Note that the structure does not populate, and there is now an error
in the logs "Unknown column 'important'"
7) Apply this patch and restart services
8) Repeat steps 3-5
9) Confirm the structure is populated correctly and there is no error in
the logs

Sponsored-by: Catalyst IT

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-07-08 15:28:25 +12:00
Aleisha Amohia 21c94b6144 Update release notes for 19.11.07 release
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-23 09:59:44 +12:00
Aleisha Amohia e5785ec8db Increment version for 19.11.07 release
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-23 09:39:05 +12:00
Aleisha Amohia e9f4e181da Fixing po files for 19.11.07
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-23 09:37:05 +12:00
Koha translators 34cd887eb8 Translation updates for Koha 19.11.07
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 17:55:25 -03:00
David Roberts bcf40fe972 Bug 22470: Missing the table name on misc/migration_tools/switch_marc21_series_info.pl
This patch adds the table name to the SQL update statements.

To test:

1) Apply the patch
2) Run the script. Check that there are no errors, and that the script
behaves as expected.

Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Created a test record with values in field 440. Applied the patch, ran the
script with the -c -f flags and observed that the values were moved to field
490. Also, the relevant Koha to MARC mappings were changed accordingly.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 051b0b8d2f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0ee5a38798)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 16:29:34 +12:00
Caroline Cyr La Rose b10e9ce6ab Bug 25394: Cronjob path in the AuthorityMergeLimit syspref description is wrong
Test plan:
1- Apply patch
2- Go to Administration > Global system preferences > Authorities
3- The path to merge_authorities.pl in the AuthorityMergeLimit
description should now read misc/cronjobs/merge_authorities.pl

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>
(cherry picked from commit 772205bab5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8deb5f874e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 16:24:47 +12:00
Kyle M Hall 9402b7c24c Bug 25537: Page reload at branchtransfers.pl loses destination branch
At branchtransfers.pl, one selects a destination branch and scans in any
number of items to generate transfers to that branch. However, anything
that makes the page reload causes your branch selection to be lost,
reverting you back to whichever branch comes first alphabetically.

This is an invitation to error when one has a stack of books to
send all to the same branch. Could that error handling get moved
into a modal or something that won't reload the page?

Test Plan:
1) Place a hold on an item and set it to waiting
2) Initiate a branch transfer from branchtransfers.pl for any branch but
   the first in the pulldown branch selector
3) Choose to cancel the hold and transfer
4) Note the pulldown reverts to the first option
5) Apply this patch
6) Repeat steps 1-3
7) Note the pulldown retains your preveiously selected branch!

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>
(cherry picked from commit 8ab8df3866)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c8c394d170)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 16:16:53 +12:00
Jonathan Druart 0bc4e41459 Bug 25576: Add link to the manual for the ILL module
Test plan:
Enable ILLModule system preference.
Go to ILL requests
Click Help

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 50b6e44773)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit abc259607e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 16:09:20 +12:00
Petro Vashchuk 26ebfc3272 Bug 25587: fix for "clear" button to reset all selects
Button "clear" on cgi-bin/koha/admin/smart-rules.pl did not reset fields
with a dropdown selector except the first one.

This happens because jQuery selector .find("select option:first")
in koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
selects only single first element in the whole group, as from jquery
doc:
> The :first pseudo-class is equivalent to :eq( 0 ). It could also be
> written as :lt( 1 ). While this matches only a single element,
> :first-child can match more than one: One for each parent.
> (https://api.jquery.com/first-selector/)

And it works if replaced by: .find("select option:first-child")

To reproduce:
    1) Go to /cgi-bin/koha/admin/smart-rules.pl
    2) Start editing one of existing rules or filling a new one, change
       all selects to have non-first option selected. Fill text input
       fields with sample data.
    3) Reset all fields with the "clear" button.
    4) Observe that only the first dropdown field was reset to the first
       option while all others still contain previously given values,
       meanwhile all text input fields are cleared as expected.
    5) Apply the patch.
    6) Repeat steps 1, 2 and 3.
    7) Check that all dropdown fields were reset to first option, as
       expected.

Mentored-by: Andrew Nugged <nugged@gmail.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 58c389bf27)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 585b481cf0)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 15:59:56 +12:00
Jonathan Druart d680ae35f3 Bug 25615: Remove empty entries in the filter dropdowns of "holds to pull"
On the "Holds to pull" view there are filters that are built on the
value of the cells.
Bug 22536 improved the ergonomic by adding a ul list, but the filters
are now broken, the ul and li tags are retrieved and put in the filter
list.

The idea of this patch is to remove the HTML tags and skip if the value
is then empty.

Test plan:
Place a hold on an item
Go to Home › Circulation › Holds to pull
Open the "libraries" filter
=> Without this patch you see empty entries
=> With this patch the filter contain only the libraries

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4f70682c56)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 58c071fad3)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 15:54:59 +12:00
Tomas Cohen Arazi 4c536ffbce Bug 25623: Make sure oauth.t rolls back the db
This patch adds a missing transaction wrapping one of the subtests. This
is probably an oversight when refactoring this file.

To test:
1. Open the patron categories page
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/oauth.t
=> SUCCESS: Tests pass
3. Reload the patron categories page
=> FAIL: There's random data in there
4. Apply this patch and repeat 2
5. Reload the patron categories page
=> SUCCESS: The random data from the previous tests is still there, but
no new random data
=> SUCCESS: Tests still pass
6. 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: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f898cef4f4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0734017ab6)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 15:45:34 +12:00
Andrew Fuerste-Henry 083ce15dee Bug 25675: Reword and reorganize sysprefs related to patron self modification
To Test:
1: apply patch
2: restart all
3: go to System Preferences > OPAC
4: confirm "Self registration" section is now labeled "Self registration and modification"
5: confirm OPACPatronDetails is now in the "Self registration and modification" section
6: confirm PatronSelfRegistration now reads "(Allow / Don't allow)  library patrons to register for an account via the OPAC."
7: set OPACPatronDetails to Don't allow
8: set PatronSelfRegistration to Allow
9: log into the opac and verify you're not able to edit your patron details on an existing account

Signed-off-by: DonnaB <donna@bywatersolutions.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3e4b92d84c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 566a9f5a21)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 15:28:31 +12:00
David Cook 7c0b9d9108 Bug 25696: Correct "Test prediction pattern" HTML button
This patch corrects the closing tag for the "Test prediction pattern"
button from "</a>" to "</button>"

Test plan:
1. Apply the patch
2. Create a serial subscription from a new or existing bib record
3. Choose any frequency, numbering pattern, and subscription start
date you choose (ie fill out all mandatory subscription fields)
4. Click "Test prediction pattern"
5. Note that the prediction pattern appears on the right of the screen

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4116ca4097)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4001d4a9a0)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 15:22:11 +12:00
Jonathan Druart d033637889 Bug 23276: Do not display tag if pref TagsEnabled is off
If the pref TagsEnabled is off we should not display the tags at the
OPAC.
There is a message to tell that tags system is disabled, but the tags
are displayed.

We should redirect to 404 like we do in opac-topissues.pl and
opac-suggestions.pl.

Test plan:
- Turn TagsEnabled on
- Add some tags
- Turn TagsEnabled off
- Hit /cgi-bin/koha/opac-tags.pl
=> Without this patch you see a warning messaging saying that the tag
system is disabled, but the tags are displayed
=> With this patch you get a 404 redirect

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>
(cherry picked from commit 6fc316d2ee)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9893fb4ec5)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 15:04:45 +12:00
Tomas Cohen Arazi 28fb7b4f83 Bug 25327: Do not call authenticate_api_request to render the spec
The original code for Koha::REST::V1::Auth::under called
authenticate_api_request when requesting the API spec. This didn't make
sense, and recent changes on what conditions are tested for public
routes, broke the route.

We could add another condition, but it really doesn't make sense to call
authenticate_api_request if it should be publicly available in any
configuration, as discussed on the bug.

This patch adds a trivial check and the requested route, and lets the
request through in any case in 'under'.

To test:
1. Point your browser to:
   http://kohadev.myDNSname.org:8080/api/v1/
   http://kohadev.myDNSname.org:8080/api/v1/.html
=> FAIL: In both cases you get an authorization error.
2. Apply the regression tests patch
3. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth.t
=> FAIL: The tests reflect the situation, and fail
4. Apply this patch
5. Repeat 1 and 3
=> SUCCESS: All good!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 14:25:17 +12:00
Tomas Cohen Arazi cd950f6341 Bug 25327: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 14:25:10 +12:00
Tomas Cohen Arazi b3189e3369 Bug 24003: (follow-up) Add all userenv parameters
This patch makes the API set more userenv params than just the
borrowernumber. To test:

1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_*
=> SUCCESS: All tests pass
3. 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: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 11:54:29 +12:00
Tomas Cohen Arazi 7d20f2cdc3 Bug 24003: (follow-up) Move interface setting to a more readable place
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 11:54:26 +12:00
Tomas Cohen Arazi 977130c7ae Bug 24003: Make the API set userenv on authentication
This patch makes the authentication step stash the user that got
authenticated so code outside the Mojo part of Koha can use it (i.e.
through the use of C4::Context->userenv).

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t \
           t/db_dependent/api/v1/auth_basic.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!

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

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 11:54:23 +12:00
Tomas Cohen Arazi b143cc31fb Bug 24003: Regression tests
This patch adds regression tests for the different authentication
mechanisms Koha supports. It highlights the fact that Koha expects
userenv to be set on authentication.

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

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 11:54:19 +12:00
Tomas Cohen Arazi 11fffb70ff Bug 25411: Add special handling for public plugin routes
This patch implements the required logic in the API code so plugins are
not affected by the new RESTPublicAnonymousRequests system preference.
It is up to the plugin develpers to handle this

To test:
1. Apply the tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> FAIL: Notice the tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Yay! Not bad for a friday evening!
5. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 11:48:07 +12:00
Tomas Cohen Arazi 8374d3bc8c Bug 25411: Regression tests
This patch adds tests the new RESTPublicAnonymousRequests syspref
doesn't apply to routes added by plugins.

It is up to the plugin developer to handle those conditions.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> FAIL: Notice the tests fail

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 11:48:04 +12:00
Aleisha Amohia d411d6b47c [19.11.x] Bug 25045: (follow-up) Fix typo adding the RESTPublicAnonymousRequests syspref
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:19:38 +12:00
Martin Renvoize f6589ccf90 Bug 25045: (RM follow-up) Correction to updatedatebase.pl
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 733874e24e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:11:13 +12:00
Martin Renvoize bdb8edb5b5 Bug 25045: (RM follow-up) Add the RESTPublicAnonymousRequests syspref
The atomic update alos included a quoting mistake

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 19a241c131)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:10:59 +12:00
Jonathan Druart e18744fd4f Bug 25045: (follow-up) Add the RESTPublicAnonymousRequests syspref
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8d77db2769)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:10:44 +12:00
Aleisha Amohia 8b31591912 Bug 25045: DBRev 19.11.06.001
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:09:42 +12:00
Tomas Cohen Arazi abc29825ee Bug 25045: (follow-up) Add a note to OpacPublic
This patch tweaks the OpacPublic system preference description so users
don't expect, incorrectly, this syspref to disable the public API
anonymous access.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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>
(cherry picked from commit 3d3a07c5ee)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:07:24 +12:00
Tomas Cohen Arazi 4efbb9bd61 Bug 25045: Allow restricting anonymous requests on the public API
This patch introduces a check on the authenticate_api_request method for
the RESTPublicAnonymousRequests system preference. If disabled,
anonymous  requests get rejected.

The idea is to replicate the homologous OpacPublic system preference
behaviour.

To test:
1. Apply the Unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> FAIL: Tests fail, 200 is answered instead of 401 on the route.
3. Apply this patch
4. Repeat 2.
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ec99043a2e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:07:10 +12:00
Tomas Cohen Arazi 554cf13b1b Bug 25045: Unit tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 78cb447c7c)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:07:00 +12:00
Tomas Cohen Arazi 811d468dc4 Bug 25045: Add the RESTPublicAnonymousRequests syspref
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5394e8443f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:06:42 +12:00
Tomas Cohen Arazi 99a3d1193e Bug 24862: Handle annonymous sessions gracefuly
This patch introduces code to detect (cookie) annonymous sessions and
act as expected.

Right now, as check_cookie_auth is not passed the required permissions
(because there aren't always required permissions, and the code to check
permissions is shared with other authentication mechanisms) it returns
'ok' and the session id. This use case was overlooked when this was
coded, and yeilds unexpected error codes (500) when the user logs out
and the annonymous session cookie is used to hit the API. The end result
doesn't pose any security issue (i.e. the resource access is rejected)
but the returned error code is not correct and should be fixed.

This patch verifies for an anonymous session (and avoids querying the
corresponding patron) and then verifies if there is an authorization
config on the route and if the patron object is defined.

To test:
1. Apply the tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> FAIL: Tests fail, 500 instead of the expected 401
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Repeat the original 'steps to reproduce' from the bug report using
   the browser
=> SUCCESS: Problem solved!
6. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit de07356028)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:01:18 +12:00
Tomas Cohen Arazi 8d2255bddc Bug 24862: Regression tests
This patch introduces tests for the expected behaviour on API routes
that expect a logged in user, but the request is made with an anonymous
session cookie.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> FAIL: Tests fail because the situation is not handled correctly in
the code

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>
(cherry picked from commit 0547ad34df)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:01:04 +12:00
Mason James 3a86cc9081 Bug 17084: Automatic debian/control updates
update for 20.05 release cycle

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b5626ab3f8)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-19 16:02:00 +12:00
Katrin Fischer 4b0600e9ef Bug 25507: Fix table in basket group PDF German 2-pages
A variable was doubled up which made the columns in the
table of orders no longer line up (different number of headers
to columns).

To test:
- Create at least one basket with one or more orders
- Close the basket
- Add the basket to a basket group manually or let Koha do it
  on closing
- Change the OrderPdfFormat system preference to 'German 2-page'
- Go to the basket group page and print the PDF of the basket
- Verify the table of orders doesn't look right and runs outside
  the page
- Apply patch
- Repeat the PDF print - now table should look right

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>
(cherry picked from commit 7de78ab092)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7acffaa03f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-19 15:45:28 +12:00
Andrew Fuerste-Henry 4ee996debc Bug 25521: Remove cart_to_shelf note from NewItemsDefaultLocation syspref
To test:
1- find the NewItemsDefaultLocation syspref
2- confirm it says "NOTE: This system preference requires the misc/cronjobs/cart_to_shelf.pl cronjob. Ask your system administrator to schedule it."
3- apply patch
4- restart all
5- reload syspref, it doesn't say that anymore!

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d21ad9fe11)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 64ea0e5a34)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-19 15:43:42 +12:00
Katrin Fischer 42f885d5b7 Bug 25545: (follow-up) Fix capitalization
Total + Adjustments + Shipment cost ($)

changed to:
Total + adjustments + shipment cost ($)

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f98f2edf0a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 31969accb3)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-19 15:39:59 +12:00
Nick Clemens 7cb30b79d7 Bug 25545: Add adjustments to total tax included
Adjustments are not affected by tax, they are meant as a way to alter invoice
values after receiving (damaged items, refuneds, extra charges, etc)

When adjustments were added the tax included column was missed

To test:
- Add a basket with at least one order
- Close it
- Receive shipment
- Receive the order
- Finish receiving
- Add an adjustment of any amount
- Verify in the invoice details table:
  - Total tax exc. is showing including the adjustmnt
  - Total tax inc. is missing the adjustment
- Apply patch
- Reload
  - Total tax exc. is showing including the adjustmnt
  - Total tax inc. is showing including the adjustment

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 286a739b5c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4be984e5e0)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-19 15:39:27 +12:00
David Cook b0c7a80c5a Bug 25597: Add missing Javascript libraries to sco printslip
This patch adds missing Javascript libraries to the self-checkout
print slip. These missing libraries were preventing the auto print
prompt and close. There was also a font error.

To Test:
0) Apply patch
1) Turn on system preference SelfCheckReceiptPrompt
2) Check out item via /cgi-bin/koha/sco/sco-main.pl
3) Click "Finish"
4) Press F12 on keyboard and choose Console
5) Note no Javascript errors
6) Note that print dialog appears and closes after
a print option is chosen

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8e00a96cf1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f83d9e683f)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-19 15:31:23 +12:00