Commit graph

45967 commits

Author SHA1 Message Date
6aa1ea5e0c Bug 29561: (follow-up) Don't remove facet '0'
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c4161b703e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 18:18:38 +00:00
3fb3a8c7d6 Bug 29561: Remove blank facets
This patch strips the blank facets from the ES aggregations, this seems
to only affect language fields currently, but could affect any facetable field
that can contain blank values

To test:
1 - Have Koha running Elasticsearch with standard test data,
    or add some records with blank values in the 008/35-37
2 - Search for 'a'
3 - Look at the language facets, they should appear normal
4 - Browse to:
    http://localhost:8081/cgi-bin/koha/catalogue/search.pl?idx=&q=a&sort_by=relevance_dsc&count=20&limit=ln:
5 - Note there is now an 'x' under the Languages facet - to remove a limit you cannot see
6 - Apply patch
7 - Reload
8 - Note the x is not there
9 - Inspect HTML, confirm no blank link under language facets

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eeb12f8a52)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 18:18:25 +00:00
5b6b095f1f Bug 29561: Unit test
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c473480d4e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 18:18:10 +00:00
Aleisha Amohia
8db2853d28 Bug 31682: Silence automatic linker warn
To test:
1. Open the plack-intranet-error.log in your terminal
2. When editing or adding a bibliographic record, click the button to
link authorities automatically.
3. Notice the warn in the log
4. Apply the patch, restart services and refresh the page
5. Click the button again. There should be no warn

Sponsored-by: Catalyst IT

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 38c4837c24)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 18:15:20 +00:00
5554f0b432 Bug 31420: Managing funds: Labels of statistic fields overlap with pull downs
This patch removes some very old inline style attributes from the fund
edit form. The "white-space" attribute prevented label text from
naturally wrapping.

To test, apply the patch and go to Administration -> Funds.

- In the list of funds, click Actions -> Edit.
- The the form, confirm that the text of the "Statistic" 1 and 2 labels
  wraps, not getting hidden by the associated select tags.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3ffd2cc02)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 18:12:02 +00:00
aceaca5d29 Bug 31587: Basket not accessible from ACQORDER notice
The parameter "aqbasket" is passed to GetPreparedLetter, but is always undefined for the notice ACQORDER.

Test Plan:
1) Set your ACQORDER notice content to:
   ***[% basket %]***
2) Set up a vendor with an email, set contact for email so the "E-mail
   order" button shows on a basket for that vendor
3) E-mail the basket
4) Note the email contents are "******"
5) Apply this patch
6) Restart all the things!
7) Email the basket again
8) Note the content looks something like:
   ***Koha::Acquisition::Basket=HASH(0x55870acd96e0)***

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c89e886b6d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 18:08:52 +00:00
a09d225815 Bug 31587: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fc7cc1467d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 18:08:35 +00:00
124d54c957 Bug 31575: Missing warning for holds where AllowHoldPolicyOverride can be used to force a hold to be placed
If some holds are overridable, and AllowHoldPolicyOverride is enabled, Koha
used to "flag" each holdable item to let librarians know the hold could not
normally be placed. In 22.05 up to current master as of this writing, no
warning is displayed.

Test Plan:
1) Set one circ rule to allow 0 holds
2) For Library A, set "Hold pickup library match" to "item's hold group"
3) Enable AllowHoldPolicyOverride
4) Set ReservesControlBranch to "item's home branch"
5) Create a record with an item for Library A, one for Library B, and one for Library C
   This should create a scenario where A's item cannot be held, and B and C's items must be overridden
6) Note you get the "Cannot place hold" but can place those holds anyway without a "warning" sign
7) Apply this patch
8) Restart all the things!
9) Reload the page, you should now see the warning icons!

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>
(cherry picked from commit 30eb30b3c1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 18:06:06 +00:00
Galen Charlton
f2e1b97386 Bug 31619: add title back to list of OPACSuggestionMandatoryFields options
This patch fixes a regression introduced by bug 29695 that prevented
setting the title as a required field when setting the
OPACSuggestionMandatoryFields to a non-default value.

To test:

[1] Set OPACSuggestionMandatoryFields in the system preferences
    editor and note that 'title' is not listed in the modal
    that is displayed.
[2] Apply the patch.
[3] Revist the system preference editor and note that 'title'
    is now displayed as an option.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7af9c1c109)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 18:03:12 +00:00
36417312eb Bug 31649: Fix acquisition basket group CSV export if biblio does not exist
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>
(cherry picked from commit 8d933d482a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 17:58:34 +00:00
ace7e412a8 Bug 31649: Fix acquisition basket CSV export if biblio does not exist
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>
(cherry picked from commit 28b56098b5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 17:58:23 +00:00
f076d3b66d Bug 31649: Add unit tests
Creates new test file GetBasketGroupAsCSV.t

Test with :
prove t/db_dependent/Acquisition/GetBasketAsCSV.t
prove t/db_dependent/Acquisition/GetBasketGroupAsCSV.t

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>
(cherry picked from commit 193d6c48a4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 17:58:10 +00:00
9b7b41be1f Bug 31685: Replace current_article_requests_count in opac-user
Fixing the "( total)" in the caption of the table.

The tt var should be replaced now by current_article_requests.size.
Note that current_article_requests is an array now (from as_list).
We cannot use .count since it is no Koha object.

Test plan:
Submit a few article requests.
Check OPAC account page, and verify that both totals are fine now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5db2163857)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:59:31 +00:00
Kevin Carnes
e02af62e0d Bug 31660: MARC preview for authority search results has hidden contents
This patch makes the contents of the MARC preview for authority search
results visible.

To test:
1)  Go to the Authorities page in the staff interface
2)  Click Submit to do a search
3)  Click on Actions to the right of an authority
4)  Select MARC preview
5)  Observe that the modal appears empty
6)  Apply patch
7)  Hold down the shift key when you reload the page, clear the cache,
    or use another web browser
8)  Do another authority search and look at a MARC preview
9)  Observe that the MARC preview contains the MARC record

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>
(cherry picked from commit 6123c2767d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:54:30 +00:00
2a14f470f7 Bug 20457: Overdue and pre-overdue cronjobs not skipping phone notices
The overdue and pre-overdue cron scripts are not skipping the generation of phone notices. This causes many phone notices to be created that will always be left at 'pending' as the Talking Tech outbound script creates its own phone notices and puts them in the message queue.

Test Plan:
1) Enable Talking Tech
2) Enable predue and overdue notice phone transports for a patron
3) Generate overdues and predues, notice phone notices are generated
4) Apply the patch
5) Repeat steps 2-3
6) Note phone notices are not generated

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>
(cherry picked from commit bf6bbc29a0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:50:19 +00:00
Christophe Torin
4c0025a81c Bug 29671: Dropbox mode is unchecked after check in confirm on item with Materials specified
Suggested patch

steps to reproduce :

1) Enable System preference CirConfirmItemParts
2) Go to Circulation > Check in
3) Enable Dropbox mode (Book drop mode) in the Checkin settings
4) Enter a barcode of an item having the 'Materials specified' field
   not empty
5) A Popup is shown, click the confirm button
6) The Dropbox mode (Book drop mode) is now unchecked, but should stay
   checked.

In the template, the modal window lacks the dropboxmode input, so that
it stays on the next page. I attached a patch with my suggested correction.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Géraud <geraud.frappier@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e024b6fb52)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:40:25 +00:00
e3db0a35c3 Bug 31643: Require only edit_catalogue, not full cataloging
To test:
1 - Grant a patron: catalogue, edit_catalogue, and editauthorities permissions
2 - Log in to staff client
3 - Browse to: http://localhost:8081/cgi-bin/koha/svc/cataloguing/automatic_linker.pl
4 - UNAUTHORIZED
5 - Apply patch, restart all
6 - Log in and go to link again
7 - status "OK"

Signed-off-by: Catrina <catrina@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fb1ca33110)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:36:34 +00:00
1bfa759583 Bug 30944: DBIC
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:32:47 +00:00
776766b520 Bug 30944: DBRev 22.05.07.001
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:29:38 +00:00
Katrin Fischer
96d135f244 Bug 30944: Undo change to ILS-DI documentation
The service not implemented by Koha is CancelRecall
as specified in:
https://old.diglib.org/architectures/ilsdi/DLF_ILS_Discovery_1.0.pdf

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8abc8c4950)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:21:28 +00:00
Aleisha Amohia
f39ee5585c Bug 30944: Fix cancel recalls actions
This patch fixes the 'cancel selected recalls' button on the biblio
details Recalls page, and ensures a correct cancellation reason is
logged when cancelling a recall in transit.

To test:
1) Ensure UseRecalls is enabled and relevant recalls circulation rules
are set
2) Check out Item A to Patron B
3) Log into OPAC as Patron A
4) Search for Item A and place a recall
5) Go back to the staff interface and search for Item A. When viewing
the biblio record, go to the recalls tab.
6) Check the checkbox for your recall, and click the button to cancel
selected recalls.
7) Confirm your recall is successfully removed and you're redirected to
the correct recalls page for this biblio.
8) Go back to the OPAC and place a recall again. This time set the
pickup location to a different library, one that you're not logged in at
9) Back in the staff interface, check in Item A and confirm the recall
and transfer
10) Go to Circulation -> Recalls to pull. Your recall should show here.
Click the button to cancel the recall and revert the transfer
11) Confirm the recall has been cancelled
12) Go to Reports and create a new SQL report with the following SQL:
select * from branchtransfers b join items i on
b.itemnumber=i.itemnumber where i.barcode = <<barcode>>
13) Run the report and paste the barcode of Item A in the field
14) Confirm there are two rows returned - the transfer triggered when
the recall was confirmed, with a reason of 'Recall' and a cancellation
reason of 'RecallCancellation, and the transfer sending the item back
home when the recall was cancelled, with a reason of
'RecallCancellation'.

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>
(cherry picked from commit ccb4180339)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:21:13 +00:00
4adc6103f9 Bug 31559: Compiled CSS
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:15:48 +00:00
fec7b1efa4 Bug 31559: Staff results page doesn't always use up full available screen width
This patch adds an explicit "width: 100%" to tables which are contained
within a #searchresults <div>. The change affects staff interface
catalog search results and these other pages with the same markup:

- Advanced MARC editor search results
- Holds to pull
- Patron search results

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)

- Test the catalog search results and other affected pages to confirm
  that the tables affected take up the full width of the page.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cfb6ea48b8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:14:50 +00:00
Shi Yao Wang
080d763c48 Bug 30517: Translation breaks editing parent type circulation rule fix
Test plan:
1. Install another language in the staff interface
   1. in commandline: `cd misc/translator/; ./translate install xx-XX`
   2. Check the box of the language in the 'language' system preference
and save
   3. Refresh and you should be able to choose languages
2. Create an item type with a parent
   1. Go to Administration > Item types
   2. Create a new item type or modify an existing one, assigning a parent type (I created a 'Children's books' type and assigned 'Books' as its parent)
3. Create a circulation rule for the parent type (I created All/Books, with 10 checkouts allowed)
4. Create a circulation rule for All/All (I created All/All with 30 checkouts allowed)
5. In English, click on "Edit" next to the parent type rule (All/Books)
--> Note that the item type in the bottom row (the modifiable row) is changed to 'Books (All)'
6. Modify the number of checkouts allowed (e.g. 99)
--> The All/Books rule is modified
7. Switch the interface to the other language
8. Click on "Edit" next to the parent type rule (All/Books)
--> Note that the item type in the bottom row stays on 'All'
9. Modify the number of checkouts allowed (e.g. 88)
--> The All/All rule is modified
10. Apply the patch, translate again and refresh the page
11. Do step 8-9 again and notice it now behaves as it should

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>
(cherry picked from commit 2eccae54ee)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 16:02:18 +00:00
3088c2f56a Bug 31593: Remove Test::DBIx::Class from Context.t
No need to keep it.
Fixing a test description too.

Test plan:
Run t/db_dependent/Context.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 499562f0b8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 15:59:15 +00:00
bb776ffe10 Bug 31594: Use count of results for displaying number shown
To test:
1 - Create a report with a number of results that is not a multiple of 20
    SELECT barcode FROM items
2 - Run the report
3 - Go to the final page
4 - Note report says 20 shown, but there are less
5 - Apply patch
6 - Reload and confirm correct number of shown is shown :-)

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>
(cherry picked from commit 926568a4e2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 15:51:19 +00:00
Julian Maurice
272510faf7 Bug 31441: Fix Koha::Item::as_marc_field when kohafield = ''
marc_subfield_structure.kohafield can be NULL, but it can also be an
empty string. But in that case, Koha::Item::as_marc_field ignores them,
which means the resulting MARC::Field object has missing data.
This can produce a bug in OPAC ISBD view (and probably other places
where this method is used)

Test plan:
1. Edit the default biblio MARC framework for the item field: find or
   create a subfield that is not linked to a DB column.
   Save even if you made no changes to make sure that
   marc_subfield_structure.kohafield is set to an empty string.
   I'll use 995$Z as an example for the following steps.
2. Add the following to syspref OPACISBD:
    #995|<br>Item:|{995Z}|
3. Create a biblio with an item and put a value into 995$Z
4. Go to the ISBD detail page for this record at OPAC. Confirm that the
   value you entered in 995$Z is not visible
5. Apply patch and restart koha
6. Refresh the ISBD detail page. Confirm that the 995$Z is now visible.
7. Run `prove t/db_dependent/Koha/Item.t`

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 389b9dfaf4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 15:37:34 +00:00
6e3ff69730 Bug 31540: Exclude expired holds from the reminder job
Some libraries don't want to auto-cancel holds, but we should not remind
a patron about a hold which has expired.

To test:
1 - Place a hold for a patron
2 - Set it waiting
3 - Run the holds reminder script in the future
    perl misc/cronjobs/holds/holds_reminder.pl -day 1 --date '2023-09-12' -v
4 - Note the holds would be reminded
5 - Set expirationdate for the hold less than today
    UPDATE reserves SET expirationdate = DATE_SUB(CURDATE(), INTERVAL 1 DAY);
6 - Run the remidner cron again
7 - No holds trigger!

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>
(cherry picked from commit 4c3d18091d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 15:30:29 +00:00
3d63dd6eb7 Bug 31653: Correct event names passed to jQuery on() function
This patch replaces the obsolete .on("hover") with .on("mouseenter
mouseleave"). This will allow the code to work again following the last
jQuery upgrade.

See Bug 20217 for discussion of the original implementation:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20217#c14

To test, apply the patch and go to the staff interface. Hover your mouse
over the "Search" link in the header menu. The adjacent dropdown menu
button should have its hover state triggered.

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>
(cherry picked from commit 6a3bded6d3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 15:26:07 +00:00
Isobel Graham
7a8a5177da 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>
(cherry picked from commit 44537c58d1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 15:15:07 +00:00
0be9eccbbd Update release notes for the 22.05.07 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-23 17:05:45 +00:00
a5eadca4bd Increment version for 22.05.07 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-23 16:56:04 +00:00
Koha translators
984db3e217 Translation updates for Koha 22.05.07
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-23 13:40:24 -03:00
d30e02977f Bug 32167: [22.05.x] (bug 14860 follow-up) Populate price fields even if no discount on vendor
On bug 14860 an 'else' was removed, assuming the price fields were set before discount,
this was incorrect. This patch renames the variable and always set the price, only discounting
ecost if a discount, but setting the values even if not

To test:
 0 - Have a vendor with a discount of 0% specified (no discount)
 1 - Export a record from your Koha
 2 - Stage the record for import and match on biblionumber
 3 - Add to a basket in acq from the staged file
 4 - Select the title, and set order price to $10 and do not fill the discount field
 5 - Add the order - note $0 order line
 6 - Repeat with another vendor with a 10% discount and confirm that is correct
 7 - Apply patch
 8 - Repeat 2-4
 9 - Add the order and confirm $10 price
10 - Repeat with discounted vendor, confirm prices are set discounted correctly

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-23 16:08:56 +00:00
cb936bd2e4 Bug 31995: build_holds_queue.pl should check to see if the RealTimeHoldsQueue syspref is on [v22.05]
The real time hold queue and the build_holds_queue.pl jobs are not 100% compatible in that we should not be running the cron if the real time queue is enabled, this could lead to double server work. It would be good to have a check in build_holds_queue for the RealTimeHoldsQueue syspref and not run the job if the preference is enabled.

There might be times when we'd want to force a run of this job without changing the syspref. To that end we would also want a flag for this job so that system administrators could force the job from the command line if required, overriding this limitation.

Test Plan:
1) Apply this patch
2) Try run misc/cronjobs/holds/build_holds_queue.pl with the -h/--help and -m/--man options
3) Disable RealTimeHoldsQueue
4) Run with no options, should succeed
5) Enable RealTimeHoldsQueue
6) Run with no options, should display a message and not rebuild the
   holds queue
7) Run again with the -f/--force option, should succeed

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 31995: (QA follow-up) Add 'system preference' to help text

We often get asked where something can be found in setting,
adding the hint that RealTimeHoldsQueue is a system preference
is hopefully helpful here.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-22 20:23:28 +00:00
8149c3d8a3 Bug 31296: (QA follow-up) Fix trivial spelling errors
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d673d7efdc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-22 20:18:26 +00:00
7980baccf3 Bug 31296: (QA follow-up) Add to debian templates
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5a6bd96d4c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-22 20:18:07 +00:00
853990a52d Bug 31296: Add ability to disable demagnetizing items via SIP2 based on itemtypes
Some libraries have certain item types that can only do in house checkouts via SIP self check machines. In these cases, the items should not be demagnetized since the items cannot leave the library.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Message.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 00f489de6d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-22 20:17:47 +00:00
432fa9415d Bug 29955: Fix method import issues
This patch fixes this:

$ prove t/db_dependent/Utils/Datatables_Virtualshelves.t
t/db_dependent/Utils/Datatables_Virtualshelves.t .. 2/13 Use of inherited AUTOLOAD for non-method Koha::Virtualshelf::haspermission() is no longer allowed at /kohadevbox/koha/Koha/Virtualshelf.pm line 248.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

https://bugs.koha-community.org/show_bug.cgi?id=32080
Signed-off-by: Blou <blou@inlibro.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-10 23:49:26 +00:00
6ccb4d0fff Bug 31482: Label creator does not call barcodedecode
The label creator can accept a list of either itemnumbers or item barcodes.
In the case that the list of composed of barcodes, those barcodes should be
passed though barcodedecode before the lookup is performed.

Test Plan:
1) Apply this patch
2) Download and install the Barcode Transformer plugin
   https://github.com/bywatersolutions/koha-plugin-barcode-transformer/releases/
3) Go to the plugin configuration page, set the configuration to the example configuration from the same page
4) On the "New label batch" page of the Label creator,,
   type in some valid barcodes, but prefix them with X and postfix them with Y, e.g. X123456Y
5) Submit the form
6) Note the items are added to the label batch!

JK: Remove unnecessary if $number check, barcodedecode already does this

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7ddfa8ddd7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-10 23:43:49 +00:00
Blou
0b57ab102b Bug 32110: Fixup to db_rev for non-english, multilingual Koha
Without this patch, the update process duplicates all the news and
content entries when they were non-english to start with.

This patch keeps the same process, but new "default" "parent" entries are empty so there'
no duplication in the OPAC display, while still being editable/deletable
in the intranet.

We came through that through many iterations.  This was the least
invasive while still providing satisfying results.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 499de13006)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-10 23:32:28 +00:00
c0ac388138 Bug 31818: Enable table elements in keyboard shortcuts popover
This patch updates the whitelist for the popover to ensrue our shortcuts table displays

To test:
1 - Open the advanced cataloging editor
2 - Click 'Keyboard shortcuts'
3 - Is empty, be sad
4 - Apply patch
5 - Reload
6 - Click it again
7 - Shortcuts!

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e4079d17f3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-10 23:27:54 +00:00
78a2c22206 Bug 31465: (follow-up) Link to preference tabs directly
This patch enhances the mapping system for the help button to allow for
each tab of preferences to link directly to the relevent section of the
manual.

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>
(cherry picked from commit 6d82b66a27)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-10 23:25:07 +00:00
2efd39fbda Bug 31465: Correct help link for preferences
This patch updates the mapping to reflect the split and rename of the
preferences section of the manual.

Test plan
1) Hitting 'Help' on any tab except for 'Local use' should lead you to
   the globalpreferences section of the manual for your Koha version.
2) Hitting 'Help' on the 'Local use' tab should take you directly to the
   'localusepreferences' manual page.

NOTE: I have now updated the manual build pipeline to remove
renamed/deleted files so prior to this patch you should now see a 404
response when clicking Help from these pages.  Before I made that
change, we had the old file hanging around, so you actually got an
outdated manual page disguised as a more recent version.

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>
(cherry picked from commit 49652f570f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-10 23:24:47 +00:00
db17c3787f Bug 31234: SubfieldsToAllowForRestrictedEditing - data from drop-down menu not stored
Problem with items restricted edition, restriced fields with a drop-down
menu are not stored, since 21.11.

This comes from a change by Bug 28445 in items edition form :
  <select name="field_value"
change to :
  <select name="[% kohafield | html %]"

This breaks the special JS code :
fc919fc796/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js (L112)

I propose we use "select.input_marceditor".

Test plan :
1. A librarian with 'edit_items_restricted' permission set
2. Item subfield not authorized for editing (SubfieldsToAllowForRestrictedEditing). In Marc framework, this subfield is linked to an authorized value (= drop-down menu). For exemple homebranch.
3. When adding/editing item, this subfield has a default value from drop-down menu and is not editable (OK).
4. Save item
=> Without patch : the subfield is empty, it should have the value from drop-down menu.
=> With patch : the subfield is saved with the value from drop-down menu.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 63119a8686)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-04 20:53:52 +00:00
a13002e06e Bug 31646: Add Select2 focus to text search field
To test:
1. Edit a biblio record
2. Go to tab 9 to find the item type MARC field 942$c
3. Click on the field to select an item type
4. Notice you have to click again on the search field to begin typing to search
   for your item type
5. Apply patch/clear browser cache
6. Try steps 2-3 again, the focus should now be on the search text field
7. Try another select2 dropdown on the same page like the  942$n ( Suppress in
   OPAC ), it should also default to the text search field.
8. Try other places in Koha that feature this kind of select2, like when
   placing hold.

Note: Using $(document).on here instead of $(".select2").on becuase there are
several instances where there are more than 1 select2 dropdown on a single page.
This allows for the text search field to default each time you click on a
different dropdown.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f439537b20)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-02 14:37:39 +00:00
31ac74eb0c 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>
(cherry picked from commit 74a1ea73f3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-01 22:26:17 +00:00
7ded1e3f8f 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>
(cherry picked from commit 2e0871fa1b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-01 22:22:02 +00:00
Lari Taskula
8fead08ced Bug 31565: [22.05.x] Fix datatables searching escape for exact search
To test:
1. Add a new patron category with categorycode 'TEST_CAT'
2. Add a patron to category 'TEST_CAT'
3. Go to Patrons search view
4. Under "Search for patron" filters, filter by category you created at step 1
5. Click Search
6. Observe no results
7. Apply this patch and reload
8. Repeat 3-5
9. Observe expected result

Double check tests from Bug 30393 still work as expected:

10. Go to the cities page
11. Add two cities:
   - 'Cordoba %'
   - 'Buenos Aires _'
   - 'London \'
12. Use the column search on the name, alternating _, \ and % as the query
=> SUCCESS: Filtering works correctly!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Bug 31565: Escape datatables MySQL special characters only in LIKE queries

Escaping \ yields no results when performing exact search in datatables.
This patch adds MySQL special character escaping only to LIKE searches.

To test:
1. Add following categorycode 'TEST\CAT' by SQL
insert into categories (categorycode,description) values ('TEST\\CAT', 'TEST\\CAT');
2. Add a patron into TEST\CAT category
3. Go to patron search
4. Limit search by category TEST\CAT
5. Observe no results
6. Apply patch
7. Refresh patron search page
8. Limit search by category TEST\CAT
9. Observe Koha redirecting you to patron you chose in step 2

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Bug 31565: (QA follow-up) Remove support for _ as wildcard in -like queries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-01 22:16:29 +00:00
f1571f44c7 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>
(cherry picked from commit 432f058a72)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-01 22:05:27 +00:00