@@ -, +, @@
by pickup library and/or itemtype
---
C4/Reserves.pm | 25 +-
.../data/mysql/atomicupdate/split_holds_queue.sql | 4 +
installer/data/mysql/sysprefs.sql | 1 +
koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 8 +
.../intranet-tmpl/prog/en/includes/holds_table.inc | 200 ++++++++++++++++
.../en/modules/admin/preferences/circulation.pref | 14 ++
.../prog/en/modules/reserve/request.tt | 257 +++++++--------------
reserve/request.pl | 10 +-
t/db_dependent/Holds.t | 8 +-
9 files changed, 334 insertions(+), 193 deletions(-)
create mode 100644 installer/data/mysql/atomicupdate/split_holds_queue.sql
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
--- a/C4/Reserves.pm
+++ a/C4/Reserves.pm
@@ -1229,7 +1229,7 @@ sub _OnShelfHoldsAllowed {
=head2 AlterPriority
- AlterPriority( $where, $reserve_id );
+ AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority );
This function changes a reserve's priority up, down, to the top, or to the bottom.
Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was placed
@@ -1237,7 +1237,7 @@ Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was
=cut
sub AlterPriority {
- my ( $where, $reserve_id ) = @_;
+ my ( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ) = @_;
my $hold = Koha::Holds->find( $reserve_id );
return unless $hold;
@@ -1247,21 +1247,18 @@ sub AlterPriority {
return;
}
- if ( $where eq 'up' || $where eq 'down' ) {
-
- my $priority = $hold->priority;
- $priority = $where eq 'up' ? $priority - 1 : $priority + 1;
- _FixPriority({ reserve_id => $reserve_id, rank => $priority })
-
+ if ( $where eq 'up' ) {
+ return unless $prev_priority;
+ _FixPriority({ reserve_id => $reserve_id, rank => $prev_priority })
+ } elsif ( $where eq 'down' ) {
+ return unless $next_priority;
+ _FixPriority({ reserve_id => $reserve_id, rank => $next_priority })
} elsif ( $where eq 'top' ) {
-
- _FixPriority({ reserve_id => $reserve_id, rank => '1' })
-
+ _FixPriority({ reserve_id => $reserve_id, rank => $first_priority })
} elsif ( $where eq 'bottom' ) {
-
- _FixPriority({ reserve_id => $reserve_id, rank => '999999' });
-
+ _FixPriority({ reserve_id => $reserve_id, rank => $last_priority });
}
+
# FIXME Should return the new priority
}
--- a/installer/data/mysql/atomicupdate/split_holds_queue.sql
+++ a/installer/data/mysql/atomicupdate/split_holds_queue.sql
@@ -0,0 +1,4 @@
+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
+('HoldsSplitQueue','nothing','nothing|branch|itemtype|branch_itemtype','In the staff client, split the holds view by the given criteria','Choice'),
+('HoldsSplitQueueNumbering', 'actual', 'actual|virtual', 'If the holds queue is split, decide if the acual priorities should be displayed', 'Choice');
+
--- a/installer/data/mysql/sysprefs.sql
+++ a/installer/data/mysql/sysprefs.sql
@@ -189,6 +189,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'),
('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'),
+('HoldsSplitQueue','nothing','nothing|branch|itemtype|branch_itemtype','In the staff client, split the holds view by the given criteria','Choice'),
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
('HomeOrHoldingBranch','holdingbranch','holdingbranch|homebranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','Choice'),
('HouseboundModule',0,'','If ON, enable housebound module functionality.','YesNo'),
--- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css
+++ a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css
@@ -360,6 +360,14 @@ fieldset {
border-radius:5px;
}
+fieldset.standard {
+ background-color:#f4f8f9 !important;
+}
+
+fieldset.contrast {
+ background-color:#F3F3F3 !important;
+}
+
fieldset.lastchecked {
margin-bottom : 0;
border-bottom-width: 0;
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
@@ -0,0 +1,200 @@
+
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
@@ -488,6 +488,20 @@ Circulation:
- the restriction periods.
Holds Policy:
-
+ - In the staff client, split the holds queue into separate tables by
+ - pref: HoldsSplitQueue
+ choices:
+ nothing: nothing
+ branch: "pickup library"
+ itemtype: "hold itemtype"
+ branch_itemtype: "pickup library & itemtype"
+ -
+ - If the holds queue is split, show librarians
+ - pref: HoldsSplitQueueNumbering
+ choices:
+ actual: "the actual priority, which may be out of order"
+ virtual: "'virtual' priorities, where each group is numbered separately"
+ -
- pref: AllowHoldItemTypeSelection
choices:
yes: Allow
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
@@ -1,3 +1,4 @@
+[% USE Dumper %]
[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
@@ -700,194 +701,106 @@ function checkMultiHold() {
[% FOREACH biblioloo IN biblioloop %]
[% IF ( biblioloo.reserveloop ) %]
-
[% END %]
[% END %]
--- a/reserve/request.pl
+++ a/reserve/request.pl
@@ -86,9 +86,13 @@ my $action = $input->param('action');
$action ||= q{};
if ( $action eq 'move' ) {
- my $where = $input->param('where');
- my $reserve_id = $input->param('reserve_id');
- AlterPriority( $where, $reserve_id );
+ my $where = $input->param('where');
+ my $reserve_id = $input->param('reserve_id');
+ my $prev_priority = $input->param('prev_priority');
+ my $next_priority = $input->param('next_priority');
+ my $first_priority = $input->param('first_priority');
+ my $last_priority = $input->param('last_priority');
+ AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority );
} elsif ( $action eq 'cancel' ) {
my $reserve_id = $input->param('reserve_id');
my $hold = Koha::Holds->find( $reserve_id );
--- a/t/db_dependent/Holds.t
+++ a/t/db_dependent/Holds.t
@@ -200,19 +200,19 @@ is( $holds->next->itemnumber, $itemnumber, "Test ModReserveMinusPriority()" );
$holds = $biblio->holds;
$hold = $holds->next;
-AlterPriority( 'top', $hold->reserve_id );
+AlterPriority( 'top', $hold->reserve_id, undef, 2, 1, 6 );
$hold = Koha::Holds->find( $reserveid );
is( $hold->priority, '1', "Test AlterPriority(), move to top" );
-AlterPriority( 'down', $hold->reserve_id );
+AlterPriority( 'down', $hold->reserve_id, undef, 2, 1, 6 );
$hold = Koha::Holds->find( $reserveid );
is( $hold->priority, '2', "Test AlterPriority(), move down" );
-AlterPriority( 'up', $hold->reserve_id );
+AlterPriority( 'up', $hold->reserve_id, 1, 3, 1, 6 );
$hold = Koha::Holds->find( $reserveid );
is( $hold->priority, '1', "Test AlterPriority(), move up" );
-AlterPriority( 'bottom', $hold->reserve_id );
+AlterPriority( 'bottom', $hold->reserve_id, undef, 2, 1, 6 );
$hold = Koha::Holds->find( $reserveid );
is( $hold->priority, '6', "Test AlterPriority(), move to bottom" );
--