koha.git
23 months agoTranslation updates for Koha 22.05.00
Koha translators [Thu, 26 May 2022 08:11:24 +0000 (05:11 -0300)]
Translation updates for Koha 22.05.00

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoAdd release notes for Koha 22.05.00
Fridolin Somers [Thu, 26 May 2022 07:37:13 +0000 (21:37 -1000)]
Add release notes for Koha 22.05.00

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30808: Add the 22.05 release team.
Martin Renvoize [Thu, 19 May 2022 12:40:56 +0000 (13:40 +0100)]
Bug 30808: Add the 22.05 release team.

Test plan
1/ Check against
   https://wiki.koha-community.org/wiki/Release_Teams

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months ago22.05.00: Update kohastructure.sql
Fridolin Somers [Thu, 26 May 2022 03:00:48 +0000 (17:00 -1000)]
22.05.00: Update kohastructure.sql

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months ago22.05.00: Update mailmap
Fridolin Somers [Thu, 26 May 2022 02:13:29 +0000 (16:13 -1000)]
22.05.00: Update mailmap

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months ago22.05.00: Update history.txt
Fridolin Somers [Thu, 26 May 2022 02:03:32 +0000 (16:03 -1000)]
22.05.00: Update history.txt

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months ago22.05.00: Update contributors.yaml
Fridolin Somers [Thu, 26 May 2022 02:01:56 +0000 (16:01 -1000)]
22.05.00: Update contributors.yaml

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoAdd Jeremy Breuillard to mailmap
Fridolin Somers [Thu, 26 May 2022 01:53:46 +0000 (15:53 -1000)]
Add Jeremy Breuillard to mailmap

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoAdd Thibaud Guillot to mailmap
Fridolin Somers [Thu, 26 May 2022 01:48:09 +0000 (15:48 -1000)]
Add Thibaud Guillot to mailmap

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30852: DBRev 21.12.00.057
Fridolin Somers [Thu, 26 May 2022 06:35:04 +0000 (20:35 -1000)]
Bug 30852: DBRev 21.12.00.057

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30852: Add index on article_requests.debit_id
Fridolin Somers [Thu, 26 May 2022 06:32:35 +0000 (20:32 -1000)]
Bug 30852: Add index on article_requests.debit_id

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30747: (follup-up) Add missing otherholdings_datelastborrowed column in settings
Fridolin Somers [Mon, 23 May 2022 18:40:51 +0000 (08:40 -1000)]
Bug 30747: (follup-up) Add missing otherholdings_datelastborrowed column in settings

See Bug 24176

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30747: Make column settings work for otherholdings table using forEach loop
Lucas Gass [Wed, 18 May 2022 14:12:11 +0000 (14:12 +0000)]
Bug 30747: Make column settings work for otherholdings table using forEach loop

To test:

1. Turn on SeparateHoldings and find a record that has some items at
   different home libraries.
2. Look at the Other holdings(x) tab. Notice there is no Columns tool
   (gear icon).
3. Go to Table Settings, try hiding columns from the otherholdings
   table. You cannot.
4. Apply patch.
5. Now under the Other holdings(x) tab you should see the Columns
   button, it should work.
6. Go back to Table settings and try hiding columns, it should work.
7. Now try uploading an item level cover image, make sure all columns
   are still properly hidden and the Columns tool works
8. Try steps 6 & 7 but with the regular holdings table. Confirm that all
   colums can properly hide.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Included a rename to table_name(s).
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30730: (follow-up) Simplify query
Martin Renvoize [Thu, 19 May 2022 14:52:21 +0000 (15:52 +0100)]
Bug 30730: (follow-up) Simplify query

This patch drops the 'fetch all non-loanable items' query used in the
subsequent query as part of the 'not_in' and instead replaces it with a
simple filter on 'notforloan => 0'

Test plan
Run the included unit tests before and apply applying the followup.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30730: Unit tests
Shi Yao Wang [Tue, 17 May 2022 15:37:21 +0000 (11:37 -0400)]
Bug 30730: Unit tests

Added an entry in holds for an item with negative notforloan value to
test if get_items_that_can_fill returns the right items.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30730: Holds to Pull should not list items with a notforloan status
Shi Yao Wang [Tue, 17 May 2022 15:08:06 +0000 (11:08 -0400)]
Bug 30730: Holds to Pull should not list items with a notforloan status

Remove items with a notforloan value other than 0 because items that are
potentially holdable (with negative notforloan status) are not wanted in holds to pull.

Test plan:
1- Have a bib with 2 items, both holdable. Give one of these items a notforloan status with a negative value (like Ordered in the testing docker data).
2- Place a title-level hold on your bib
3- Confirm your bib is showing on Holds to Pull as expected, prompting staff to pull the item that does not have a not for loan status (correct!)
4- Take the item that does not have a not for loan status and check it out to a different patron, make sure not to fill or cancel your hold
5- Reload Holds to Pull, see your title is still listed and now Koha is directing staff to the item with a notforloan status
6- Apply the patch
7- Reload Holds to Pull, see your title with a notforloan status is gone
8- Run `prove t/db_dependent/Koha/Holds.t` and all tests should pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30735: Fix filtering by patron attribute with AV in overdues report
Fridolin Somers [Wed, 11 May 2022 20:51:20 +0000 (10:51 -1000)]
Bug 30735: Fix filtering by patron attribute with AV in overdues report

In Circulation > Overdues, if there are seachable patron attributes
they can be used in left filters. Search does not work if this attribute
is linked to an authorized values category.

The problem is that AV code is compared to the AV desciption in :
  if (grep { $attrval eq lc($_->[1]) } @{ $pattrs->{$code} }) {

Looking at a Data::Dumper of the var $pattrs you see for example :
$VAR1 = {
          'ATT1' => [
                      [
                        'afr',
                        'Afrikaans'
                      ]
                    ]
        };
First row is attribute code and second row is desciption.
It works for an attribute without AV because in this case
'avdescription' is undefined so code is stored as description :
          push @{ $pattrs->{$row->{attrcode}} }, [
            $row->{attrval},
            defined $row->{avdescription} ? $row->{avdescription} : $row->{attrval},
        ];

This patch fixes the code and removes commented line.
Also reviews the SQL query :
  - avcategory is useless
  - use alias attrcode for borrower_attributes.code to be more explicit

Test plan :
1) Create a patron A with overdues
2) Go to Circulation > Overdues
3) Check you see the patron A
4) Create a patron attribute, searchable, with an authorized value
   category, ie LANG
5) Edit patron A to set a value in this attribute
6) Go to Circulation > Overdues
7) Select attribute value and apply filter
8) Check you see the patron A
9) Redo test plan with a patron attribute, searchable, without an
   authorized value category

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30797: (follow-up) Hide default Flatpickr clear-field button
Owen Leonard [Wed, 18 May 2022 12:27:02 +0000 (12:27 +0000)]
Bug 30797: (follow-up) Hide default Flatpickr clear-field button

The basic MARC editor has its own button associated with each subfield
for emptying the contents of the input. Since the Flatpickr "X" icon
causes a layout problem and would be redundant, we can hide it on this page.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30797: Add the calendar.inc include to addbiblio.tt
Alex Buckley [Wed, 18 May 2022 04:07:06 +0000 (04:07 +0000)]
Bug 30797: Add the calendar.inc include to addbiblio.tt

addbiblio.tt throws the '$(...).flatpickr is not a function' because it
is missing includes to flatpickr.min.js and shortcut-buttons-flatpickr.min.js

To fix this the addbiblio.tt should include the calendar.inc file (like
additem.tt does) which includes to those aforementioned JS files.

Test plan:
1. Edit a MARC bibliographic framework
2. Make the 902$d subfield visible in the Editor
3. Also set the 902$d subfield plugin='dateaccessioned.pl'
4. Catalogue a new biblio record
5. Notice the 902$d subfield has not been pre-populated with todays date
6. Right click, choose 'Inspect', observe this JS error in the console: "Uncaught
TypeError: $(...).flatpickr is not a function"
7. Apply patch, and restart services
8. Repeat steps 4-6 and this time observe the 902$d is pre-populated,
and there is no flatpickr JS error in the console

Sponsored-by: Chartered Accountants Australia and New Zealand
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30009: Do not set MARCNOTES to empty list in list context
Nick Clemens [Fri, 18 Mar 2022 15:03:30 +0000 (15:03 +0000)]
Bug 30009: Do not set MARCNOTES to empty list in list context

AMENDED:
We should not pass an empty list here, but just undef in order to
prevent creating a shift of elements in the hash.

To test:
1 - Find or create an invalid marc record
2 - View in staff client
3 - Note tab Descriptions(1) has no content
4 - Apply patch, reload
5 - No empty tab

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30714: Do no log update to holdingbranch
Nick Clemens [Fri, 6 May 2022 20:32:32 +0000 (20:32 +0000)]
Bug 30714: Do no log update to holdingbranch

When an item from another branch is checked in, the holdingbranch is
updated, and this change is logged.  We record the checkin in
statistics, we do not need the cataloguing update logged

To recreate:
1 - Enable cataloguing log
2 - Check in an item with a different holding branch
3 - Check the action logs
4 - There is a cataloguing log for the holdingbranch update
5 - Apply patch
6 - Repeate with another item
7 - No log added!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30714: Unit test
Nick Clemens [Fri, 6 May 2022 20:32:12 +0000 (20:32 +0000)]
Bug 30714: Unit test

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30776: import missing subroutine to fix import_webservice_batch.pl
Joonas Kylmälä [Mon, 16 May 2022 18:56:05 +0000 (18:56 +0000)]
Bug 30776: import missing subroutine to fix import_webservice_batch.pl

Test plan:
 1) Apply patch and notice the following error is gone:
    $ perl misc/cronjobs/import_webservice_batch.pl
    Undefined subroutine &main::GetStagedWebserviceBatches called at misc/cronjobs/import_webservice_batch.pl line 46.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30640: Focus does not always move to correct search header form field
Owen Leonard [Thu, 28 Apr 2022 11:37:31 +0000 (11:37 +0000)]
Bug 30640: Focus does not always move to correct search header form field

This patch updates the staff interface's global JavaScript to
accommodate changes in the way focus is being handled after the jQuery
upgrade (see: https://github.com/jquery/jquery/issues/4950).

The "focus" class is removed from search header include files so that
there isn't a contradiction between which form field has the focus class
and which form field is displayed in the active tab.

To test, apply the patch and view various pages in the staff interface.

- On pages where focus is not being directed to a form field within the
  main content of the page, the form field in the active search header
  tab should have focus on page load:

  - Patron details
  - System preferences
  - Cities and towns

  Also test pages where a tab other than the first one is preselected:

  - Bibliographic details page
  - Patron lists

  On these pages, focus should move to the active tab's form field when
  you switch tabs.

- On pages where focus is being sent to another form field, it should
  work correctly:

  - Patrons home page
  - Check in
  - Acquisitions home page

Signed-off-by: Séverine Queune <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30695: (follow-up) Fix selenium test
Martin Renvoize [Tue, 17 May 2022 07:22:37 +0000 (08:22 +0100)]
Bug 30695: (follow-up) Fix selenium test

The tab title words were re-ordered and we forgot to update the
corresponding selenium test.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
23 months agoBug 30720: Batch action links in result list missing permission checks
Katrin Fischer [Fri, 13 May 2022 10:25:27 +0000 (10:25 +0000)]
Bug 30720: Batch action links in result list missing permission checks

In the staff interface you can select records for merging, batch editing,
and batch deleting from the result list. This fixes the code to check for
the specific batch edit records and batch delete records permissions, so
those actions are only shown if the user has the right permissions.
As there is no merge record permission yet, it's assumed that edit_cataloge is
needed as before (no change in behavior).

To test:
- Create a staff user with only catalogue and editcatalogue permissions.
- Do a search in the catalog of the staff interface
- Select a few records from result list to unlock the Edit button on top
- Verify it shows all three options: edit, delete and merge
- Apply patch
- Verfiy now only merging is shown
- Add the records_batchdel and records_batchmod permissions from the tools
  area one after another and verify the display changes accordingly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30701: Make Upload Tool buttons work on mobile-size screen
Aleisha Amohia [Fri, 6 May 2022 03:33:59 +0000 (03:33 +0000)]
Bug 30701: Make Upload Tool buttons work on mobile-size screen

When the Upload tool is accessed on a smaller (mobile) screen (less than
768 pixels wide), the Upload and Browse buttons cannot be clicked. This
patch fixes that.

To test:
1) Go to Tools -> Upload
2) Make the screen narrower, either by opening your browser's Inspector
tool and using Responsive Design Mode, or by dragging in the edge of the
window to make it narrower.
3) Notice that when the screen becomes narrower than 768px, the sections
squash together and the padding between them is lost. Try to click on
the Browse and Upload buttons, notice you cannot.
4) Apply patch and refresh the Upload Tool
5) Ensure the screen is narrower than 768px. Confirm there is now
padding between the sections, and the buttons are clickable again.

Sponsored-by: Chartered Accountants Australia and New Zealand
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 30740: Link to authorities 'used in' should not use equal
Fridolin Somers [Thu, 12 May 2022 07:23:58 +0000 (21:23 -1000)]
Bug 30740: Link to authorities 'used in' should not use equal

When showing an authority, there is a link to search biblio records it is used in.
Actually this link uses 'q=an=$auth_id', this is wrong for an URL, and other places use 'idx:value'.
It does not break search with Zebra nor Elasticsearch but it is better to use ':'

Test plan :
Check changed links return same results with and without patch

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 29719: Do not clear onloan value when not passed in MARC
Nick Clemens [Fri, 14 Jan 2022 19:59:30 +0000 (19:59 +0000)]
Bug 29719: Do not clear onloan value when not passed in MARC

We blank the field to prevent users from setting it during import, but this has the
affect of blanking it in the DB.
This patch replaces the onloan field when not passed in to 'ModItemFromMARC' to preserve
the value

To test:
 1 - Check an item out to a paron
 2 - Export the item using Tools->Export data
 3 - Stage the record for import
 4 - Match on 999c and replace items
 5 - Import the batch
 6 - View the record and note item is checked out and Available
 7 - In the DB note the onloan value is now null
 8 - Check in the item
 9 - Apply patch
10 - Repeat 1-5
11 - View the record and note item is checked out
12 - In the DB note the onloan value matches the due date

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
23 months agoBug 29719: Unit tests
Nick Clemens [Fri, 14 Jan 2022 19:59:07 +0000 (19:59 +0000)]
Bug 29719: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30207: Allow any reserveforothers subpermission to access the page
Kyle Hall [Tue, 10 May 2022 10:56:15 +0000 (06:56 -0400)]
Bug 30207: Allow any reserveforothers subpermission to access the page

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30207: Librarians with only "place_holds" permission can no longer update hold...
Kyle Hall [Tue, 1 Mar 2022 16:49:49 +0000 (11:49 -0500)]
Bug 30207: Librarians with only "place_holds" permission can no longer update hold pickup locations

Bug 29540 increased the flags required to for modreserve.pl, but in doing so created a situation where a library can select a different pickup location for a hold, but upon clicking the "Update hold(s)" button, will be logged out due to having insufficient permissions for modreserve.pl.

Test Plan:
1) Create a librarian with "place_holds" permissions, but not "modify_holds_priority".
2) Place a hold for a patron
3) Attempt to change the pickup location from request.pl
4) Note you get logged out with a permissions error
5) Apply this patch
6) Restart all the things!
7) Attempt to change the pickup location from request.pl
8) This time it should succeed!

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30666: Holds reminder cronjob (holds_reminder.pl) uses DataTime::subtract wrong
Kyle M Hall [Tue, 3 May 2022 10:29:49 +0000 (06:29 -0400)]
Bug 30666: Holds reminder cronjob (holds_reminder.pl) uses DataTime::subtract wrong

In holds_reminder.pl, the script loops over all available branchcodes. For each iteration of the loop, if not using the calendar, the script subtracts the days parameter from the current date to get the waiting date threshold. The problem is that this method alters the DateTime object in $date_to_run, so for each iteration of the loop, the waiting date becomes farther and farther in the past, when it should always be the same!

The solution is to either clone the "date to run" for each call to subtract, or to move it out of the loop since it doesn't need to be recalculated each time.

Test Plan:
1) Become the koha user using koha-shell
2) Run DBIC_TRACE=1 misc/cronjobs/holds/holds_reminder.pl --days 7
3) Note in the queries that for each loop, the waiting date is different
4) Apply this patch
5) Run the command in step 2 again
6) Note the queries all now have the same waiting date threshold!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30667: Holds reminder cronjob (holds_reminder.pl) never uses default letter template
Kyle Hall [Tue, 3 May 2022 10:53:43 +0000 (06:53 -0400)]
Bug 30667: Holds reminder cronjob (holds_reminder.pl) never uses default letter template

Bug 28514 changed the way holds_reminder.pl searches for templates, using a direct search for letters,
but should be using find_effective_template instead. Now, if a branch specific template does not exist,
it will skip that branch.

Test Plan:
1) Ensure you only have the default HOLD_REMINDER template
2) Become the koha user using koha-shell
3) Run misc/cronjobs/holds/holds_reminder.pl --days 7 -v
4) Note that the script skips every branch
5) Apply this patch
6) Run the command in step 3 again
7) Note the script doesn't skip over any branches

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30422: Authorities editor update broke the feature added by Bug 20154
Owen Leonard [Thu, 31 Mar 2022 15:51:14 +0000 (15:51 +0000)]
Bug 30422: Authorities editor update broke the feature added by Bug 20154

This patch corrects JavaScript in authorities templates so that
clicking "Edit" on the authority detail page will take you to the
authority edit page while keeping the same tab open.

This patch also corrects the JavaScript which should have been
automatically moving the cursor focus to the first form field when
switching tabs in the editor.

This patch also adds the "Section" headings which are present in the
basic cataloging editor but were not added here at the time of the
page's tabs revision.

To test, apply the patch and locate an authority record in your catalog.

- Without changing tabs, choose "Edit record" from the "Edit" dropdown
  menu."
- The authorities editor should load and display the "Section 0" tab.
- Return to the authority detail page and select a tab besides tab 0.
- Click back to tab 0. Editing the record at this point should open the
  editor to Section 0.
- Return to the authority detail page.
- Click any of the numbered tabs besides tab 0.
- Choose "Edit record" from the "Edit" dropdown menu.
- When the authorities edit page loads the same tab should be
  preselected.
- Test that when you switch tabs in the authority editor the cursor
  focus is automatically moved to the first visible input.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30139: Same fix for the other javascript moneyFormat function
Shi Yao Wang [Fri, 13 May 2022 14:18:22 +0000 (10:18 -0400)]
Bug 30139: Same fix for the other javascript moneyFormat function

This patch makes javascript moneyFormat function in paycollect.tt consistent
with the one in pay.tt

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30139: Fix javascript moneyFormat to be compatible with FR format
Shi Yao Wang [Tue, 10 May 2022 17:34:15 +0000 (13:34 -0400)]
Bug 30139: Fix javascript moneyFormat to be compatible with FR format

New way of formatting money amount to make it work with FR format

Test plan:
1- Set CurrencyFormat pref to FR
2- Activate Point of sale and cash register features
3- Add cash register
4- Add debit type that 'can be sold' with a price of 10.00
5- Go to point of sale, click on the item to purchase
6- Verify the Amount to be paid shows the wrong amount and can't be fixed on the interface
7- Apply the patch
8- Refresh the page and do step 5 again
9- Notice it now shows the right amount

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30717: (QA follow-up) Move to module
Marcel de Rooy [Fri, 13 May 2022 07:29:04 +0000 (07:29 +0000)]
Bug 30717: (QA follow-up) Move to module

We will probably use this a bit more :)
Let's put it in a module (with a trivial test).

Test plan:
Repeat item edit.
Run  t/DateUtils.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30717: Format dates when editing items
Jonathan Druart [Mon, 9 May 2022 08:28:51 +0000 (10:28 +0200)]
Bug 30717: Format dates when editing items

This is a result of bug 29369 and bug 27526.
Bug 29369 removed the format of the dates, and bug 27526 assumed that it
was the correct behaviour.

Here we don't want to let the controller know which fields is a date, or
we will have to access the subfield structure to know which subfields
have the "date cataloguing plugin".

This patch suggests to use the altFormat options from flatpickr that
will "Show the user a readable date (as per altFormat), but return
something totally different to the server."

It's actually an option we want to use for all our dates, that will
reduce a lot the overhead in our controllers.

Test plan:
Edit items (additem.pl and in batch) and confirm that the subfields
using the dateaccessioned plugin are displayed according to the
dateformat syspref. Make sure the date is stored correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30721: Markup error in detail page's component parts tab
Owen Leonard [Mon, 9 May 2022 15:22:16 +0000 (15:22 +0000)]
Bug 30721: Markup error in detail page's component parts tab

This patch adds a missing </div> to the bibliographic detail
page template in the section for showing component parts.
Some comments are added to clarify the markup structure.

To test you should have a record in your catalog with component
parts. Bug 11175 provides one you can import if necessary:
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78023

To see the error, go to the staff interface, locate the record
in question and view the detail page. Under the Components tag,
scroll to the bottom. You will see content from "later" tabs at
the bottom, e.g. "There is no order for this bibliographic record"
or "No images have been uploaded for this bibliograhpic record yet."

Apply the patch and reload the page. The tabs should still look
correct, and now the tab content should be correctly isolated.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30728: (QA follow-up) Fix missing comma
Nick Clemens [Fri, 13 May 2022 11:48:00 +0000 (11:48 +0000)]
Bug 30728: (QA follow-up) Fix missing comma

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30520: Allow BatchImport to be used by command line tools.
Andreas Jonsson [Wed, 13 Apr 2022 07:20:42 +0000 (09:20 +0200)]
Bug 30520: Allow BatchImport to be used by command line tools.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30689: Incorrect Babeltheque setting can cause console warning
Owen Leonard [Thu, 5 May 2022 11:13:08 +0000 (11:13 +0000)]
Bug 30689: Incorrect Babeltheque setting can cause console warning

This patch adds an additional system preference check to the part of the
OPAC bibliographic detail template which conditionally loads Babelthèque
JavaScript. The script tag should not be output if there is no
Babeltheque_url_js setting to use.

To test, apply the patch and search for "Babeltheque" in system
preferences.

 - Set "Babeltheque" to "Do" include information.
 - Enter a path in the "Babeltheque_url_js" preference, e.g.
   "https://www.example.com/example.js" It doesn't have to be a valid
   Babeltheque URL.
 - In the OPAC, view the bibliographic detail page for any title. If you
   used a dummy URL for the js preference you should see an error in the
   console about the file not being found. This confirms that the
   template logic is working. If you used a working Babeltheque URL then
   the corresponding content should load.
 - Return to system preferences and remove the URL from the
   "Babeltheque_url_js" preference.
 - Return to the bibliographic detail page in the OPAC and confirm that
   there is no warning in the console about "'src' attribute of <script>
   element is empty."

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30728: Fix typo 'in real time'
Fridolin Somers [Fri, 13 May 2022 08:07:56 +0000 (22:07 -1000)]
Bug 30728: Fix typo 'in real time'

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30728: BDRev 21.12.00.056
Fridolin Somers [Fri, 13 May 2022 07:58:25 +0000 (21:58 -1000)]
Bug 30728: BDRev 21.12.00.056

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30728: Make RealTimeHoldsQueue disabled by default
Tomas Cohen Arazi [Tue, 10 May 2022 17:26:30 +0000 (14:26 -0300)]
Bug 30728: Make RealTimeHoldsQueue disabled by default

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30728: Only trigger real-time holds queue update if enabled
Tomas Cohen Arazi [Tue, 10 May 2022 17:18:55 +0000 (14:18 -0300)]
Bug 30728: Only trigger real-time holds queue update if enabled

This patch makes the places in which Koha enqueues holds queue for
real time updates verify the feature is enabled.

To test:
1. Apply this patches up to the unit tests
2. Run:
   $ updatedatabase
   $ kshell
  k$ git diff origin/master --name-only | grep -e '\.t$' | xargs prove
=> FAIL: tests fail, the code doesn't care about the syspref
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Be happy!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30728: Add unit tests
Tomas Cohen Arazi [Tue, 10 May 2022 17:17:37 +0000 (14:17 -0300)]
Bug 30728: Add unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30728: Add RealTimeHoldsQueue syspref
Tomas Cohen Arazi [Tue, 10 May 2022 17:17:17 +0000 (14:17 -0300)]
Bug 30728: Add RealTimeHoldsQueue syspref

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30727: Avoid holds queue updates multiple times on BatchDeleteBiblio
Tomas Cohen Arazi [Tue, 10 May 2022 15:27:02 +0000 (12:27 -0300)]
Bug 30727: Avoid holds queue updates multiple times on BatchDeleteBiblio

This patch makes the background job only enqueue holds queue updates
once per biblio, when appropriate.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t
=> FAIL: It enqueues 3 times for a bib!
3. Apply this patch
4. Repeat 2
=> SUCCESS: It only enqueues once!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30727: Regression tests
Tomas Cohen Arazi [Tue, 10 May 2022 15:26:32 +0000 (12:26 -0300)]
Bug 30727: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30734: Fix BackgroundJob.t
Marcel de Rooy [Thu, 12 May 2022 08:38:15 +0000 (08:38 +0000)]
Bug 30734: Fix BackgroundJob.t

Added test for empty string or undefined. We could still consider
evaling the json operations.

Test plan:
Run t/db_dependent/Koha/BackgroundJob.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27619: (QA follow-up) Remove xt/sample_notices.t
Martin Renvoize [Wed, 11 May 2022 10:27:41 +0000 (11:27 +0100)]
Bug 27619: (QA follow-up) Remove xt/sample_notices.t

Now that we've remove the last of the translated .sql files, we can just
drop this test entirely.. translation is now handled on pootle for all
languages.   Woopie! :)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30695: (QA follow-up) Catch moremember.tt too
Martin Renvoize [Fri, 6 May 2022 11:19:36 +0000 (12:19 +0100)]
Bug 30695: (QA follow-up) Catch moremember.tt too

This patch does the same treatment for moremember.tt where the same
summary block is includes. We also correct the tab order to be a little
more consistent too.

We should really move this to an include and refer to it from both
templates instead of this copy/paste code..

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30695: Display tabs more consistently in patron details
Tomas Cohen Arazi [Thu, 5 May 2022 15:03:35 +0000 (12:03 -0300)]
Bug 30695: Display tabs more consistently in patron details

This patch makes tab texts display 'Thing (count)' as opossed to the
current mix we have.

To test, check before after the patch how it looks.

You need to:
- Enable ArticleRequests
- Set ClaimReturnedLostValue to 1 (for example)
- Have some clubs set

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30127: By default show pending suggestions tab
Fridolin Somers [Sat, 30 Apr 2022 02:46:24 +0000 (16:46 -1000)]
Bug 30127: By default show pending suggestions tab

Pending suggestions are the most important ones in links pointing to suggestions.
This tab should be the default one, like did Bug 7875

Changing order in perl code seems really difficult because it is a
generic code using GetDistinctValues()

Test plan :
1) Create some suggetions, accept some of them
2) In staff interface, click on 'More > Suggestions'
=> You see pending tab selected
3) In left menu, click on 'Suggestions' under 'Late orders'
=> You see pending tab selected
4) In left menu, use a filter, then click on '[clear]'
=> You see pending tab selected
5) Create a suggestion, click on 'cancel'
=> You see pending tab selected
6) Create a suggestion, click on 'Suggestions' in breadcrumbs
=> You see pending tab selected
7) Edit an existing suggestion, click on '<< Back to suggestions'
=> You see pending tab selected
8) Create a suggestion, click on 'Submit your suggestion'
=> You see pending tab selected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30603: Fix other occurrences
Jonathan Druart [Mon, 9 May 2022 07:42:30 +0000 (09:42 +0200)]
Bug 30603: Fix other occurrences

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30603: Display Sort1 and Sort2 as free text if no AV exists
Jonathan Druart [Mon, 9 May 2022 07:28:04 +0000 (09:28 +0200)]
Bug 30603: Display Sort1 and Sort2 as free text if no AV exists

Test plan:
Don't define AV for Sort1 and Sort2, edit a patron
=> Should be editable via an input box

Define AVs for Sort1 and Sort2, edit a patron
=> Should see the dropdown

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30710: (QA follow-up) Add POD
Tomas Cohen Arazi [Tue, 10 May 2022 14:16:59 +0000 (11:16 -0300)]
Bug 30710: (QA follow-up) Add POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30710: Build holds queue once per biblio when batch deleting items
Nick Clemens [Fri, 6 May 2022 14:45:13 +0000 (14:45 +0000)]
Bug 30710: Build holds queue once per biblio when batch deleting items

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30710: Regression tests
Tomas Cohen Arazi [Tue, 10 May 2022 14:43:46 +0000 (11:43 -0300)]
Bug 30710: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 13142: DBRev 21.12.00.055
Fridolin Somers [Wed, 11 May 2022 06:39:42 +0000 (20:39 -1000)]
Bug 13142: DBRev 21.12.00.055

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 13142: (QA follow-up) Convert database update to current format
Katrin Fischer [Thu, 28 Apr 2022 14:01:52 +0000 (14:01 +0000)]
Bug 13142: (QA follow-up) Convert database update to current format

https://bugs.koha-community.org/show_bug.cgi?id=13412
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 13412: (QA follow-up) Rephrase and link system preference descriptions
Katrin Fischer [Thu, 28 Apr 2022 13:28:13 +0000 (15:28 +0200)]
Bug 13412: (QA follow-up) Rephrase and link system preference descriptions

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 13412: (QA follow-up) Fix alphabetic order in sysprefs.sql
Katrin Fischer [Thu, 28 Apr 2022 13:09:09 +0000 (15:09 +0200)]
Bug 13412: (QA follow-up) Fix alphabetic order in sysprefs.sql

TaxRates was not moved when renamed from gist, just moving it down
so things are tidy again.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 13412: Allow configuration of auto-created authorities
Roch D'Amour [Wed, 21 Feb 2018 15:55:35 +0000 (10:55 -0500)]
Bug 13412: Allow configuration of auto-created authorities

This patch add 2 new system preferences:
- GenerateAuthorityField667
- GenerateAuthorityField670

When Koha creates authority records from biblios, use these preferences instead of the hard-coded "Machine generated authority record." and "Work cat." values.

Test plan:
    1. Make sure AutoCreateAuthorities and BiblioAddsAuthorities are enabled in the system preferences
    2. Go to Home › Cataloging › Add MARC record and add a new record
    3. Fill in the required fields and add a name in the 100$a field. Note the name, and add the new record.
    4. run rebuild_zebra.pl -a
    5. Go to Home › Authorities and search for the name you entered in 100$a
    6. Select details and look at the 667 and 670 fields. They should default to the hard-coded values.
    7. Apply patch, run update database
    8. Edit the new GenerateAuthorityField667 and GenerateAuthorityField670 system preferences
    9. Do 2-6 . Now the 667 and 670 fields should be what you entered in the system preferences.

Thanks for testing

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works well, no errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30511: Don't lock up entire database while running koha-dump
Alex Buckley [Fri, 8 Apr 2022 08:10:04 +0000 (08:10 +0000)]
Bug 30511: Don't lock up entire database while running koha-dump

Test plan:
1. Apply the patch
2. Restart services
3. Run koha-dump
4. Confirm the .sql.gz and .tar.gz files are generated successfully

Sponsored-by: Catalyst IT
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27619: Remove fr-FR installer data
Jonathan Druart [Thu, 28 Apr 2022 10:04:11 +0000 (12:04 +0200)]
Bug 27619: Remove fr-FR installer data

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 27619: Add custom for fr-FR
Jonathan Druart [Fri, 4 Jun 2021 09:56:18 +0000 (11:56 +0200)]
Bug 27619: Add custom for fr-FR

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 20615: Add the link of number of times the authority are used in edit mode
George Veranis [Thu, 24 Feb 2022 15:16:19 +0000 (16:16 +0100)]
Bug 20615: Add the link of number of times the authority are used in edit mode

Currently when show an authority record you can see the count of records linked
with that authority, but when edit that authority record the that detail is
dissapeared.
Applying this patch will have that information also on edit mode of authority.

Test plan:
1) Search for an authority that is already connected with at least one record
2) On detail view of an authority you can check that authority is linked with
   x records.
3) Edit that authority and the information about in how many records that
   authority is linked is missing.
4) Apply this patch
5) Edit again that authrity and you can find now the count in how many records
   is used that authority

Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30510: Add Patron reason column to suggestion tables
Lucas Gass [Mon, 11 Apr 2022 21:36:16 +0000 (21:36 +0000)]
Bug 30510: Add Patron reason column to suggestion tables

To test:
1. Make some patron reasons for suggestion via Home > Administration > Authorized values > OPAC_SUG
2. Give those reasons a description.
3. Make several suggestions via staff client and/or OPAC and apply some of the reasons you just made
4. Apply patch
5. Go to Home > Acquistions > Suggestions management
6. Give some of the suggestions some different status (PENDING/REJECTED/ACCEPTED/ect)
7. Make sure on each of the tables you can see the column 'Patron reason'
8. Go to Administration > Table settings and attempt to hide the column.
9. Confirm that the column is properly hidden on the Suggestions management page

Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 23352: DBRev 21.12.00.054
Fridolin Somers [Wed, 11 May 2022 01:02:12 +0000 (15:02 -1000)]
Bug 23352: DBRev 21.12.00.054

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 23352: Update DBIC schema
Alex Buckley [Mon, 13 Dec 2021 16:02:12 +0000 (16:02 +0000)]
Bug 23352: Update DBIC schema

Sponsored-By: Brimbank Library, Australia
Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 23352: (follow-up) Fix QA test failure
Alex Buckley [Mon, 4 Apr 2022 04:22:39 +0000 (04:22 +0000)]
Bug 23352: (follow-up) Fix QA test failure

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 23352: (follow-up) Fixes for QA review
Alex Buckley [Mon, 7 Mar 2022 04:37:12 +0000 (04:37 +0000)]
Bug 23352: (follow-up) Fixes for QA review

Test plan:
1. Confirm that
installer/data/mysql/atomicupdate/bug_23352-add_ccode_column_to_subscriptions_table.pl
has the exec flag

2. Create a subscription. Notice the 'Collection' dropdown defaults to
the 'None' option - same as Location

3. Save the subscription without changing the 'None' collection

4. Receive the serial and confirm the 'Collection' field is empty

5. Create a second subscription. Change the 'Collection' dropdown to
'Fiction', then save the subscription

6. Receive the serial and confirm the 'Collection' dropdown is set to
'Fiction'

7. Confirm that the 'Collection code' terminology in the template is replaced with
'Collection'

Sponsored-By: Brimbank Library, Australia
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 23352: Set default collection code when creating subscription
Alex Buckley [Mon, 13 Dec 2021 15:28:36 +0000 (15:28 +0000)]
Bug 23352: Set default collection code when creating subscription

The default collection code set in the subscription will be applied if
item records are created when receiving the serial.

Test plan:
1. Apply 3 patches
2. Run updatedatabase.pl and restart services
3. Create a subscription:
- Tick the 'Create an item record when receiving this serial' radio
button
- Select values in the Location, Collection code and Item type dropdowns
- Save the subscription
4. Confirm the Location, and Collection code default values
you choose in #3 are displaying in the 'Information' tab of page that's
loaded
5. Receive the serial:
- Click 'Receive'
- Change the status dropdown from 'Expected' to 'Arrived'
- Confirm the 'Collection Code', 'Shelving location' and 'Koha item
type' dropdowns are pre-filled with the values you defined in #3
6. Run unit test t/db_dependent/Serials.t

Sponsored-By: Brimbank Library, Australia
Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 23352: Database changes
Alex Buckley [Mon, 13 Dec 2021 13:56:38 +0000 (13:56 +0000)]
Bug 23352: Database changes

Sponsored-By: Brimbank Library, Australia
Signed-off-by: Samu Heiskanen <samu.heiskanen@hypernova.fi>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28082: Compiled CSS
Fridolin Somers [Wed, 11 May 2022 00:54:51 +0000 (14:54 -1000)]
Bug 28082: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28082: Add acquisitions toolbar to vendors on vendor search page
Owen Leonard [Mon, 21 Mar 2022 16:00:47 +0000 (16:00 +0000)]
Bug 28082: Add acquisitions toolbar to vendors on vendor search page

This patch makes a number of changes to the vendor search/view template
in order to make it work better in different contexts:

- Add a vendor-specific toolbar under each vendor search result. This
  gives instant access to the options for a new basket, new contract,
  vendor edit, or to receive shipments. A delete button will appear if
  available.
- Add a summary of the number of baskets and subscriptions. This helps
  the user know if there are closed baskets and whether an outstanding
  subscription might be blocking the option to delete. Each number is
  linked to the view of those entries.
- Indicate whether a vendor is inactive. The vendor name appears in a
  different color when it is inactve and is labeled as such.

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

- To test you should have multiple vendors in your system, some active
  and some inactive. Add some baskets and subscriptions to one or more
  if necessary.
- Go to Acquisitions and submit an empty vendor search to show all
  vendors.
- Verify that the page looks correct and that all controls work as
  expected.
- Open the basket view for a single vendor and compare the two views.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30438: Add select all/clear all buttons to invoices.tt
Lucas Gass [Fri, 15 Apr 2022 14:00:01 +0000 (14:00 +0000)]
Bug 30438: Add select all/clear all buttons to invoices.tt

To test:
1. Apply patch
2. Have a bunch of invoices, some open and some closed.
3. Go to Home > Acquisitions > Invoices and do a search that will
   return you many of those invoices, some open and some closed.
4. Notice the 'Select all' and 'Clear all' buttons.
5. Try clicking 'Select all' on the Open invoices tab. All Open invoices
   should become checked.
6. Try clicking 'Clear all' on the Open invoices tab. All open invoices
   should become unchecked.
7. Try 5 - 6 again but on the Closed invoices tab.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30611: DBRev 21.12.00.053
Fridolin Somers [Wed, 11 May 2022 00:49:27 +0000 (14:49 -1000)]
Bug 30611: DBRev 21.12.00.053

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30611: (follow-up) Use constants
Martin Renvoize [Fri, 6 May 2022 10:45:22 +0000 (11:45 +0100)]
Bug 30611: (follow-up) Use constants

Update ternary for token timeout to use perl constants

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30611: (QA follow-up) Only show reset option for allowed categories
Martin Renvoize [Fri, 6 May 2022 10:36:15 +0000 (11:36 +0100)]
Bug 30611: (QA follow-up) Only show reset option for allowed categories

This patch adds a check that the patron can reach the password reset
page using category.effective_reset_password which handles fallback to
OpacResetPassword system preference transparently.

Test plan
1) Set at least one patron category to dissallow patron password resets
2) Search for a patron of that category
3) Confirm the 'Send password reset' option no longer appears

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30611: Add ability for staff to send password reset emails
Martin Renvoize [Fri, 29 Apr 2022 09:42:57 +0000 (10:42 +0100)]
Bug 30611: Add ability for staff to send password reset emails

This patch adds the ability for staff with the edit_borrowers permission
to send password reset emails to users.

The staff initiated password reset has it's own notice,
STAFF_PASSWORD_RESET, and the reset link produced has an extended
timeout of 5 days, as apposed to the usual 2 day limit.

Test plan
1) Apply patch and run the database update
2) Login to the staff client with a user who has the 'edit_borrowers'
   permission.
3) Note that a new, 'Send password reset' option appears under the
   'More' menu on the patron details page.
4) Clicking the button will queue the STAFF_PASSWORD_RESET notice and
   redirect the user to the Notices tab.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30611: Add STAFF_PASSWORD_RESET notice
Martin Renvoize [Fri, 29 Apr 2022 11:14:38 +0000 (12:14 +0100)]
Bug 30611: Add STAFF_PASSWORD_RESET notice

This patch adds a new STAFF_PASSWORD_RESET notice template for password
recoveries initiated via the staff client as aposed for those initiated
by the end user.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Chmod 755 on atomic update file.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30290: DBRev 21.12.00.052
Fridolin Somers [Wed, 11 May 2022 00:46:04 +0000 (14:46 -1000)]
Bug 30290: DBRev 21.12.00.052

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30290: (QA follow-up) Sample notices/database update: Change phrasing to Yes/No
Katrin Fischer [Mon, 25 Apr 2022 10:30:36 +0000 (10:30 +0000)]
Bug 30290: (QA follow-up) Sample notices/database update: Change phrasing to Yes/No

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30290: (follow-up) Add warning for translated notices
Marcel de Rooy [Mon, 14 Mar 2022 13:01:22 +0000 (13:01 +0000)]
Bug 30290: (follow-up) Add warning for translated notices

Note: Problem is that we cannot know if default was translated
or en contains the original notice. Actually this holds for
the other languages too. So this is an educated guess without
using the lang field.

Test plan:
Run db rev.
Trigger the warning by replacing Pages by PPages in an AR notice.
Run db rev again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30290: Database revision for existing notices
Marcel de Rooy [Mon, 14 Mar 2022 11:54:33 +0000 (11:54 +0000)]
Bug 30290: Database revision for existing notices

Note: It will be hard to update translated notices. If we cannot find
the part 'Pages:' then the replace does not do anything.

Test plan:
Run db rev.
Check an existing AR notice (English).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30290: Adjust sample_notices.yml
Marcel de Rooy [Mon, 14 Mar 2022 11:37:11 +0000 (11:37 +0000)]
Bug 30290: Adjust sample_notices.yml

Test plan:
Run a new install. Check the AR notices.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30722: Typo in overdue recalls template
Owen Leonard [Mon, 9 May 2022 15:42:44 +0000 (15:42 +0000)]
Bug 30722: Typo in overdue recalls template

This patch corrects a typo in the <title> tag of the
overdue recalls template:

"Circulaion" corrected to "Circulation."

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30706: Fix space in check for dateformat preference
Owen Leonard [Fri, 6 May 2022 13:31:31 +0000 (13:31 +0000)]
Bug 30706: Fix space in check for dateformat preference

This patch fixes the calendar.inc includes in both staff and OPAC in
order to remove a typo: An extra space in the check for the "dateformat"
system preference.

The result of this error is that changes to the dateformat system
preference will not be correctly applied to Koha without a restart.

To reproduce the problem start the process of creating a new patron.

 - In the date of birth field, select a date. The format of the date
   inserted should match your current dateformat system preference.
 - Go to Administration -> System preferences and update dateformat to
   something different.
 - Go back to the patron creation form (refresh it if necessary).
 - The hint under the Date of birth field will match your updated system
   preference, but when you pick a date using the calendar widget it
   will still be formatted according to the old value of dateformat.

To test the fix, apply the patch and run through the same steps above.
A change the dateformat preference should be immediately reflected in
the functionality of the calendar widget.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30668: Do not record itme location updates in cataloguing log
Nick Clemens [Fri, 6 May 2022 20:10:54 +0000 (20:10 +0000)]
Bug 30668: Do not record itme location updates in cataloguing log

To test:
1 - Set a rule in UpdateItemLocationOnCheckin
2 - Enable cataloguing log
3 - Check in an item that will trigger a change
4 - Check the modification log for item - there is a cataloguing entry
5 - Apply patch
6 - Repeat
7 - No log!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30668: Unit tests
Nick Clemens [Fri, 6 May 2022 20:09:27 +0000 (20:09 +0000)]
Bug 30668: Unit tests

Simple test to cover UpdateNOtForLoanStatusOnCheckin and UpdateItemLocationOnCheckin
to confirm the cataloguing log does not record these

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29755: (follow-up) Mock NoIssuesChargeGuarantorsWithGuarantees in test
Nick Clemens [Thu, 28 Apr 2022 11:07:17 +0000 (11:07 +0000)]
Bug 29755: (follow-up) Mock NoIssuesChargeGuarantorsWithGuarantees in test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29755: Check each NoIssuesCharge separately
Nick Clemens [Thu, 10 Feb 2022 14:30:02 +0000 (14:30 +0000)]
Bug 29755: Check each NoIssuesCharge separately

This patch updates SIP patron code to use account methods to calculate balances
over the patronflags returns. It also checks if patron should be blocked for each
'No Issues charge' preference

Tests are added for NoIssuesChargeGuarantees

To test:
 1 - Set noissuescharge preference to 5
 2 - Add a $10 charge to a patron
 3 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m patron_information --patron BARCODE
 4 - Note the 64 message starts with Y's that mean patron is blocked
 5 - Set noissuescharge to 11
 6 - Repeat 3, patron is no longer blocked
 7 - Set NoIssuesChargeGuarantees to 8
 8 - Repeat 3, patron is blocked
 9 - Pay $3 on patron so they owe 7
10 - Repeat 3, patron is not blocked
11 - Add a child account with patron as guarantor
12 - Repeat 3, patron is not blocked
13 - Add a $4 charge to child
14 - Repeat 3, patron is blocked
15 - Repeat 3, but with child barcode, child is not blocked
16 - Set NoIssuesChargeGuarantorsWithGuarantees to 10
17 - Repeat 3, patron is blocked
18 - Repeat 3 with child barcode, child is blocked

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30604: Add value builders for UNIMARC 146 ($a, $h and $i)
Julian Maurice [Tue, 18 Jan 2022 13:36:34 +0000 (14:36 +0100)]
Bug 30604: Add value builders for UNIMARC 146 ($a, $h and $i)

Test plan:
1. Configure the default MARC framework to use those value builders:
   - unimarc_field_146a for 146$a
   - unimarc_field_146h for 146$h
   - unimarc_field_146i for 146$i
2. Verify that they all work correctly according to
https://www.ifla.org/files/assets/uca/unimarc_updates/BIBLIOGRAPHIC/u-b_146.pdf

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30703: Remove a few CookieManager warnings
Marcel de Rooy [Fri, 6 May 2022 07:24:07 +0000 (07:24 +0000)]
Bug 30703: Remove a few CookieManager warnings

Running Auth.t produces several warnings like:
Use of uninitialized value $name in hash element at /usr/share/koha/Koha/CookieManager.pm line 103.
Use of uninitialized value $name in hash element at /usr/share/koha/Koha/CookieManager.pm line 104.
Use of uninitialized value $name in hash element at /usr/share/koha/Koha/CookieManager.pm line 112.
Use of uninitialized value $name in hash element at /usr/share/koha/Koha/CookieManager.pm line 103.
Use of uninitialized value $name in hash element at /usr/share/koha/Koha/CookieManager.pm line 104.
Use of uninitialized value $name in hash element at /usr/share/koha/Koha/CookieManager.pm line 112.
Use of uninitialized value $name in hash element at /usr/share/koha/Koha/CookieManager.pm line 103.
Use of uninitialized value $name in hash element at /usr/share/koha/Koha/CookieManager.pm line 104.
Use of uninitialized value $name in hash element at /usr/share/koha/Koha/CookieManager.pm line 112.

Test plan:
prove  t/CookieManager.t t/db_dependent/Auth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30702: Fix Context.pm L785 warning on sessionID
Marcel de Rooy [Fri, 6 May 2022 07:09:34 +0000 (07:09 +0000)]
Bug 30702: Fix Context.pm L785 warning on sessionID

Trivial fix. Before working on bug 29954.

Test plan:
Run a few tests like t/Context.t, t/db_dependent/Auth.t and
t/db_dependent/Circulation.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30638: Resolve odd number in hash warn in Letters
Marcel de Rooy [Thu, 28 Apr 2022 10:04:02 +0000 (10:04 +0000)]
Bug 30638: Resolve odd number in hash warn in Letters

Odd number of elements in anonymous hash at C4/Letters.pm line 827.

Trivial fix. Adding undefined check on result to prevent warns
on that one.

No test plan. Read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>