Commit graph

14 commits

Author SHA1 Message Date
7966037747 Bug 11258: fix another case where holds queue made transfer requests that contradict the library holds policy
This patch fixes a problem where the holds queue generator
was making requests where the pickup library is the
same as the item's library but not the patron's branch,
even if there is a "Default holds policy by item type" rule that states
this item can only fill holds for patrons of the same library as the
item.

Test Plan:
1) Create a test record with 2 items with different itemtypes
2) Set the Default holds policy by item type for the first
   item to "From any library"
3) Set the Default holds policy by item type for the second
   item to "From home library"
4) Place a record level hold for a patron from another library,
   but for pickup at the same library as the item is from
5) Rebuild the holds queue
6) View the holds queue, note the item is listed, though this
   patron cannot place a hold on this item
7) Apply this patch
8) Repeat step 5, note the hold is no longer in the queue

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
automated tests pass, functional tests pass. Bug replicated, eradicated by patch.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I finally managed to reproduce this, patch works as described.
Passes tests and QA script, provided tests fail without patch, but
succeed with the patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 15:23:23 +00:00
612b33ae69 Bug 11711 - Use new DataTables include in circ templates
Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to all
circ-related pages which use DataTables.

Apply the patch and test the following pages to confirm that table
sorting works correctly:

- Circulation
  - The UseTablesortForCirc system preference must be enabled.
  - Check out to a patron with existing checkouts. Choose a patron who
    is a guarantor to another patron with checkouts in order to test the
    relatives' checkouts table.
  - The checkouts and relatives' checkouts tables have been modified to
    exclude articles when sorting of titles.

- Hold ratios - The title column has been configured to exclude articles
  from sorting

- Transfer to receive

- Holds queue
  - The title column has been configured to exclude articles when
    sorting
  - The date column has been modified to use the title-string filter for
    sorting. An unformatted date is now passed from C4::HoldsQueue.pm to
    the template, where the KohaDates filter is used for formatting.
    Sorting is based on the unformatted date.

- Holds awaiting pickup
  - The "available since" column has been configured for sorting on an
    unformatted date. waitingreserves.pl now passes the unformatted
    date to the template, and formatting is done using the KohaDates
    filter.
  - The title column has been configured to exclude articles when
    sorting.

Edit: Rebased on current master following commit of Bug 11605
Signed-off-by: A. Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-08 23:47:27 +00:00
Galen Charlton
67d3985929 Bug 10452: (follow-up) remove duplicate check of damaged status
While reviewing the main patch for this bug to verify that the
holds queue routines and C4::Reserves had the same conception of
when a damaged item could fill a hold request, I noticed that
GetItemsAvailableToFillHoldRequestsForBib() duplicated the code
for adding an SQL clause to filter out damaged items.  This patch
removes the duplication and improves the POD for that routine.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-03-10 18:15:44 +00:00
06ea76c3c2 Bug 10243: (follow-up) prevent TransportCostMatrix from overriding library holds policy
Using the TransportCostMatrix can cause the same issue. Removing the
last ditch use of the first item causes the the subroutine to continue
with the traditional matching, which will respect the hold policies.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-30 03:13:41 +00:00
78d27ad539 Bug 10243: prevent holds queue from making transfer requests that contradict library holds policy
For some reason MapItemsToHoldRequests will, as a last ditch effort,
grab what seems to be an arbitrary available item to fill a hold request,
even if it will violate the circulation rules for holds.

In other words, even if an item matches a "Holds policy by item type"
that says "From home library", a request to transfer that item to
another library will be added to the holds queue!

Test Plan:
1) Create a record with a an item at BranchA of item type BOOK
2) Set the holds policy such that itemtype BOOK for BranchA is set
   to "From home library"
3) Place a bib-level hold request for a patron with a pickup at BranchB
4) Run build_holds_queue.pl
5) You should now see a request for that item to be transfered to
   BranchB, even though the rules should not allow this.
6) Apply this patch
7) Run build_holds_queue.pl again
8) View the holds queue again, that request should no longer exist

Signed-off-by: Heather Braum <hbraum@nekls.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-30 03:12:05 +00:00
dbaefb626c Bug 10550: Fix database typo wthdrawn
This patch updates the wthdrawn field in items and deleteditems to be
withdrawn instead. No functional changes are made.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Save for translation files (that will be fixed on next release),
only occurrence of wthdrawn is on updatedatabase.pl
No koha-qa errors.

This touch many files, and I did not test everything,
but all seems normal. I think that any problem could
be fixed later.

Perhaps both entries in updatedatabase.pl could be joined
into one, but thats for QA.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-08 01:58:41 +00:00
d46657f8af Bug 10628: make sure AutomaticItemReturn doesn't prevent holds queue from filling local holds with local items
For some reason, C4::HoldsQueue::MapItemsToHoldRequests used the system
preference AutomaticItemReturn to decide if an attempt to fill local
holds with local items. No explanation of this behavior is provided.

This patch removes this behavior, and also adjusts the calculation
of the lead-cost library to always return the pickup library if it
is on the list of libraries that could fill the hold -- on the
basis that if the item is already at the pickup library, its
transport cost is inherently zero.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and adds unit tests.
Tested with some examples and those worked correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-20 15:31:38 +00:00
Galen Charlton
484b7ec732 bug 5825: (follow-up) consult item-level_itypes
This patch teaches GetHoldsQueueItems to consult
the item-level_itypes system preference and return
the item-level or bib-level item type accordingly.

To test:

- Arrange so that an item that shows up on the holds queue
  report has one item type while its bib has a different one.
- Run the report with item-level_itypes ON.  Verify that
  the item-level item type is displayed.
- Change item-level_itypes to OFF.  Run the report again and
  verify that the bib-level item type is displayed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-16 15:36:10 +00:00
70ede048e5 Bug 5825 - Add Item Type column to Holds Queue report
The hold queue report shows collection code but not item type. This
patch adds it. Also added is use of the KohaAuthorisedValues template
plugin to display the collection code description instead of code.

To test, apply the patch and view the holds queue. There should be a new
item type column showing an item type description for each row. The
collection column should now show the collection description instead of
code.

Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2013-08-16 15:15:31 +00:00
acd4b21c91 Bug 10311 - Holds queue ignores item-level holds where only one items exists
If a record has only one item, and that item has one item-level hold on
it, that hold will not show in the holds queue.

Test Plan:
1) Create 1 record with 1 item at BranchA
2) Create an item-level hold for that item, for pickup at BranchA by a
   patron of BranchA
3) Run build_holds_queue.pl
4) View the holds queue for BranchA
5) Note the hold is not in there
6) Apply this patch
7) Re-run build_holds_queue.pl
8) View the holds queue again
9) Not that the hold is now there

Signed-off-by: George Williams <georgew@latahlibrary.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-06-10 09:08:16 -07:00
d098a7c298 Bug 8419 - Suspended holds appear on the daily holds queue
This bug was reintroduced by the patch for bu 5911: Transport Cost Matrix

Test Plan:
1) Place a hold on a record
2) Run build_holds_queue.pl
3) Verify the hold is showing in the holds queue
4) Suspend the hold
5) Re-run build_holds_queue.pl
6) Note the hold is still in the holds queue
7) Apply patch
8) Re-run build_holds_queue.pl
9) Note the hold is no longer in the holds queue

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes test plan and QA script.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-01 08:14:56 -04:00
3b2abc60d7 Bug 9922 - holds queue shows home library with AutomaticReturn
Test Plan:
 1) Enable AutomaticItemReturn
 2) Place a reserve on a record where the holding and home branches differ
    for the available items
 3) Rebuild the holds queue
 4) Check the holds queue, verify the item is listed in the items to pull for the item's home branch
 5) Disable AutomaticItemReturn
 6) Rebuild the holds queue
 7) Verify the item is listed in the items to pull for the item's holding branch
 8) Enable AutomaticItemReturn
 9) Apply patch
10) Rebuild the holds queue
11) Verify the item is listed in the items to pull for the item's holding branch

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tested per plan, and the patch seems sane. Functionality of the hold queue is restored to previous behaviour.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Amended test plan to make clear it has to be a record level
hold for the test plan to work.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-29 22:25:23 -04:00
Jared Camins-Esakov
b29e524656 Bug 8890: C4/HoldsQueue requires DB
This counter-patch moves all database handling code into subroutines
in C4::HoldsQueue. This fixes the test, and is required for persistent
environments like Plack.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-10-24 17:52:36 +02:00
Srdjan
86c2c4626d bug_5911: Transport Cost Matrix
Create transport_cost table,  added UseTransportCostMatrix syspref.
transport_cost table contains branch to branch transfer
costs. These are used for filling inter-branch hold transfers.

Moved GetHoldsQueueItems() from .pl to HoldsQueue.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-12 14:49:25 +02:00