Martin Renvoize [Thu, 24 Mar 2022 10:30:33 +0000 (10:30 +0000)]
Bug 30194: (follow-up) Remove reference to swagger-v2-schema
This file is now bundled directly an no longer needs to be refered to
separately.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch simplifies the specification directory further by doing the
following:
* Inlines paths.yml into swagger.yaml
* Inlines definitions.yaml into swagger.yaml
* Inlines parameters.yaml into swagger.yaml
* Drops x-primitives.yaml
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Thu, 24 Mar 2022 07:54:59 +0000 (08:54 +0100)]
Bug 30194: Auto generate swagger.yaml
It was not sorted correct and had inconsistencies.
use YAML;
use File::Slurp qw( write_file );
my $hash = YAML::LoadFile('api/v1/swagger/swagger.yaml');
YAML::Bless($hash)->keys([qw(swagger basePath definitions parameters paths info tags)]);
my $info = $hash->{info};
YAML::Bless($info)->keys([qw(title version license contact description)]);
my $yaml= YAML::Dump($hash);
$yaml =~ s|'|"|xmsg;
write_file('api/v1/swagger/swagger.yaml', $yaml);
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Every place in which Koha::Plugin::Test is loaded, and a patron is
updated, this hook needs to be silenced.
To reproduce:
1. Run:
$ kshell
k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> FAIL: There's a warn about patron_barcode_transform
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Mason James <mtj@kohaaloha.com> 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>
This patch removes tests for the wrong 'Accept' header situation. It is
the only thing I found I could do.
The situation is: the JSON::Validator + Mojolicious::Plugin::OpenAPI is
trapping this case and returning its own error code (400) and it also
builds its own message! So no point testing it, as it can change again.
I post it as a separate patch just in case someone finds a better way to
handle this and obsoletes the patch :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Mason James <mtj@kohaaloha.com> 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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Mason James <mtj@kohaaloha.com> 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>
Bug 30194: Adapt Koha to the latest JSON::Validator version
This patch makes V1.pm and PluginRoutes.pm work with the
JSON::Validator breaking changes introduced after v4.
JSON::Validator got stricter, and it seems there's some bug in how it
resolves references, so I propose we bundle the YAML spec into a single
file using a gulp task. This will save load time too, so has its
advantages too.
To test:
1. Edit /etc/apt/sources.list.d/koha.list
2. Duplicate the existing line below, replacing 'dev' for 'exp'
3. Upgrade the packages
$ apt update ; apt dist-upgrade -y
4. Run:
$ kshell
k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t \
t/db_dependent/api/v1
=> SUCCESS: Tests pass!
5. Restart plack and check the logs:
$ koha-plack --restart kohadev ; tail -f /var/log/koha/kohadev/*.log
=> SUCCESS: Nothing seems broken, things work
6. Point your browser to http://localhost:8081/api/v1/
=> SUCCESS: The API is loaded
7. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Mason James <mtj@kohaaloha.com> 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>
Nick Clemens [Fri, 11 Mar 2022 14:24:27 +0000 (14:24 +0000)]
Bug 30244: Include lost items in list of hidden items
When building search results for XSLT we generate and pass a list of hidden
itemnumbers.
We do skip the lost items in our parsing, however, we neglect to add the itemnumber
to the hidden list
This patch simply adds the lost itemnumbers to the list
There is more work to be done here to simpliofy this process, however, this patch resolves
the issue and can be backported to stable branches
To test:
1 - Set systempreference hidelostitems to "Don't show"
2 - Edit a record to set one item as lost and one as available
3 - Perform an OPAC search that returns the record above
4 - Note that the lost item shows in availability line
5 - Click on the record - note the lost item does not show on details
6 - Apply patch
7 - Reload search results
8 - Lost itme no longer displays
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Thu, 24 Feb 2022 12:12:27 +0000 (12:12 +0000)]
Bug 30175: Toggle digest boxes when loading messaging preferences
To test:
1 - Define default messaging preferences for a patron category, checking a transport and the digest only boxes
2 - Create a new patron of a different category
3 - Change the category to the one set above
4 - Note that checkboxes are checked, but digest boxes are disabled
5 - Save patron - the digest boxes are not saved
6 - Apply patch
7 - Repeat 2&3
8 - Note checkboxes for digest are checked and enabled
9 - Save patron and confirm options are saved
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 30251: (bug 10902 follow-up) With IndependentBranches non-superlibrarians do not get autocomplete list in circulation module
Having IndependentBranches on, a librarian who is not superlibrarian
does not get a autocomplete hint list when entering a part of the
patron's name (while performing check out, etc.) Koha registers
an error:
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st
execute failed: Column 'branchcode' in where clause is ambiguous at
.../Koha/Objects.pm line 312
This is due to fix to the bug 10902 -- addig "prefetch => 'branchcode'" to
the attributes of the query in circ/ysearch.pl, while having branchcode
in the search parameters.
Test plan:
----------
1. Have IndependentBranches on, PatronAutoComplete set to 'Try.
Be a librarian without superlibrarian privileges. Have some
patrons defined.
2. In the main input field on the top, with Check out active, try to
put 3+ characters from the known user name/cardnumber etc. You
will get no hint.
3. Apply the patch.
4. Repeat 2. You should now see an autocomplete hint list.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nicolas Legrand [Tue, 18 Jan 2022 10:45:50 +0000 (10:45 +0000)]
Bug 29103: Change desk when checking in a waiting reserve
A check in should relocate a waiting hold under the current desk. But
the current behaviour when confirming the hold is to dismiss the
modal, the item is still attached to the preceding desk.
This patch mimicks the print and confirm behaviour to trigger the desk
change.
Plan test:
1. Add some desks to you library (syspref UseCirculationDesks and
Administration -> Patrons and circulation -> Circulation desks.
2. Set a desk in your session (Circulation -> Set library and desk)
3. Have some waiting hold attach to a desk (make a hold on a checked
out item and return it).
4. Change your current desk.
5. Check in again the item, click on confirm.
6. Go to the item notice detail, it appears as waiting at your first
desk.
7. Apply patch.
8. Check in again the item.
9. go to the item notice detail, it should appear at your current
desk.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Fri, 21 May 2021 12:10:56 +0000 (14:10 +0200)]
Bug 28416: Delay load of Email::Sender::Transport::SMTP
As it's taking 10M of RAM
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Lucas Gass [Tue, 1 Mar 2022 17:32:13 +0000 (17:32 +0000)]
Bug 24221: Move OPACMySummaryNote to HTML customizations in additional-contents
To test:
1- Before applying the patch add some content to the system preference OPACMySummaryNote
2- Apply patch
3- restart_all and updatedatabase
4. Go to additional-content.pl ( HTML customizations )
5. You should now see your content from the system preference under OpacMySummaryNote in HTML customizations
6. Try searching for the system preference, OPACMySummaryNote. It has been removed and you should not be able to find it.
7. Try changing/removing/adding content from OpacMySummaryNote in HTML customizations
8. Make sure your edits are reflected when you look at the user summary page
Note: The system preference was named OPACMySummaryNote but in to be more consitent with how we have named other additional_contents I have renamed this OpacMySummaryNote. Signed-off-by: shiyao <shiyao@inlibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Fri, 4 Mar 2022 17:09:40 +0000 (17:09 +0000)]
Bug 30227: Replace the use of jQueryUI tabs on bibliographic detail page
This patch replaces jQueryUI tabs on the bibliographic detail page,
replacing them with Bootstrap tabs.
To test, apply the patch and locate a bibliographic record in the staff
client. Check the tabs on the detail page. Try to test as many
variations as possible:
- With and without holdings
- With and without descriptions (5** note fields)
- With alternate holdings (AlternateHoldingsField preference)
- With HTML5 media (see Preferences -> Enhanced content -> HTML5 media)
- With an associated suggestion
- With an associated subscription
- With acquisition information
- With local cover images
- With SeparateHoldings enabled
- With other editions available (FRBRizeEditions)
- With component parts
Owen Leonard [Fri, 18 Mar 2022 15:24:49 +0000 (15:24 +0000)]
Bug 30316: Replace the use of jQueryUI tabs on MARC detail page
This patch replaces jQueryUI tabs on the MARC detail page, replacing
them with Bootstrap tabs.
To test, apply the patch and locate a bibliographic record in the staff
client. View the MARC detail page for that record. Confirm that the
numered tabs work correctly.
JD amended patch: removed commented line Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Thu, 17 Mar 2022 18:21:56 +0000 (18:21 +0000)]
Bug 29998: Replace the use of jQueryUI tabs on item types administration page
This patch updates the item type edit interface so that it uses
Bootstrap tabs instead of jQueryUI tabs for displaying icon sets.
Unrelated: The patch removes an invalid "type" attribute from a <select>
element.
- Go to Administration -> Item types in the staff interface.
- Edit an item type.
- On the edit page you should see tabs under "Choose an icon."
- Confirm that the tabs look correct and work correctly.
- If you did not previously have any icon selected, the "None" tab
should be active.
- If you had an icon selected, that icon set's tab should be active.
- Confirm that if you specify a remote image (e.g.
https://via.placeholder.com/50/FF0000/FFFFFF.png ) the tab is
correctly shown after you save and re-edit.
- Confirm that changing icons works correctly and that the selected
icon's tab is always active when you return to the edit view.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Thu, 17 Mar 2022 18:17:44 +0000 (18:17 +0000)]
Bug 29999: (follow-up) Show the remote image tab if selected
This follow-up corrects the markup so that if a value is entered in the
"Remote image" field, the correct tab will be selected upon page load.
The patch also corrrects the input name on the "No image" field so that
the option works correctly.
To test, apply the patch and edit an authorized value.
- Select an icon from an icon set. Save, and then re-edit.
- The correct icon set tab should be activated.
- Select "No image," save, and re-edit.
- The "No image" tab should be selected.
- On the "Remote image" tab, enter a remote image url, e.g.
https://via.placeholder.com/50/FF0000/FFFFFF.png. Save and re-edit.
- The "Remote image" should be selected.
Owen Leonard [Tue, 1 Feb 2022 19:36:22 +0000 (19:36 +0000)]
Bug 29999: Replace the use of jQueryUI tabs on authorized values administration page
This patch updates the authorized values edit interface so that it uses
Bootstrap tabs instead of jQueryUI tabs for displaying icon sets.
Normally Bootstrap tabs don't have to be initiated via JavaScript, but
this page requires some JS to select the first tab as active if no other
tabs are active. Because of the way the template works it's not simple
to do it via template logic, so in this case some JS helps.
To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
- Go to Administration -> Authorized values in the staff interface.
- Select a category and then add or edit an authorized value in that
category.
- On the edit page you should see tabs under "Choose an icon."
- Confirm that the tabs look correct and work correctly.
- If you did not previously have any icon selected, the "None" tab
should be active.
- If you had an icon selected, that icon set's tab should be
active.
- Confirm that changing icons works correctly and that the
selected icon's tab is always active when you return to the edit
page.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Our objects.search helper is written for being used in our API
controllers, which get their query parameters processed by the OpenAPI
plugin, using JSON::Validator.
Particularly, the 'q' parameter is defined as 'multi' on our spec, which
means objects.search always gets it as an arrayref.
As the Objects.t tests are not using the OpenAPI plugin, a hashref is
generated as only one q= is being passed. This patch adds an extra
validation on objects.search, for the non-arrayref use case and does the
right thing.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Fri, 18 Mar 2022 09:26:48 +0000 (10:26 +0100)]
Bug 30199: Do not generate jwt if patron does not exist
This is a follow-up patch for bug 29543. If an invalid cardnumber has
been used we should not generate a token.
Test Plan:
1. Set SelfCheckoutByLogin to 'cardnumber'.
2. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
3. Enter an invalid carnumber like 'thisisabadcardnumber'
4. See the appropriate message "Sorry The userid thisisabadcardnumber was not found in the database. Please try again."
5. Try again with a different cardnumber and notice the same exact error message including the 'thisisabadcardnumber' cardnumber.
6. Apply this patch
7. Restart all the things!
8. Repeat steps 2-4
9. Try again with a different cardnumber, you should now see the correct
cardnumber!
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Fridolin Somers [Fri, 25 Mar 2022 00:11:57 +0000 (14:11 -1000)]
Bug 17748: (follow-up) Stronger unit tests
Before this patch, unit tests perform an item search assuming there is
no checked-out items in database.
This is correct for a fresh reseted database.
But if you checkout any item then prove t/db_dependent/Items.t it will
fail.
We can see in this file that other tests use filter on generated
branchcode.
Fridolin Somers [Thu, 24 Feb 2022 02:30:03 +0000 (16:30 -1000)]
Bug 17748: (follow-up) Fix date due column filter
After items search result when entering a term in date due colum filter
table is not filtered.
Its is because columns from 'Issue' must be added in _SearchItems_build_where_fragment()
like it has been added in SearchItems().
Test plan :
1) Perform an item search with some results beeing checked-out
2) In colum 'Date due' enter a number that is contained is some due
dates, ie '2022'
3) Table results are filtered with items having search term in due date
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Aleisha Amohia [Fri, 5 Feb 2021 03:01:54 +0000 (16:01 +1300)]
Bug 17748: Show due date and availability in item search results
This enhancement adds the availability of an item to the item search
results (i.e. shows if checked out or not). If checked out,
shows due date in item search results. The due
date column will also show when exporting results to a CSV file.
To test:
1) Apply patch and restart services
2) Set up two items. Check out Item A to a borrower. Leave Item B as
is not checked out, and not unavailable status.
3) Go to Search -> Item search. Scroll down and notice the Availability
radio options - Ignore, and Checked out.
4) Leave the Ignore option selected and do a search so that both items show.
5) Confirm the availability and due date columns are showing at the
right end of the table. Confirm Item A says Checked out and has a due
date. Confirm Item B says available.
6) Export all result to CSV. Confirm the results show in the CSV file as
expected.
7) Go to edit your search. Select the 'Checked out' radio option for
Availability and submit the search. Confirm only Item A shows in the
results (not Item B).
Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ) Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Thu, 3 Mar 2022 09:21:48 +0000 (10:21 +0100)]
Bug 30059: Deal with timezones
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 [Thu, 3 Feb 2022 09:31:27 +0000 (10:31 +0100)]
Bug 30059: Add JS equivalent for Koha::Patron->get_age
On bug 30055 we are going to use the REST API to display the patron
search result, we will then need to calculate patron's age client-side.
This is moved to its own bug report in case we need to reuse it
somewhere else.
Test plan:
Copy/paste the JS function in your browser's console then call it and
confirm that the result is correct
For instance:
$get_age('2000-01-01')
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>
Nick Clemens [Mon, 14 Mar 2022 17:05:56 +0000 (17:05 +0000)]
Bug 25251: Remove alert from disabled buttons
This patch removes the alert, but adds a stopPropagation call
in order to not close the menu when the disabled buttons are clicked
To test:
1 - Find a record with items in the staff interface
2 - Click edit
3 - Note 'Edit items in a batch, 'Delete items in a batch', and 'Delete
all items' are grayed out
4 - Note hovering displays a note that there are no items
5 - Click on each anyway, an alert is generated, menu is closed
6 - Apply patch
7 - Reload page
8 - Click on each disabled option and confirm
- there is no more alert
- the menu does not close
9 - Confirm tooltip is displayed
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>
Blou [Fri, 11 Mar 2022 20:54:51 +0000 (15:54 -0500)]
Bug 30282: overdues report does not display subtitle, part_name, part_number
In circ/overdue.pl, the Title column is the result of includes/biblio-title.inc display. The code of biblio-title.inc means to display subtitle, part_number and part_name from biblio table, but nothing but commas show up because those fields are never retrieved by overdue.pl
To reproduce:
1) have an item whose biblio.subtitle, part_name and part_number and non-empty.
2) issue it, then set it late (overdue).
3) go to the report page (circ/overdue.pl) and make it appear.
4) subtitle, part_number and part_name do not appear, although they are meant to by biblio-title.inc code
5) apply the patch and try again.
It's a simple fix of adding the fields in the database query.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Mon, 10 Jan 2022 16:21:11 +0000 (16:21 +0000)]
Bug 24415: Authority enhancement - Improve access to tabs
This patch makes style changes to the authority record editor in order
to make it easier to navigate among tabs and tags. This change matches
the one made to the basic MARC editor in Bug 22045.
Tabs are now part of the page's toolbar, which floats as the page
scrolls. In addition to the numbered tabs, there is also a section
showing in-page links to the MARC tags which are available on that page.
To test, apply the patch and clear your browser cache if necessary.
Open a blank or existing record in the authority record editor. Test
the redesigned tabs, the floating toolbar, and the in-page tag links.
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>
Mark Tompsett [Wed, 15 Jul 2020 04:55:06 +0000 (04:55 +0000)]
Bug 6815: Capture member photo via webcam
This patch builds on a patch by Mark Tompsett, adding the option to take
a patron's picture using the computer's webcam. The photo can then be
saved to the patron's account.
To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
- Go to Administration -> System preferences and enable the
'patronimages' preference.
- View a patron record. In the sidebar, hover your mouse over the blank
patron image. Click the "Edit" button which appears.
- A modal window should appear with two sections, "Upload patron photo"
and "Take patron photo."
- If your computer has a webcam, your browser should ask permission to
access it. Grant access.
- You should see the view of your webcam shown under the "Take photo"
button.
- Click the "Take photo" button. The captured photo should be shown in
place of the live video from the webcam.
- You should now see three buttons: "Retake photo," "Download photo,"
and "Upload photo."
- Clicking "Retake photo" should hide those buttons and return you
to a live video view.
- Clicking "Download" should make your browser download the image.
- Clicking "Upload" should cause the page to redirect back to the
patron detail page where you should see the new patron image
displayed in the sidebar.
- Trigger the modal again and click the "cancel" button. The
modal should disappear and camera access should stop.
- If your computer has no webcam the modal should appear correctly but
there should be a banner at the bottom indicating that a camera is not
available.
- Try the test again but this time deny your browser access to the
webcam. You may need to reset the camera permissions in your browser's
settings. When the modal appears you should see a message saying
access to the camera is denied.
- The patron image edit modal should be available on all pages which
show the patron image in the sidebar: Check out, Batch check out,
Details, Accounting, Routing lists, Circulation history, Holds
history, Modification log, Notices, Statistics, Files, Purchase
suggestions, Discharges, Housebound, and ILL requests history.
- Test adding an image to a patron record using the "Upload photo"
option. It should still work correctly.
- If the patron has an image attached, the "Upload photo" section should
have a "Delete" button. Test that it works correctly.
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Thu, 24 Feb 2022 16:43:14 +0000 (16:43 +0000)]
Bug 29713: Make item table when placing an item level hold sortable
This patch modifies the holds page in the OPAC so that users selecting a
specific item to place a hold on can sort the table of items.
This patch also removes some obsolete JavaScript left over from before
Flatpickr.
To test, apply the patch and go to Administration -> Circulation and
fine rules to make sure at least one item type in your system has
"OPAC item level holds" set to "allow."
- Log in to the OPAC as a user who can place holds.
- Search the catalog for items which will accept item-level holds.
- Place a hold on one of the results, and click the "Show more options"
link on the holds page.
- Check the "specific item" radio button.
- A table of items should be displayed. Confirm that the table is
sortable.
- The first entry in the table should be selected.
- Perform the same test when placing a hold on multiple titles.
Confirm that each table of items is sortable.
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>
Katrin Fischer [Sun, 24 Oct 2021 16:40:38 +0000 (16:40 +0000)]
Bug 22605: (QA follow-up) Make Braille search option stick
To test:
- Add to records, one with 007 fb and another with 007 tc
- Search for Format: Braille from the advanced search
- Verify both records are found
- Return to advanced search
- Verify that Braille is still selected
- Rerun search - same results show
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Thu, 21 Oct 2021 18:44:50 +0000 (18:44 +0000)]
Bug 22605: (follow-up) Fix operators
- Don't add an operator on first loop
- Only add plus option on last loop
- Fix indentation of first search box
- Remove spaces from operators in query_cgi and add to query and query_desc
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Thu, 12 Aug 2021 15:28:40 +0000 (15:28 +0000)]
Bug 22605: Add ability to edit a search on staff interface
This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms
A few notes:
1 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
2 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now
3 - Previously selected branch or group selections will populate the dropdowns, only one is allowed
To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options
QA note: Missing filters on deletion of keys form hash are false positives
Owen Leonard [Fri, 18 Mar 2022 14:37:54 +0000 (14:37 +0000)]
Bug 30000: Replace the use of jQueryUI tabs on the search engine configuration page
This patch replaces jQueryUI tabs on the search engine configuration
page, replacing them with Bootstrap tabs.
To test, apply the patch and go to Administration -> Search engine
configuration.
- The "Search fields" tab should be selected by default, and the table
should be initialized as a DataTable with sorting and filtering.
- When you switch to the "Bibliographic records" and "Authorities" tabs
the tables on those tabs should also be initialized, each with
filtering and drag-and-drop row re-ordering.
- All tables should continue to work correctly after switching back and
forth between tabs.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Thu, 17 Feb 2022 16:39:52 +0000 (17:39 +0100)]
Bug 29893: Redraw the tables from other tabs without paging
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, 9 Feb 2022 10:07:40 +0000 (11:07 +0100)]
Bug 29893: Make sure the form will be submitted after the draw calls
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 [Mon, 17 Jan 2022 14:45:06 +0000 (15:45 +0100)]
Bug 29893: Prevent ES mappings UI to remove hidden rows
If you are editing ES mappings and you use the DataTable filtering option,
the table won't contain all the mappings you have in the DB.
If the form is submitted they will be removed and data will be lost!
Test plan:
Edit ES mappings, filter and submit the form.
Confirm that the table are redrawn before the form submission which
prevent data loss
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>
Marcel de Rooy [Thu, 24 Mar 2022 07:31:12 +0000 (07:31 +0000)]
Bug 29915: Prevent bad cookie from corrupted session
If there is deleted session info but no session->id, a wrong cookie
with empty name could be generated containing expired session id.
Test plan:
Run t/db_dependent/Auth.t
Login. Check cookies in browser.
Logout. Check cookies in browser.
Without this patch, you should see an invalid cookie.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
David Cook [Fri, 4 Dec 2020 05:36:04 +0000 (05:36 +0000)]
Bug 26328: Cast barcode from varchar to integer for incremental barcode
Without this patch, the incremental barcode generation will
treat 978e0143019375 as having an exponent and interpret it as a very
large number.
With this patch, the incremental barcode generation will first cast
barcode varchar strings to integers before finding a max() value.
In this case 978e0143019375 becomes 978 instead of
1.7976931348623157e308
Test plan:
0. Using koha-testing-docker
Before applying patch:
1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=autobarcode
2. Set to "generated in the form 1, 2, 3"
3. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=1#additema&searchid=scs_1607059974968
4. Add item with barcode 978e0143019375
5. Click "p - Barcode"
6. Note the barcode is "Inf"
After applying patch:
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=1#additema&searchid=scs_1607059974968
2. Click "p - Barcode"
3. Note the barcode is "39999000019194"
Nick Clemens [Fri, 18 Mar 2022 14:25:14 +0000 (14:25 +0000)]
Bug 29802: add 'me' to filter_by_visible_in_opac query
This patch prefixes all of the fields in OpacHiddenItems with
"me." before searching.
Unit tests added to cover this case1
To test:
1 - Create a public list
2 - Set OpacHiddenItems to:
biblionumber: [1]
3 - Attempt to view list in OPAC
4 - Booom
5 - Aply patch
6 - Reload list
7 - Success
Bug 30294: Rename Koha::Recall->* used relationship names
This patch renames the underlaying relationship names used in the
'patron' and 'library' subs so they are more clearly prefetchable and
also enabling them to be embeddable and searchable through an eventual
API route for recalls.
To test:
1. Apply the patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Recall*
=> SUCCESS: Tests pass, nothing really changes
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Test plan:
1 - Find a record in the staff catalog
2 - Edit the record
3 - In the 520 notes field, add an ASCII escape character (27 decimal, 1b hex)
On ubuntu Ctrl+Shift+u, then 1b, enter
4 - Save the record
5 - Set syspref ShowComponentRecords to 'both...'
6 - On record details: New->New child record
7 - Save the record
8 - Attempt to view the parent record in the staff client and opac
Jonathan Druart [Wed, 19 Jan 2022 13:40:14 +0000 (14:40 +0100)]
Bug 29486: Add check in search_for_data_inconsistencies.pl
If the MARC record does not contain the correct biblionumber of
biblioitemnumber, the script will display the following warning:
== Bibliographic records have MARCXML without biblionumber or biblioitemnumber ==
* Biblionumber 4242 has '1' in 999$c
* Biblionumber 4242 has biblioitemnumber '4242' but should be '1' in 999$d
=> The bibliographic records must have the biblionumber and biblioitemnumber in MARCXML
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Tue, 16 Nov 2021 08:13:30 +0000 (09:13 +0100)]
Bug 29486: _koha_marc_update_bib_ids no longer needed for GetMarcBiblio
This subroutine is ensuring that the biblionumber and biblioitemnumber
will be part of the MARC record.
We should not need that, unless there is something broken somewhere
else.
This line has been added by the following commit:
commit 4e95e94727b09b33d2f6c597bdd218a59dcc3681
Bug 6789: biblios with many items can result in broken search results link
"""
To this end, it also moves the fix_biblio_ids portion of get_corrected_marc_record out of rebuild_zebra.pl,
and makes it a part of GetMarcBiblio (right before EmbedItemsInMarcBiblio, so the 952s still come last). fix_biblio_ids
is kept as a subroutine for the deletion portion of rebuild_zebra.pl, which still uses it.
"""
But it does not explain why it's better to have it in GetMarcBiblio.
If we need it for the reindexation process, we shouldn't impact
GetMarcBiblio which is used from several different places.
We might then consider adding the fix_biblio_ids call to
rebuild_zebra.pl, but I am failing to understand in which cases it could
be useful.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Owen Leonard [Tue, 25 Jan 2022 12:32:28 +0000 (12:32 +0000)]
Bug 29940: Phase out jquery.cookie.js in the OPAC
This patch replaces the use of jquery.cookie.js in the OPAC with the
newer js-cookie plugin. The patch adds the latest version of the
js-cookie library and removes the old jquery.cookie plugin.
To test, apply the patch and go to the advanced search page in the OPAC.
- Perform a search using a number of different limits and settings, e.g.
keyword, item type, and sort-by.
- On the search results page you should see at the top of the results
list a link to "Return to the last advanced search."
- The link should take you back to the advanced search page with all the
same settings filled into the form.
- A search with the "More options" view enabled in the advanced search
form should result in a link which returns to the "More options" view.
- Searching via the "quick search" form at the top of the page should
clear the cookies which were set in order to remember the advanced
search. See
https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector for
information on viewing your browser's stored cookies.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Thu, 10 Mar 2022 12:23:42 +0000 (12:23 +0000)]
Bug 30266: Hide pickup location input on waiting hold
This patch updates the holds table to always insert a hidden input when a hold is 'found'
and covers the case where the hold is 'found' but doesn't match known statuses
To test:
1 - Place two holds on a record for two different patrons, with different pickup locations
2 - Check in one item at expected branch to set waiting
3 - Then either:
- Use batch modification or item editor to change the holding branch for the item
- Sign in to a different branch and manually transfer the item back to it's home location
4 - View the holds for the record
5 - Note the 'Pickup library' column is blank for that hold
6 - Change pickup location for other hold and press 'Update holds'
7 - Note the waiting hold is still blank, and now second hold has no pickup location
8 - Check the DB and note the first hold has had the pickup location changed
8 - Apply patch
9 - Delete holds and repeat 1-4
10 - Note the waiting hold now displays:
Hold expected at {Branch}, please checkin to verify status
11 - Change location for second hold and update holds
12 - COnfirm location chanegd correctly and first hold unaffected
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>
Julian Maurice [Wed, 2 Feb 2022 12:53:48 +0000 (13:53 +0100)]
Bug 30004: Prevent TooMany from executing too many SQL queries
If a maximum number of checkouts allowed is defined in circulation
rules, C4::Circulation::TooMany will loop over all patron's checkouts.
When a patron has several hundreds of checkouts, it can really slow down
the checkout process by several seconds (or even tens of seconds)
This patch does two things:
- Always prefetch item data so that `$c->item` does not execute an
additional SQL query at every iteration of the loop. Item data is
always needed at the first line of the loop, so there is really no
downside for doing this.
- Build the `@types` array only once, out of the checkouts loop. Since
it does not depend at all on patron's checkouts data, it does not make
sense to build it inside the loop.
Test plan:
1. Before applying the patch, create a patron with a lot of checkouts.
I tested with 1000 checkouts, but the slowness should be noticeable
with less.
2. Make sure you have a circulation rule (one that apply to your patron
and the item(s) you will check out for testing) with a maximum number
of checkouts allowed
3. Check out an item for the patron with a lot of checkouts. Measure the
time it takes.
4. Apply the patch
5. Check out another item (or check in and then check out the same item
used in step 3). Measure the time it takes and compare it to step 3.
It should be faster now.
6. Run `prove t/db_dependent/Circulation/TooMany.t`
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>
Martin Renvoize [Mon, 14 Mar 2022 14:32:31 +0000 (14:32 +0000)]
Bug 30183: Fetch flatPickr instance prior to custom search definition
This patch updates teh search customisations in ill-list-table to
properly fetch the existing flatpickr instances for date searches.
To test:
1. Have at least one ILL request on the ILL requests page
2. Open the broser inspector
3. Choose a date on the left hand form
=> FAIL: Errors in the console, search doesn't work
4. Apply this patch
5. Reload
6. Repeat 2-3
=> SUCCESS: No more errors, filtering works!
7. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Thu, 27 Jan 2022 14:12:40 +0000 (15:12 +0100)]
Bug 29915: Add a note for tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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>
Marcel de Rooy [Wed, 26 Jan 2022 15:54:28 +0000 (15:54 +0000)]
Bug 29915: (QA follow-up) Add a comment in checkauth on $flags
This is quite a misleading call.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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>
Marcel de Rooy [Wed, 26 Jan 2022 12:27:56 +0000 (12:27 +0000)]
Bug 29915: Changes to Auth.t
Test plan:
Run Auth.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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, 26 Jan 2022 10:58:33 +0000 (11:58 +0100)]
Bug 29915: Add tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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>
Marcel de Rooy [Tue, 25 Jan 2022 14:52:31 +0000 (14:52 +0000)]
Bug 29915: (QA follow-up) Fix POD typo
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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>
Marcel de Rooy [Tue, 25 Jan 2022 13:55:00 +0000 (13:55 +0000)]
Bug 29915: Tiny session adjustments
It may be that we need a few additional flushes.
And checking the returned session before clearing busc.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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>
Marcel de Rooy [Mon, 24 Jan 2022 13:08:01 +0000 (13:08 +0000)]
Bug 29915: Changes for get_session and check_cookie_auth
If we look for an existing session, do not create a new one.
Found a bug in the unset_userenv calls. For this moment
changing the calls in Auth here. Later fix goes to bug
29954.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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 [Thu, 20 Jan 2022 11:05:11 +0000 (12:05 +0100)]
Bug 29915: Don't generate a new session ID for anonymous navigation
When a user is not logged in, a new session ID is generated every time a
new page is hit.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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>
Fridolin Somers [Mon, 21 Mar 2022 22:18:57 +0000 (12:18 -1000)]
Bug 30325: (Bug 30098 follow-up) Fix broken patron search redirect when one result
Bug 30098 fixed patron search behavior when a later page has only 1 result, but broke the redirect when there is only a single result from search.
To test:
1 - Perform a patron search that returns 41 results, on koha-testing-docker, 'a' works
2 - Go to second page of results, works
3 - On third page you remain in results and are not redirected
4 - Perform a patron search that return only 1 result, name or cardnumber
5 - You get redirected to this patron page
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>
This patch updates t::lib::Koha::BackgroundJob::BatchTest to the new
style, and also removes a couple stray cases in which job_id was still
passed as a parameter.
Tests are rewritten a bit, so they actually test more of the behaviors.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/BackgroundJobs.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: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 30181: (follow-up) Remove redundant queries and parameters
Now $self is actually an instance of the job class, there's no need to
have the job_id parameter passed, or the have the ->process method
re-fetch the object from the database.
This patch cleans things up.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 30181: Make Koha::BackgroundJob->_derived_class return the right thing
This patch makes _derived_class rely on _new_from_dbic to generate a new
object with the right class, but based on the same DB row. Not an empty
one as it was before. This way we can remove some biolerplate that is
required now when writing background job classes.
To test:
1. Apply the regression tests
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/BackgroundJob.t
=> FAIL: Boo, tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> 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: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 30061: Make Koha::Patron->get_age use DateTime math
This patch does what the title says. Instead of converting dates to
strings and performing math manually, we can just use the DateTime
objects we have and calculate the DateTime::Duration there's between
them, to get the years count.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 30165: (follow-up) Fix GET /acquisitions/orders
This patch fixes the particular use case of the orders route, which has
a slightly modified version of the objects.search helped, embeded in the
controller itself. This controller gets adjusted to the fact q will now
be an array.
Because of the latter, we end up requiring more code duplication
regarding the query fix, so I moved it to an internal sub that gets
reused.
To test:
1. Apply the previous patches
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/*
=> FAIL: It t/db_dependent/api/v1/acquisitions_orders.t fails!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch changes the q_param definition so the defined query parameter
is repeatable. This way JSON::Validator will always generate an arrayref
for it and won't skip occurences.
The objects.search helper is updated to always consider the 'q'
parameter as an array, as expected.
To test:
1. Apply the regression tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/query.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This method will allow to filter a patron set by a given subpermission.
It will be useful on bug 30055 where we want to display only patron
with suggestion or acquisition subpermission.
Note that it could be extended to allow several subpermissions, but we
don't need it so far.
Test plan:
prove t/db_dependent/Koha/Patrons.t
must return green
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>