Owen Leonard [Thu, 8 Sep 2022 12:15:35 +0000 (12:15 +0000)]
Bug 31529: [OPAC] Fix errors in SCSS files raised by stylelint
This patch corrects errors raised by the new stylelint configuration in
OPAC SCSS files. Many of the fixes were made automatically by using the
"--fix" option:
- Unexpected empty line before $-variable
- Expected single space after ":"
- Expected "#fff" to be "#FFF"
- Expected modern color-function notation
- Expected single space after "("
- Expected single space before ")"
- Expected empty line before comment
- Expected no more than 1 empty line
- Expected a trailing semicolon
- Expected color.adjust($color, $lightness: -$amount) instead of darken($color, $amount)
- Unexpected leading zero
- Expected single space after "," in a single-line function
- Expected double colon pseudo-element notation
Manual fixes include replacing named colors with hex codes, combining
duplicate selectors, removing empty blocks, etc.
Some warnings remain: "Unexpected !important" and "Expected a
placeholder selector (e.g. %placeholder) to be used in @extend" which
both require more than a quick fix, if we should choose to address them.
To test, apply the patch and rebuild the OPAC SCSS:
https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client
Browse around the OPAC to confirm that there are no visible changes to
style.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Owen Leonard [Thu, 8 Sep 2022 12:37:25 +0000 (12:37 +0000)]
Bug 31528: (follow-up) A few additional rules
Adding a few more rules which came up during the correction process in
the follow-up bug.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
It should output a list of problems with the file:
koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
30:27 ✖ Expected "#e6f0f2" to be "#E6F0F2" color-hex-case
81:31 ✖ Expected single space after "(" function-parentheses-space-inside
...etc.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Isobel Graham [Mon, 12 Sep 2022 16:33:57 +0000 (17:33 +0100)]
Bug 31412: Add focus to 'name' on SMTP Servers
This patch adds the focus class to ensure focus is given to the first form element on the SMTP server entry page.
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Katrin Fischer [Sat, 1 Oct 2022 22:16:41 +0000 (22:16 +0000)]
Bug 26368: Rephase system preference to sentence style
The preference was using a yes/no instead of the more common
display/don't display. This patch switches it to the latter
and adds a note about position 17.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Thu, 3 Sep 2020 12:52:28 +0000 (12:52 +0000)]
Bug 26368: Add OCLC options to marc21_leader.tt
See documentation at:
https://www.oclc.org/bibformats/en/fixedfield/elvl.html
To test:
1 - Apply patch, updatedatabase
2 - Edit a record in the basic editor
3 - Edit the leader using the plugin
4 - Note the options for '17 - Encoding level'
5 - Find the system preference 'UseOCLCEncodingLevels'
6 - Edit the record again
7 - Note new options I,J,K,M
8 - Set the value of encodign level to one of the new options and save
9 - Edit again
10 - Confirm the value is displayed correctly selected
11 - Repeat tests using advanced cataloging editor
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Marcel de Rooy [Mon, 29 Aug 2022 13:40:28 +0000 (13:40 +0000)]
Bug 15545: Remove reqholdnotes from opac-reserve
This never really made it. So let's remove all traces.
Test plan:
Look at code changes and git grep reqholdnotes.
Bonus: Place a hold with/without hold notes.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Isobel Graham [Thu, 1 Sep 2022 10:03:31 +0000 (11:03 +0100)]
Bug 8305: Added an icon for iOS home screen
1. Bookmark the Koha OPAC on an iOS device
2. See if an icon is formed on the home screen
of the device
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Lari Strand [Wed, 31 Aug 2022 12:39:42 +0000 (15:39 +0300)]
Bug 31496: Fix branch in printslip.pl to logged in staff user's library
When you print a receipt slip in SCO, the library/branch you are at
in should be fetched from the logged in staff member's data (staff login
done before entering SCO view) instead of the patron's own who has signed
in to the SCO. Printing a slip shows patron's own home branch in the slip
as the branch they're in. This causes confusion with patrons who want to
print receipts/slips.
Test plan:
1) Make sure the staff user's library (used to login into SCO patron
view) is not the same as the patron's who is logging into SCO
2) Print a slip in SCO and notice patron's home library printed on the slip
3) Apply patch
4) Print a slip in SCO and notice the library is now the staff user's library
used to sign in to SCO patron view.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Fri, 19 Aug 2022 10:04:56 +0000 (10:04 +0000)]
Bug 31419: Add accesskeys for modals
This patch simply adds accesskey elements to the buttons, and changes an icon to be
consistent with bug 26626
For tips on how to access the accesskeys:
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
To test:
1 - Generate a recall
2 - Fill it/check in
3 - Note modal now has hints "Confirm (Y)"
4 - Test with Y,P,I keys (may need to recreate recalls)
5 - Confirm the recall and test waiting recall modal too
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Owen Leonard [Thu, 22 Sep 2022 15:48:32 +0000 (15:48 +0000)]
Bug 31605: Improve style of OPAC suggestions search form
This patch makes minor modifications to the markup for the
OPAC suggestions search form so that the different labels and
form fields display a little more nicely.
The patch also adds standard Bootstrap alert classes to
several messages which might be displayed on the screen, e.g.
"You have no pending purchase suggestions."
To test, apply the patch and make sure the "suggestion" system
preference is enabled.
- With the OPACViewOthersSuggestions preference disabled, log
in to the OPAC and view your suggestions.
- If you have no suggestions you should see a Bootstrap-styled
message box, "You have no pending purchase suggestions."
- If necessary, submit a suggestion. With at least one suggestion
present you should see a search form above the table of
suggestions. The label, form field, and submit button should
line up nicely.
- Test that the search form works correctly to find suggestions
in your system.
- If you search for a suggestion which doesn't exist you should
see a message-style alert, "There are no pending purchase
suggestions matching your search."
- Enable the OPACViewOthersSuggestions system preference.
- Return to the OPAC suggestions page. The form field should
now include a nicely-styled "Suggested by" filter.
Signed-off-by: George Williams <george@nekls.org> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Owen Leonard [Thu, 22 Sep 2022 16:41:12 +0000 (16:41 +0000)]
Bug 31527: Breadcrumbs for anonymous suggestions are not correct
This patch updates the OPAC suggestions template in order to
omit the patron name breadcrumb if there is not a logged-in
user.
To test, apply the patch and view the OPAC suggestions page
with the AnonSuggestions preference both enabled and disabled.
- If you are logged in, the page breadcrumbs will be:
Home -> [Your name] -> Purchase suggestions.
- If you are not logged in it should be:
Home -> Purchase suggestions
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 29744: (QA follow-up) Only consider PLACK_ENV for underscore
When run under certain circumstances (in jenkins, for example) some ENV
variables are set for convenience, like PLACK_WORKERS and
PLACK_MAX_REQUESTS and is causing some tests to fail (notably, shib
ones).
This patch makes the regex only consider PLACK_ENV when testing for the
underscore case.
Tests are updated accordingly, and they are also rewritten to test for
boolean values instead of empty string, or zero or one, etc. The
implementation shouldn't matter as long as the boolean evaluation is
correct and it is clearer for devs what to expect.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Shi Yao Wang [Tue, 5 Jul 2022 16:03:52 +0000 (12:03 -0400)]
Bug 31105: Holds to pull counts items from other branches when independentbranches is active
Holds to pull should not show items from other branches that shares a
record when IndependentBranches is active. Except for superlibrarians.
Test plan:
1- Have IndependentBranches set to Yes
2- Have a record with an item from the current branch and another item from a different branch. We will call them branch A and branch B respectively
3- Have a patron from branch A place a hold on that record
4- Have a staff account on branch A and B with the following permissions:
- circulate (all)
- catalogue
5- Go to circulation > holds to pull
6- Notice under "Libraries" it displays branch A and B. Also, it shows 2 under "Items available"
7- Checkout the item from branch A to another patron
8- Go back to circulation > holds to pull
9- Notice under "Libraries" it displays branch B even though we are in branch A
10- Apply the patch
11- Return the checked out item from step 7
12- Redo step 5 to 9 with superlibrarian privileges and notice nothing changed
13- Redo step 11-12 but using accounts from step 4 and notice Holds to
pull only shows information relevant to their branch
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Katrin Fischer [Sat, 30 Jul 2022 14:35:27 +0000 (14:35 +0000)]
Bug 23538: (QA follow-up) Group system preferences into one entry
This makes the new perferences EmailPatronRegistrations and EmailAddressForPatronRegistrations
follow a little more closely the pattern set by the very similar
EmailPurchaseSuggestions and EmailAddressforSuggestions.
* Group both preferences into one entry
* Add line break between preferences
* Switch branch for library in pull down
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Alex Buckley [Wed, 6 Apr 2022 12:40:01 +0000 (12:40 +0000)]
Bug 23538: (follow-up) Fix up notices
- Add toolkit template (TT) syntax to notices
- Add TT conditionals to notices
Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Alex Buckley [Wed, 6 Apr 2022 10:38:38 +0000 (10:38 +0000)]
Bug 23538: Unit tests
Test plan:
1. Run unit tests:
sudo koha-shell <instance>
cd t/db_dependent/Koha
prove -v Patron.t
Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Alex Buckley [Tue, 5 Apr 2022 21:33:12 +0000 (09:33 +1200)]
Bug 23538: Email library when new patron self-registers
Test plan:
1. Apply all patches
2. Update database
3. Restart services
4. Set email addresses in:
- KohaAdminEmailAddress syspref
- EmailAddressForPatronRegistrations syspref
- Email address in the library branch
5. Enable PatronSelfRegistration syspref
6. Test the following use cases:
- EmailPatronRegistrations syspref = 'none'.
Submit OPAC registration.
= OUTCOME: Confirm no OPAC_REG notice in message_queue table
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Alex Buckley [Mon, 4 Apr 2022 07:52:06 +0000 (07:52 +0000)]
Bug 23538: Database changes
Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Marcel de Rooy [Fri, 26 Aug 2022 09:28:14 +0000 (09:28 +0000)]
Bug 31468: Change interface in Koha::Logger
Test plan:
Add a line in mainpage.pl:
require Koha::Logger; Koha::Logger->get->warn("intranet L51");
Restart. Hit intranet mainpage. Verify that line is in plack=intranet.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Retested with L49 now ;) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Andrew Isherwood [Wed, 13 Apr 2022 10:30:40 +0000 (11:30 +0100)]
Bug 30484: Add unit tests
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=28909 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 30484: Implement support for ILL request updates
This commit adds support for the concept of ILL request update notices.
- Adds a new Koha::Illrequest::SupplierUpdate class that is used to
encapsulate an update to a request, this update may come from a
supplier via a backend or from core ILL via, perhaps, a user action
- Adds a new Koha::Illrequest::SupplierUpdateProcessor base class that
can be subclassed in order to create a processor that can be passed an
update and act accordingly.
- Updates to Illrequest.pm to support the above classes and allow core
Koha to offer update processors
- A shell script to initiate a periodic process to check for updates
meeting given criteria and run the appropriate processors
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=28909 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Adds a new ILL_REQUEST_UPDATE notice which is to be used for the
formation of notices informing users of updates to ILL requests.
Commit includes database updates and template changes for messaging
preferences
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=28909 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Shi Yao Wang [Thu, 19 May 2022 15:05:17 +0000 (11:05 -0400)]
Bug 30802: Make numReturnedItemsToShow function properly
Replaced the hardcoded 20 by the value of numReturnedItemsToShow to
display the right number of items in check in.
Test plan:
1- Make lots of checkouts, at least like 40 (I used the batchCheckouts feature)
2- Go to Circulation > Check in
3- Return 21 items
The last 20 items returned will be displayed
4- Change numReturnedItemsToShow to 50
5- Return a couple more items
Only the last 20 returned items are displayed
6- Change numReturnedItemsToShow to 10
7- Return a couple more items
Only the last 10 returned items are displayed
8- Apply the patch
9- Change numReturnedItemsToShow back to 20
10- Do steps 1 to 7 again, but this time step 5 returns the right amount
of items
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 31525: display streetnumber with address in patron search
Adds back street number to the address when searching for patrons
To test:
1) Edit a patron's contact information
2) Under Main Address put an address, make sure to put something in the
Street number field
3) Do a simple patron search that will yield results (i.e. "a")
4) Confirm the street number does not show, but the rest of the address
does
5) Apply this patch
6) Do another patron search
5) Confirm the street number now shows
Sponsored-by: Catalyst IT
Testing note: AddressFormat system preference must be set to "US style"
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 31518: Fix syntax error on request.tt that prevents showing hidden item count
The variable set by request.pl doesn't have biblio prefix, it is just
hiddencount.
To test:
1) Log in with a staff member account that has "Lost items in staff
interface" setting set to "Hidden by default" in the patron category
settings
2) Add a lost item to biblio
3) Go place a hold on staff interface (request.pl) notice the broken
link on the request page: "Show all items ( hidden)"
4) After applying the patch it should read "Show all items (1 hidden)"
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Mon, 8 Aug 2022 12:15:16 +0000 (12:15 +0000)]
Bug 25375: Match current Zebra availability limit
In Zebra the availability limit code states:
'available' is defined as (items.onloan is NULL) and (items.itemlost = 0)
We should make ES follow the same behaviour so that changing the engine does not
change this.
To test:
1 - Find or create several records with two items each
2 - For those records setup items as:
a - one checked out, one available
b - both marked lost
c - both damaged
d - both withdrawn
e - both notforloan
3 - Enable ES and reindex to confirm everything is set
4 - Perform an advanced search to return those records and 'limit to available items'
5 - Confirm you see records b,c,d,e and records say '2 items, none available'
6 - Apply patch
7 - Run `misc/search_tools/rebuild_elasticsearch.pl -d -b`
8 - Perform an advanced search to return those records and 'limit to available items'
9 - Confirm you see records a,b,c,d and al but a say '2 items, none available'
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Julian Maurice [Thu, 3 Mar 2022 10:18:25 +0000 (11:18 +0100)]
Bug 25375: Add tests for the "available" ES field
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Fri, 11 Sep 2020 15:23:02 +0000 (15:23 +0000)]
Bug 25375: (QA follow-up) Count available items rather than iterating
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Julian Maurice [Fri, 4 Sep 2020 08:25:17 +0000 (12:25 +0400)]
Bug 25375: Get biblionumber from the correct MARC field
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Julian Maurice [Wed, 29 Apr 2020 14:13:08 +0000 (16:13 +0200)]
Bug 25375: Fix 'available' facet in elasticsearch
Add a new boolean ES field named 'available', which is true if at least
one item is available, which means the item is not on loan, not
"notforloan", not withdrawn, not lost and not damaged
A full indexation is required
Test plan:
1. Apply patch and run updatedatabase.pl
2. Run `misc/search_tools/rebuild_elasticsearch.pl -d -b`
3. Make sure you have some biblios whose items are all unavailable, some
biblios whose items are all available, and some biblios with at least
one item available and at least one item unavailable
4. Use the 'available' filter on both opac and intranet and make sure it
works as expected.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Fri, 26 Aug 2022 13:32:50 +0000 (13:32 +0000)]
Bug 31367: Add subtotals if budget has children
On bug 29287 we added child funds if a fund had no parent id
It turns out funds can have a parent, and still have children (sub-sub-funds)
This patch simply checks for children, rather than checking for lack of parent.
Totals are already calculated correctly in GetBudgetHierarchy
To test:
1 - Add a fund "Fund" to a budget - assign 1000 dollars
2 - Add a sub-fund "SubFund" - assign 100 dollars
3 - Add a sub-sub-fund "SubSubFund" - assign 10 dollars
4 - Add to a basket $5 order from SubSubFund
5 - Add to a basket $50 order from SubFund
6 - Add to a basket $500 order form Fun
7 - View acqui home - note 'SubFund' does not include total from 'SubSubFund'
8 - Apply patch
9 - Confirm all sub-sub-funds totaled in sub-funds and that fund total correctly adds sub and sub-sub funds
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 30982: (QA follow-up) Remove redundancy from template
The template now contains two lists for both status and type:
a TT list and a JS list. The type list already proves that
redundancy leads to bugs. We miss three types at one side:
Unknown job type 'stage_marc_for_import'
Unknown job type 'marc_import_commit_batch'
Unknown job type 'marc_import_revert_batch'
This patch removes the TT list. And gets the status and type
via an additional js call. For that reason I hide the fieldset
until document ready. This can be improved later when needed.
Test plan:
Look at status and type on both job list and detail view.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
[1] Correct: BackgrounJob
[2] If should filter out not current jobs
=> Had a hard time reading that one until I replaced if by it.
=> Decided to rephrase it in a more positive way.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
When I started looking at this patch I felt like the two tables
(current/past jobs) implemented on bug 30462 was the way to go.
In order to make this patches apply after it I had to redo all the
things. Or most of them.
But I decided to keep the idea of filtering out completed tasks, not
just having the option to display 'the last hour' tasks. For the task I
added some required helper methods and the relevant tests as well. So a
behavior change.
Hope you all agree with it.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch makes the following changes to the 'background_jobs' API:
* We now call them 'jobs'
* Removed deprecated query parameter definitions
* Added only_current query parameter
* Controller gets adapted to use $rs->filter_by_current when
only_current is passed
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Jonathan Druart [Tue, 26 Jul 2022 06:44:10 +0000 (08:44 +0200)]
Bug 30982: Add 'context' to the REST API specs
context has been added by bug 30889
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Martin Renvoize [Wed, 29 Jun 2022 14:14:41 +0000 (15:14 +0100)]
Bug 30982: Make code more re-usable
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Jonathan Druart [Wed, 29 Jun 2022 09:28:31 +0000 (11:28 +0200)]
Bug 30982: Add tests and implement GET /background_jobs/$id
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Martin Renvoize [Tue, 28 Jun 2022 07:10:38 +0000 (08:10 +0100)]
Bug 30982: (QA follow-up) Double quoting and console.log
This patch fixes the issues highlighted by the QA script; We use double
quotes for translatable strings in JS and remove an errant console.log
call.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Jonathan Druart [Fri, 17 Jun 2022 09:13:19 +0000 (11:13 +0200)]
Bug 30982: Use the REST API for background job list view
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Jonathan Druart [Fri, 17 Jun 2022 07:21:39 +0000 (09:21 +0200)]
Bug 30982: REST API specs
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch populates the koha.statistics.usercode with borrowers.categorycode where it is easily available.
Currently for statistics.type 'issue' OR 'localuse' OR 'renew'.
Supplied a script to UPDATE the old statistics records.
Have fun!
To test:
1. Add loan for patron.
2. Check statistics table
=> 'usercode' column for this issue should now contain patrons categorycode
To test add_statistics_borrowers_categorycode.pl:
1. Run add_statistics_borrowers_categorycode.pl
2. Check statistics table
=> all statistics which are type 'issue' OR 'localuse' OR 'renew'
should now contain patrons categorycode in 'usercode' column
Also prove that tests in t/db_dependent/Circulation.t still pass.
Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Emmi Takkinen [Wed, 16 Jun 2021 11:40:47 +0000 (14:40 +0300)]
Bug 7021: Reintroduce usercode column
This patch reintroduces usercode column to
statistics table.
To test:
1. Apply patch and update database
2. Confirm there's column usercode in statistics
table
Sponsored-by: Koha-Suomi Oy Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Wed, 14 Sep 2022 11:45:38 +0000 (11:45 +0000)]
Bug 31562: Respect mandatory fields pref
To test:
1 - Set gonenoaddress and lost in BorrowerMandatoryField
2 - Edit a patron, confirm fields are required
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Wed, 14 Sep 2022 11:35:44 +0000 (11:35 +0000)]
Bug 31562: Remove gonenoaddress and lost from OPAC borrower field preferences
These are not shown, so cannot be unwanted or mandatory
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Wed, 14 Sep 2022 11:27:03 +0000 (11:27 +0000)]
Bug 31562: Treat flags as other borrower fields
Rather than generate a custom hash for these fields, we should treat them as other borrower data fields
To test:
1 - Edit a patron, note the 'Lost card' and 'Gone no address' fields
2 - Edit syspref BorrowerunwantedField
3 - Set gonenoaddress and lost as unwanted
4 - Edit patron, the fields remain
5 - Apply patch
6 - Edit a patron, fields are hidden
7 - Unhide one of the fields
8 - Edit a patron and confirm it shows and saves correctly
9 - Unhide the other field
10 - Confirm it can be edited and saved
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The test in question concerns non-superlibrarian staff users.
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
David Cook [Thu, 18 Aug 2022 03:26:20 +0000 (03:26 +0000)]
Bug 31389: Calculate user permissions in separate function
This patch refactors the setting of user permissions for templates into
a new function, which can be easily unit tested and reduces the amount
of code in C4::Auth::get_template_and_user(). It also aids in the
re-usability of permission checking code.
Test plan:
0) Apply patch and koha-plack --restart kohadev
1) prove t/Koha/Auth/Permissions.t
2) As koha superlibrarian, go to
http://localhost:8081/cgi-bin/koha/tools/tools-home.pl
3) Go to http://localhost:8081/cgi-bin/koha/members/members-home.pl
4) Create new test user with "Staff access..." and "Remaining circulation permissions"
5) Logout of koha superlibrarian
6) Login as test user
7) Note you can only see a limited view of the staff interface
(i.e. no administration, no tools, no reports, etc.)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 30497: Recreate old_reserves_ibfk_4 when it cascades
Test plan:
Drop old_reserves_ibfk_4.
Add back with:
alter table old_reserves ADD CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE;
Run dbrev. Check that constraint has been replaced by SET NULL.
Run dbrev again. No changes.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT 23-08-22 Replaced DROP CONSTRAINT]
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Change from CASCADE to restrict.
In harmony with dbrev 20.06.00.022.
Test plan:
Run the dbrev.
Bonus:
update itemtypes set parent_type='VM' where itemtype='CF';
delete from itemtypes where itemtype='VM';
=> ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`koha_myclone`.`itemtypes`, CONSTRAINT `itemtypes_ibfk_1` FOREIGN KEY (`parent_type`) REFERENCES `itemtypes` (`itemtype`))
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 27550: "Duplicate budget" does not keep users associated with that budget
When a budget is duplicated, Owner is copied but not Users
Test plan :
Home > Administration > Budgets
1)Create a budget to allow (active or inactive)
2)Give it some funds by filling up the form, especially Owner and
User(s)
3)Submit then go back to the Budgets dashboard
4)Duplicate the Budget and click on its name
5)Edit it and notice that User(s) is empty
6)Apply the patch
7)Repeat from 1) to 5)
Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Wed, 14 Sep 2022 13:23:58 +0000 (13:23 +0000)]
Bug 31564: Pass start label in PDF link
To test:
1 - Tools->Lbel creator
2 - Make a new batch
3 - Add an item
4 - Click 'export' on the single item
5 - Enter a starting label position greater than 1
6 - Click Export
7 - Click Download as PDF
8 - Note label in 1st position
9 - Apply patch
10 - Repeat and note label position now honored
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 29744: (QA follow-up) Call psgi_env in OO style
Result of git grep -l -E "::psgi_env" | xargs sed -i -e's/::psgi_env/->psgi_env/g'
Also resolving this warn from Auth.t:
Use of uninitialized value $ENV{"SCRIPT_NAME"} in pattern match (m//) at /usr/share/koha/Koha/AuthUtils.pm line 211.
Note that the following warn is resolved on report 30588 (underway).
Use of uninitialized value $return in numeric gt (>) at /usr/share/koha/C4/Auth.pm line 1154.
Test plan:
Run t/db_dependent/Auth.t
Hit some opac, intranet pages. API call.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
David Cook [Wed, 20 Apr 2022 05:27:32 +0000 (05:27 +0000)]
Bug 29744: Remove unnecessary condition in C4::Auth::safe_exit
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Adding David's comments from Bugzilla to safe_exit here. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Martin Renvoize [Mon, 28 Mar 2022 09:23:58 +0000 (10:23 +0100)]
Bug 29744: Harmonize psgi/plack detection methods
This patch updates and moves the existing psgi_env method out of Auth
and into Context and then replaces any manual references of the same
code to use the new method.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 31597: Add missing semicolon to restriction.pl
In restrictions.pl line 114 is missing a semicolon after try-catch statement.
This causes error 500 when one tries to delete restriction.
To test:
1. Navigate to "Patron restrictions".
2. Find or create patron restriction to be deleted.
3. Hit "Delete" and confirm deletion.
=> Error 500 is raised.
4. Apply this patch.
5. Try to delete again.
=> Success!
Sponsored-by: Koha-Suomi Oy Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Joonas Kylmälä [Mon, 29 Aug 2022 20:39:13 +0000 (20:39 +0000)]
Bug 28167: Remove uninitialized variable warnings from circ/set-library.pl
With UseCashRegisters syspref disabled going to the page
/cgi-bin/koha/circ/set-library.pl in staff interface and setting a
library gives the following errors in plack-intranet-error.log:
Use of uninitialized value $register_id in string ne at /kohadevbox/koha/circ/set-library.pl line 79.
Use of uninitialized value $referer in pattern match (m//) at /kohadevbox/koha/circ/set-library.pl line 114.
In the if clause $userenv_register_id appears to be typoed, it should have
been $register_id as $userenv_register_id is always defined. As for the
$referer variable, it is undef if there is no referer so let's just initialize
it to an empty string for the regex so it doesn't give the warning.
To test:
1) Go directly to /cgi-bin/koha/circ/set-library.pl by typing it in
the URL bar and set a library
2) Make sure plack-intranet-error.log doesn't contain the above mentioned errors
after applying this patch
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Isobel Graham [Thu, 1 Sep 2022 11:06:26 +0000 (12:06 +0100)]
Bug 30890: Fixed ILL breadcrumb
Added correct breadrumb depth when managing requests.
1. Viewing a request on a ILL request page
2. Making sure the breadcrumb has three depths
and the manage requests has the correct
request id
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Tue, 13 Sep 2022 12:19:57 +0000 (12:19 +0000)]
Bug 31497: Prevent ID clash on quick add fields
The quick add clones the original fields, including ids. This can cause some clash when
other JS is running on the page.
This patch updates the ids of the fields before adding to the form, which prevents bad
copying/clearing of fields
To test:
* Go to patrons module
* Click on Quick add new patron (I chose Patron as category)
* On sample database these fields are marked as mandatory:
* Surname
* Cardnumber
* Library
* Category
* Fill in Surname, leave cardnumber empty
* Save - mandatory message is shown
* Fill in cardnumber - save
* The patron is saved
* BUT: cardnumber is empty!
APPLY PATCH
* Repeat plan above
* Cardnumber is correctly saved
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Thu, 25 Aug 2022 11:18:18 +0000 (11:18 +0000)]
Bug 30359: Unit tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Johanna Raisa [Fri, 25 Mar 2022 10:25:56 +0000 (12:25 +0200)]
Bug 30359: GetBudgetHierarchy is slow on order receive page
This patch adds skiptotals parameter to GetBudgetHierarchy so calculating
totals can be skipped from some pages.
Test plan:
1) Open browser's Inspect -> Network
2) Go to receive orders
3) Check the timings for page load
4) Apply the patch
5) Refresh the page
6) Check the timings again
7) prove t/db_dependent/Budgets.t
Sponsored-by: Koha-Suomi Oy Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Julian Maurice [Wed, 9 Jun 2021 14:28:51 +0000 (16:28 +0200)]
Bug 31254: Add additional fields for accountlines
Test plan:
1. Go to Admin » Additional fields
There are two new categories: "Account lines (credit)" and
"Account lines (debit)"
2. Create fields for both categories, with and without an authorized
value category
3. Go to a user's accounting page
4. Create a manual invoice. Verify that all "debit" fields are there,
put a value in them and save
5. Create a manual credit. Verify that all "credit" fields are there,
put a value in them and save
6. Make a payment. Verify that all "credit" fields are there, put a
value in them and save
7. Go to the transactions tab, click on the "Details" button for the
lines you just created and verify that the additional fields are
there
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>