Commit Graph

44590 Commits

Author SHA1 Message Date
Martin Renvoize bdaefd6745 Bug 26689: Prepend letter codes.
This patch prepends the credit_type_code and debit_type_code with
CREDIT_ and DEBIT_ respectively when doing a lookup on the notice letter
code.

Test plan
1) As previous patches, however instead of just naming your notice to
   match the credit_type_code or debit_type_code use
   CREDIT_credit_type_code and DEBIT_debit_type_code respectively.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 87aa05f9de)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6d9fd8160a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:48:14 +02:00
Martin Renvoize e4f6538094 Bug 26689: Check for specific template then fallback - printinvoice
This patch adds a check for a more specific ACCOUNT_DEBIT template
(named to match the debit_type_code of the credit line) prior to
falling back to the ACCOUNT_DEBIT template.

Test plan
1/ On a patrons account page use the print option on a series of debit
lines with differing credit types (Overdue, Payout)
2/ Note that the same template 'ACCOUNT_DEBIT' is used for all types
3/ Apply the patch
4/ Run step 1 again and note all still print using ACCOUNT_DEBIT
5/ Add a new notice template under the 'circulation' module with a code
that matches one of your account debit types (OVERDUE, PAYOUT)
6/ Run step 1 again and note that where you have added a specific notice
for that debit type it has been used.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 021ca321ee)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:48:14 +02:00
Martin Renvoize 8463b63d9b Bug 26689: Check for specific template then fallback - printfeercpt
This patch adds a check for a more specific ACCOUNT_CREDIT template
(named to match the credit_type_code of the credit line) prior to
falling back to the ACCOUNT_CREDIT template.

Test plan
1/ On a patrons account page use the print option on a series of credit
lines with differing credit types (Payment, Lost Item Return, Writeoff)
2/ Note that the same template 'ACCOUNT_CREDIT' is used for all types
3/ Apply the patch
4/ Run step 1 again and note all still print using ACCOUNT_CREDIT
5/ Add a new notice template under the 'circulation' module with a code
that matches one of your account credit types (PAYMENT, WRITEOFF,
LOST_FOUND)
6/ Run step 1 again and note that where you have added a specific notice
for that credit type it has been used.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 32091958c7)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:48:14 +02:00
Martin Renvoize 23ba5b0de0 Bug 31121: Fix date formatting in cashup summary modal
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c12d037da2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a75cacaf34)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:47:10 +02:00
Lucas Gass 0b3e608f41 Bug 31204: Clearly indicate edit buttons are for record modification
To test:
1. Apply patch
2. Do a search and select some records
3. On the toolbar (#selection_ops) open the Edit dropdown.
4. The labels should read 'Batch edit records' and 'Batch delete records'.

Note: To see both you must have batchmod and batchdelete permission.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7ce420ed82)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eeaeb57f25)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:45:36 +02:00
Martin Renvoize 440829305e Bug 30838: (QA follow-up) Add unit tests
Two tests added, one in t/db_dependent/Circulation.t to catch the
initial setting of to_address at enqueue time and a second in
t/db_dependent/Letters.t to catch the correcting at send time.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 467b444c7e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 899898400f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:43:53 +02:00
Kyle Hall 1b1931c93f Bug 30838: (QA follow-up) Add missing semicolon
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 008e6ae9eb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3805235e45)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:43:53 +02:00
Martin Renvoize bcc36081f4 Bug 30838: Set to_address to smsalertnumber at send
It may be helpful to know exactly what number was used for the sms alert
that was sent. As such, we should ensure it's set at the time of
sending.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 625b354f8a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:43:53 +02:00
Martin Renvoize 6fe74607d1 Bug 30838: Don't fallback through phone numbers for sms
This patch removes the fallback handling for smsalartnumber as the
to_address in notices. We ignore the to_address field in the message
queue at send time for sms anyway and use smsalertnumber exclusively so
having this field populated is just confusing to the end user

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5e388ed509)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 20b17b5167)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:43:53 +02:00
Arthur Suzuki 594b300bc2 Bug 31086: DBIC
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-14 11:36:33 +02:00
Tomas Cohen Arazi 26d6c99b3f Bug 31086: (QA follow-up) Use plain SQL in db_rev
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit efd2dfdaae)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f72d4a85a0)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:59:21 +02:00
Nick Clemens 74684039b6 Bug 31086: Notify of problematic holds during upgrade
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0704102bc8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 097969ac4d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:59:21 +02:00
Martin Renvoize 3683037c3b Bug 31086: (QA follow-up) Improve atomicupdate to be more resilient
We now populate the branchcode field with the first available branch on
the system if we find it to be NULL before we set the NOT NULL

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5fa510b431)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 13a3b0be9c)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:59:21 +02:00
Martin Renvoize d780879565 Bug 31086: (QA follow-up) Add unit tests
This patch adds the unit tests for the change to Koha::Hold::store.

We test for and catch the exception introduced for both the create and
update cases.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit bc95ffa3e3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:59:19 +02:00
Martin Renvoize 503b67cbdd Bug 31086: (QA follow-up) Fix failing tests
This test was missed first time around, branchcode needed adding to all
the calls to AddReserve.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 51f33cbc20)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:55:05 +02:00
Martin Renvoize e416ab92fe Bug 31086: (QA follow-up) Remove DEFAULT from column
There's no need to have a default here, and in fact it doesn't make
sense.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4db94b43c8)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:54:15 +02:00
Nick Clemens 9fb796376d Bug 31086: Update existing unit tests
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 bf2a9b5279)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 20226a8082)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:52:25 +02:00
Nick Clemens 3141773457 Bug 31086: Prevent placing hold with no pickup location
To test:
1 - Apply patch
2 - Repeat test on previous patch
3 - You should get a warning popup when attempting to save hold
4 - Reload page
5 - Inspect the HTML and manualy set #pickup value of selected option to ""
6 - Attempt to save hold
7 - You get the popup
8 - Place a hold normally (with location) and verify it works

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 e609e20c04)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 56f452c173)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:52:25 +02:00
Nick Clemens 67513c6562 Bug 31086: Throw an exception when a hold is stored with no branchcode
To test:
1 - Apply first 2 patches
2 - On staff client, find a biblio, place hold, select a patron
3 - Before creating hold, right click on 'Pickup location'
4 - Inspect the element
5 - In the console find the top <li> for pickup, and right click
6 - Select 'Delete node'
7 - Save hold
8 - You get an exception/error

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 e7d886d388)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e03b542a18)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:52:25 +02:00
Frédéric Demians 084c14787f Bug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData)
Test plan:

(A) Reproduce the bug:

A1 In Administration > System preferences > Web services:
   - Enable OAI-PMH
   - Enable OAI-PMH:AutoUpdateSets
   - Enable OAI-PMH:AutoUpdateSetsEmbedItemData

A2 In Tools > Export data > Export bibliographic records, export 1 (one)
   biblio record. Be sure that this biblio record has at least one item.
   Don't tick "Don't export items".

A3 Delete the exported biblio record, and its items.

A4 In command line, on the server load the exported file:
   ./bulkmarcimport.pl -b -v -file /path/to/koha.mrc

A5 Retrieve the biblio record in Koha. Note the absence of the item(s). This is
   the bug.

(B) Apply the patch

B1 Delete the record (without item) loaded at A4.

B2 In command line, on the server load the exported file:
   ./bulkmarcimport.pl -b -v -file /path/to/koha.mrc

B2 Retrieve the biblio record in Koha. Note the presence of the item(s).

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 d5e65dd4c0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 06b48f16e4)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:50:06 +02:00
Jonathan Druart 6ac8f34e99 Bug 31138: Don't ignore DataTables errors and raise them to the end-user
DataTables is not raising error to the end user, it's only displaying a generic message in the console.
This leads to lot of questions on IRC or the mailing list ("the table is empty").
We can do better and display what went wrong.

We could also imagine add a link to the wiki for the more common problems (won't be implemented here however).

Test plan:
Revert "Bug 31104: Put each link on a separate header" and search for a
patron using a very long string
You should get an alert with the reponse of the server.
In my case:
"""
Something went wrong when loading the table.
414: Request-URI Too Long
"""

You can also make the REST API returns a 500 (bad specs or simply with a
die statement).

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

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7a5d048b51)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:49:13 +02:00
Nick Clemens c2c6967f71 Bug 31213: Auto search simple term quoted
This patch does a second search if the first had no results and was a simple single term search

We simply quote the term, rebuild the query, and rerun the search

This targets both Zebra and ES, but is more relevant for ES

To test:
0 - Have Koha running using ES
1 - Add titles your system "Ivy + Bean" "The 6:20 Man"
2 - Search for these titles without quotes - NO results under ES
3 - Search with quotes - you find them
4 - Apply patch, restart all
5 - Search again without quotes
6 - Success!
7 - Confirm search still works under Zebra

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2ce5f0532c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e1500c7c6b)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:48:49 +02:00
Kyle Hall eff7bb8df3 Bug 30458: Include librarian (manager_id) in accountline when using "Payout amount" button
When using the "Payout amount" button, accountlines.manager_id is not
populated. This is not the case with the "Issue payout" buttons.

Test Plan:
1) Create a manual credit
2) Issue a payout using the "Payout amount" button
3) Inspect the payout accountline, note it has no manager_id
4) Apply this patch, restart all the things!
5) Repeat steps 1 and 2
6) Note the new payout accountline has a manager_id!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
JK: Fix commit title

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0177b88eb3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 73f7c89ba6)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 13:48:21 +02:00
Nick Clemens 6a29b7afa1 Bug 30471: Correct display of default rules
To test:
1 - Browse to 'Administration->Circulation and fines rules'
2 - Make sure you are editing 'Standard rules for all libraries'
3 - Set 'Lost item fee refund on return policy' to 'Refund lost item charge and charge new overdue fine'
4 - Swtich to edit rules for a specific library, click on the dropdown for 'Lost item fee refund on return policy' and note default says 'Use default (Refund lost item charge and restore overdue fine)'
5 - Switch default/all libraries rule to 'Refund lost item charge and restore overdue fine'
6 - On specific branch note the default option is now 'Use default (Refund lost item charge and charge new overdue fine)'
7 - Apply patch and repeat, note the default descriptions now display correctly

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 417d8df61b)

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c92a1cf501)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 11:59:03 +02:00
Kyle Hall 6a26ee39ec Bug 31202: Don't remove optional SIP fields with a value of "0"
If the value of a SIP field is "0", that evaluates to false, so any calls to maybe_add with a value of "0" will not get added to the SIP response message.

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

Signed-off-by: Michal Urban <michalurban177@gmail.com>
JK: Adjust commit title

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8b957a69d4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5775f6c9a9)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 10:38:08 +02:00
Jonathan Druart 028ac8d39f Bug 31201: Prevent Pseudonymization.t to fail
It's failing if selenium/patrons_search.t failed before, they are using
the same code and the selenium tests didn't clean correctly

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7d2086663e)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-09-12 10:37:02 +02:00
Janusz Kaczmarek a42512dbf3 Bug 30658: (bug 29496 follow-up) CheckMandatorySubfields don't work properly with select field in serials-edit.tt for Supplemental issue
CheckMandatorySubfields use the class "input_marceditor" but in file
serials-edit.tt this class is not set for select input in Supplemental
issue form. In consequence if a select field is set as mandatory, it is
detected as missing even if it is filed and so you can't submit the form
and receive the new supplemantal issue.

Test plan:
1- Create (or find) a subscription for a biblio record and select the
   option "Create an item record when receiving this serial"
2- Be sure to have at least one mandatory subfield that is filed with a
   select input in the framework used by the biblio record. (ex: 952$a,
   952$b or 952$c).
3- From the subscription-detail page click on "Receive"
4- In the lower part--Supplemental issue--fill the suppelemant details,
   change the status to "Arrived" and fill the item form that appears.
5- Click on "Save"
6- Check that an error box appear with the message " Form not submitted
   because of the following problem(s) 1 mandatory fields empty
   (highlighted)" (the number can be different according to the number of
   concerned subfields)
7- Apply the patch
8- Repeat step 3 to 5
9- Check that no error appear and that your item has been created

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4f6164d194)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e40a76bd78)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:55:23 +02:00
Marcel de Rooy 13982926c7 Bug 31186: Fix the hidingrules test for result numbering
We should not test the $hidingrules variable but the number
of keys it contains.

Test plan:
Clear OpacHiddenItems.
Check with and without this patch search result numbering on
the OPAC.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b8f34e1acc)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:54:48 +02:00
Katrin Fischer 6c47479066 Bug 27045: (follow-up) Fix delimiter in header rows
The header rows still showed \t because the newly defined
variable wasn't used there.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2eea061ca3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ed114537d3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:54:19 +02:00
Jonathan Druart cdfecb6fb7 Bug 27045: Fix other exports using CSV profiles
This patch corrects the export of the 2 other reports
using CSV profiles:

* Late issues (serials)
* Basket (acquisitions)

To test:
1) Late issues
* Update the late issues sample report to use tab as separator
* Create a subscription
* Go to serial collection and 'generate next' to get some late issues
* Go to Claims
* Export the late issues and verify format is correct
* Verify exported file has tabs

2) Basket summary
* Create an order with several order lines
* Create an SQL type CSV profile for basket export using tab as separator
  Example: aqorders.quantity|aqordres.listprice|Title=biblio.title
* Export the basket using your configured CSV profile
* Verify exported file has tabs

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7cd84171ab)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9af01ea2e3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:54:14 +02:00
Jonathan Druart becbc5bec1 Bug 27045: Fix items lost report export if delimiter is tab
When choosing tabulation as the delimiter for a CSV profile
for the lost item report, the tabs appear in the file as \t
instead of as proper tabs.

title\tauthor\tstocknumber\tcallnumber
"E Street shuffle :"\"Heylin, Clinton."\\

To test:
* Upate the existing sample lost item CSV profile to use tabs as
  separator
* Make sure you have some lost items in your database or create some
* Go to Reports > Lost items
* Run the report
* Check all or some of the checkboxes in the result list
* Export using the link on top and the CSV profile
* Verify the tabs are not exported correctly
* Apply patch
* Verify tabs now are proper tabs instead of \t

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 983965ee47)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4db8368fd5)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:54:06 +02:00
Julian Maurice 0c2f6c9f43 Bug 30268: Check mandatory fields in addorderiso2709.pl
Test plan:
1. Make sure you have mandatory item subfields in the MARC bibliographic
   framework used in acquisitions ("ACQ" if it exists, the default framework
   otherwise).
2. Use the "Stage MARC records for import" tool to upload a file. Do not import
   the bibliographic records.
3. Create a new acquisition basket ("Create items when:" must be set to
   "placing an order") and add a new order from a staged file
4. Select the file you just uploaded
5. In the "Items information" tab, make sure at least one mandatory subfield is
   empty
6. Try to submit the form. If there are errors about other mandatory fields
   (like the fund for instance), fix those errors and resubmit. There should be
   an error message about mandatory item subfields.
7. Enter a value for the mandatory item subfields and resubmit the form. Verify
   that the order and the item have been correctly created.

Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e37359cae9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7faeaf4aef)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:52:04 +02:00
Nick Clemens cf35f971c4 Bug 7660: Use first available categorycode when none passed in
The code that populates the patron messaging preferences on initial form load
expects to have a category selected. Currently we only have one if one was
passed to the form. When creating an account from a parent, we don't have a
category explicitly selected - so we can just select the first of the possible
categories

To test:
 1 - In KTD set 'Juvenile' category to have some messaging preferences
 2 - Find a patron, say Edna Acosta, and 'Add guarantee'
 3 - In new form preferences are blank, cancel
 4 - Apply patch, restart all
 5 - Go to Edna, click 'Add guarantee'
 6 - Preferences are populated!
 7 - Cancel
 8 - Go to 'Patrons' module
 9 - Click "+ New patron"
10 - Confirm messaging preferences load correctly when not adding child

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1256907319)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:49:52 +02:00
Fridolin Somers 7b86721280 Bug 31020: Fix PassItemMarcToXSLT in system preferences description
Bug 28373 added system preference PassItemMarcToXSLT is referenced is all XSLT system preferences.
But it only applies on results pages.
The only use in perl code is in C4::Search :
 > $marcrecord->delete_fields( @fields ) unless C4::Context->preference('PassItemMarcToXSLT');

I've tested by adding in all XSLT files :
  <strong>ITEMS <xsl:value-of select="count(marc:datafield[@tag=952])"/> </strong>
Number of items only appears in OPAC and staff interface results pages.

In fact only search pages get MARC record from search engine, in which items datas have been embedded for indexing.
In other pages MARC record does not embed items datas.

This patch adds "MARC21 952, UNIMARC 995" to be explicit we talk about
MARC datas not item tags build in XML recieved by XSLT.

Test plan :
1) Apply patch
2) Search for PassItemMarcToXSLT in system preferencies
3) Look at description of PassItemMarcToXSLT
4) Check PassItemMarcToXSLT only apprears in OPACXSLTResultsDisplay and XSLTResultsDisplay

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f6dbad91c4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f70fd04521)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:16:25 +02:00
Shi Yao Wang 6bd8547c92 Bug 30935: Holds to pull shows wrong first patron
When different patrons have item level holds on the same item, Holds to
pull shows wrong first patron.

Test plan:
1) Place a record-level hold on a biblio with an available item
2) Check the Holds to pull page (circ/pendingreserves.pl)
--> The biblio should appear in the list and the patron should appear in the 'First patron' column
3) Place a second record-level hold on the same biblio
4) Go back to the Holds to pull page
--> The biblio is still there, but the patron in the 'First patron' column is the second patron
5) Place a third record-level hold on the same biblio
6) Go back to the Holds to pull page
--> The biblio is still there, but the patron in the 'First patron' column is the third patron
7) Apply the patch
8) Go back to the Holds to pull page
--> The biblio is still there and the patron in the 'First patron' column is the first patron

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 87b985528e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c1cc0c0737)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:11:36 +02:00
Fridolin Somers b2b132b9af Bug 27683: Impact on catalogue/detail.pl
Since EasyAnalyticalRecords pref is now in GetAnalyticsCount, remove
test in catalogue/detail.pl.

Test plan :
1) Build an item and a linked analytical record with 773$0 and $9
2) Go to record detail page
3) Enable EasyAnalyticalRecords
4) You see analytics tab and analytical count on item
5) Disable EasyAnalyticalRecords
6) You dont see analytics tab

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 cc23a4c478)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e9daeb70a2)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:10:43 +02:00
Fridolin Somers b91d31c02e Bug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref
C4::Items::GetAnalyticsCount is part of the easy analytics feature.
Like Bug 20702 make early return when the system preference EasyAnalyticalRecords is disabled.
Actually it may block an item deletion for wrong reason.

Test plan :
1) Dont apply patch
2) Build an item and a linked analytical record with 773$0 and $9
3) Enable EasyAnalyticalRecords
4) Try to delete the item
5) You have an alert because linked to analytics
6) Disable EasyAnalyticalRecords
7) Try to delete the item
8) You have an alert because linked to analytics
9) Apply patch
10) Try to delete the item
11) No alert, it works :D

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 dfc390940d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 28b5880d71)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:10:37 +02:00
Fridolin Somers a989b49ec9 Bug 27683: Unit test for GetAnalyticsCount
Run prove t/db_dependent/Items/GetAnalyticsCount.t

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 fd7652255c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 555efbd447)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:10:30 +02:00
Michal Urban 79719d61f5 Bug 30447: Unit tests
Added tests to ensure that Koha::Holds->get_items_that_can_fill returns items with datecancelled and datearrived
Added test for correct number of items for each call of "get_items_that_fill"

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2dfd3b05e7)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:08:36 +02:00
Nick Clemens caea8b048d Bug 30447: Check if transfers arrived or cancelled
TO test:
 1 - Find a bib with a single item
 2 - Browse to Circulation->Transfer
 3 - Transfer the item to another branch
 4 - Check the item in at current branch and cancel the transfer on the dialog
 5 - Place a hold on the biblio for a patron at current branch
 6 - Browse to Circulation->Holds to pull
 7 - Item does not show
 8 - Apply patch, restart all
 9 - Browse to Circulation->Holds to pull
10 - Item shows

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 206ba015c4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 3f7363f6ca)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:06:47 +02:00
Shi Yao Wang 049481bfbf Bug 29922: (follow-up) Remove extra sort
Remove wrong sort in staff advanced search page

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

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 15918c3370)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c41dba3eba)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:03:40 +02:00
Shi Yao Wang b30ad9a54e Bug 29922: Make get_search_groups return results sorted by title
get_search_groups from Koha/Library/Groups.pm returns library groups sorted by title.

Test plan:
1- Go to administration > library groups and create multiple library groups with different names (e.g. AGroup, BGroup, ÄGroup, etc.). Make sure to tick "Use for OPAC search groups" checkbox.
2- Go to advanced search in OPAC.
3- Under "Groups of librairies" , click the select button.
4- Notice that the library groups are not in alphabetical order.
5- Apply the patch.
6- Notice that the library groups are in alphabetical order.
7- Run `prove t/db_dependent/LibraryGroups.t` and all test should pass.

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

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

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 73d5fd08f5)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:02:30 +02:00
Martin Renvoize 24c692589f Bug 31163: Sort cashups newest to oldest
The cashup history table was sorting from oldest to newest.. it's
perferable to show the most recent at the top by default.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9739eb738d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:01:02 +02:00
Andrii Veremeienko 19ff6014d2 Bug 29114: Trim whitespace before the barcode
The solution was to add regexp that trims all whitespaces.

How to test:
1. Go to the koha/virtualshelves/shelves.pl;
2. Add new list or edit existing one;
3. Start adding new items;
4. In the "Barcode" field add barcode(s) with whitespaces before them;
5. Observe that it wasn't added as the barcode isn't recognized because of whitespaces;
6. Apply the patch;
7. Repeat step 4;
8. Observe that the item was successfully added;

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 c4ee39bf3a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1e54d08e64)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 15:00:27 +02:00
Katrin Fischer 7a5f92c410 Bug 27667: (QA follow-up) Fix singular index and rephrase heading
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 325d783419)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 65292aaa86)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 14:59:36 +02:00
Fridolin Somers cf74b01068 Bug 27667: Display a warning for records missing in Elasticsearch
On "About Koha" page are displayed the numbers of indexed biblios and authorities with ES.
It could be great if we could have comparison with the number of records in the database to display the number of missing records.
In the "System information" tab with the other "Data problems".

If Searchengine has any issue (index count will be -1), we do not
display missing records.

Test plan :
1) Use Elasticsearch searchengine
2) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
3) Go to "About Koha" page and look at System information tab
=> you see no warning
4) On a biblio record delete the MARCXML in biblio_metadata.metadata
5) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
6) Go to "About Koha" page and look at System information tab
=> you see warning : 1 record(s) missing on a total of 435 in indice koha_kohadev_biblios.
7) On a authority record delete the MARCXML in auth_header.marcxml
8) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
9) Go to "About Koha" page and look at System information tab
=> you see warning : 1 record(s) missing on a total of 1705 in indice koha_kohadev_authorities.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 21ff480612)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 14:59:04 +02:00
Lucas Gass aabb010ec1 Bug 20439: Sort SMS providers in alphabetical order by DB field
To test:
1/ Add 'Email' to the 'SMSSendDriver' system preference.
2/ Make sure 'EnhancedMessagingPreferencesOPAC' and 'EnhancedMessagingPreferences' are turned on.
3/ Add some SMS providers (/cgi-bin/koha/admin/sms_providers.pl) with different names.
4/ Notice on memberentry.pl and opac-messaging.pl the SMS providers sort by when they were added, not alphabetically.
5/ Apply patch and restart services.
6/ Look at memberentry.pl and opac-messaging.pl and notice that they SMS providers now sort alphabetically.

Signed-off-by: George Williams <george@nekls.org
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd49601079)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 35b8967b84)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 14:57:15 +02:00
Nick Clemens dbeefd1f2a Bug 31144: When modifying an order we should not load the vendor default discount
After placing an order in a basket with a discount of "0" if you attempt to modify we will load the vendor default discount, this can lead to accidentally applying a discount when modifying other order parts

To test:
0 - Have a vendor with a discount set
1 - Add an order to a basket
2 - While adding, set discount to 0
3 - Add order - prices are calculated ocrrectly
4 - Modify order
5 - Note discount is populated with vendor discount
6 - Cancel
7 - Apply patch
8 - Modify order
9 - Discount remains at 0
10 - Repeat with a vendor with no discount set
11 - Placing order not specifiying discount it remains blank
12 - Modifying order discount remains blank
13 - Modify order and set discount
14 - Confirm it is retained on modifcation

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 73d2066837)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f92f6a315d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 14:52:33 +02:00
Martin Renvoize 731c9dd7c9 Bug 29105: Add effective_itemtype handling to items api
This patch adds effective_item_type_id to the items api.

We overload the to_api method to append the effective_item_type_id field
with that of the effective itemtype code.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dc75b5d5cd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f00a28b576)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 14:47:57 +02:00
Martin Renvoize ce4f785d32 Bug 29105: Unit test
This patch adds a unit test for the addition of effective_item_type_id
to the items responses.

Test plan
1) Run the unit test prior to applying the second patch and confirm it
   fails
2) Apply the second patch and confirm the unit test now passes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6ca908816f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5974ff87c7)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2022-08-26 14:47:49 +02:00