Jonathan Druart [Wed, 22 Jul 2020 14:43:38 +0000 (16:43 +0200)]
Bug 25826: Add a warning to the about page
This patch adds a warning to the about page if the biblionumber field is
hidden at the OPAC or staff interface.
Test plan:
Hide the biblionumber to some framework
Confirm that there is a warning on the about page
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Mon, 27 Jul 2020 12:26:41 +0000 (12:26 +0000)]
Bug 26037: openlibrary.org is hit on every Koha requests
This patch moves the inclusion of Open Library JavaScript from
opac-bottom.inc to the three templates where it might be used.
In addition, the Open Library JS has been modified to check for the
existence of the relevant markup on the page before executing a query.
Unrelated: The Open Library label is now hidden when the status returned
is "Not found." Previously this information was displayed.
To test, apply the patch and enable the OpenLibrarySearch system
preference.
- Perform a search in the OPAC which will return results from Open
Library. Some ISBNs: 0140423826, 0395082552, 0679436405.
- On the search result page there should be an Open Library "Read
now" button for each result that can be opened for reading in Open
Library.
- Add these titles to a list and view the list.
- The "Read now" button should appear on the list page.
- View the details for one of these titles.
- The "Read now" button should appear on the page below the holdings.
- Watch the browser's developer tools on these and other pages in the
OPAC. There should be no errors in the console and no 404 errors in
the network tab.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 10 Jun 2020 12:26:06 +0000 (12:26 +0000)]
Bug 25683: Fix grouping of results
DBIX doesn't seem to work as I expected - if trying to group by we can only
get the columns we grouped by, otherwise the queries are much more complicated
and come out wrong
This patch removes the 'amountoutstanding' from the query. Note that we do return patron
object, however, to access all the columns we must discard_changes (or refetch)
Also fixes a typo 'verbosse'
To test:
1 - charge a $1 fine to a patron
2 - pay off the fine
3 - perl misc/cronjobs/update_patrons_category.pl -f J -t J -fu=5 -v
4 - Note the patron is returned twice
5 - export DBIC_TRACE=1
6 - repeat 3 - view the SQL query and see how odd it is
7 - Apply this patch
8 - repeat 3 - simpler query
9 - patron returned only once
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Tue, 9 Jun 2020 10:52:26 +0000 (10:52 +0000)]
Bug 25683: Patron with no accountlines should have 0 outstanding (not NULL)
Test plan:
- Have a patron with nothing in accountlines
- run update_patron_categories to find patrons with fines under $5 (-fu=5)
- Your patron is not found
- Give your patron a manual charge of $1
- rerun the cron, your patron is found
- pay off your patron's fine, putting their balance at $0
- rerun the cron, your patron is found
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Lucas Gass [Mon, 3 Aug 2020 21:56:48 +0000 (21:56 +0000)]
Bug 26131: Remove parentheses in circulation.pref
To test:
1. Search for a SCO system preference like SCOUserJS.
2. Note that there is a console error on that screen and you cannot open editor.
3. Apply patch
4. Reload the page.
5. No more console error and you can now edit the system pref!
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 30 Jul 2020 08:51:26 +0000 (10:51 +0200)]
Bug 26098: Fix JS error on the fund list view when no fund displayed
TypeError: this.data(...) is undefined
in jquery.treetable.js
Test plan:
Go to the fund list view
Select a filter that will return no result
=> With this patch applied there is no JS error in the console
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Mon, 20 Jul 2020 08:40:00 +0000 (09:40 +0100)]
Bug 26017: Correct permission check on tools page
The 'Cashup registers' link from the tools page retained an previous
verions of the permission name. This patch corrects it to use the final
name we sebtled on and thus now correctly displays the link when
appropriate.
Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Ensure you are logged in as a user who has the cash management
cashup permission.
3/ Verify that the 'Cashup registers' option appears on the tools page.
Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Lucas Gass [Fri, 31 Jul 2020 22:47:21 +0000 (22:47 +0000)]
Bug 26121: Add z-index for CodeMirror
To test:
1. Make sure the system preference 'NewsToolEditor' is set to CodeMirror
2. Go add or edit some News content.
3. Add some content to the News section
4. Use the datepicker to pick a Publication date/Expiration date
5. Notice its very hard to see your dates overlapping with CodeMirror.
6. Apply patch
7. Much easier to see the dates!
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Mon, 29 Jun 2020 18:15:39 +0000 (18:15 +0000)]
Bug 25893: Use wildcards when searching logs
The restores the wildcards that were used in the past
To test:
0 - Ensure cataloguing logs and issues logs are enabled
1 - Edit an item
2 - Circulate that same item
3 - Browse to tools-> log viewer
4 - Put the itemnumber in the 'info' box
5 - You see only the circulation
6 - Put the itemnumber in the object box
7 - You see only the cataloging modification
8 - Apply patch
9 - Put itemnumber in info box
10 - you see both actions
11 - Put the itemnumber in the object box
12 - You see only the catalogiong modification
Signed-off-by: Jason Robb <jrobb@sekls.org>
Bug 25893: Don't wildcard object
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 25893: (follow-up) Undo unrelated changes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Tue, 16 Jun 2020 21:34:52 +0000 (21:34 +0000)]
Bug 25871: Add "only library" to OpacItemLocation options
This patch adds a new option to the OpacItemLocation system preference,
"only library." It also rewords the descriptions of the existing options
in order to make their use more clear.
To test, apply the patch and make sure your OPACXSLTResultsDisplay
system preference is set to "default."
Test the OPAC search results using each of the OpacItemLocation
preference options:
- location: "library, location, and call number," e.g.
"Availability: Items available for loan: Athens (1).
Location(s): Athens new book shelf Call number: JNF 952.025 Bl."
- ccode: "library, collection code, and call number," e.g.
"Availability: Items available for loan: Athens (1).
Collection(s): Juvenile non-fiction Call number: JNF 952.025 Bl."
- callnum: "library and call number," e.g.
"Availability: Items available for loan: AthensCall number: JNF
952.025 Bl (1)."
- library: "only library," e.g."
"Availability: Items available for loan: Athens (1)."
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch introduces handling for per_page=-1 and actually adds a
missing feature to the API: being able to request all resources on a
route.
To test this:
1. Visit the libraries admin page
2. On the table, choose to display 'All' rows
=> FAIL: it doesn't refresh, the browser console displays a 500 error
code and so the logs
3. Apply the tests patches
4. Run:
$ kshell
k$ prove t/Koha/REST/Plugin/Pagination.t \
t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail loudly
5. Apply this patch
6. Restart plack
7. Repeat 2
=> SUCCESS: choosing to display all, works
8. Repeat 4
=> SUCCESS: Tests pass now!
9. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch introduces tests for the per_page=-1 handling use case. From
now on per_page=-1 means 'all resources'.
On writing this I noticed that we always paginate results no matter
what, but there was a weird condition under which on pagination headers
were sent back to the API consumer. This is highlighted in the precedent
patch, which is not the -1 situation this one tries to tackle.
Both pagination and searching are broken with per_page=-1, which is a
standard, and we actually didn't explicitly set a way to request all
resources.
To verify this:
1. Apply the previous tests patch and this one
2. Run:
$ kshell
k$ prove t/Koha/REST/Plugin/Pagination.t \
t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Things are damn broken
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 4 Aug 2020 11:54:28 +0000 (13:54 +0200)]
Bug 26133: Remove GetMarc* calls in detail.pl
There are several calls in catalogue/detail.pl that can be removed:
GetMarcISBN, GetMarcAuthors, GetMarcSubjects, GetMarcSeries, GetMarcUrls and GetMarcHosts
They pass a variable to the template that is never used.
Test plan:
Confirm that this TT variable is never used.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit added code related to the itemtypes to the advanced search, but this code already existed.
The weird bit is:
$template->param(advancedsearchesloop => \@advancedsearchesloop);
my $types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes";
my $advancedsearchesloop = prepare_adv_search_types($types);
$template->param(advancedsearchesloop => $advancedsearchesloop);
We are passing twice advancedsearchesloop to the template.
Test plan (for QA):
Review the changes and confirm that we can safely remove this code
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 22 Jul 2020 12:11:03 +0000 (14:11 +0200)]
Bug 26043: Fix random failure from Holds.t
# Failed test 'Test ModReserveMinusPriority()'
# at t/db_dependent/Holds.t line 202.
# got: undef
# expected: '1605'
# Looks like you failed 1 test of 66.
It is coming from Koha::Patron->holds that is ordering by reservedate,
so "sometimes" they are ordered in reverse (at least it's my
understanding of the problem).
Test plan:
Run the test file several times (from 20 to 60x), it must never fail
with this patch
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 5 Aug 2020 07:30:31 +0000 (09:30 +0200)]
Bug 26138: Make Koha::Plugins->call return consistent value
It must return an empty array in case the enable_plugins config flag is
disabled
Test plan:
Turn the config off in koha-conf
Start a search at the OPAC
Without this patch you got:
Can't use string ("0") as a HASH ref while "strict refs" in use at /home/vagrant/kohaclone/opac/opac-search.pl line 661
With this patch applied you see the search result
Followed test plan - works as described.
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Julian Maurice [Fri, 7 Feb 2020 10:21:43 +0000 (11:21 +0100)]
Bug 24610: Let user switch between 'Pay' and 'Write off' mode
In patron's accounting section, under 'Make a payment' tab, you have the
choice between 'Pay' and 'Write off'. It takes you to another form, but
once there you cannot change mode. You have to click on Cancel,
re-select the lines you had selected (if you made a selection) and click
on the right button.
This patch adds link above the form to easily switch between the two
modes.
Also fixes a CSS bug to be able to use Bootstrap's nav pills inside
.statictabs
Test plan:
1. Create some manual invoices
2. Go to 'Make a payment' tab
3. Click on the 'Pay' button in a table row
4. Above the form you should see two links ('Pay' and 'Write off').
Click on 'Write off', confirm the write off and verify that it did
make a 'write off'.
5. Go to 'Make a payment' tab
6. Click on the 'Write off' button in a table row
7. Click 'Pay', confirm the pay and verify that it did make a 'pay'
8. Go to 'Make a payment' tab
9. Select some lines and click on 'Pay selected'
10. Click on 'Write off', confirm the 'write off' and verify that it did
make a 'write off'
11. Go to 'Make a payment' tab
12. Select some lines and click on 'Write off selected'
13. Click on 'Pay', confirm the pay and verify that it did make a 'pay'
Signed-off-by: Christofer <christofer.zorn@ajaxlibrary.ca> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Wed, 29 Jul 2020 12:21:29 +0000 (12:21 +0000)]
Bug 25762: Typo in linkitem.tt
This patch corrects the same typo in two different templates:
’ -> ›
If you want to test beyond examining the patch, apply the patch
and go to Tools -> Rotating collections.
- Add an item to a rotating collection.
- In the browser's title bar (or the tab title if the title bar isn't
shown) the separator between the rotating collection name and "Add or
remove items" should be ">" instead of "`"
- Enable the EasyAnalyticalRecords system preference.
- View the detail page for a bibliographic record.
- From the "Edit" menu, choose "Link to host record"
- Check the title bar as you did previously.
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Wed, 29 Jul 2020 12:58:22 +0000 (12:58 +0000)]
Bug 26085: Add the copy, print and export DataTables buttons to lost items report
This patch removes the in-page DataTables DOM configuration option so
that the default option is used. This will allow all the standard
controls to appear, including copy/print/export.
Since the default DataTables information includes the number of results
in the table, the template markup showing this information is removed.
To test, apply the patch and go to Reports.
- Run the "Items lost" report using parameters which will return
multiple results.
- On the results page confirm that the standard controls are present:
Result count, search form, columns filter, export buttons.
- Confirm that the "Activate filters" feature works, and that selecting
results activates the option to download a CSV using a CSV export
profile.
Note that the "Activate filters" feature doesn't play well with hidden
columns. However this issue predates the patch.
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 30 Jul 2020 12:39:17 +0000 (14:39 +0200)]
Bug 26094: Add class to the "Suggest for purchase" button
Bug 14963 added a new "Suggest for purchase" button on the detail page
of bibliographic records at the OPAC.
This patch adds a specific CSS class to make it reachable easily
Like others button in this action list
Test plan:
Go to the detail page of a bibliographic record at the OPAc
Notice the new CSS class
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 17 Jul 2020 13:20:45 +0000 (13:20 +0000)]
Bug 26004: Remove unused jQuery plugin jquery.hoverIntent.minified.js from the OPAC
The jQuery plugin jquery.hoverIntent.minified.js hasn't been used in
Koha in long time. This patch removes it from the OPAC.
To test, apply the patch and search for instances of "hoverIntent."
There should be none.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 17 Jul 2020 18:09:30 +0000 (18:09 +0000)]
Bug 26011: Remove unused jQuery plugin jquery.metadata.min.js from the OPAC
The jQuery plugin jquery.metadata.min.js hasn't been used in
Koha in long time. This patch removes it from the OPAC.
To test, apply the patch and search for instances of "jquery.metadata."
There should be none.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Julian Maurice [Thu, 25 Jun 2020 07:25:41 +0000 (11:25 +0400)]
Bug 25873: Ignore malformed data for Elasticsearch integer fields
If we try to put malformed data into an integer field, Elasticsearch
rejects the whole document.
Setting 'ignore_malformed' to true allows to ignore malformed data and
process the other fields of the document normally
Test plan:
* Without the patch
1. In search engine configuration, change the type of a text field to
'Number' (for instance 'title')
2. misc/search_tools/rebuild_elasticsearch.pl -d -b
3. See that the index is empty (unless you have titles consisting only
of digits)
* With the patch
1. misc/search_tools/rebuild_elasticsearch.pl -d -b
2. Now records are correctly indexed
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 26084: Clarify language on ConsiderOnSiteCheckoutsAsNormalCheckouts
To test:
- apply patch
- confirm explanation reads as suggested
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 31 Jul 2020 09:53:53 +0000 (11:53 +0200)]
Bug 26111: Add "Serials" (SER) to the reports dictionnary
It's missing in the template
Test plan:
Go go Home › Reports › Guided reports wizard › Dictionary
At step 2, notice that with this patch you have "Serials" in the
dropdown list (instead of an empty entry)
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The current implementation makes the assumption that if $issue is
defined, then it is the 'return' use case. This is correct, but
incomplete: after verifying that there's actually an issue, the return
can be rejected for various reasons.
This patch introduces a regression test for one of those situations
(which I consider enough for testing purposes) . It highlights that the
hook shouldn't be called if there hasn't been an actual checkin.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Plugins/Circulation_hooks.t
=> FAIL: Tests fail because there's an unexpected warining printed by
the erroneous plugin call (i.e. there's been no return but the plugin is
called anyway).
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 30 Jul 2020 08:57:53 +0000 (10:57 +0200)]
Bug 25887: Keep library filter on the fund list view
The problem:
When filtering funds by library, the pull down for libraries resets to "empty" when the page is reloaded,
although the filter criteria is visible in the URL.
Test plan:
Create a fund for library A
Create a fund for library B
Go to the fund list view
=> All funds are listed
Select library A in the library filter, click "Go"
=> Funds for library A are listed
=> Library filter has "library A" selected
Edit fund for library B
=> The edit form has "library B" selected
Signed-off-by: Holly Cooper <hc@interleaf.ie> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Wed, 29 Jul 2020 20:01:24 +0000 (20:01 +0000)]
Bug 26093: Markup error after Bug 24279 creates formatting problem
This patch makes a few minor changes to the markup of the item detail
page in order for everything to be valid and styled correctly:
- Remove unnecessary and invalid <br clear="both"/>
- Move heading inside container so that floats clear correctly
- Change <span> tag back to <div> to enable the correct style.
To test, apply the patch and view the item details page for a title with
multiple items.
- Each section starting with "Barcode" should be bordered above by a
two-pixel gray line
- The "statuses" section should be styled like the areas above and
below, not as an ordered list.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 30 Jul 2020 09:59:44 +0000 (11:59 +0200)]
Bug 25852: Add tests
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 30 Jul 2020 10:00:03 +0000 (12:00 +0200)]
Bug 25852: Improve C4::Creators::Lib reliability under plack
This is certainly a major issue that leads to many side-effects.
Under plack, the structure of the default values are not handled
correctly.
Package variables are used to store stuff like the "layout type". They
are complex structures (arrays of hashes) and returned without being
copied.
When the caller (the controller script) retrieve them then modify the
returned structures, it actually modifies the package's variables.
One of the issue is:
Create a new layout
The script retrieve a structure with all "selected" flags are set to 0
It select the first one as default (BAR as selected => 1)
The user creates the new layout and will selected BIBBAR (for instance)
If you then edit this new layout, the script will retrieve the
"label_types" and set "selected" for BIBBAR. However BAR is still
selected!
The UI receives 2 selected and display the first selected one that has
the selected option.
Test plan:
1. Create a layout type for Barcode/Biblio
2. Choose fields to print and size of font
3. Save
4. Edit existing Layout
=> Withtout this patch "Barcode" is the preselected option
=> With this patch applied, the correct "Barcode/Biblio" option is
selected
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 31 Jul 2020 07:49:06 +0000 (09:49 +0200)]
Bug 26108: (bug 25855 follow-up) Call after_circ_action hook only if issue exists
AddReturn can be called on an item even if it's not checked out (to
trigger holds for instance).
The hook should (?) not be called in that situation
Test plan:
Confirm the above and that the following tests are now passing:
t/db_dependent/SIP/Message.t
t/db_dependent/Reserves.t
t/db_dependent/Circulation/issue.t
t/db_dependent/SIP/Transaction.t
t/db_dependent/Circulation.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Wed, 29 Jul 2020 17:03:57 +0000 (13:03 -0400)]
Bug 26083: Item editor defaults to lost
When editing an item via additem.pl, koha defaults to the first
available lost status, rather than defaulting to not-lost.
Test Plan:
1) Ensure you do not have a value ClaimReturnedLostValue
2) Edit an existing item that is not lost
3) Note the lost value is set even though it is not lost
4) Apply this patch
5) Edit a different item that is not lost
6) Note the lost value is not set!
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 24 Jul 2020 15:59:42 +0000 (15:59 +0000)]
Bug 26061: Improve style of sidebar datepickers
This patch makes a small change to the staff interface CSS so that
datepicker form fields in sidebar forms don't force the datepicker icon
onto a second line.
The change uses the CSS calc() function to specify that form fields with
a .hasDatepicker class (dynamically added by jqueryUI) have a width of
100% minus 20 pixels, leaving room for the datepicker icon.
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_interface).
- View a page in the staff interface which has a datepicker field in a
sidebar form and confirm that the icon stays on the same line as the
firm field at varying browser widths. Examples:
Owen Leonard [Mon, 27 Jul 2020 19:16:07 +0000 (19:16 +0000)]
Bug 26070: Remove GoogleIndicTransliteration system preference
The Google Transliterate API was deprecated on May 26, 2011. This patch
removes the feature and associated system preference.
To test, apply the patch and run the database update process.
- Go to Administration -> System preferences and search for
'GoogleIndicTransliteration.' There should be no results.
- Search the Koha codebase for references to
'GoogleIndicTransliteration.' There should be no current references..
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch makes some changes to the way assets are included based on
the value of the system preferece in order to minimize unnecessary
JavaScript includes.
The patch also adds HTML syntax-highlighting and linting like we have in
the system preferences editor.
Removed are two JS files which were not required.
To test, apply the patch and set the NewsToolEditor preference to
"CodeMirror."
- Edit a news item and confirm that the contents of the
editor show HTML syntax highlighting.
- Test HTML linting by adding some malformed HTML (missing closing tag,
for instance). The error should be highlighted.
- Set the NewsToolEditor to "TinyMCE" and confirm that WYSIWYG editing
still works correctly.
Lucas Gass [Fri, 8 May 2020 22:57:40 +0000 (22:57 +0000)]
Bug 22660: Add system pref to allow switching of editors in News Tool
This patch adds a system preference called 'NewsToolEditor' which allows for the choice between TinyMCE and CodeMirror in the News Feature.
TEST PLAN:
1. Apply patch and run updatedatabase
2. Go to Tools > News and make a new entry or edit an existing News item.
3. When you initially load you should gte the TinyMCE editor (WYSIWYG)
4. Search for the NewsToolEditor system preference and switch to CodeMirror.
5. Reload your News item and now you should see the CodeMirror editor.
6. Try saving content with both and maki sure it works.
7. Try adding some different HTML tags in CodeMirror mode, saving, and making sure it looks right when you switch back to TinyMCE
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 10 Jul 2020 13:19:14 +0000 (13:19 +0000)]
Bug 25968: Make logs sort by date descending as a default
This patch adds DataTables with columns configuration to the log viewer.
The table of log entries is now sorted by default by date descending.
To test, apply the patch and go to Administration -> Table settings.
- Expand the "Tools" section and confirm that there is a section for
"logviewer."
- Go to Tools -> Log viewer.
- Perform a search which will return multiple results.
- Confirm that the results are sorted by date descending.
- Test that the table controls work correctly: Paging, columns, export.
- Return to the Table settings administration page and test that
changes to those settings are correctly reflected in the log viewer
table.
Signed-off-by: barbara <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD amended patch: Fix indentation in .yml to match other entries
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 7 Apr 2020 10:01:05 +0000 (12:01 +0200)]
Bug 22087: Prevent variable names colision
We should not use PROCESS:
http://www.template-toolkit.org/docs/manual/Directives.html
" The PROCESS directive is slightly faster than INCLUDE because it
avoids the need to localise (i.e. copy) the variable stash before
processing the template. "
The 'patron' variable is reused by patron-title.inc
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 6 Apr 2020 14:00:13 +0000 (16:00 +0200)]
Bug 22087: Use include file to display patrons address in search result
In order to display the city and country in the patron search result, we
need to use the member-display-address-style include file, to satisfy
AddressFormat.
Test plan:
Modify some patrons and fill the different address info
Search for them and notice that the city, zipcode and country are now
displayed.
Modify the value of AddressFormat and confirm that the display is
modified according to its value
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 24 Jul 2020 14:07:29 +0000 (14:07 +0000)]
Bug 26060: Replace staff interface table sort icons with SVG
This patch modifies the staff interface CSS to convert table sorting
icons from PNG to SVG. These icons are added via background-image
data-urls, so only the SCSS file is modified.
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_interface).
- Clear your browser cache if necessary
- View any DataTable in the staff interface, for instance when checking
out to a patron with existing checkouts, the catalog detail page for
a title with holdings, the table of saved reports.
- Confirm that the sorting icons in the table headers look correct in
each state: Sorted ascending, sorted descending, and unsorted.
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Test plan:
1) have books entered
2) log in create a list
3) add books to list
4) display list in OPAC
5) click the RSS link button.
-- output is displayed as html text
6) apply patch
7) repeat steps 4&5
-- output is displayed as xml tree
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Thu, 18 Jun 2020 13:10:35 +0000 (13:10 +0000)]
Bug 25351: Move cart-related strings out of opac-bottom.inc and into basket.js
This patch adds the necessary JavaScript includes to the OPAC to
enable translation of strings in JavaScript. It also updates the
translation of cart-related strings by removing the strings from
opac-bottom.inc and putting them in basket.js where they are used.
To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:
- Update a translation:
> cd misc/translator
> perl translate update fr-FR
- Open the corresponding .po file for the strings pulled from
JavaScript e.g. misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from bootstrap/js/basket.js for
translation, e.g.:
#: koha-tmpl/opac-tmpl/bootstrap/js/basket.js:89
msgid "Your cart is currently empty"
msgstr ""
- Edit the "msgstr" string however you want (it's just for testing)
- Install the updated translation:
> perl translate install fr-FR
In the OPAC, switch to the language you're testing. Confirm that your
translated string appears. In the above example, by clicking the "Cart"
icon in the header when there are no items in the cart.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 28 Jul 2020 07:23:35 +0000 (09:23 +0200)]
Bug 21268: Don't remove 0 allocated funds from fund list
If a fund is created with a amount of 0, it will not appear in the fund
list (when a new order is created for instance).
0 allocated funds can be used to track donations and other situations
where there is not an expected amount for the year.
Test plan:
0. Do not apply the patch
1. Create 1 active and 1 inactive budgets
2. Create some funds for each budgets, with amount > 0 and amount == 0
3. Add orders to basket
=> Note that the funds with amount == 0 are not displayed
4. Apply the patch
5. Add orders to basket (using the different possible ways we have)
=> Note that the funds with amount == 0 are displayed
This change is applied to the different views of the acquisition module.
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Katrin Fischer [Fri, 22 May 2020 23:12:22 +0000 (01:12 +0200)]
Bug 25499: Fix fund code column when closing a budget
When closing a budget the fund code column in the table is
always empty. This is due to a TT variable not being correct.
To test:
- Create a budget and fund
- Order anything, leave basket open or not, but don't receive
- Duplicate your existing budget
- Close the first budget in order to move the pending orders
- Verify the fund code is not showing in the table
- Apply patch and reload the patch
- Verify fund codes are now showing correctly
Bonus: Changes the column heading Fund id to Fund ID.
Bug 26063: Use Koha::Plugins->call for circulation hooks
This patch gets rid of a helper method used for calling the plugin
hooks.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/Koha/Plugins/Circulation_hooks.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch simplifies the payload as suggested on bug 25855. It also
keeps some specific params that cannot be deduced from the passed
checkout object, (e.g. if it is an onsite checkout).
Tests are cleared and added for this special exceptions.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Thu, 21 Nov 2019 13:08:38 +0000 (08:08 -0500)]
Bug 24031: Fix warnings
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Julian Maurice [Wed, 13 Nov 2019 10:11:54 +0000 (11:11 +0100)]
Bug 24031: Add plugin hook after_hold_create
It is called after a hold has been placed
Test plan:
1. Write a plugin that implements only after_hold_create (see
`perldoc Koha::Plugins` for implementation details). Install it and
enable it
2. Place a hold and verify that your plugin method has been called with
the right parameters
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 25855: (QA follow-up) Generalize hook and simplify tests
This patch generalizes the hook so it can be used by other circulation
actions.
Tests are also simplified by mocking some of the (extensive) plugin
hooks.
To test:
1. Repeat the test plan on the original patch
=> SUCCESS: All good
2. 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>
This patch adds a new hook to notify plugins about renewal actions. To
test it:
1. Apply the unit tests
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Plugins/Circulation_hooks.t
=> FAIL: The tests expect some warnings to show, and they don't (i.e.
the sample plugin hook is not being called).
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! The hook is being called on renewal!
5. Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds tests fr a new circulation hook for plugins.
In this case the post_renewal_action hook,
The tests add the hook to the Test plugin, and verify that all the
required parameters are passed for the plugin hook to use them.
It relies on throwing an exception that is to be caught.
Sponsored-by: ByWater Solutions Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 25961: Add hooks for plugins to inject variables to OPAC XSLT
This patch adds the following plugin hooks:
- opac_results_xslt_variables
- opac_detail_xslt_variables
This hooks will inject variables returned by the plugin in the form of a
hashref, into the ones that are passed to the XSLT processing code.
To test:
1. Apply the 'DO NOT PUSH' commit
2. Install the Kitchensink plugin
3. Restart all
4. Search biblios in the OPAC
=> SUCCESS: A text is injected in front of the biblio title
5. Enter the detail page of any of the results
=> SUCCESS: A text is injected in front of the biblio title
6. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 21 Jul 2020 09:03:07 +0000 (11:03 +0200)]
Bug 24157: New permission - merge_invoices
Add a new permission to merge invoices
Test plan:
- Remove the new permission "merge_invoices" for a given patron,
use it to log in into Koha
- Create 2 invoices, try to merge them
=> There is no way to merge it
- Add the permission
=> Now you can merge the invoices
Sponsored-by: Galway-Mayo Institute of Technology Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 6 Mar 2020 19:13:35 +0000 (19:13 +0000)]
Bug 24157: (follow-up) Conditionally show controls to reopen and close invoice
This follow-up makes minor changes to the template so that the checkbox
for reopening or closing an invoice are not displayed when the user
doens't have the correct permissions.
To test, apply the patch and try the process of viewing or editing an
invoice as a user with these various permissions:
- edit_invoices ON
- edit_invoices OFF
- reopen_closed_invoices ON
- reopen_closed_invoices OFF
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 11 Dec 2019 15:39:36 +0000 (16:39 +0100)]
Bug 24157: New permission - delete_baskets
Add a new permission to delete acquisition baskets
Test plan:
- Remove the new permission "delete_basket" for a given patron,
use it to log in into Koha
- Create basket, try to delete it
=> There is no way to delete it
- Add the permission
=> Now you can delete the basket
Sponsored-by: Galway-Mayo Institute of Technology Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 11 Dec 2019 15:37:46 +0000 (16:37 +0100)]
Bug 24157: New permission - delete_invoices
Add a new permission to delete invoices
Test plan:
- Remove the new permission "delete_invoices" for a given patron,
use it to log in into Koha
- Create an invoice, try to delete it
=> There is no way to delete it
- Add the permission
=> Now you can delete the invoice
Sponsored-by: Galway-Mayo Institute of Technology Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 13 Dec 2019 16:37:36 +0000 (17:37 +0100)]
Bug 24157: Add new method Acq::Invoice::Adjustement->fund
Moving to its own commit in case we want to cherry-pick or move it to
its own bug report.
Sponsored-by: Galway-Mayo Institute of Technology Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 10 Dec 2019 20:05:40 +0000 (21:05 +0100)]
Bug 24157: New permission - edit_invoices
Add a new permission to edit invoices
Test plan:
- Remove the new permission "edit_invoices" for a given patron,
use it to log in into Koha
- Create an invoice, edit it (click "detail")
=> You can see the detail of the invoice, but cannot edit it. It's a read-only view.
- Add the permission
=> The form is back and you can modify the invoices and save the changes.
Also, you are able to create adjustments.
Sponsored-by: Galway-Mayo Institute of Technology Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 10 Dec 2019 19:03:28 +0000 (20:03 +0100)]
Bug 24157: New permission - reopen_closed_invoices
New permission to reopen a closed invoice.
Test plan:
- Remove the new permission "reopen_closed_invoices" for a given patron,
use it to log in into Koha
- Create an invoice, close it
=> You are not able to reopen the invoice
- Add the permission
=> You are able to reopen the invoice
Sponsored-by: Galway-Mayo Institute of Technology Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>