Bug 24860: Add reserves.item_group_it
This feature builds upon bug 24857 and allows placing holds that target a specific item group of a record. It is patterned after the feature that allows limiting hold selection by itemtype ( AllowHoldItemTypeSelection ). Test Plan: 1) Apply bug 24857 and this bug's patches 2) Run updatedatabase.pl 3) Restart all the things! 4) Enable the sysprefs EnableVolumes and EnableVolumeHolds 5) Create a record, items and item groups, with each item being assigned to an item group 6) Place a hold for a patron 7) Note the new selector to choose an item group in addition to record and item level holds 8) Place an item group level hold 9) Check in an item from the record that is not part of that item group 10) Note the hold is not trapped for that item 11) Check in an item from the record that *is* part of that item group 12) Note the hold is trapped for that item 13) Place an item group level hold for another item 14) Run the holds queue builder 15) Note the holds queue targets only items from that item group 16) Check out all the items of that item group to other patrosn 17) Re-run the holds queue builder 18) Note the holds queue no longer has a line for that hold, as all items that could fill that hold are now unavailable Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
30efad72a4
commit
cfa6e15169
2 changed files with 25 additions and 0 deletions
21
installer/data/mysql/atomicupdate/bug_24860.perl
Normal file
21
installer/data/mysql/atomicupdate/bug_24860.perl
Normal file
|
@ -0,0 +1,21 @@
|
|||
$DBversion = 'XXX'; # will be replaced by the RM
|
||||
if ( CheckVersion( $DBversion ) ) {
|
||||
unless ( column_exists( 'reserves', 'item_group_id' ) ) {
|
||||
$dbh->do(q{
|
||||
ALTER TABLE reserves
|
||||
ADD COLUMN `item_group_id` int(11) NULL default NULL AFTER biblionumber,
|
||||
ADD CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
});
|
||||
}
|
||||
|
||||
unless ( column_exists( 'old_reserves', 'item_group_id' ) ) {
|
||||
$dbh->do(q{
|
||||
ALTER TABLE old_reserves
|
||||
ADD COLUMN `item_group_id` int(11) NULL default NULL AFTER biblionumber,
|
||||
ADD CONSTRAINT `old_reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE SET NULL;
|
||||
});
|
||||
}
|
||||
|
||||
SetVersion( $DBversion );
|
||||
print "Upgrade to $DBversion done (Bug 24860 - Add ability to place item group level holds)\n";
|
||||
}
|
|
@ -4101,6 +4101,7 @@ CREATE TABLE `old_reserves` (
|
|||
`borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
|
||||
`reservedate` date DEFAULT NULL COMMENT 'the date the hold was places',
|
||||
`biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
|
||||
`item_group_id` int(11) NULL default NULL COMMENT 'foreign key from the item_groups table defining if this is an item group level hold',
|
||||
`branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
|
||||
`desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
|
||||
`notificationdate` date DEFAULT NULL COMMENT 'currently unused',
|
||||
|
@ -4127,6 +4128,7 @@ CREATE TABLE `old_reserves` (
|
|||
KEY `old_reserves_itemnumber` (`itemnumber`),
|
||||
KEY `old_reserves_branchcode` (`branchcode`),
|
||||
KEY `old_reserves_itemtype` (`itemtype`),
|
||||
CONSTRAINT `old_reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE SET NULL,
|
||||
CONSTRAINT `old_reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,
|
||||
CONSTRAINT `old_reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL,
|
||||
CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL,
|
||||
|
@ -4547,6 +4549,7 @@ CREATE TABLE `reserves` (
|
|||
`borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
|
||||
`reservedate` date DEFAULT NULL COMMENT 'the date the hold was placed',
|
||||
`biblionumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
|
||||
`item_group_id` int(11) NULL default NULL COMMENT 'foreign key from the item_groups table defining if this is an item group level hold',
|
||||
`branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
|
||||
`desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
|
||||
`notificationdate` date DEFAULT NULL COMMENT 'currently unused',
|
||||
|
@ -4575,6 +4578,7 @@ CREATE TABLE `reserves` (
|
|||
KEY `branchcode` (`branchcode`),
|
||||
KEY `desk_id` (`desk_id`),
|
||||
KEY `itemtype` (`itemtype`),
|
||||
CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
|
|
Loading…
Reference in a new issue