From 1670689f9797aef4cc06d119847e4563593543f7 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 5 Oct 2015 09:12:59 -0400 Subject: [PATCH] [SIGNED-OFF] Bug 14695 - Add new issuing rule This patch fines a new issuing rule 'holds_per_record' which defines the number of holds a given patron can place on a given record. The default is 1 to retain Koha's current behavior as the default. Signed-off-by: Jason M. Burds --- Koha/Schema/Result/Issuingrule.pm | 12 ++++++++++-- admin/smart-rules.pl | 2 ++ installer/data/mysql/atomicupdate/bug_14695.sql | 1 + installer/data/mysql/kohastructure.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 4 ++++ 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_14695.sql diff --git a/Koha/Schema/Result/Issuingrule.pm b/Koha/Schema/Result/Issuingrule.pm index ff1617b..c068eda 100644 --- a/Koha/Schema/Result/Issuingrule.pm +++ b/Koha/Schema/Result/Issuingrule.pm @@ -159,6 +159,12 @@ __PACKAGE__->table("issuingrules"); default_value: 0 is_nullable: 0 +=head2 holds_per_record + + data_type: 'smallint' + default_value: 1 + is_nullable: 0 + =head2 branchcode data_type: 'varchar' @@ -241,6 +247,8 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 1 }, "reservesallowed", { data_type => "smallint", default_value => 0, is_nullable => 0 }, + "holds_per_record", + { data_type => "smallint", default_value => 1, is_nullable => 0 }, "branchcode", { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, "overduefinescap", @@ -268,8 +276,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype"); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-10-22 14:50:45 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jTYQaXLtBrSIGEqpFlgIfg +# Created by DBIx::Class::Schema::Loader v0.07040 @ 2015-10-05 09:16:16 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5KeKXqpCaxR99RwWTEEHEQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 253b08a..c9978f2 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -120,6 +120,7 @@ elsif ($op eq 'add') { $norenewalbefore = undef if $norenewalbefore =~ /^\s*$/; my $auto_renew = $input->param('auto_renew') eq 'yes' ? 1 : 0; my $reservesallowed = $input->param('reservesallowed'); + my $holds_per_record = $input->param('holds_per_record'); my $onshelfholds = $input->param('onshelfholds') || 0; $maxissueqty =~ s/\s//g; $maxissueqty = undef if $maxissueqty !~ /^\d+/; @@ -156,6 +157,7 @@ elsif ($op eq 'add') { norenewalbefore => $norenewalbefore, auto_renew => $auto_renew, reservesallowed => $reservesallowed, + holds_per_record => $holds_per_record, issuelength => $issuelength, lengthunit => $lengthunit, hardduedate => $hardduedate, diff --git a/installer/data/mysql/atomicupdate/bug_14695.sql b/installer/data/mysql/atomicupdate/bug_14695.sql new file mode 100644 index 0000000..cee3561 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_14695.sql @@ -0,0 +1 @@ +ALTER TABLE `issuingrules` ADD `holds_per_record` SMALLINT( 6 ) NOT NULL DEFAULT '1' AFTER `reservesallowed`; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 146565c..031b198 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1187,6 +1187,7 @@ CREATE TABLE `issuingrules` ( -- circulation and fine rules `norenewalbefore` int(4) default NULL, -- no renewal allowed until X days or hours before due date. In the unit set in issuingrules.lengthunit `auto_renew` BOOLEAN default FALSE, -- automatic renewal `reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed + `holds_per_record` SMALLINT( 6 ) NOT NULL DEFAULT '1', -- how many holds are allowed for a single patron per record `branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode) overduefinescap decimal(28,6) default NULL, -- the maximum amount of an overdue fine onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index b871463..3490a06 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -158,6 +158,7 @@ for="tobranch">Clone these rules to: Clone these rules to: Clone these rules to: +