Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 12 Jan 2022 09:30:59 +0000 (10:30 +0100)]
Bug 29857: Provide a generic full_message method for our exceptions
We pass useful information when throwing exceptions, but we don't
display them! We must display all the details we need when the exception
is stringified.
Test plan:
Use the following snippet:
use Koha::Exceptions::Elasticsearch;
Koha::Exceptions::Elasticsearch::BadResponse->throw( type => "a good type", details => "and some details" );
Execute it without and with the patch.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 12 Jan 2022 09:31:24 +0000 (10:31 +0100)]
Bug 29857: Make the exception classes inherit from the base class
We have a base class Koha::Exceptions::Exception but it's not used in
most of our exception classes
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 23 Feb 2022 14:21:04 +0000 (15:21 +0100)]
Bug 30164: Fix datatable wrapper when no filter passed
This problem appears (at least) on the cities list view:
If you pass a filter in the "Search cities" filter in the header, it
won't be taken into account and all the cities will be displayed.
There are two problems. First we are passing an "empty" q=[] in the
body, the filter from the header is passed as URL parameters. We should
not need to pass the q if it's empty.
Then the main problem is coming from a bug in
Koha::REST::Plugin::Query but I didn't manage to track it down. If we
have two 2 passed, only the second one will be used. We are certainly
using a hash somewhere we should not.
This patch is fixing the bug but not on the correct side. A follow-up
bug should take care of the main problem at lower level.
Test plan:
Hit /admin/cities.pl
Create some cities
Use the filter in the header of the page and submit
=> Without this patch all cities are retrieved
=> With this patch applied only the relevant cities are displayed.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lucas Gass [Wed, 27 Oct 2021 21:58:44 +0000 (21:58 +0000)]
Bug 29338: Add print hold/transfer button to request.tt
1. Apply patch
2. Make some holds, have some item level and some bib level
3. On request.tt notice a new column on the holds_table called 'Print hold/transfer slip'
4. Make sure the button works and takes you to the proper hold/transfer slip
5. Make sure it works well with both item/bib level holds
Thomas Klausner [Tue, 22 Feb 2022 14:09:58 +0000 (15:09 +0100)]
Bug 30153: Use uppercase AND to join query parts
C4::Search->FindDuplicate joins title and author using 'and'
(lowercase). When this query is passed on to ElasticSearch, it
interprets the lowercase 'and' as a term to search for, because the
operator has to be in uppercases ('AND').
Test plan:
* Reproduce the bug:
- Set SearchEngine to ElasticSearch (and make sure you have the data
indexed etc)
- Find an existing book, note the title (245a) and the author (100a)
- Create a new book (Cataloging -> New Record)
- Fill in the same title and author using the same data as in an
existing book (and any other fields that might be required)
- Click "save"
=> A new book will be created, the Duplicate Finder has failed
* Apply the patch
* Check if it's working now:
- Create a new book (Cataloging -> New Record)
- Fill in the same title and author using the same data as in an
existing book (and any other fields that might be required)
- Click "save"
- The DuplicateFinder should now report the already exising book
Maybe we should also check if Zebra does not have any problems with the
uppercase 'AND'? In that case, repeat the above steps, but set
SearchEngine to Zebra :-)
Nick Clemens [Wed, 20 Oct 2021 18:47:01 +0000 (18:47 +0000)]
Bug 29287: Add child funds to display of parent funds on acqui home
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Michael Sutherland <sudrland@vt.edu> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Mon, 5 Jul 2021 18:37:57 +0000 (19:37 +0100)]
Bug 28663: Prevent discounts against void lines
With the introduction of double entry accounting for VOID actions, we
need to add an additional filter to the 'Apply discount' button appearance
Test plan
1/ Add a debt
2/ Pay the debt
3/ Void the payment
4/ Confirm that with the patch applied the 'Apply discount' button does
not appear on the 'Void' accountline.
Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Fri, 6 Aug 2021 16:31:15 +0000 (16:31 +0000)]
Bug 25025: Drag-and-drop cover image upload
This patch updates the Upload local cover image page so that the user
has the option of dragging a file from a folder on their computer
instead of using a file upload button.
The patch also adds a preview of uploaded single images and display of
existing images on the record you're adding to.
To test, apply the patch and make sure the LocalCoverImages system
preference is enabled.
- Go to Tools -> Upload local cover image and test the following
processes:
- Upload single cover image, specifying a biblionumber
- Test dragging an image from a file on your computer
- Test clicking the "Drop files here or click..." link.
- You should see a preview of the image file on the screen, with
information about the file: file name, image type, file size.
- Click "Process images"
- with "Existing covers will be replaced" checked
- with "Existing covers will be replaced" unchecked
When the upload process completes you should see information about the
title in the page heading and a thumbnail of the cover in the sidebar.
- Test that the image can be deleted from this page. You should be
redirected back to this page with the same title still selected.
- Upload a zip file of images
- Test dragging an image from a file on your computer
- Test clicking the "Drop files here or click..." link.
- A zip file can't be previewed onscreen but you should see the same
file information and a Font Awesome "zip file" icon.
- Click "Process images"
From the bibliographic detail page, click the "Images" tab, and click
"Upload." With this workflow the field asking for a biblionumber should
not appear.
From the bibliographic detail page, in the holdings table, choose Edit
-> Upload image. This process should be the same as above but should
provide item information on the screen. Confirm that images are uploaded
correctly to the specific item.
Test with AllowMultipleCovers enabled and disabled to confirm that the
"Existing covers will be replaced" checkbox is enabled only when
multiple covers are possible.
Owen Leonard [Thu, 18 Apr 2019 12:17:13 +0000 (12:17 +0000)]
Bug 20689: (follow-up) Correct scope of template variables
The removal of the <select>s should have been accompanied by a
correction to the scope of tagfield and tagsubfield. It is also
unnecessary to conditionally include the "value" attribute.
To test, apply the patch and test the process for editing an item search
field. All the correct values should appear in form fields during edit,
and all values should save correctly.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Fri, 12 Oct 2018 15:46:43 +0000 (15:46 +0000)]
Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields
This patch adds some custom validation to the MARC tag and subfield
fields so that they are limited to alphanumeric characters.
Both templates (the main view and the edit view) have been modified so
that item_search_fields.js can be included in both.
To test, apply the patch and test the form by entering a variety of
different character combinations. The "MARC field" and "MARC subfield"
inputs should only accept alphanumeric entries.
Test both "new" and "edit" operations.
Test other operations like delete and cancel.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jose-Mario <jose-mario.monteiro-santos@inLibro.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Katrin Fischer [Thu, 9 Aug 2018 22:51:43 +0000 (22:51 +0000)]
Bug 20689: Replace marc (sub)field pull downs with input fields on item search fields config
The pull down for marc subfields on the item search fields config page is
long and hard to use. It also doesn't include the commonly used
upper case letters for custom item subfields.
Also hard to use with its 999 entries is the marc field list. It doesn't
allow for tags like 01e, which exist in our MARC21 default framework.
To test:
- Go to Administration > Item search fields
- Add different mappings with and without subfields
- Verify the entered values are stored correctly
- Edit mappings
- Verify editing works and changes save correctly
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 30133: Fix pagination in /biblios/:bibio_id/pickup_locations
This patch does the same thing we did for items on the previous patch,
but for biblios. The tests are almost the same as well.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Fri, 18 Feb 2022 14:25:41 +0000 (14:25 +0000)]
Bug 30133: Avoid calling c->objects->search twice
Calling this twice sets double pagination headers, which messes up the page for the requests and
retrieves on ly the end of the list
This patch simply avoids a doulbe call
TO DO: must implement same for Biblio->pickup_locations and cover with tests
this also returns all as needing override
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lucas Gass [Fri, 7 Jan 2022 22:31:35 +0000 (22:31 +0000)]
Bug 29824: Allow editing of quick spine labels
To test:
1. Apply patch
2. Go to the quick spine label tool and enter a barcode of an item with a itemcallnumber
3. Notice the 'Edit this label' button at the bottom of the page, click it
4. Edit the itemcallnumber in some way: add some line breaks, remove some, insert some new characters, remove some characters.
5. You can now print the label with your edits.
Note: This changes nothing in the database, if you relaod the same item/itemcallnumer it will have returned to its original form
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 15 Dec 2021 14:36:47 +0000 (14:36 +0000)]
Bug 28955: (follow-up) Set to fall back
This patch updates the original fix to only set the template parameter
for opac sessions and updates all occurences in templats to check first
for logged_in_user.branchcode before falling back to default_branch
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 27 Oct 2021 10:27:18 +0000 (11:27 +0100)]
Bug 28955: Add OPAC_BRANCH_DEFAULT
This patch adds support for OPAC_BRANCH_DEFAULT as an environment option
that can be passed via apache with either SetEnv or as a header for
plack. It allows setting a default branch for the anonymous opac
session such that you can display the right opac content blocks prior to
login if you have set up per branch URI's.
To test (on top of bug 29691)
1 - Add to apache conf (/etc/apache2/sites-available/kohadev.conf)
SetEnv OPAC_BRANCH_DEFAULT "CPL"
RequestHeader add X-Koha-SetEnv "OPAC_BRANCH_DEFAULT CPL"
2 - Restart all
3 - Confirm that news for all and CPL show on opac mainpage
4 - Sign in as a different library
5 - Confirm users library news shows
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Mon, 27 Sep 2021 18:34:17 +0000 (18:34 +0000)]
Bug 30060: Add primary key to user_permissions table
Without primary key DBIC is failing with something like:
GET /api/v1/suggestions/managers: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::ResultSource::RowParser::_resolve_collapse(): Unable to calculate a definitive collapse co
lumn set for UserPermission (last member of the Borrower -> user_permissions chain): fetch more unique non-nullable columns at /kohadevbox/koha/Koha/Objects.pm line 394>> Koha::REST::Plugin::Exceptions::__ANON__ /
kohadevbox/koha/Koha/REST/Plugin/Exceptions.pm (73)
Test plan:
Execute the atomic update and confirm that the new PK has been added to the user_permissions table.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Thu, 4 Feb 2021 16:14:48 +0000 (16:14 +0000)]
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs
This patch modifies the XSL template for OPAC search results in order to
improve HTML validation: Changing some <span>s to <div>s will prevent an
error when those <span>s contain block-level elements.
To test, apply the patch and restart_all if necessary.
- Confirm that OPACXSLTResultsDisplay is set to "default"
- Perform a catalog search in the OPAC.
- Validate the page source and confirm that there are no errors about
"Element ul not allowed as child of element span in this context"
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Tue, 28 Sep 2021 13:18:18 +0000 (13:18 +0000)]
Bug 27613: (follow-up) Modify additional repeating entries for consistency
This patch makes further changes to the detail and results XSLT in the
OPAC so that previously pipe-separated fields are styled with CSS. The
following tags are modified on the detail page:
020 ISBN
022 ISSN
050 LOC classification
060 NLM classification
082 DDC classification
084 Other classification
130/240/730 Uniform titles
246 Other title
336 Content type
337 Media type
338 Carrier type
385 Audience
508 Production credits
583 Action note
586 Awards
655 Genre/Form
700/710/711 Contained works
700/710/711 Related works
770 Supplement
772 Supplement to
856 Online resources
These are modified on the results page:
028 Publisher number
246 Other title
To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
In order to better see the effect of the CSS change you can add
something ike this to your OPACUserCSS system preference:
.resource_list li::after {
content: "♦";
}
View catalog search results and detail pages for records which contain
repeated entries from the tag list above. The entries should be
separated by "|" without customization, or the symbol from your
OPACUserCSS if you specified one.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lucas Gass [Thu, 4 Feb 2021 00:27:11 +0000 (00:27 +0000)]
Bug 27613: Change pipe seperated online resource links to psuedo elements
To test:
1. Have a record with many 856 links
2. Look at the links on both the results and detail pages.
3. Look at the '|' and notice it is outside any HTML element, making it
hard to remove.
4. Apply the patch and regenerate the CSS
5. Look at both the pages again and notice that the '|' is now a psuedo
element.
6. It should look identical to the way it did without the patch
7. Switch the system pref OPACURLOpenInNewWindow to 'do' and make sure
the the links look and function right still.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Fri, 18 Feb 2022 17:31:04 +0000 (17:31 +0000)]
Bug 29965: (follow-up) Use a new class for the preview
With previous patches everythign worked, however, clicking the heading in
authority search results now launched the preview instead of taking you to the
authority details
This patch uses a new class to launch the modal and conditionally applies it to
authority results as we expect different behaviours when searching from the popup
vs authority module
To test:
1 - Repeate previous tests, confirm they pass
2 - Search for authorities in the authority module
3 - COnfirm clicking on heading takes you to detail page for authority
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Fri, 18 Feb 2022 17:15:07 +0000 (17:15 +0000)]
Bug 29965: (follow-up) Move repeated JS to its own file
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Aleisha Amohia [Fri, 28 Jan 2022 02:58:55 +0000 (02:58 +0000)]
Bug 29965: Preview MARC in authority search results
This enhancement makes the authority MARC preview modal available for
the general authority search results.
To test:
1) Do a catalog search and edit a biblio record
2) Go to one of the authority tags (i.e. 1xx, 6xx, 7xx) and open the
authority finder plugin
3) Do an authority search
4) Click on one of the search result headings to open the modal. Confirm
it opens as expected.
5) Exit the biblio editor and go to Authorities
6) Do an authority search
7) Click on the Actions dropdown, then the MARC preview button,
to open the modal. Confirm it opens as expected.
Sponsored-by: Education Services Australia SCIS Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lucas Gass [Tue, 15 Feb 2022 17:59:47 +0000 (17:59 +0000)]
Bug 29845: add classes to overdrive results action buttons
To test:
1. You must have OverDrive credentials populated in the OverDrive
system preferences
2. Go to the Overdrive results page and make sure you are logged in.
3. Use your browsers dev tools to look at the check-in, check-out,
place hold, cancel hold buttons, none of them contain classes.
4. Apply patch
5. Repeat 3 again but this time they should all contain a class which
makes them much easier to style.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Mon, 10 Jan 2022 15:52:16 +0000 (15:52 +0000)]
Bug 26975: Reindent authorities editor template
This patch performs general template cleanup to the authorities editor:
Make indentation consistent, replace tabs with spaces, and trim trailing
whitespace.
To test, apply the patch and edit or create a new authority record. Test
the functionality of the authority editor and confirm that everything
works correctly, including JS interactions like subfield reordering, tag
and subfield cloning, and tag and subfield deletion.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 23 Feb 2022 10:02:24 +0000 (11:02 +0100)]
Bug 29844: Fix advanced editor
The method Koha::Libraries->branchcode is not covered by tests!
Trace begun at /kohadevbox/koha/Koha/Objects.pm line 572 Koha::Objects::AUTOLOAD('Koha::Libraries=HASH(0x563bf134b810)') called at /kohadevbox/koha/svc/cataloguing/framework line 33
Jonathan Druart [Wed, 8 Dec 2021 14:34:28 +0000 (15:34 +0100)]
Bug 29660: Remove biblioitem loop from request.pl
It seems that hiddencount didn't work prior to this patch (to confirm)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 8 Dec 2021 14:32:14 +0000 (15:32 +0100)]
Bug 29660: Unused code in placerequest.pl
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Wed, 8 Dec 2021 14:10:57 +0000 (15:10 +0100)]
Bug 29660: Remove hostitemsflag
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
We retrieve two counts that are only needed if rules for hold limits are defined.
The DB counts should only be fetched once the rules are confirmed to exist
Further improvement would be possiblke by allowing them to be passed in (or cached?)
from CanBookBeReserved as they rely only on patron/biblionumber and not item specific information
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lucas Gass [Wed, 12 Jan 2022 16:12:37 +0000 (16:12 +0000)]
Bug 29760: Add patron category column to view_holdsqueue.tt
To test:
1. Have some holds and build the holds queue.
2. Go to view_holdsqueue.tt, there is no patron category column
3. Apply patch
4. Look again, there should now be a column for 'Patron category'
showing both the caterory name and the category code.
5. Make sure you can sort and filter by this new column
6. Go to table settings and make sure you can properly hide this column
and all other columns in the Holds queue.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch fixes it by removing the third $date that wasn't removed
back then.
To reproduce:
1) Head over to Reports page.
2) Search for report by date. It should cause 500 error.
3) Apply the patch.
4) Repeat the search again, it should be working now.
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Fri, 28 Jan 2022 08:49:44 +0000 (09:49 +0100)]
Bug 29962: (bug 27526 follow-up): Fix columns button on item list
The "Columns" button on the item list view has been broken (hidden) by
bug 27526.
"column_name" was removed from the item_header_loop:
- if ( $kohafield && $kohafield =~ /items.(.+)/ ) {
- $header_value{column_name} = $1;
- }
We can still access the attribute name using 'attribute' however.
The difference is that non-mapped subfield will have an "attribute", but
there is a net to prevent a crash in columns_settings.inc:
12 var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' );
13 var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter;
14 if ( used_id == -1 ) return;
We should simply pass attribute.
Test plan:
Create a non-mapped subfield (952$k)
Edit an item, add a value for k
On the item table at the top of the edit form notice that the "Columns"
button is back and that it's working correctly.
Note that 'k' cannot be hidden (may be considered as a bug, but it's not
a regression).
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Mon, 10 Jan 2022 11:29:11 +0000 (12:29 +0100)]
Bug 29803: Do not wait for the images more than 5 seconds
In case of the previous bug, the page was calling the callback function
every 100ms, endlessly. We should add a test to prevent future similar
problem.
Test plan:
Remove the previous patch "Prevent local cover image to be hidden if
Coce is enabled"
Recreate the test plan
=> You should see the local image displayed after 5 seconds, and a
log in the JS console
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Mon, 10 Jan 2022 11:19:54 +0000 (12:19 +0100)]
Bug 29803: Prevent local cover image to be hidden if Coce is enabled
If Coce is enabled by no image are returned by the service, then no
other image will be displayed (actually un-hidden)
The getURL is returning early if no image is returned by the service and
the "done" flag is never set.
Test plan:
Add a local cover image to a bibliographic record (ktd biblionumber=14
is good)
Set CoceHost = http://coce.bywatersolutions.com
Select all CoceProviders
Enable OpacCoce
=> If no image is returned by Coce then the local image should be
displayed anyway
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Fri, 28 Jan 2022 14:04:49 +0000 (15:04 +0100)]
Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation
If you cancel holds in bulk, the list is not updated as we enqueued the
task. But the "Update hold(s)" button will explode if clicked.
Test plan:
Place several holds on a bib record
Use the "Cancel selected" link to cancel holds in bulk
The job is enqueued and the hold list still show the holds you cancelled
Click "Update holds"
=> Without this patch you get an ugly 500
Can't call method "found" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1060
=> With this patch applied the table is refresh, no crash (and there is
a warning in the log, that may not be necessary)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Tue, 1 Feb 2022 11:55:23 +0000 (11:55 +0000)]
Bug 29989: Improve headings in MARC staging template
This patch updates the MARC staging page so that the headings are
descriptive based on the context.
To test, apply the patch and go to Tools -> Stage MARC for import.
- The heading should be "Stage MARC records for import."
- Upload a MARC file and stage the file for import.
- The heading on the next page should read "MARC staging results."
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Kevin Carnes [Tue, 8 Feb 2022 13:35:18 +0000 (14:35 +0100)]
Bug 27770: ES: Deprecated aggregation order key [_term] used, replaced by [_key]
Starting in Elasticsearch 6.0 _key should be used instead of _term to order
buckets by their term
To test:
1) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
2) If you observe an error about types, apply patch for bug 25669
3) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
4) Observe if you get a deprecation warning about order key
5) Apply patch
6) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
7) Observe no deprecation warning about order key
8) Sign off
Sponsored-by: Lund University Library Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Blou [Tue, 15 Feb 2022 21:18:15 +0000 (16:18 -0500)]
Bug 30115: Uninitialized value warning in C4/Output.pm
Use of uninitialized value $url_suffix in concatenation (.) or string at GIT/C4/Output.pm line 180.
Use of uninitialized value $url_suffix in concatenation (.) or string at GIT/C4/Output.pm line 197.
Use of uninitialized value $url_suffix in concatenation (.) or string at GIT/C4/Output.pm line 211.
This is in pagination_bar sub. A lot of pages call it. For me it
happened with any Authority search (authorities/authorities-home.pl)
producing multiple results.
Simple fix is initializing the variable.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers [Thu, 2 Dec 2021 22:21:45 +0000 (12:21 -1000)]
Bug 29625: Fix var name in Koha::BiblioUtils get_all_biblios_iterator
In Koha::BiblioUtils, get_all_biblios_iterator method is a class level method like get_from_biblionumber.
So its first arg should be named $class instead of $self.
Even if this var in not used.
Test plan :
1) Run Elasticsearch full rebuild with and without patch
2) Check all biblio records are in index
Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Mon, 18 Oct 2021 12:29:19 +0000 (12:29 +0000)]
Bug 22671: Show warning if browser doesn't support applicationCache
This patch adds a check for browser support for the "applicationCache"
feature required by the offline circulation tool. If the feature is not
available, a message is shown to the user that offline circulation is
disabled.
To test, apply the patch and enable the AllowOfflineCirculation system
preference.
In a browser which supports applicationCache (Firefox < 81, Chrome < 94,
Safari <= 15), go to Circulation -> Built-in offline circulation
interface.
- You should see the standard Offline Circulation menu options: Check
out, check in, syncrhonize, etc.
- Click "Synchronize," then "Download records."
- The process should complete correctly, updating the "last synced"
information on the page.
Follow the same steps in a browser which has dropped support for
applicationCache. As soon as you reach the built-in offline circulation
page you should see a message, "Your browser is not compatible..."
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers [Wed, 12 Jan 2022 05:40:35 +0000 (19:40 -1000)]
Bug 29853: Add HTML filter before KohaSpan filter
Usage of Template Toolkit plugin KohaSpan as filter is actually :
Group [% added.title | $KohaSpan class = 'name' | $raw %] created.
But KohaSpan filter does not escape HTML characters.
Whe should filter HTML then KohaSpan.
This patch adds TT html filter before KohaSpan.
Also replaces in Javascript html() with text()
to ensure special caracters are still encoded.
See https://api.jquery.com/text/
Test plan :
1) Create a library with name Libra'rie
2) Create a library group with name Grou'pe
3) Play with this group
4) Add library
5) Remove library
6) Edit group
7) Delete group
8) Each time check that &apos, is not interpreted as single quote
Alex Buckley [Mon, 13 Dec 2021 02:31:51 +0000 (02:31 +0000)]
Bug 29761: Prevent batch patron modification to process several time the same patron
If a cardnumber, SMS number, or borrower number is inputted multiple times then the batch patron
modification page should not display that patron multiple times.
Test plan:
1. Create three text files that list card numbers, SMS numbers, and borrower numbers for three patrons. Example lists are below, notice in each there is one number duplicated:
2. Enable sending of SMS messages:
* Set SMSSendDriver system preference to Email
3. Make sure the cardnumbers, borrower numbers, and SMS numbers listed
above belong to patrons in your Koha
4. Go to Tools > Batch patron modification
5. Upload lists of cardnumbers, SMS numbers, and borrower numbers above, and confirm the following is happening in the batch patron modification page:
- Upload the text file of cardnumbers. Notice one patron is displayed twice
- Paste in the list of cardnumbers. Notice one patron is displayed twice
- Upload the text file of SMS numbers. Notice one patron is displayed twice
- Paste in the list of SMS numbers. Notice one patron is displayed twice
- Upload the text file of borrower numbers. Notice one patron is displayed twice
- Paste in the list of borrower numbers. Notice one patron is displayed twice
6. Apply patch and restart services
7. Repeat step 5 and this time observe that the patron record is not duplicated in the batch patron modification page
Sponsored-By: Catalyst IT Signed-off-by: David Nind <david@davidnind.com>
JD Amended patch: adjust commit title Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Thu, 10 Feb 2022 14:28:11 +0000 (15:28 +0100)]
Bug 30074: Add missing extended_attributes rs in DBIC schema
REST API route /patrons has extended_attributes available (x-koha-embed) but it's actually not working.
GET /api/v1/patrons: unhandled exception (Koha::Exceptions::BadParameter)<<Cannot find Koha::Object class for extended_attributes>> Koha::REST::Plugin::Exceptions::__ANON__ /kohadevbo
x/koha/Koha/REST/Plugin/Exceptions.pm (73)
It's missing the relationship named "extended_attributes".
Test plan:
Create a new patron attribute CODE and a value for a patron
Hit /api/v1/patrons?q={"extended_attributes.type":"CODE"}
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lucas Gass [Tue, 4 Jan 2022 22:44:32 +0000 (22:44 +0000)]
Bug 29795: add empty value for branchcode on self-reg form
1. Set branch code as a PatronSelfRegistrationBorrowerMandatoryField
2. Go to the self reg form and look at the Home library field, it defaults to the first choice alphabetically
3. Fill out the other required fields and the captcha. Don't change the branchcode value.
4. Submit the form, it submits.
5. If branchcode is required it should default to an empty value and force the user to make a choice.
6. Apply patch
7. Repeat 1-3
8. Now you cannot submit the form unless you choose a branchcode
9. Make sure it still works normally when branchcode is not in PatronSelfRegistrationBorrowerMandatoryField
Fridolin Somers [Mon, 14 Feb 2022 20:35:53 +0000 (10:35 -1000)]
Bug 30099: Fix error when accessing circulation.pl without patron parameter
If I access circulation.pl directly, with no patron cardnumber or borrowernumber submitted, I get an error:
Can't call method "messages" on an undefined value at /kohadevbox/koha/circ/circulation.pl line 525
This is caused by Bug 29230 which calls $patron outside a
"if ($aptron)".
Test plan :
1) In staff interface, click in 'check out' search box
2) Hit enter (without a search text)
=> Without patch you get an error
=> With patch you see a blank page /cgi-bin/koha/circ/circulation.pl
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Mon, 13 Dec 2021 09:59:15 +0000 (09:59 +0000)]
Bug 23873: Enable capture groups in MarcModificationTemplates
This patch adds support for regular expression capture groups in
MarcModificationTemplates.
We escape double quotes in the replacement string, then quote the whole
string before applying the `ee` modifier to the final regex application.
See
https://blog.james.rcpt.to/2010/10/25/perl-search-and-replace-using-variables/
for further details.
Test plan
1) Attempt to use capture groups in your regular expression based
MarcModificationTemplate and note it does not work.
2) Apply the patch and try again, this time the capture group should
yield the expected results.
3) Run t/SimpleMARC.t and confirm the tests still pass.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Mon, 13 Dec 2021 10:20:54 +0000 (10:20 +0000)]
Bug 23873: Unit tests
This patch adds a unit test for capture groups support in
Koha::SimpleMARC.
Test plan
1) Run the test prior to applying the capture groups fix, note it fails.
2) Apply teh capture groups fix patch
3) Run the test again, it should now pass
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
The method Koha::AuthorisedValues->authorised_value is not covered by tests!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Tue, 15 Feb 2022 07:45:42 +0000 (08:45 +0100)]
Bug 30104: (bug 29844 follow-up): Fix holds to pull
There was an error when circ/pendingreserves.pl was hit:
The method Koha::Items->biblionumber is not covered by tests!
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers [Mon, 14 Feb 2022 21:04:25 +0000 (11:04 -1000)]
Bug 30090: Don't export some columns in patron search results
The checkout and Edit buttons should not export (Exel, Print) on the patron search result list.
Same for fist column with checkboxes.
Test plan :
1) Go to patrons module /cgi-bin/koha/members/members-home.pl
2) Perform a search with results
3) Click on 'Export' then 'Print'
=> Check you dont see column with checkboxes (text 'Select patron') and colum with actions
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Thu, 27 Jan 2022 15:29:32 +0000 (15:29 +0000)]
Bug 29603: Fix responsive behavior of facets menu in OPAC search results
The OPAC was originally featured a search results facets box that would
collapse at narrower browser widths and show a "Refine your search" link
under the breadcrumbs menu. At some point this broke, with the "Refine
your search" link appearing at the bottom instead.
This patch revises the page to restore the previous behavior.
To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
- Perform catalog search in the OPAC which will return multiple results.
- View the page at various browser widths. At narrower widths the facets
menu should appear as a "collapsed" box with a "Refine your search"
link.
- Clicking the link should toggle the facets menu visibility.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Tue, 30 Nov 2021 15:06:05 +0000 (15:06 +0000)]
Bug 29960: Remove Modernizr dependency in the OPAC
This patch refactors the code around JavaScript-driven responsive
behavior in the OPAC. The use of Modernizr dropped and the dependency
removed.
This patch also adds a missing listing for Enquire.js licensing on the
"About" page.
To test, apply the patch and perform a catalog search in the OPAC.
- Narrow your browser window until its width falls below 609 pixels
(Using your browser's Responsive Design Mode is helpful for this, e.g.
https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode)
- The window should automatically scroll to the "main content" area, in
this case the section headed by "Your search returned..."
- Change your browser window's width until it falls below 768 pixels.
- Scroll to the bottom of the search results where you should find the
"Refine your search" facets box collapsed.
- As you increase your browser width above 768 pixels the facets box
should expand.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Tue, 30 Nov 2021 15:06:05 +0000 (15:06 +0000)]
Bug 29960: Remove Modernizr dependency in the OPAC
This patch refactors the code around JavaScript-driven responsive
behavior in the OPAC. The use of Modernizr dropped and the dependency
removed.
This patch also adds a missing listing for Enquire.js licensing on the
"About" page.
To test, apply the patch and perform a catalog search in the OPAC.
- Narrow your browser window until its width falls below 609 pixels
(Using your browser's Responsive Design Mode is helpful for this, e.g.
https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_Mode)
- The window should automatically scroll to the "main content" area, in
this case the section headed by "Your search returned..."
- Change your browser window's width until it falls below 768 pixels.
- Scroll to the bottom of the search results where you should find the
"Refine your search" facets box collapsed.
- As you increase your browser width above 768 pixels the facets box
should expand.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lucas Gass [Thu, 2 Dec 2021 01:36:26 +0000 (01:36 +0000)]
Bug 29617: exclude categorycode from BorrowerUnwantedField
To test:
1. Go to BorrowerUnwantedField and select categorycode as unwanted
2. Try adding a new patron, you will see an error message in the staff client "Something went wrong when creating the patron. Check the logs." You will be unable to make a new patron.
3. Apply patch
4. Go to BorrowerUnwantedField, you are unable to exlcude it. Patrons need categorycodes
Lari Taskula [Fri, 11 Feb 2022 12:53:55 +0000 (12:53 +0000)]
Bug 30081: Add item type column to holds table
Add new column item type to holds table in patron's details and check
out views. Some libraries will find this information useful for
distinguishing inter library holds from normal holds.
To test:
1. Apply patch
2. Place a hold and confirm it
3. Go to cgi-bin/koha/circ/circulation.pl?borrowernumber=1 with
borrowernumber being the id of your patron
4. Click "1 Hold(s)" tab
5. Observe new column "Item type"
6. Confirm the item type is correct
7. Go to moremember.pl?borrowernumber=1 with
borrowernumber being the id of your patron
8. Repeat steps 4-6
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Fri, 11 Feb 2022 15:24:43 +0000 (15:24 +0000)]
Bug 30082: Bibliographic details tab missing when user can't add local cover image
This patch corrects the template logic which determines whether the
"Images" tab should be displayed on the bibliographic detail page. The
"Images" tab should display whenever local cover images are enabled, not
just if the user has permission to manage cover images.
To test, apply the patch and go to Administration -> System preferences.
- Enable the LocalCoverImages system preference.
- Locate and view the detail page for a bibliographic record in the
catalog which doesn't have a local cover image attached.
- If you are logged in as a user with upload_local_cover_images
permission you should see an "Images" tab with the message "No
images have been uploaded for this bibliographic record yet" and an
upload button.
- If you are logged in as a user without upload_local_cover_images
permission you should see an "Images" tab with just the "No
images..." message.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Mon, 17 Jan 2022 13:38:28 +0000 (13:38 +0000)]
Bug 29781: Enable capture groups in batch item modification
This patch adds support for regular expression capture groups in
MarcModificationTemplates.
We escape double quotes in the replacement string, then quote the whole
string before applying the `ee` modifier to the final regex
application.
See https://blog.james.rcpt.to/2010/10/25/perl-search-and-replace-using-variables/
for further details.
Test plan
1) Attempt to use capture groups in your regular expression based
batch item modification and note it does not work.
2) Apply the patch and try again, this time the capture group
should yield the expected results.
3) Run t/SimpleMARC.t and confirm the tests still pass.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jo Hunter <jhunter@clicweb.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Mon, 17 Jan 2022 13:50:34 +0000 (13:50 +0000)]
Bug 29781: Unit test
This patch adds a unit test for capture groups support in Koha::Items
Test plan
1) Run the test prior to applying the capture groups fix, note it fails.
2) Apply the capture groups fix patch
3) Run the test again, it should now pass
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jo Hunter <jhunter@clicweb.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Thu, 27 Jan 2022 11:50:28 +0000 (11:50 +0000)]
Bug 29952: Replace obsolete DataTable column filter function
The "Filter paid transactions" link on the Accounting -> Transactions
page is broken because it uses an obsolete DataTables function for
filtering. This patch updates it to use the current syntax, available in
DataTables since version 1.10.
To test, apply the patch and locate a patron in the staff interface who
has multiple fines, some paid.
- View the patron's "Accounting" page and click the "Transactions" tab.
- Click the "Filter paid transactions" link. The table should be
filtered so that only transactions with an outstanding amount > zero
are shown.
- The filter link should change to read "Show all transactions."
- Clicking "Show all transactions" should clear the filter.
- Test with one or more columns hidden using the "Columns" control.
Filtering should still work correctly with columns hidden.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Thu, 16 Dec 2021 01:59:50 +0000 (01:59 +0000)]
Bug 29706: Hide items that cannot be held by default when placing hold on OPAC
This patch adds a 'holdable' and 'unholdable' class to the rows of the table
Additionally I rename the 'backgroundcolor' field to 'onloan' as that is what it contains.
Note: Out of the box, there is no css associated with this class
I add a div around the table to allow hiding the new buttons as well when optiuons are hidden
It would be nice in the future to utilise a Koha table here, however, it is complicated by multi-holds
To test:
1 - Add a number of items to a record, ensuring they belong to different libraries
2 - Set 'Default checkout, hold and return policy'->'Hold policy' to 'From home library'
3 - Sign in to opac and attempt to placehold on the record
4 - Click 'show more options' and 'a specificitem'
5 - Note holds table includes items that cannot be held
6 - Apply patch
7 - Reload holds page
8 - Note items that cannot be heldare hidden
9 - Click 'Show unholdable items' and note they appear
10 - Click 'Hide unholdable items' and veriofy they hide
11 - Test with multi holds
Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>