Bug 11665

Summary: An ability to place orders directly from hold ratios list
Product: Koha Reporter: Jacek Ablewicz <abl>
Component: AcquisitionsAssignee: Jacek Ablewicz <abl>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: abl, gmcharlt
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Medium patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 12149    
Attachments: Bug 11665: An ability to place orders directly from hold ratios list
[SIGNED-OFF] Bug 11665: An ability to place orders directly from hold ratios list
[PASSED QA] Bug 11665: An ability to place orders directly from hold ratios list

Description Jacek Ablewicz 2014-02-02 18:24:43 UTC
This enhancement introduces a possibility to place orders
from hold ratios list:
- new option "Add order to basket" -> "From titles w/ highest hold ratios";
(user gets redirected from acqusition to "hold ratios" list in circulation)
- "N to order" in "Items needed" column now becomes a link - when clicked,
user gets redirected back to acquisition, directly to order form for
a choosen title (suggested quantity "N to order" is being preserved)
- in the "Items needed" column, there is an additional indication if
there are any pending (not yet received) orders for a given title

This solution is not exactly ideal.. most important drawback: to use
it librarian needs both acquisition & circulation priviledges; if not
having both - new options will not show / wouldn't be active. But it
requires relatively small amount of changes in the code.

To test:
- apply patch,
- test new functions (try to place some orders using an newly added
option, examine resulting order records etc.)
- check modified hold ratios list for possible problems (for user
with only circulation priviledges, additional information regarding
pending orders should be still visible, but not the link
to order form)
- ensure the two following existing options for adding orders to basket
("From an existing record", "From a new (empty) record") a still working
properly.
Comment 1 Jacek Ablewicz 2014-02-02 18:36:52 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2014-04-22 18:24:37 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-04-27 19:58:17 UTC
Created attachment 27683 [details] [review]
[PASSED QA] Bug 11665: An ability to place orders directly from hold ratios list

This enhancement introduces a possibility to place orders
from hold ratios list:
- new option "Add order to basket" -> "From titles w/ highest hold ratios";
(user gets redirected from acqusition to "hold ratios" list in circulation)
- "N to order" in "Items needed" column now becomes a link - when clicked,
user gets redirected back to acquisition, directly to order form for
a choosen title (suggested quantity "N to order" is being preserved)
- in the "Items needed" column, there is an additional indication if
there are any pending (not yet received) orders for a given title

This solution is not exactly ideal.. most important drawback: to use
it librarian needs both acquisition & circulation priviledges; if not
having both - new options will not show / wouldn't be active. But it
requires relatively small amount of changes in the code.

To test:
- apply patch,
- test new functions (try to place some orders using an newly added
option, examine resulting order records etc.)
- check modified hold ratios list for possible problems (for user
with only circulation priviledges, additional information regarding
pending orders should be still visible, but not the link
to order form)
- ensure the two following existing options for adding orders to basket
("From an existing record", "From a new (empty) record") a still working
properly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Minor edit in signoff: Changed "w/" to "with"

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works nicely in my tests, neat new addition.
Comment 4 Katrin Fischer 2014-04-27 19:58:46 UTC
Comment on attachment 27434 [details] [review]
[SIGNED-OFF] Bug 11665: An ability to place orders directly from hold ratios list

Review of attachment 27434 [details] [review]:
-----------------------------------------------------------------

I am a bit torn about this patch. It seems to work nicely, no problems found.

::: circ/reserveratios.pl
@@ +185,5 @@
>  );
>  
>  output_html_with_http_headers $input, $cookie, $template->output;
> +
> +sub CountPendingOrdersByBiblionumber {

But I wonder if this should not be in the .pl file, but in Acquisitions.pm with unit tests. 
Maybe also orders should be OrderedItems?

Waiting for another opinion, leaving this a signed off for now.
Comment 5 Katrin Fischer 2014-04-28 05:10:06 UTC
On Galen's suggestion I have filed a follow-up bug to deal with the routine.
Comment 6 Galen Charlton 2014-05-04 19:15:31 UTC
Pushed to master.  Thanks, Jacek!