@@ -, +, @@ --- Koha/Schema/Result/Issuingrule.pm | 8 ++++++++ admin/smart-rules.pl | 2 ++ .../bug_12365_-_add_note_column_to_issuingrules.perl | 9 +++++++++ installer/data/mysql/kohastructure.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 6 +++++- 5 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_12365_-_add_note_column_to_issuingrules.perl --- a/Koha/Schema/Result/Issuingrule.pm +++ a/Koha/Schema/Result/Issuingrule.pm @@ -221,6 +221,12 @@ __PACKAGE__->table("issuingrules"); extra: {list => ["no","yes","bib_only","item_only"]} is_nullable: 0 +=head2 note + + data_type: 'varchar' + is_nullable: 1 + size: 100 + =cut __PACKAGE__->add_columns( @@ -302,6 +308,8 @@ __PACKAGE__->add_columns( extra => { list => ["no", "yes", "bib_only", "item_only"] }, is_nullable => 0, }, + "note", + { data_type => "varchar", is_nullable => 1, size => 100 }, ); =head1 PRIMARY KEY --- a/admin/smart-rules.pl +++ a/admin/smart-rules.pl @@ -182,6 +182,7 @@ elsif ($op eq 'add') { my $article_requests = $input->param('article_requests') || 'no'; my $overduefinescap = $input->param('overduefinescap') || undef; my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on'; + my $note = $input->param('note'); $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price"; my $params = { @@ -215,6 +216,7 @@ elsif ($op eq 'add') { overduefinescap => $overduefinescap, cap_fine_to_replacement_price => $cap_fine_to_replacement_price, article_requests => $article_requests, + note => $note, }; my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br}); --- a/installer/data/mysql/atomicupdate/bug_12365_-_add_note_column_to_issuingrules.perl +++ a/installer/data/mysql/atomicupdate/bug_12365_-_add_note_column_to_issuingrules.perl @@ -0,0 +1,9 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + unless( column_exists( 'issuingrules', 'note' ) ) { + $dbh->do(q|ALTER TABLE issuingrules ADD note varchar(100) default NULL AFTER article_requests|); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 12365: Add column issuingrules.note)\n"; +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -876,6 +876,7 @@ CREATE TABLE `issuingrules` ( -- circulation and fine rules onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed, + `note` varchar(100) default NULL, -- description of rule, reason for setting rule PRIMARY KEY (`branchcode`,`categorycode`,`itemtype`), KEY `categorycode` (`categorycode`), KEY `itemtype` (`itemtype`) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -96,6 +96,7 @@ Item level holds Article requests Rental discount (%) + Note Actions @@ -215,7 +216,8 @@ Item only [% END %] - [% rule.rentaldiscount | html %] + [% rule.rentaldiscount | html %] + [% rule.note | html %] Edit Delete @@ -316,6 +318,7 @@ + @@ -353,6 +356,7 @@ Item level holds Article requests Rental discount (%) + Note   --