Bugzilla – Attachment 66830 Details for
Bug 12365
Allow descriptive notes to be added to circulation and fine rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12365 - Notes for rules
Bug-12365---Notes-for-rules.patch (text/plain), 6.50 KB, created by
Aleisha Amohia
on 2017-09-05 03:05:01 UTC
(
hide
)
Description:
Bug 12365 - Notes for rules
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-09-05 03:05:01 UTC
Size:
6.50 KB
patch
obsolete
>From 38c35f278c764c023d7b288361dd2789c2c536cc Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 19 Jun 2017 19:47:52 +0000 >Subject: [PATCH] Bug 12365 - Notes for rules > >Lee Jamison <ldjamison@marywood.edu> rescued this patch. >It is a clean re-build of attachments 61865 and 63902 >to fix the merge conflict introduced during application of both >attachments. > >To test: >Follow test plan in Comment 2 > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: macon lauren KohaCon17 <caballeromaricon@gmail.com> >--- > 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 > >diff --git a/Koha/Schema/Result/Issuingrule.pm b/Koha/Schema/Result/Issuingrule.pm >index 0ea74ca..924835a 100644 >--- a/Koha/Schema/Result/Issuingrule.pm >+++ b/Koha/Schema/Result/Issuingrule.pm >@@ -215,6 +215,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( >@@ -294,6 +300,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 >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index 6a55b7b..aa9e327 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -160,6 +160,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 = { >@@ -192,6 +193,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}); >diff --git a/installer/data/mysql/atomicupdate/bug_12365_-_add_note_column_to_issuingrules.perl b/installer/data/mysql/atomicupdate/bug_12365_-_add_note_column_to_issuingrules.perl >new file mode 100644 >index 0000000..6b4d671 >--- /dev/null >+++ b/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"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e227125..87f49f1 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -886,6 +886,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`) >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 5bc44ba..b6c41b3 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 >@@ -194,6 +194,7 @@ $(document).ready(function() { > <th>Item level holds</th> > <th>Article requests</th> > <th>Rental discount (%)</th> >+ <th>Note</th> > <th>Actions</th> > </tr> > </thead> >@@ -298,6 +299,7 @@ $(document).ready(function() { > [% END %] > </td> > <td>[% rule.rentaldiscount %]</td> >+ <td>[% rule.note %]</td> > <td class="actions"> > <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> > <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% rule.itemtype %]&categorycode=[% rule.categorycode %]&branch=[% rule.current_branch %]"><i class="fa fa-trash"></i> Delete</a> >@@ -397,6 +399,7 @@ $(document).ready(function() { > </select> > </td> > <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td> >+ <td><input type="text" name="note" id="note" size="15" value=""></td> > <td class="actions"> > <input type="hidden" name="branch" value="[% current_branch %]"/> > <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button> >@@ -433,7 +436,8 @@ $(document).ready(function() { > <th>Item level holds</th> > <th>Article requests</th> > <th>Rental discount (%)</th> >- <th> </th> >+ <th>Note</th> >+ <th colspan="2"> </th> > </tr> > </tfoot> > </tbody> >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12365
:
61865
|
63902
|
64441
|
64443
|
64565
|
66829
|
66830
|
67802
|
76609
|
76637
|
76658
|
77147
|
77275
|
78685
|
78686
|
80790
|
80956
|
80957
|
80958
|
80997
|
80998
|
81603
|
81604
|
81605
|
81606
|
81647
|
81648
|
81649
|
81650
|
82081