Commit graph

1047 commits

Author SHA1 Message Date
Joonas Kylmälä
70239b355c Bug 28139: Simplify logic for handling found holds in returns.pl
We are handling in this if-else block 3 cases:
 - Hold found and waiting
 - Hold found but not waiting AND whether HoldsAutoFill is enabled
 - Hold found but not waiting AND whether HoldsAutoFill disabled

If we simply first handle hold found = Waiting case first then we
don't have to individually list all those other found cases and that
simplifies this code a lot.

To test:
 1. Apply patch
 2. Make sure HoldsAutoFill is disabled
 3. Make item-level hold on branch A
 4. Check-in the item at branch A and you should get pop-up confirming
    the hold, ignore it
 5. Set HoldsAutoFill is enabled
 4. Check-in the item again and you now the hold should have been
    automatically filled

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-16 12:28:17 +02:00
Joonas Kylmälä
49da7cd462 Bug 28139: Handle Processing status with HoldsAutoFill pref turned on
To test:
 1: Turn on HoldsAutoFill setting
 2: Place a item-level hold on item X at Branch A
 3: Make the hold to Processing state:
 $ koha-mysql kohadev
 > select * from reserves; # look up the reserve_id
 > UPDATE reserves SET found = 'P', priority = 0 WHERE reserve_id = XXX;
 4: Check in the item X at Branch A - A pop-up asking confirmation comes
 5: Apply patch & restart plack
 6: Check in the item X again at Branch A - now the hold is confirmed automatically

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-16 12:28:17 +02:00
9d7f55a874 Bug 28136: Handle Transferred status for ResFound
bug 25690 added a new 'Transferred' status to 'ResFound', this status
needs to be handled in circ/returns.pl

To test:
1 - Place a hold on an item at Branch B for pickup at Branch A
2 - Check in the item at Branch B - confirm hold and transfer
3 - Check in the item at Branch A - nothing happens?
4 - Apply patch
5 - Checkin in the item at Branch A - hold popup appears
6 - Clear the hold and place it again
7 - Set system preference 'HoldsAutoFill' to do
8 - Check in the item at Branch B - hold is found and confirmed
9 - Check in the item at Branch A - hold is found and confirmed

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-14 16:07:55 +02:00
a8df1af9e5 Bug 22569: Add a 'Transfers to send' report
This patch adds a 'Transfers to send' report to the circulation page
which displays items which have been triggered for transfer but not
marked as sent.

Test plan
1) Setup a rotation plan and add some items to it as per the
   manual
2) Run the stockrotation cronjob with the --execute flag
3) Check that the expected items appear in the new 'Transfers to send'
   page.
4) Confirm that items marked with 'StockRotationAdvance' provide the
   option to mark the item as 'In demand' (Which will cancel the
   transfer and mark the item as in demand such that it will wait at the
   current branch for an additional stage period before being
   automatically picke for transfer again)
5) Setup a rotating collection
6) Trigger a collection transfer for the above collection
7) Check that the expected items appear in the new 'Transfers to send'
   page'.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>

Bug 22569: (QA follow-up) Rename script to snake_case

As requested, we simply rename the script, and references to it, to use
snake_case to make it clearer.

Bug 22569: (QA follow-up) Rename branchesloop to libraries

Bug 22569: (QA follow-up) Fix indentation in template

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-11 11:51:40 +01:00
010181a6a0 Bug 27652: Display patron's categories for sysprefs expecting them
This patch adds a new type of system preference entry option: patron
category. A preference with this type will show either a <select> with
patron categories to choose from or a multiple-select menu for choosing
one or more.

This prevents possible errors from incorrect category codes being
entered manually.

To test, apply the patch and run the database update.

- Go to Administration -> System preferences.
- Test each of the updated preferences to confirm that the available
  options are correct and that your selections are correctly saved.

  - Single category selections, PatronSelfRegistrationDefaultCategory
    and GoogleOpenIDConnectDefaultCategory. With each of these you
    should see a dropdown where you can select of all the existing
    patron categories.

  - Multiple selections, OPACHoldsIfAvailableAtPickup and
    BatchCheckouts: These preferences should have an option for
    selecting one or more system preferences at once.

- Test the pages affected by the updated system preferences:

- With BatchCheckouts enabled, confirm that the batch checkout page is
  correctly limited by patron category.

- Set the OPACHoldsIfAvailableAtPickup preference to "Don't allow" and
  select at least one patron category in the
  OPACHoldsIfAvailableAtPickupExceptions preference.
- Log in to the OPAC as a patron whose category was not selected in
  the OPACHoldsIfAvailableAtPickupExceptions preference.
- Try to place a hold on an item which is available at a library.
- When confirming the hold, the libraries where the item is available
  should be disabled in the "Pick up location" dropdown.
- Repeat the process as a patron whose category was selected in
  OPACHoldsIfAvailableAtPickupExceptions. There should be no disabled
  pickup locations.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-09 17:20:47 +01:00
1b289f74cc Bug 25690: (QA follow-up) PROCESSED -> PROCESSING for consistency
PROCESSED gave the apearance that the item processing had been completed
whereas in reading the code it appears to actually signify that the item
is awaiting/in proessing state.

This patch updates the variable to be PROCESSING consistently throughout
the codebase.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-04 16:18:42 +01:00
Joonas Kylmälä
fd0bc2204c Bug 25690: Make CanBookBeIssued return In Processing state as needing confirmation
This prevents checking out to a patron an item with hold to someone
else in the In Processing state via staff interface.

Also the checkout error message via SIP is now a more clearer one: "Item is
on hold for another patron." Before it was "Item cannot be issued:
$confirmation".

Also the branch transfer and batch checkout pages are adapted to this new
confirmation message as well.

To test:
 1) Create bib level hold to an item for patron A
 2) Check-in that item via SIP2, now the hold state should be "In processing"
 3) Apply patch
 4) Try to checkout the item to patron B via staff interface and
    notice we get now confirmation prompt do we really want to do it
    because it is in processing.

 In order to not have to setup SIP2 server, alternatively steps 1) and
 2) can be done so that you check-in the item in staff interface and
 make it Waiting, and then with SQL change it to "In processing":

 UPDATE reserves SET found = "P" WHERE reserve_id = XXX;
 UPDATE reserves SET waitingdate = NULL WHERE reserve_id = XX
 UPDATE reserves SET expirationdate = NULL WHERE reserve_id = XXX;

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-04 16:18:42 +01:00
Joonas Kylmälä
fbef547832 Bug 25690: Remove double usage of 'Reserved' return value
The patch "Bug 19116: Hold not set to waiting after transfer" added a
new meaning to 'Reserved' return value of C4::Reserves::CheckReserves
function. Let's remove double usage and have separate Transferred
return value so we can differentiate between attached and non-attached
holds. This will come useful in future refactorings.

This patch does no changes to the logic except in the
/cgi-bin/koha/circ/branchtransfers.pl and circulation.pl we now give
similarly to waiting state notice about hold being transferred.

To test:
   1) Apply this patch
   2) Create a new item level hold so that pickup library is different
   than where the item is currently. Then return the item so that hold
   is being attached and transferred.
   3) Go to branchtransfers.pl and try to create a new transfer: it
   should prompt you with message "Item is attached to a hold and
   being transferred for XXX" and provide you with option to cancel
   the hold or to ignore the transfer.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-04 16:18:42 +01:00
7e919d12d8 Bug 24446: Catch daterequested in circ returns
Update C4::Circulation::AddReturn to use Koha::Item->get_transfer to
find requested transfers and use Koha::Item::Transfer->receipt to complete
transfer requests if they have arrived at their destination or return the
relevant 'WrongTransfer', 'WasTransfered' and 'TransferTrigger' messages
to the end user.

Signed-off-by: Kathleen Milne <kathleen.milne@cne-siar.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-03 15:36:13 +01:00
099e2fe2b7 Bug 7806: Fix remaining occurrences of 0000-00-00
We should remove all SQL queries that contain 0000-00-00 and finally
assume we do not longer have such value in our DB (for date type)

We already dealt with such values in previous update DB entries.
The 2 added by this one haven't been replaced already.

The code will now assume that either a valid date exist, or NULL/undef.

Test plan:
QA review is needed and test of the different places where code is
modified.

Not sure about the change from reports/issues_avg_stats.pl

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-01 11:16:42 +01:00
919caa19c8 Bug 27131: Add get_items_that_can_fill
Signed-off-by: Andrew Nugged <nugged@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-18 11:53:10 +01:00
fafcbff015 Bug 27673: Fix encoding issues
There is a difference between YAML::Load and YAML::XS::Load
From YAML::XS pod:
"YAML::XS only deals with streams of utf8 octets"

Test plan:
We are going to test 1 occurence and QA will confirm others don't
contain typos.
0. Don't apply the patches
1. Create a new itemtype with code=❤️
2. Create a new item using this itemtype (to biblionumber=1 will work)
3. Fill OpacHiddenItems with
 itype: [❤️]
4. Search for "street shuffle" or any terms that will return the biblio
Notice that the item is there (there is an error in logs)
5. Apply the patches
6. Repeat 4 and confirm that the item is now hidden

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-16 14:54:50 +01:00
46f7239b08 Bug 27673: Replace YAML with YAML::XS
From tht YAML pod:

"""
This module has been released to CPAN as YAML::Old, and soon YAML.pm will be changed to just be a frontend interface module for all the various Perl YAML implementation modules, including YAML::Old.

If you want robust and fast YAML processing using the normal Dump/Load API, please consider switching to YAML::XS. It is by far the best Perl module for YAML at this time. It requires that you have a C compiler, since it is written in C.
"""

See also
https://gitlab.com/koha-community/qa-test-tools/-/merge_requests/35

Test plan:
Try some place where YAML::XS is not used and confirm that it works
correctly

QA note: This patch removes some uses of YAML that were not useful

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-16 14:54:50 +01:00
f831130525 Bug 27676: Correct finesMode ne off condition
finesMode is 'off' by default (sysprefs.sql), but if you modify its value from
the UI and set it to 'production' then back to 'off', the DB value becomes an
empty string '', because of $YAML::Syck::ImplicitTyping

This has been found when working on on removing YAML::Syck (bug 22824),
so it's not perfect but the situation will be cleared in the follow-up
bug report.

Test plan:
0. Don't apply the patch
1. reset_all
=> finesMode eq 'off' in DB
2. Set the pref's value to production
3. Switch it back to 'off'
4. Value is '' in DB
5. Check an item in that should generate overdue charges
=> Charges are not generated
6. Apply the patch
7. Check an item in that should generate overdue charges
=> Charges are generated

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-12 12:14:50 +01:00
419d816f1f Bug 24488: create a loop to avoid copy paste
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

JD amended patch: Rename variables

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
4e296e78be Bug 24488: (QA follow-up) Go to next loop as early as possible
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
97a6cb4b90 Bug 24488: perf - Move holds search out of the loop
This will need attention from QA.
We are assuming that the hold with the highest priority has priority=1

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
b9bc3a11f1 Bug 24488: Simplify structure passed to the template
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
d54e32fa3a Bug 24488: perf - move patrons_count out of the loop
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
774d4e9ab4 Bug 24488: perf - Group by at DBMS level
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
83944dc232 Bug 24488: Fix count distinct patron on a given hold
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
d1af4bc0c3 Bug 24488: (QA follow-up) Move getting items out of cycle
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
6d7a12302b Bug 24488: (QA follow-up) Remove two queries out of foreach cycle
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
3c4985fbd6 Bug 24488: (QA follow-up) Make pending reserves faster
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:56:00 +01:00
ed4ad48c56 Bug 24488: (QA follow-up): Fix small bugs, add checkk for waiting holds
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:55:59 +01:00
e313bcf130 Bug 24488: [DISCUSSION] For comparaison
I'd like someone to run a benchmark with and without this patch on a
quite big database and see which approach is the best

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:55:59 +01:00
de0cded95c Bug 24488: Simplify searches
It also:
Use dtf for date handling
add missing td

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:55:59 +01:00
1dc3d55ea2 Bug 24488: Display patron with the highest priority hold
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:55:59 +01:00
19361b797d Bug 24488: Fix reserve.reserve_id' isn't in GROUP BY
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:55:59 +01:00
Aleisha Amohia
2285c2d657 Bug 24488: Show correct first patron details on Holds to pull
This patch rewrites the complex search query to reduce the risk of
reordering the results multiple times.

This patch includes a change to schema files so may need to upgrade
schema and/or restart memcached

To test:
1) Reproduce problem following test plan in Description
2) Apply patch and refresh page
3) Notice the correct patron is now shown
4) Play with date selection, confirm correct results are still shown
5) Test cancelling holds
6) Test filtering table results
7) Test with biblios with multiple items
8) Test with making items unavailable (i.e. not for loan, checked out)

Sponsored by: IHC New Zealand

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-08 14:55:59 +01:00
Petro Vashchuk
1af0778703 Bug 27549: "use of uninitialized value" warning on renew.pl
On the beginning we have empty "barcode" parameter for this form, but that not taken into account in regular expression  warning emitted: "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47." in renew.pl
Fixed by making $barcode to become an empty string by default.

To reproduce:
    1) Head over to the "Circulation -> Renew" page.
    2) Check intranet-error.log there will be a warning "Use of uninitialized value $barcode in substitution (s///) at /usr/share/koha/intranet/cgi-bin/circ/renew.pl line 47".
    3) Apply the patch, refresh the "Renew" page.
    4) Ensure that the new "use of uninitialized value" warnings didn't appear in the console.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-01 17:20:37 +01:00
Petro Vashchuk
c3d2268756 Bug 27548: "use of uninitialized value" warning on branchoverdues.pl
On the beginning we have empty "location" parameter for this form,
but that not taken into account in comparison and undef warning emitted:
"Use of uninitialized value $location in string eq at
/usr/share/koha/intranet/cgi-bin/circ/branchoverdues.pl line 72" in branchoverdues.pl

Fixed by adding pre-check for $location.

To reproduce:
    1) Head over to "Circulation ->Overdues with fines" page. Check
       intranet-error.log where there will be many warnings
       "Use of uninitialized value $location in string eq at /usr/share/koha/intranet/cgi-bin/circ/branchoverdues.pl line 72".
    2) Apply the patch, refresh the "Overdues with fines" page.
    3) Ensure that the new "use of uninitialized value" warnings didn't appear in the console.

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-02-01 17:20:37 +01:00
Amy King
113992e620 Bug 27011: Remove unused $name variable
The variable is no longer used in the template, it has been removed by:

  commit 76eb3a0549
  Bug 18789: (follow-up) Pass a Koha::Patron object from returns.pl

-            <td>[% name %]</td>
+            <td>[% INCLUDE 'patron-title.inc' patron=patron %]</td>

We can simply remove the $name variable from the controller script.

Test Plan:
1. Check out a book
2. Check in a book
3. Note what happens
4. Apply patch
5. Repeat step 1-2
6. Note that it doesn't break and everything still works

JD Amended patch: fix commit message

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-21 15:40:29 +01:00
Andrew Isherwood
8595e80b78 Bug 24083: Add support for unseen_renewals
This patch adds support for unseen renewals.

Here we retrofit knowledge of unseen renewals and add the display of unseen
renewal counts and warnings, in addition to adding the ability to
specify a renewal as being "unseen".

The functionality added here is goverened by the UnseenRenewals syspref.

Signed-off-by: Sally Healey <sally.Healey@cheshirewestandchester.gov.uk>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-11 16:09:58 +01:00
1008e21d43 Bug 23091: Add template handling for new messages
This patch adds handling for the display of the two new messages added
by this patchset in the returns screen.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-06 15:55:17 +01:00
Nicolas Legrand
47b32572d4 Bug 24412: Attach waiting reserve to desk
When an item is checked in and marked 'Waiting' or already 'Waiting'
and there is a desk attached to the session, the item is marked
waiting at the current desk of the current library.

The information is displayed on the OPAC and on the intranet. The
patron can then know at which desk he can retrieve his document.

Desk Management (Bug 13881) is now useful.

Test plan :

1. apply Bug 24201
2. $KOHA_PATH/installer/data/mysql/updatedatabase.pl
3. Check out some document to someone
4. make another one reserve this document
5. check in the document
6. you can see the document is attach to the current library
7. create some desks and attach one to your session (see Bug 13881 and
Bug 24201)
8. cancel the preceding reserve and redo steps 3 to 5
9. you should see the document is waiting at the current library and
current desk on:
  a. the intranet document request page
  b. the intranet borrower holds tab
  c. the item list where the document is listed on the bibliographic
    details
  d. the borrower's OPAC holds tab.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 24412: (follow-up) QA

Following Josef Moravec QA comments :

- rewrite Koha::Hold->desk according to Object Oriented Koha
Guidelines and use it to fetch desk name in various templates
- remove unused Desks.GetName
- Check for columns existence in db update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 24412: (follow-up) QA: useless change

Maybe it was a relic of something usefull... anyway
not anymore.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 24412: (follow-up) Fix POD

Koha::Desk and not Koha::Library...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-06 15:55:17 +01:00
1bc723b33c Bug 24786: (follow-up) Cache the register_name in the session
This leads to one DB hit less per page load in the staff client when
cash registers are enabled.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-06 15:40:00 +01:00
5b1934312b Bug 24786: Allow setting a register for the session
This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-11-06 15:39:59 +01:00
Katrin Fischer
4c1218af64 Bug 18170: Show damaged status in table of checkins
This copies the display of the damaged status from the holds and
checkouts pages in staff.

To test:
- Apply patch
- Check out some items, some damaged, others not
- Verify the damaged status is displayed below the due date
  in the table of checkouts
- Check the items in from the checkin page
- Verify the damaged status displays in the table of checkins

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-15 12:56:31 +02:00
Julian Maurice
96cc447045 Bug 25898: Prohibit indirect object notation
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-15 12:56:30 +02:00
bbd86d7a30 Bug 26643: Notify librarian of completed transfers
It came to light that it's not clear to all users that a checkin results
in the completion of a transfer if one exists for the item being checked
in.  This patch adds such a notification to the error messages loop to
highlight that the item has been recieved from it's sending brnach.

To test
1/ Setup a transfer from branch A to branch B
2/ Check the item in at branch B
3/ Note that a new message appears in the 'Check in message' alert box
saying "Item recieved from branch A"
4/ Signoff

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-15 12:56:30 +02:00
Joonas Kylmälä
0e1d291b14 Bug 12556: Add new "in processing" state to holds
This adds new syspref, HoldsNeedProcessingSIP, which controls whether
a hold that is related to item will be filled automatically or not. If
the user has enabled the syspref then instead of fulfilling the hold
automatically the hold will go to "in processing" state.

To test:
 1. Checkout a book to patron A
 2. Place a bib level hold to the book for B
 3. Patron A returns the book via SIP, to simulate this use:
        ./misc/sip_cli_emulator.pl -su koha -sp koha -l CPL -a 127.0.0.1 -p 6001 --item <ItemBarcode> -m checkin
 4. Notice that no notification is generated for Patron B about hold
    and that the hold status in intranet and opac is "In Processing".
 5. Notice that patron A (or other patrons) cannot checkout a book
    that is in processing, because it is considered to be attached to
    the holdee (similarly to the waiting state):
        ./misc/sip_cli_emulator.pl -su koha -sp koha -l CPL -a 127.0.0.1 -p 6001 --patron <PatronABarcode> --item <ItemBarcode> -m checkout

Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se>
Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-14 14:50:07 +02:00
7f61ca7f47 Bug 19382: (QA follow-up) Fix typos
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-14 14:50:07 +02:00
899bd08e0c Bug 19382: Add blocking of ability to checkout on circulation.pl
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-14 14:50:07 +02:00
7a7a0a2474 Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees
Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items.

Test Plan:
1) Apply this patch
2) Set NoIssuesChargeGuarantorsWithGuarantees to $14
3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children
4) Give 3 of the 4 a $5 fine
5) None of them should be able to check out items

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-14 14:50:07 +02:00
9ddb312749 Bug 23695: (QA follow-up) Revert 'Orginating library' option
At my request, we added an 'Originating library' option to the manual
transfers form.

However, we did not properly pass this through in the controller and I
have since discovered that my request was ill conceived/a
misunderstanding of requirements.

This patch removes the option from the template and drops the references
to it in the controller.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-09 13:07:01 +02:00
2524a1a740 Bug 26485: Simplify itemnumber handling in returns.pl
This is a follow-up for bug 25969. The way we handle itemnumber is too complicated and error prone.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-08 14:50:13 +02:00
1ab6247435 Bug 25261: (QA follow-up) Prevent server error on bad barcode
Prior to this patch if you had CircConfirmParts enabled and you
attempted to checkin a deleted item then you would be met with a server
error.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-01 10:33:10 +02:00
be379b664c Bug 25261: (QA follow-up) Capitalize return of needsconfirm
This patch capitalizes the 'ADDITIONAL_MATERIALS' key in the
needsconfirm hash return value for CanBookBeIssued to restore
consistency with previous code and ensure SIP Checkout works as
expected.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-01 10:33:10 +02:00
acf11bacfd Bug 25261: (QA follow-up) Non-confirm on return
This patch updates the confirmation from an alert to a dismissable modal
which allows for optionally not checking the item in

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-01 10:33:10 +02:00