koha.git
4 years agoBug 24995: (QA follow-up) Terminology: Use checkin and checkout
Katrin Fischer [Sat, 2 May 2020 02:29:11 +0000 (04:29 +0200)]
Bug 24995: (QA follow-up) Terminology: Use checkin and checkout

... instead of issue and return.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24995: Add issuedate to table_account_fines and finest
Lucas Gass [Thu, 26 Mar 2020 21:17:42 +0000 (21:17 +0000)]
Bug 24995: Add issuedate to table_account_fines and finest

TO TEST:
1. Have a patron with some fines on an item. Try accruing fines.
2. Go to the accounting tab and look at both the Tranaction tab and Make a payment Tab
3. No Issue Date
4. Apply patch
5. Check those tabs again and see the issue date displays.
6. Go to column configuration and try to hide the issuedate, make sure it hides properly. Try this for both tables. Also make sure other columns hide properly.
7. Sign off!

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24740: Use biblio title rather than biblio number in OPAC search result cover...
Didier Gautheron [Thu, 27 Feb 2020 09:51:19 +0000 (10:51 +0100)]
Bug 24740: Use biblio title rather than biblio number in OPAC search result cover images tooltips

In OPAC biblionum doesn't mean much to patrons, use biblio title field if not empty.

Test plan:
OPAC search
1) Apply the patch
2) For each cover images providers available to tester in:
/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=Cover
OPACLocalCoverImages, AdlibrisEnabled, OPACAmazonCoverImages, GoogleJackets, Coce provider.
3) Enable the provider.
4) Search a Library Catalog for a book with a cover image.
6) test mouse over cover image display biblio title.

OPAC Shelves
1) Enable OPAC virtualshelves preference
2) Create a list.
3) For each covers providers available.
4) Search the List
5) test mouse over cover image display biblio title.

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25341: Remove whitespace from barcode in add_items.pl
Lucas Gass [Fri, 1 May 2020 17:01:11 +0000 (17:01 +0000)]
Bug 25341: Remove whitespace from barcode in add_items.pl

TEST PLAN:
1. Go to course reserves and trying adding a course with a barcode that has some leading/trailing whitespace.
2. It doesnt work
3. Apply patch and restart_all
4. Try again with leading/trailing whitespace, it should work.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24522: Show alert when trying to add nothing to a list in staff
Owen Leonard [Fri, 1 May 2020 13:23:12 +0000 (13:23 +0000)]
Bug 24522: Show alert when trying to add nothing to a list in staff

This patch modifies the JavaScript which handles the process of adding
items to a list in the staff client. Error-handling is added in the case
when a set of biblionumbers hasn't been passed to the vShelf function.

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

On the search results page, select any list from the "Add to list" menu
at the top of the search results table without checking any checkboxes.

You should get an alert, "No item was selected."

Also test that adding to a list works correctly after selecting one or
more titles.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25340: Pass biblio object to OPAC comments template
Owen Leonard [Fri, 1 May 2020 12:43:40 +0000 (12:43 +0000)]
Bug 25340: Pass biblio object to OPAC comments template

This patch modifies the OPAC comments system so that the biblio object
is passed to the template. This allows the biblio-title include to
properly access the title and subtitle information.

Unrelated change: Remove some custom CSS from the page which was
obsolete.

To test, apply the patch and make sure the "reviewson" preference is
enabled.

- Log in to the OPAC and open a bibliographic record's detail page.
- Under the "Comments" tab, click the "Post your comments" link to
  trigger the pop-up window.
- In the pop-up window, verify that the item's title is correct in the
  page title and the heading. Author should display correctly, if
  present.
- Test submitting a comment and editing a comment. Everything should
  work correctly.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24636: (follow-up) - move 'by' into include file
Bernardo Gonzalez Kriegel [Sun, 3 May 2020 22:19:21 +0000 (19:19 -0300)]
Bug 24636: (follow-up) - move 'by' into include file

To ease correct translation.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24636: translate planning sections
Bernardo Gonzalez Kriegel [Wed, 29 Apr 2020 00:21:09 +0000 (21:21 -0300)]
Bug 24636: translate planning sections

This patch adds a new inc file to process
and translate plannig sections

To test:
1) Apply patch
2) Create new language files
(cd misc/translator; ./translate create xx-YY)
3) Verify new file is taken into account in
translation files
egrep -n budget_planning misc/translator/xx-YY*.po
check new strings in staff-prog file
4) Go to Administration > Budgets > Founds > Planning
select different options, check page title and
'Planning for...' phrase
5) Translate strings, install new language, enable it,
verify the text change with options like point 4)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25335: group by authorised_value in addbiblio.pl
Andrew Fuerste-Henry [Thu, 30 Apr 2020 19:35:51 +0000 (19:35 +0000)]
Bug 25335: group by authorised_value in addbiblio.pl

To Test:
1- Edit your default framework, connect any subfield outside of the 952 to an authorised value (for example, connect the 942$n to the Yes_No auth value)
2 - Find a record in that framework
3 - Edit the record and find your subfield
4 - The subfield shows a dropdown with no contents
5 - check plack log, see "DBD::mysql::st execute failed: 'koha_kohadev.authorised_values.authorised_value' isn't in GROUP BY "
6 - apply patch, restart all
7 - reload edit record page, see your auth value dropdown has contents

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25133: (follow-up) Move changes to timepicker.inc
Nick Clemens [Mon, 4 May 2020 11:33:11 +0000 (11:33 +0000)]
Bug 25133: (follow-up) Move changes to timepicker.inc

Witht the changes in calendar.inc there can be a js error where the timepicker is not
included. Moving the changes to timepicker.inc should resolve this

Note: in previous patches the amnames/pmnames were removed. It is possible they had
no effect because they were declared in two files, so I have left them in timepicker.inc

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25133: (follow-up) Remove Names as they do no affect display
Nick Clemens [Tue, 21 Apr 2020 12:06:09 +0000 (12:06 +0000)]
Bug 25133: (follow-up) Remove Names as they do no affect display

In testing I couldn't make any changes to the names have an effect
and everythign worked as expected without these lines

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25133: Handle 12hr format for dt_from_string
Jonathan Druart [Mon, 20 Apr 2020 08:59:55 +0000 (10:59 +0200)]
Bug 25133: Handle 12hr format for dt_from_string

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25133: Fix time part of due date for 12hr
Jonathan Druart [Fri, 17 Apr 2020 10:11:25 +0000 (12:11 +0200)]
Bug 25133: Fix time part of due date for 12hr

With Timeformat system preference set to 12 hours format:

Prior to 19.05.08, when due date was specified at checkout,
the time in the box would show in 24hr format (e.g. 15:59)
while the due date in the patron's checkouts would show
in 12hr format (e.g. 3:59 PM).

After 19.05.08, the format in the specify a due date box
shows in 24hr format and the due date in 12hr format
(in patron checkouts) as before.

But when checking out multiple items using the specify due
date option for the session, the time changes from PM to
AM.

To test:
- Check out an item with specified due date 15:50 PM
- Check out a second item in same transaction
- Verify date changed to AM
- Apply patch
- Repeat
- Verify this time the date is kept as set

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24801: (follow-up) Display all the libraries - Selenium fix
Jonathan Druart [Wed, 8 Apr 2020 06:47:49 +0000 (08:47 +0200)]
Bug 24801: (follow-up) Display all the libraries - Selenium fix

We have it failing now for the delete link..
14:26:50 selenium_1   | 05:26:50.451 WARN - Exception: Unable to locate element: {"method":"xpath","selector":"//*[@id=\"delete_library_UT_BC\"]"}

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24801: Display all the libraries - Selenium fix
Jonathan Druart [Thu, 26 Mar 2020 08:59:32 +0000 (09:59 +0100)]
Bug 24801: Display all the libraries - Selenium fix

Same as for categories.

22:41:28 koha_1       | STRACE: /usr/share/perl5/Try/Tiny.pm:104 in Selenium::Remote::Driver::catch {...}
22:41:28 koha_1       |  /usr/local/share/perl/5.20.2/Selenium/Remote/Driver.pm:353 in Try::Tiny::try
22:41:28 koha_1       |  (eval 1337):1 in Selenium::Remote::Driver::__ANON__
22:41:28 koha_1       |  (eval 1339):2 in Selenium::Remote::Driver::__ANON__
22:41:28 koha_1       |  /usr/local/share/perl/5.20.2/Selenium/Remote/Driver.pm:1330 in Selenium::Remote::Driver::_execute_command
22:41:28 koha_1       |  /usr/local/share/perl/5.20.2/Selenium/Remote/Driver.pm:1330 in (eval)
22:41:28 koha_1       |  /kohadevbox/koha/t/lib/Selenium.pm:174 in Selenium::Remote::Driver::find_element
22:41:28 koha_1       |  /kohadevbox/koha/t/lib/Selenium.pm:166 in t::lib::Selenium::click_when_visible
22:41:28 koha_1       |  t/db_dependent/selenium/administration_tasks.t:128 in t::lib::Selenium::click
22:41:28 koha_1       |
22:41:28 selenium_1   | 14:41:28.273 INFO - Executing: [take screenshot])
22:41:28 selenium_1   | 14:41:28.873 INFO - Done: [take screenshot]
22:41:31 koha_1       |
22:41:31 koha_1       | SCREENSHOT: https://framapic.org/0nvX5dhLHpU1/tAEnENSeLRXB
22:41:31 koha_1       | An element could not be located on the page using the given search parameters: //div[@class="main container-fluid"]//a[contains(@href, "/admin/branches.pl?op=add_form&branchcode=UT_BC")],xpath at /kohadevbox/koha/t/lib/Selenium.pm line 174.

The screenshot was obvious, the UT_BC was not on the first page.
There was a total of 33 libraries at this point, which is not expected,
maybe data not deleted from previous selenium tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24801: Display all the categories - Selenium fix
Jonathan Druart [Wed, 4 Mar 2020 14:53:12 +0000 (15:53 +0100)]
Bug 24801: Display all the categories - Selenium fix

To make sure we are going to be able to click on the "Delete" button of
our newly created category PATRON_CAT, we are displaying them all.

Test plan:
Create several patron categories that will fill the first page:

use t::lib::TestBuilder;
my $builder = t::lib::TestBuilder->new;
for my $i ( 1..20 ) {
    $builder->build_object({ class => 'Koha::Patron::Categories', value => { description => "cat_$i" } });
}

Execute the selenium tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23081: [19.11.x] Set items.issues to 0 if not provided (AddItem)
Jonathan Druart [Mon, 11 May 2020 14:04:27 +0000 (16:04 +0200)]
Bug 23081: [19.11.x] Set items.issues to 0 if not provided (AddItem)

In master it has been replaced by Koha::Object->store and we deal with
the default value.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20816: [19.11.x] Add ability to define custom templated fields in SIP patron...
Nick Clemens [Wed, 19 Jun 2019 17:59:14 +0000 (17:59 +0000)]
Bug 20816: [19.11.x] Add ability to define custom templated fields in SIP patron responses

To test:
 1 - You will need to enable SIP on your testing instance
    cp etc/SIPconfig.xml /etc/koha/sites/kohadev/
    sudo koha-start-sip
    add a user listed in the SIPconfig to your system and give them permissions (superlibrarian works)
    on koha-testing-docker you should be able to start sip with user koha/koha without any adjustments
 2 - If you copied the above file you should be set to get custom field DE with dateexpiry
     Otherwise edit the sip login for the user to have a custom section like:
  <login id="koha"   password="koha"  delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" >
  <custom_patron_field field="DE" template="[% patron.dateexpiry %]" />
  </login>
 3 - send a status test using the sip cli tester:
     perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_status_request
 4 - send an information test using the sip cli tester:
     perl misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l kohalibrary --patron 23529001000463 -m patron_information
 5 - confirm you receive the DE field with a dateexpiry
 6 - Add your own custom fields and confirm it works with several
         <custom_patron_field field="EW" template="Phone: [% patron.phone %] Email: [% patron.email %]" />
 7 - prove -v t/db_dependent/SIP/Patron.t
 8 - prove -v t/db_dependent/SIP/

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 20816: Make SIP tests pass under ES

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22515: Improve logic determining how to show OPAC suggestions
Owen Leonard [Mon, 27 Apr 2020 13:20:23 +0000 (13:20 +0000)]
Bug 22515: Improve logic determining how to show OPAC suggestions

This patch makes changes to the OPAC suggestions view so that the logic
around logged in users and the OPACViewOthersSuggestions preference is
more specific.

To reproduce the bug you should have pending purchase susggestions in
your system from more than one patron.

1. Set the OPACViewOthersSuggestions preference to "Show."
2. Log in to the OPAC as a user who has not submitted any suggestions.
3. Follow the link to the purchase suggestions page from the menu under
   the search bar.
4. The page will say that there are no  purchase suggestions.
5. Add "?suggested_by_anyone=1" to the end of the page URL.
6. You should see suggestions from other users.

To test, apply the patch and repeat steps 2-3 above. The suggestions
page should show other patrons' suggestions.

Test with different combinations of factors:

 - Logged in user, OPACViewOthersSuggestions off
 - No logged in user, OPACViewOthersSuggestions on
 - No logged in user, OPACViewOthersSuggestions off

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25247: Only convert data ot objects when displaying on screen
Nick Clemens [Wed, 22 Apr 2020 12:11:53 +0000 (12:11 +0000)]
Bug 25247: Only convert data ot objects when displaying on screen

To test:
 1 - Modify a patron
 2 - Circulate some items to the patron
 3 - Click 'Modification log'
 4 - Verify you see your actions
 5 - Under 'Output' select 'To a file'
 6 - Save the output to a file
 7 - View the file
 8 - Not you have references ot objects in stead of patron/item data
 9 - Apply patch
10 - Repeat
11 - Note viewing on screen has not changed
12 - Note exporting to file inlcudes borrower/item numbers and not references
13 - Sign off

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21565: (follow-up) Make confirmation buttons more detailed
Owen Leonard [Wed, 29 Apr 2020 17:57:44 +0000 (17:57 +0000)]
Bug 21565: (follow-up) Make confirmation buttons more detailed

This patch updates the confirmation buttons to be more specific about
what each one does. My concern was that it wasn't clear that "No" meant
"No receipt" and not "Cancel logging out."

The patch also updates the modal confirmation code so that the modal
body is removed if no message is passed for it.

To test, apply the patch and repeat the previous test plan. When you
click "Finish" you should have the options "Print receipt and end
session" and "End session."

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21565: Add modal to SCO confirm
Lucas Gass [Fri, 24 Apr 2020 18:39:02 +0000 (18:39 +0000)]
Bug 21565: Add modal to SCO confirm

This patch uses the confirmModal framework to add a modal confirm to
SCO Finish.

TO TEST:

1. Enable SCO and go to /cgi-bin/koha/sco/sco-main.pl. Make sure
   SelfCheckReceiptPrompt is set to 'show'
2. Login and click 'Finish' to see the old print alert box.
3. Apply patch and repeat steps 1 and 2.
4. Make sure the modal works for confirming and denying a receipt.
   Checkout some items and make sure everything still functions the
   same.
5. Make sure when printing a receipt that the print dialog automatally
   shows
6. Set SelfCheckReceiptPrompt to 'Don't show' and confirm behavior is
   acceptable.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25107: Remove double passing of $server variable to maybe_add in C4::SIP::Sip...
Kyle M Hall [Fri, 10 Apr 2020 10:58:43 +0000 (06:58 -0400)]
Bug 25107: Remove double passing of $server variable to maybe_add in C4::SIP::Sip::MsgType

At some point some calls to maybe_add got an extra $server var in their
parameter lists. This doubled parameter does nothing and should be
removed.

Test Plan: No change in behavior should be noted

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23119: MARC21 added title 246, 730 subfield i displays out of order, and should...
David Roberts [Mon, 6 Apr 2020 23:42:19 +0000 (23:42 +0000)]
Bug 23119: MARC21 added title 246, 730 subfield i displays out of order, and should display before subfield a

This patch makes the subfield i display before subfield a in the 246 and
730 fields

To test:

1) Create a bibliographic record with data in several subfields in tags
246 and 730.
2) See that subfield i displays at the end of the field in the 246
field, and probably not at all in the 730 field. Check in both the OPAC
and staff client
3) Apply the patch.
4) Check your bib record again in both clients. Subfield i should now
display before subfield a.

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 15751: Add ModDateLastSeen to ProcessOfflineReturn
Martin Renvoize [Wed, 11 Dec 2019 11:53:51 +0000 (11:53 +0000)]
Bug 15751: Add ModDateLastSeen to ProcessOfflineReturn

Test plan:
1) Before the patch when one checks in something using the KOCT the last seen
date is not updated.
2) After the patch when one checks in something using the KOCT the last seen
   date is updated.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25127: Use Koha::Number::Price->round for comparison
Martin Renvoize [Mon, 20 Apr 2020 11:09:27 +0000 (12:09 +0100)]
Bug 25127: Use Koha::Number::Price->round for comparison

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25127: Correction to tests
Martin Renvoize [Mon, 20 Apr 2020 08:34:19 +0000 (09:34 +0100)]
Bug 25127: Correction to tests

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25127: Unit tests
Nick Clemens [Mon, 13 Apr 2020 12:47:03 +0000 (12:47 +0000)]
Bug 25127: Unit tests

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24043: (QA follow-up) Fix another TypeError when retrieving status name
Josef Moravec [Thu, 30 Apr 2020 11:29:56 +0000 (11:29 +0000)]
Bug 24043: (QA follow-up) Fix another TypeError when retrieving status name

Test plan:
1) Apply first patch, and have the same requests as in previous patch
test plan
2) Load ill requests list
2a) You can see another TypeError in console
2b) You can notice, the Placed on and Updated on columns have prepended
another columns with unformatted dates and without header label
3) Apply this patch
4) Reload page (be sure it is not loaded from cache - Ctrl+F5)
5) Errors from 2a and 2b are gone

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24043: Fix retrieval of of status name
Andrew Isherwood [Mon, 13 Jan 2020 10:18:19 +0000 (10:18 +0000)]
Bug 24043: Fix retrieval of of status name

This patch modifies the way in which a request's status name is
retrieved. I think the previous way it was done (which can never have
worked properly) must have come from a time when we weren't embedding
the request's backend capabilities in each request. So now we can just use
the current row.

Test plan:

1. *Before applying the patch*:
2. Ensure you have at least two requests, from two different backends.
One of the backends you are using must have a possible status that
doesn't exist in the other. For example, the BLDSS backend has a status
of STAT, that doesn't not exist in any other backends.
3. Ensure that the request who's backend has the unique status is *not*
the first request in the returned list.
4. Load the "View ILL requests" page
5. Observe that the page JS fails with a "Cannot read property 'name' of
undefined" error
6. Apply the patch
7. Reload the page (maybe doing a hard reload to ensure the JS is not
cached)
8. TEST: Observe that the error no longer occurs and the requests all
have their statuses displayed correctly.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24908: Add text-formatted MARC support in /biblios/{biblio_id}
Tomas Cohen Arazi [Thu, 19 Mar 2020 15:04:39 +0000 (12:04 -0300)]
Bug 24908: Add text-formatted MARC support in /biblios/{biblio_id}

This patch makes the route support requesting (through the Accept
header) the MARC record to be output as formatted text as in
$record->as_formatted.

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/biblios.t
=> FAIL: Tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Try the route with your favourite API testing tool (Postman?)
=> SUCCESS: Accept: text/plain returns the expected results
=> SUCCESS: Wrong Accept header returns a list of valid formats, and
includes 'text/plain'.
6. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24908: Unit tests
Tomas Cohen Arazi [Thu, 19 Mar 2020 15:04:27 +0000 (12:04 -0300)]
Bug 24908: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23137: Move cache flushing to the method
Jonathan Druart [Wed, 15 Apr 2020 14:38:16 +0000 (16:38 +0200)]
Bug 23137: Move cache flushing to the method

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23137: Add documentation
Nick Clemens [Tue, 14 Apr 2020 10:14:00 +0000 (10:14 +0000)]
Bug 23137: Add documentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23137: Add reset and delete to koha-elasticsearch
Nick Clemens [Thu, 19 Mar 2020 16:37:24 +0000 (16:37 +0000)]
Bug 23137: Add reset and delete to koha-elasticsearch

Same as previous test, but use the script to run the reindex
reset_all to update the scripts or use
misc4dev/cp_debian_files.pl

sudo koha-elasticsearch --rebuild -r -v

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23137: Add reset option to rebuild_elasticsearch.pl
Nick Clemens [Thu, 19 Mar 2020 16:30:29 +0000 (16:30 +0000)]
Bug 23137: Add reset option to rebuild_elasticsearch.pl

Setup:
1 - Be using Elasticsearch
2 - Reload mappings from the db
    Admin->Search configuration
    Reset Mappings
3 - Reindex ES and confirm searching is working

To test:
1 - Apply patch
2 - Alter your mappings file for elastic (just change a description for a field)
3 - perl misc/search_tools/rebuild_elasticsearch.pl -r -v
    Verbose not necessary, but good for letting you know things are progressing
4 - Confirm the mapping change shows in the interface
5 - Confirm reindex worked and searching is working

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22828: Add tests
Jonathan Druart [Fri, 21 Feb 2020 15:07:23 +0000 (16:07 +0100)]
Bug 22828: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 22828: Elasticsearch - display errors encountered during indexing on the command...
Nick Clemens [Thu, 2 May 2019 11:27:27 +0000 (11:27 +0000)]
Bug 22828: Elasticsearch - display errors encountered during indexing on the command line

To test:
 1 - Use the Koha sample data, or insert a blank 245$b into a record (easiest way is using advanced cataloging editor
 2 - Reindex elasticsearch
 3 - Check the ES count on the about page
 4 - Check the count in the DB (SELECT count(*) FROM biblio)
 5 - They don't match!
 6 - perl misc/search_tools/rebuild_elastic_search.pl -v -v
 7 - No errors indicated
 8 - Apply patch
 9 - perl misc/search_tools/rebuild_elastic_search.pl -v
10 - You should be notified of an error
11 - perl misc/search_tools/rebuild_elastic_search.pl -v -v
12 - You should be notified of the specific biblio with an error and a (somewhat) readable reason
13 - perl misc/search_tools/rebuild_elastic_search.pl
14 - No output

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25231: Rename button instead of alert/confirm when replacing record
Nick Clemens [Tue, 21 Apr 2020 17:30:00 +0000 (17:30 +0000)]
Bug 25231: Rename button instead of alert/confirm when replacing record

This test plan applies to the basic editor only

To test:
1 - Edit an existing record
2 - Click 'Z3950 Search'
3 - Note the confirmation box
4 - Add a new record
5 - Click 'Z3950 Search'
6 - Note no popup
7 - Apply patch
8 - Edit existing record
9 - Note button now says 'Replace record via Z3950 search'
10 - Add a new blank record
11 - Note the button says 'Z3950 search'
12 - Confirm editing/saving/replacing works as in the past

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25072: Fix details.tt print CSS
Lucas Gass [Wed, 15 Apr 2020 21:42:36 +0000 (21:42 +0000)]
Bug 25072: Fix details.tt print CSS

TO TEST:
-Search for something in the catalog and go to the details page.
-Try to print either for the Print button in Koha or File->Print...
-Notice the large amount of whitespace on the left
-Apply patch
-Reload detaials page and attempt to print again.
-No whitespace on left side

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25299: Show soon to expire patron date
David Cook [Tue, 28 Apr 2020 01:40:23 +0000 (11:40 +1000)]
Bug 25299: Show soon to expire patron date

This patch fixes the call to show the patron expiry date
on the Details page when the patron is soon to expire.

Test plan:
0. Do not apply patch yet
1. Create a patron
2. Set patron's date expiry to 3 days from today
3. Go to Details tab
4. Note message "Expiration: Patron's card will expire soon.
Patron's card expires on Renew or Edit details"
5. Apply patch
4. Note message pattern "Expiration: Patron's card will expire soon.
Patron's card expires on XX/XX/XXXX Renew or Edit details"

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25300: Fix typo in "Edit details" for expiring/expired patron
David Cook [Tue, 28 Apr 2020 02:00:15 +0000 (12:00 +1000)]
Bug 25300: Fix typo in "Edit details" for expiring/expired patron

This patch removes a typo in the argument to the "op" parameter
for the "Edit details" link when editing an expiring/expired patron
on the Details page.

Test plan:
0. Do not apply patch yet
1. Create patron
2. Set expiry date to 3 days from now
3. Go to Details tab in patron record
4. Click "Edit details" in "Library use" section
5. Note the form is blank and has no patron data in it
6. Apply the patch
7. Reload the Details page in patron record
8. Click "Edit details" in "Library use" section
9. Note the form now contains your patron data and will
work for editing the details

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25291: Escape barcode in ReturnClaims table display
Didier Gautheron [Mon, 27 Apr 2020 12:42:49 +0000 (14:42 +0200)]
Bug 25291: Escape barcode in ReturnClaims table display

Test Plan:

1) Set ClaimReturnedLostValue
2) Create a checkout
3) Claim a return
4) Change the barcode to something with html inside, </a> will do

Without this patch cgi-bin/koha/members/moremember.pl claim tab barcode link is broken.

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>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25229: (follow-up) Move QueryBuilder test to Elasticsearch dir
Nick Clemens [Mon, 27 Apr 2020 11:37:13 +0000 (11:37 +0000)]
Bug 25229: (follow-up) Move QueryBuilder test to Elasticsearch dir

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25229: Return authid of record rather than 001
Nick Clemens [Tue, 21 Apr 2020 13:47:59 +0000 (13:47 +0000)]
Bug 25229: Return authid of record rather than 001

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25229: Unit test
Nick Clemens [Mon, 27 Apr 2020 11:28:51 +0000 (11:28 +0000)]
Bug 25229: Unit test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25227: Display correct message if item is withdrawn and withdrawn returns are...
Kyle M Hall [Mon, 27 Apr 2020 11:07:12 +0000 (07:07 -0400)]
Bug 25227: Display correct message if item is withdrawn and withdrawn returns are allowed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25227: Display correct message if item is lost and lost returns are allowed
Kyle M Hall [Tue, 21 Apr 2020 11:11:08 +0000 (07:11 -0400)]
Bug 25227: Display correct message if item is lost and lost returns are allowed

Even if a library allows returns of lost items, the SIP server returns the error message "Item lost, return not allowed" if the checkin was not ok for any reason other than it being withdrawn ( and withdrawn items not being returnable ).

The most clear example of this is that when a lost item is not checked out to a patron and is returned. SIP returns that message even though lost items *can* be returned. The actual problem being that the item was not checked out.

Test Plan:
1) Ensure you can return lost items
2) Mark an item as lost
3) Check it in via SIP
4) Note the message you get back is "Item lost, return not allowed"
5) Apply this patch
6) Restart your SIP server
7) Repeat steps 2 and 3
8) Note you no longer get the incorrect message!

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25227: Add unit tests
Kyle M Hall [Mon, 27 Apr 2020 12:04:07 +0000 (08:04 -0400)]
Bug 25227: Add unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25235: Rename the button instead of alerting when replacing an existing record
Phil Ringnalda [Wed, 22 Apr 2020 04:34:33 +0000 (21:34 -0700)]
Bug 25235: Rename the button instead of alerting when replacing an existing record

Test plan:

Pre-patch
1 - Go to the main Authorities page, search for any authority, click
    the Actions menubutton and choose Edit
2 - Note the button saying Z39.50 search
3 - Note the modal alert forcing you to click it
4 - Cancel and cancel again, and in the New authority menubutton choose
    Default
5 - Click the button saying Z39.50 search again, note that it warns you
    about replacing your totally blank record

Apply this patch
6 - Edit an existing authority, note the button says "Replace record via
    Z39.50/SRU search"
2 - Click the button, verify it still opens the search window with the
    main entry of the record filled in without an alert
3 - Create a new authority, note the button says "Z39.50/SRU search"
4 - Click the button, verify it still opens the search window but
    without an alert

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 17232: Make sure all fields are copies when creating a new framework from another
Katrin Fischer [Tue, 14 Apr 2020 10:45:01 +0000 (10:45 +0000)]
Bug 17232: Make sure all fields are copies when creating a new framework from another

Some digging revealed that when you create a new framework
and use an old framework as the base, some information would
not be copied to the new framework as they were missing from
the SQL command used here.

- Tag: Important
- Subfield:
  - Important
  - Default value
  - Max length
  - Is a URL
  - Link

To test:
- Pick one of the existing frameworks and change the
  fields listed above. Take note of what you changed.
- Create a new framework
- Go to "Marc structure" of the new framework
- You are offered the option to copy an existing framework
- Use your prepared framework
- Verify the fields weren't copied - your config was lost
- Apply patch
- Create another new framework
- Repeat the duplication and tests
- Verify that now all fields have been copied correctly

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24339: Do not assume there are exactly 3 SIP* AVs
Jonathan Druart [Mon, 27 Jan 2020 10:03:46 +0000 (11:03 +0100)]
Bug 24339: Do not assume there are exactly 3 SIP* AVs

Update DB entry 19.06.00.017:
We created SIP* AV from accountlines if '^Pay[[:digit:]]{2}$', so I
think we should assume that more than SIP00, SIP01, SIP02 can exist.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24339: Remove SIP payment types from staff pay screens
Martin Renvoize [Wed, 8 Jan 2020 12:48:55 +0000 (12:48 +0000)]
Bug 24339: Remove SIP payment types from staff pay screens

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24339: Add SIP2 payment types for installation
Martin Renvoize [Fri, 3 Jan 2020 21:50:51 +0000 (21:50 +0000)]
Bug 24339: Add SIP2 payment types for installation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23081: followup remove atomicupdate file
Joy Nelson [Fri, 8 May 2020 21:45:33 +0000 (21:45 +0000)]
Bug 23081: followup remove atomicupdate file

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoDBIC update
Joy Nelson [Fri, 8 May 2020 21:26:45 +0000 (21:26 +0000)]
DBIC update

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23081: DBRev 19.11.05.004
Joy Nelson [Fri, 8 May 2020 21:22:48 +0000 (21:22 +0000)]
Bug 23081: DBRev 19.11.05.004

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23081: Adjust tests
Jonathan Druart [Mon, 27 Apr 2020 09:55:15 +0000 (11:55 +0200)]
Bug 23081: Adjust tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23081: Revert "Bug 24443: Consider NULL as 0 for issues in items search"
Jonathan Druart [Mon, 27 Apr 2020 09:51:35 +0000 (11:51 +0200)]
Bug 23081: Revert "Bug 24443: Consider NULL as 0 for issues in items search"

This reverts commit 80f1374f262544a750b5d81a7d9605c8708c53b1.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23081: atomicupdate for change to existing installs
Andrew Fuerste-Henry [Sun, 26 Apr 2020 23:53:26 +0000 (23:53 +0000)]
Bug 23081: atomicupdate for change to existing installs

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23081: set default to 0 for items.issues and deleteditems.issues
Andrew Fuerste-Henry [Sun, 26 Apr 2020 23:51:25 +0000 (23:51 +0000)]
Bug 23081: set default to 0 for items.issues and deleteditems.issues

To test:
- save and run this sql query in reports: select sum(if(issues is null,1,0)),sum(if(issues=0,1,0)) from items
- you should see a lot of nulls and no zeros
- apply patch
- updatedatabase
- re-run your query and see that your nulls have changed to zeros
- create a new item
- rerun your query and see your new item is counted in the zeros, not the nulls

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24750: Instructor Search Results
Joseph Sikowitz [Sat, 18 Apr 2020 20:06:05 +0000 (16:06 -0400)]
Bug 24750: Instructor Search Results

Adds regex to the split() of the passed parameters to improve searching.

Test plan
1. Go to Course Reserves module.
2. Press New course button.
3. Make active the instructor search box.
4. Start typing the last name of a patron that exists in your database.
5. At the end of the last name type ", " and try to add a first name.
6. The search should fail.
7. Apply the patch.
8. Follow steps 1-5 again.
9. You should now be able to search using the following methods
9a. surname, firstname
9b. firstname surname

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25233: Staff XSLT material type label "Book" should be "Text"
Lucas Gass [Tue, 21 Apr 2020 21:33:03 +0000 (21:33 +0000)]
Bug 25233: Staff XSLT material type label "Book" should be "Text"

This patch makes the staff client XSLT stylesheets consistent with the
ones for the OPAC, it also makes consitent the use of 'Text' when the leader6 = 't'

TO TEST:
1. Have a record with leader06 = 'a' and leader07 = 'c' 'd' or 'm'.
2. Check the staff client results and details page. See that the
   material type label says "Book"
3. Check the OPAC client results and details page. See that the
   materila type label says "Text"
4. Apply patch.
5. See that both staff client and OPAC results/details all now say
   "Text"
6. Set the leader6 = 't' and make sure that is says 'Text' on both the
   staff client and OPAC

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25276: Compiled CSS
Joy Nelson [Fri, 8 May 2020 20:52:03 +0000 (20:52 +0000)]
Bug 25276: Compiled CSS

4 years agoBug 25276: Correct hover style of list share button in the OPAC
Owen Leonard [Fri, 24 Apr 2020 14:24:07 +0000 (14:24 +0000)]
Bug 25276: Correct hover style of list share button in the OPAC

This patch adds missing "btn" classes to the OPAC share button so that
its style is consistent with similar controls.

The patch also makes some general changes to the OPAC CSS to make sure
link color and hover color are applied with enough specificity. This
corrects the hover color of the share button but should not change any
other existing style.

To test you should have the OpacAllowSharingPrivateLists preference
enabled.
 - Rebuild the OPAC CSS
   (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
 - Log in to the OPAC as a user with one or more private lists.
 - Go to Lists -> Your lists.
 - In the list of lists there should be a "Share" link for each list.
   Hovering your mouse pointer over the link should change the style in
   the same way the "Edit" link does.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25211: Add missing share icon to OPAC lists page
Owen Leonard [Mon, 20 Apr 2020 11:38:41 +0000 (11:38 +0000)]
Bug 25211: Add missing share icon to OPAC lists page

This patch adds a Font Awesome icon to the "Share" links on the list of
lists in the OPAC.

To test, apply the patch and log in to the OPAC as a user who has one
or more private lists.

  - Go to Lists -> Your lists
  - In the table of your lists, each list should have a "Share" link
    with an icon.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24957: OpenLibrarySearch shouldnt display if nothing is returned
Lucas Gass [Tue, 21 Apr 2020 20:11:17 +0000 (20:11 +0000)]
Bug 24957: OpenLibrarySearch shouldnt display if nothing is returned

TO TEST:
1. Turn on OpenLibrarySearch
2. Do an OPAC search that returns results that have results with Open Library results and some that do not.
3. Notice results that return nothing simpliy say "Open Library:" with nothing afterwards.
4. Some results return a png from OpenLibrary or "Not found"
5. Apply patch and look at records again.
6. The results that return nothing for OpenLibrary API should now to hidden.

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 21927: Acq - Add blank values in pull downs of mandatory item subfields
Katrin Fischer [Sun, 12 Apr 2020 03:19:03 +0000 (03:19 +0000)]
Bug 21927: Acq - Add blank values in pull downs of mandatory item subfields

This is the same fix as on bug 14662, which fixed the behaviour in
cataloguing, but for the item form in acquisitions.

The code assumes that if a subfield is marked as mandatory, there
should be no empty entry in the pull downs.

This assumption is not correct, as it leads to the first entry of the
pull down being preselected if there is no default set. As the field
can never be 'unset', there will never be a 'required' warning.
Furthermore, it might be counterproductive to use mandatory fields,
as it might be easily forgotten to change the preselected value and
those mistakes will be hard to find.

Correct behaviour would be to preselect the empty value when there is
no default. This means on saving the item an error message is triggered
and the cataloger is forced to set the value.

To test:
- This is best tested with an ACQ framework, but default can be used
  when no ACQ framework was created.
- In your MARC bibliographic framework:
  - In 952 make itemtype, classification source and some other pull downs
    like location or collection mandatory and set them to visibel if needed
- Create a new basket with 'items created while ordering'
- Add a new order, an existing record with 942$c set will work best
- Add items for your order line
  - Verify that the first value of each pull down is preselected,
    there is no way to trigger the 'required' error
- Apply patch
  - Add a new order line
    - Verify that classification source is preselected according to the
      DefaultClassificationSource system preference (try unsetting it later)
    - Verify all mandatory fields can be set to empty
    - Verify that you can't save before correctly setting them
  - Change your frameworks and set a default for itemtype (Ex: BK) and
    another mandatory and non-mandatory field of your choice
  - Add a new order line and item and verify the defaults are selected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25274: Don't initialize DataTable if table isn't present
Owen Leonard [Fri, 24 Apr 2020 11:49:21 +0000 (11:49 +0000)]
Bug 25274: Don't initialize DataTable if table isn't present

This patch modifies the OPAC basket JavaScript so that a check is added
for the existence of the "itemst" table. This avoids an error if the
"More details" view is selected and hte "itemst" table isn't present.

To reproduce the error, add some items to the OPAC cart and open the
cart window. Open the JavaScript console in your browser and click the
"More details" link. You'll see an error.

To test, apply the patch and perform the same test as above. The error
should not be present. Test that table sorting in the "brief" view words
correctly.

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25118: Return claims has some translation issues
Owen Leonard [Tue, 14 Apr 2020 11:52:17 +0000 (11:52 +0000)]
Bug 25118: Return claims has some translation issues

This patch adds the right function calls to checkouts.js so that English
strings can be picked up by the translator. The resolution message has
been reformatted so that it can be clear without including "on" and
"by" in the middle of the string.

To test you should have a patron with at least one return claim. Open
the checkout page for that patron and open the "Claims" tab. Test the
process of editing, deleting, and resolving claims.

TESTING TRANSLATABILITY

- Update a translation:

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

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

  #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:920
  msgid "Double click to edit"
  msgstr ""

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

> perl translate install fr-FR

Switch to the udpated translation and test the functionality under the
"Claims" tab again to confirm that your translated strings appear.

Note that "untranslatable string" failures reported by the QA script are
false positives.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25257: Preserve prolog on translated XML files
Bernardo Gonzalez Kriegel [Thu, 5 Dec 2019 00:51:16 +0000 (21:51 -0300)]
Bug 25257: Preserve prolog on translated XML files

This patch fix the missing xml prolog in translated
files, XML or TT.

Is fixed teaching C4::TTParse not to ignore <?..?> constructs,
then teaching xgettext.pl to ignore those strings. Net result is
that they are copied in the translated file.

To test:
1) Update & install your preferred language,
(cd misc/translator/; perl translate update xx-YY; perl translate install xx-YY )

2) Compare the first lines (head -2) of:
koha-tmpl/opac-tmpl/bootstrap/en/xslt/compact.xsl
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt
koha-tmpl/intranet-tmpl/prog/en/xslt/plainMARC.xsl
and
koha-tmpl/opac-tmpl/bootstrap/xx-YY/xslt/compact.xsl
koha-tmpl/opac-tmpl/bootstrap/xx-YY/modules/opac-opensearch.tt
koha-tmpl/intranet-tmpl/prog/xx-YY/xslt/plainMARC.xsl

Check the missing prolog

3) Install this patch, repeat 1 and 2, now the prolog is present
on translated files.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25224: Show large print format in search results XSLT
Andrew Fuerste-Henry [Tue, 21 Apr 2020 17:41:29 +0000 (17:41 +0000)]
Bug 25224: Show large print format in search results XSLT

To test:
1: find a bib with 008 type Book
(Leader position 6 = 'a' and leader position 7 = 'm' -- use bib number 1 in master data)
2: set 008 position 23 to 'd' for large print
3: check your book record in opac and intranet search results, note that your change is not reflected in the "format" note in line with material type
4: find a bib with 008 type Continuing Resource
(Leader position 6 = 'a' and leader position 7 = 's' -- use bib number 44 in master data)
5: set 008 position 23 to 'd' for large print
6: check your continuing resource record in opac and intranet search results, note that your change is not reflected in the "format" note in line with material type
7: apply patch, restart_all
8: reload search results from steps 3 and 6, confirm they now say "format: large print"

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25186: Fix accordion sections height in columns configuration page
Jonathan Druart [Mon, 20 Apr 2020 09:13:40 +0000 (11:13 +0200)]
Bug 25186: Fix accordion sections height in columns configuration page

The height for each section was the height of the highest section.
Now the height is set to the length of the section.

Test plan:
Go to Administration > Column configuration
Open the sections and confirm that the height fits its content.

QA: note that I guess "autoHeight: false" was meant to achieve that,
but it does not exist in the API of the plugin.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24768: (RM follow-up) Add missing koha_object_class's
Martin Renvoize [Fri, 17 Apr 2020 15:05:43 +0000 (16:05 +0100)]
Bug 24768: (RM follow-up) Add missing koha_object_class's

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24768: Add 'Return claims' to column configuration for checkouts tables
Katrin Fischer [Sat, 11 Apr 2020 10:36:36 +0000 (10:36 +0000)]
Bug 24768: Add 'Return claims' to column configuration for checkouts tables

The checkouts tables on the checkouts and details tabs in the staff
patron account support column confiugration, but the new column
"Return claims" was missing.

This patch adds the column to the column configuration.

To test:
- Make sure to test with a patron having return claims and without
- Verify cou can toggle the visibility of the return claims column
  from top of the tables in the checkouts and details tabs
- Go to administrastion > column configuration
- Change the settings for the issues tables in the Patrons and
  Circulation sections
- Verify the changes have been applied to the tables as configured

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20501: Don't cut strings when unhighlighting in intranet search results
Phil Ringnalda [Sun, 19 Apr 2020 02:37:49 +0000 (02:37 +0000)]
Bug 20501: Don't cut strings when unhighlighting in intranet search results

When you click Unhighlight on the search results of a search in the staff client
when the search terms contain the same word twice, like "ma ma", the highlighted
words disappear, and don't reappear if you click Highlight.

This patch makes the same change to the intranet copy of jquery.highlight-3.js that
bug 5844 made to the OPAC copy.

Test plan:
1) Without this patch, search in the intranet for ma ma and verify you have at least
   two matching records.
2) Notice that the Ma in Material type: Book is highlighted.
3) Click Unhighlight, and notice that it has become terial type: Book
4) Apply this patch, repeat the search with a shift+reload to reload the .js
5) Click Unhighlight, and verify that Material type: Book remains Material

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25223: Make join of aqbasket and aqorders explicit
Nick Clemens [Mon, 20 Apr 2020 18:41:37 +0000 (18:41 +0000)]
Bug 25223: Make join of aqbasket and aqorders explicit

This is simply a SQL change that makes things a bit easier to read
and also prevents too much data being returned in a large system

To test:
1 - Have some orders in your system in the ordered status
2 - Click the 'Ordered' amount for your budget from Acquisitions home
3 - Note the view of orders, possibly screen shot
4 - Apply patch
5 - Restart all the things
6 - Reload the ordered page
7 - Confirm nothing has changed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25123: (QA follow-up) Re-used variable name
Martin Renvoize [Mon, 20 Apr 2020 07:37:10 +0000 (08:37 +0100)]
Bug 25123: (QA follow-up) Re-used variable name

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25123: Count the current fine when reducing for maxFine
Nick Clemens [Mon, 13 Apr 2020 11:38:28 +0000 (11:38 +0000)]
Bug 25123: Count the current fine when reducing for maxFine

If maxFine is set, we total the patrons outstanding fines when making an adjustment, however, we neglect to count the amount of a currently updating fine when doing so.

To test:
1 - Set maxFine to 5
2 - Create an overdue amount of 4.99 for a patron
3 - Set an itemtype to have a fine of $.10 per day
4 - Checkout an item of that type to a patron and backdate the due date so it is overdue
5 - Run fines.pl with -v
6 - Note the fine is reduced from $.10 (or a multiple) to .01
7 - Run it again, a second cent is added
8 - Repeat and note it keeps happening until the amount of the fine is reached, exceeding the maxFine setting
9 - Apply patch
10 - Note the fine is now reduced to 0 and nothing is added to account

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25123: Unit tests
Nick Clemens [Mon, 13 Apr 2020 11:38:23 +0000 (11:38 +0000)]
Bug 25123: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 14369: Only show 'Create labels' link on staged records import when status is...
Katrin Fischer [Sun, 12 Apr 2020 22:06:05 +0000 (22:06 +0000)]
Bug 14369: Only show 'Create labels' link on staged records import when status is imported

The label creator won't be able to add a batch for items, if they are
not imported into the database (missing itemnumber). This patch hides
the link, when the status is not imported, to avoid the error situation.

To test:
- Export a record with items from your Koha installation
- Delete items and record from Koha
- Stage the record with the items - the "Create labels" link should be showing
- Try to create the labels - note error
- Apply patch
- Retry - the link should no longer show
- Import the records - the link should show now
- Create labels again - a new batch should have been created
- Verify the link on the batch # leads to the batch in the labels module

Bonus: Moves the message from the .pl file to the template to make
it translatable.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20484: (RM follow-up) Highlight ES disablement
Martin Renvoize [Tue, 21 Apr 2020 11:14:13 +0000 (12:14 +0100)]
Bug 20484: (RM follow-up) Highlight ES disablement

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20484: Implement blocking_errors for ES config page
Nick Clemens [Tue, 21 Apr 2020 10:54:56 +0000 (10:54 +0000)]
Bug 20484: Implement blocking_errors for ES config page

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20484: Allow configuration of ES before switching to ES
Nick Clemens [Wed, 8 Apr 2020 10:11:38 +0000 (10:11 +0000)]
Bug 20484: Allow configuration of ES before switching to ES

To test:
1 - Set SearchEngine syspref to Zebra
2 - Be a user with permission to manage search engine configuration (manage_search_engine_config)
3 - Confirm you do not see 'Search engine configuration' on Admin main page
4 - Apply patch
5 - Confirm you see it with '(Elasticsearch)' appended
6 - Be a user without above permission
7 - Confirm you cannot see the 'Search engine configuration'
8 - Confirm you cannot access directly:
    /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 13557: Add hint for on-site checkouts to list of current checkouts in OPAC
Katrin Fischer [Mon, 13 Apr 2020 21:45:22 +0000 (21:45 +0000)]
Bug 13557: Add hint for on-site checkouts to list of current checkouts in OPAC

In the list of checkouts it's currently not possible for the
patront or tell the difference between normal checkouts (item
is at home with them) and on-site checouts (items remained at
the library). This patch adds a hint to the list of checkouts to
allow differentiating these kinds of checkouts.

To test:
- In your patron account, have multiple checkouts, some on-site,
  some others, overdue items, etc.
- Go to: OPAC > your summary > Checked out
- Verify that there is no hint for the on-site checkouts
- Apply patch
- Check again, there should now be a note

The note also has a class, so would be easy to be hidden
or formatted differently: class="onsite_checkout".

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 21211: Add patron toolbar to suggestions, discharges and ill requests tabs
Katrin Fischer [Tue, 14 Apr 2020 13:14:37 +0000 (13:14 +0000)]
Bug 21211: Add patron toolbar to suggestions, discharges and ill requests tabs

When paging through the patron account in staff, using the tabs on
the right, you notice that some pages are missing the patron toolbar
on top and that the headings, where they exist, vary in size.

This patch adds the patron toolbar to 3 more tabs and changes headings
to h1 to be consistent with older tabs. It has also been suggested on
another tab that this is preferrable for screen readers.

Note: Modification log was left out for now, as this is also used in tools.

To test:
- Activate ILL (ILLModule pref)
- Activate discharges (UseDischarge pref)
- Go to any patron account, tab through the tabs...
- Verify that discharge, purchase suggestions and ill requests are
  missing the toolbar
- Apply patch
- Verify that the toolbar now appears on these pages and works
  correctly
- Also veriy that the headings are now consistently h1 on all pages

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 18680: Add an empty entry by default to sort1/sort2 values in patron account
Katrin Fischer [Tue, 14 Apr 2020 16:57:38 +0000 (16:57 +0000)]
Bug 18680: Add an empty entry by default to sort1/sort2 values in patron account

When using sort1/sort2 with authorised values to create a pull down
list, there will be no empty entry unless one is manually added to
the authorised values list.

This is not a good default behaviour, as it can easily
cause errors on patron creation. Without the empty entry, the first
alphabetic value is pre-selected and will be saved if not explicitly
changed. It also doesn't allow to mark sort1/sort2 as mandatory,
as the value is always 'set', the required message won't be triggered.

This adds an empty parameter to av-build-dropbox.inc to allow selectively
adding this empty entry without causing side-effects in other places
this include is used.

To test:
- Create authorised values for either Bsort1 or Bsort2 authorised
  value category
- Create a new patron:
  - you should see a pull down list on one and an input field for the other
  - for the pull down list, there will be no empty entry and the first
    alphabetic value will be preselected
- Make your sort1 and sort2 mandatory using BorrowerMandatoryField
- Verify there is still on empty entry
- Apply patch
- Repeat tests and verify that the behaviour is as expected
  - There should now be an empty entry
  - When the field is marked mandatory and empty is left, the required
    warning will be shown.

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 10561: Rephrase DisplayOPACiconsXSLT and DisplayIconsXSLT slightly
Katrin Fischer [Mon, 13 Apr 2020 01:46:25 +0000 (03:46 +0200)]
Bug 10561: Rephrase DisplayOPACiconsXSLT and DisplayIconsXSLT slightly

As the pref removes the whole 'line' of information, this tries to makes
the behaviour a little clearer by adding a 'and descriptions' to the pref
text. It now reads:

[Show|Don't show]  the format, audience, and material type icons and
descriptions in XSLT MARC21 results and detail pages in ...

To test:
- Check both preference descriptions in the staff client
- Verify the text reads correctly and this helps things

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25016: Coce should not return a 1-pixel Amazon cover image
Owen Leonard [Sun, 29 Mar 2020 00:19:39 +0000 (00:19 +0000)]
Bug 25016: Coce should not return a 1-pixel Amazon cover image

This patch adds an onload function to the JavaScript which loads images
from Coce. In the case where the image is 1 x 1 pixel the image should
be removed.

To test you should have Coce enabled and Amazon.com included in the list
of sources.

 - Apply the patch and view the bibliographic details page under a
  variety of conditions:
   - A title which has a matching Amazon image:
     - The image should load as expected.
   - A title which doesn't have a matching Amazon image
     - The image should not be found in the source at all after the page
       has loaded.
  - Test with local cover images enabled

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25176: Compiled CSS
Joy Nelson [Thu, 7 May 2020 21:07:30 +0000 (21:07 +0000)]
Bug 25176: Compiled CSS

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25176: Fix style of checkout form
Owen Leonard [Fri, 17 Apr 2020 11:40:36 +0000 (11:40 +0000)]
Bug 25176: Fix style of checkout form

This patch makes a small CSS change in order to fix a display problem
with the checkout form where the form's width doesn't match that of the
"last checked out" message.

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

Check an item out to a patron. Confirm that the green-bordered "Checked
out" message under the checkout form matches the width of the form.

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24800: Add tests
Jonathan Druart [Wed, 11 Mar 2020 11:56:41 +0000 (12:56 +0100)]
Bug 24800: Add tests

Signed-off-by: Clemens Elmlinger <clemens.elmlinger@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24800: Handle inexistent return date on self checking
Jonathan Druart [Wed, 11 Mar 2020 12:01:52 +0000 (13:01 +0100)]
Bug 24800: Handle inexistent return date on self checking

See bug 24800 comment 0 for a description of the problem.

We do not want the SIP server to crash if it receives a checkin request
with a return date that is not given.

The option this patch chose is to parse it only if provided.

Signed-off-by: Clemens Elmlinger <clemens.elmlinger@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25069: Fix AddressFormat="fr" behavior
Jonathan Druart [Mon, 6 Apr 2020 10:44:13 +0000 (12:44 +0200)]
Bug 25069: Fix AddressFormat="fr" behavior

Something went wrong during a rebase of bug 13618
  commit dcd1f5d48c758aee17b6c6f069c6146b42efe117
  Bug 13618: Add html filters to all the variables

Several changes related to AddressFormat are wrong:

-    [% IF Koha.Preference( 'AddressFormat' ) %]
-        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
-    [% ELSE %]
-        [% INCLUDE 'member-main-address-style-us.inc' %]
-    [% END %]
+    [% SWITCH Koha.Preference( 'AddressFormat' ) %]
+        [% CASE 'de' %]
+            [% INCLUDE 'member-main-address-style-de.inc' %]
+        [% CASE # us %]
+            [% INCLUDE 'member-main-address-style-us.inc' %]
+     [% END %]

Test plan:
Create a patron with all the address fields filled
Play with the 3 option values of AddressFormat, and confirm that the address is displayed correctly
on the patron's view, and in the patron module (top left)

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24840: [19.11.x] Replace DateTime->now with dt_from_string
Nick Clemens [Thu, 26 Mar 2020 11:05:32 +0000 (11:05 +0000)]
Bug 24840: [19.11.x] Replace DateTime->now with dt_from_string

We should use Koha::DateUtils instead of Date::Time directly

This patch simplay replaces calls to now() with a call to dt_from_string()
which does effectively the same thing.

Probably reading the code and verifying changes is sufficient but...

To test:
1 - confirm the files all compile
2 - confirm all tests pass
3 - confirm Koha still works

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 24840: Catch some further cases of DateTime->now

This patch corrects a few additional cases where DateTime->now is called
directly instead of via Koha::DateUtils.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24620: [19.11.x] Close existing transfer when hold set to waiting (squashed)
Nick Clemens [Mon, 10 Feb 2020 18:18:45 +0000 (18:18 +0000)]
Bug 24620: [19.11.x] Close existing transfer when hold set to waiting (squashed)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 24620: Close existing transfers when setting item to waiting

This patch adds a clause in ModReserveAffect to check if there
are existing transfers and close them when setting a hold to waiting

To test:
 1 - Set AutomaticItemReturn to Do
 2 - Checkin an item from Library B at Library A
 3 - Confirm item is in transfer (check the details page)
 4 - Place a item level hold for pickup at library A
 5 - Checkin the item at Library A
 6 - Confirm the hold
 7 - View the details page
 8 - Note the item is in transit and waiting
 9 - Apply patch
10 - Delete hold and repeat
11 - Confirm that transfer is closed when hold marked waiting

Signed-off-by: Sally <sally.healey@cheshirewestandchester.gov.uk>
Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 24620: Fix test, remove replaced code, use dt_from_string

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 20101: Cronjob automatic_item_modification_by_age.pl does not log run in action...
Kyle M Hall [Tue, 30 Jan 2018 16:10:07 +0000 (11:10 -0500)]
Bug 20101: Cronjob automatic_item_modification_by_age.pl does not log run in action logs

C4::Log::cronlogaction() was never implemented in automatic_item_modification_by_age.pl.

Test Plan:
1) Apply this patch
2) Enable CronjobLog
3) Run automatic_item_modification_by_age.pl succesfully
4) Note the run is noted in the action logs

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25086: DBRev 19.11.05.003
Joy Nelson [Tue, 5 May 2020 23:04:53 +0000 (23:04 +0000)]
Bug 25086: DBRev 19.11.05.003

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25086: Set changed_fields column as nullable
Agustin Moyano [Wed, 8 Apr 2020 19:53:43 +0000 (16:53 -0300)]
Bug 25086: Set changed_fields column as nullable

This patch changed_fields column as nullable.

To test:
1. Do not apply any patch
2. Set PatronSelfRegistrationVerifyByEmail preference to require
3. Fill self registration form in opac and submit
CHECK => OPAC dies with a nasty message, that says Field 'changed_fields' doesn't have a default value
4. Apply this patch and updatedatabase
5. Repeat step 3
SUCCESS => Registry process continues as expected
6. Sign off

Sponsored-by: Orex Digital
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 25007: (follow-up) Fix the way image check alters layout
Owen Leonard [Sat, 28 Mar 2020 17:42:50 +0000 (17:42 +0000)]
Bug 25007: (follow-up) Fix the way image check alters layout

A question in the bug report asks: Why is is necessary to change the
Bootstrap class to col-xs-12? The JavaScript which checks for the
existence of an Amazon cover image is designed to remove the Amazon
cover's container if there is none. Changing the class of
cover image column is gone.

However, the check is incorrect because it doesn't account for Local
Covers. There might be both a 1 x 1 pixel Amazon image and a local cover
image, so the layout shouldn't be changed unless there are no images
present.

To test, apply the patch and view the bibliographic details page of
various titles including:
- Amazon cover present, no local cover
- No Amazon cover, local cover image present
- Both Amazon and local cover image

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>