Bugzilla – Attachment 68284 Details for
Bug 19287
Add ability to mark an item 'Lost' from 'Holds to pull' list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19287: Do not use 'yes' and 'no' for choices
Bug-19287-Do-not-use-yes-and-no-for-choices.patch (text/plain), 8.03 KB, created by
Jonathan Druart
on 2017-10-18 23:01:29 UTC
(
hide
)
Description:
Bug 19287: Do not use 'yes' and 'no' for choices
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-10-18 23:01:29 UTC
Size:
8.03 KB
patch
obsolete
>From 038f5a618f8a2dc5c5155f8ba239d4f6cc0711a3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 18 Oct 2017 19:59:42 -0300 >Subject: [PATCH] Bug 19287: Do not use 'yes' and 'no' for choices > >If the pref value is 'yes' or 'no', it will actually be '1' or '0' in >DB, and the comparaison will then fail. >To avoid that I think it is better to rename the value. >--- > circ/waitingreserves.pl | 4 ++-- > installer/data/mysql/atomicupdate/bug_19287.sql | 2 +- > installer/data/mysql/sysprefs.sql | 2 +- > .../prog/en/modules/admin/preferences/circulation.pref | 6 +++--- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt | 6 +++--- > 5 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index ab28b41d40..3e2ca1a55d 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -79,11 +79,11 @@ if ( $op eq 'cancel_reserve' and $item) { > my $reserve_id = $input->param('reserve_id'); > my $hold = Koha::Holds->find( $reserve_id ); > die "wrong reserve_id" unless $hold; # This is a bit rude, but we are not supposed to get a wrong reserve_id >- if ( C4::Context->preference('CanMarkHoldsAwaitingPickupAsLost') =~ m|^yes| ) { >+ if ( C4::Context->preference('CanMarkHoldsAwaitingPickupAsLost') =~ m|^allow| ) { > my $itemnumber = $hold->item->itemnumber; > my $patron = $hold->borrower; > C4::Circulation::LostItem( $itemnumber, 'MARK RETURNED' ); # FIXME Do we have to mark it returned? There is no pref for that? See other occurrences of 'LostItem(' >- if ( $op eq 'mark_as_lost_and_notify' and C4::Context->preference('CanMarkHoldsAwaitingPickupAsLost') eq 'yes_and_notify' ) { >+ if ( $op eq 'mark_as_lost_and_notify' and C4::Context->preference('CanMarkHoldsAwaitingPickupAsLost') eq 'allow_and_notify' ) { > my $library = $hold->branch; > my $letter = C4::Letters::GetPreparedLetter( > module => 'reserves', >diff --git a/installer/data/mysql/atomicupdate/bug_19287.sql b/installer/data/mysql/atomicupdate/bug_19287.sql >index 7ae924b792..ff754930eb 100644 >--- a/installer/data/mysql/atomicupdate/bug_19287.sql >+++ b/installer/data/mysql/atomicupdate/bug_19287.sql >@@ -1,3 +1,3 @@ >-INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('CanMarkHoldsAwaitingPickupAsLost','no','no|yes|yes_and_notify','Add a button on the "Holds awaiting pickup" screen to mark an item as lost and notify the patron.','Choice'); >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('CanMarkHoldsAwaitingPickupAsLost','do_not_allow','do_not_allow|allow|allow_and_notify','Add a button on the "Holds awaiting pickup" screen to mark an item as lost and notify the patron.','Choice'); > > INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('reserves', 'CANCEL_HOLD_ON_LOST', '', 'Hold has been cancelled', 0, "Hold has been cancelled", "Dear [% borrower.firstname %] [% borrower.surname %],\n\nWe regret to inform you that the following item cannot longer be placed on hold, it has been marked as lost\n\nTitle: [% biblio.title %]\nAuthor: [% biblio.author %]\nCopy: [% item.copynumber %]\nLocation: [% branch.branchname %]", 'email', 'default'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 104e56a0b9..8b66853fa1 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -255,7 +255,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('MARCAuthorityControlField008','|| aca||aabn | a|a d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'), > ('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'), > ('MarcItemFieldsToOrder','',NULL,'Set the mapping values for new item records created from a MARC record in a staged file. In a YAML format.','textarea'), >-('CanMarkHoldsAwaitingPickupAsLost','no','no|yes|yes_and_notify','Add a button on the "Holds awaiting pickup" screen to mark an item as lost and notify the patron.','Choice'), >+('CanMarkHoldsAwaitingPickupAsLost','do_not_allow','do_not_allow|allow|allow_and_notify','Add a button on the "Holds awaiting pickup" screen to mark an item as lost and notify the patron.','Choice'), > ('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'), > ('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'), > ('MaxItemsToDisplayForBatchDel','1000',NULL,'Display up to a given number of items in a single item deletionbatch.','Integer'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index acc56a4c46..4e5bfde238 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -693,9 +693,9 @@ Circulation: > - > - pref: CanMarkHoldsAwaitingPickupAsLost > choices: >- no: "Do not allow to mark items as lost" >- yes: "Allow to mark items as lost" >- yes_and_notify: "Allow to mark items as lost and notify the patron" >+ do_not_allow: "Do not allow to mark items as lost" >+ allow: "Allow to mark items as lost" >+ allow_and_notify: "Allow to mark items as lost and notify the patron" > - "from the 'Holds awaiting pickup' screen" > Fines Policy: > - >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >index 397b39c6f4..b2525d6a0b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -191,16 +191,16 @@ > <input type="submit" value="Cancel hold" /> > [% END %] > </form> >- [% IF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') != 'no' %] >+ [% IF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') != 'do_not_allow' %] > <form name="cancelReserve" action="waitingreserves.pl" method="post"> > <input type="hidden" name="reserve_id" value="[% hold.reserve_id %]" /> > <input type="hidden" name="fbr" value="[% hold.holdingbranch %]" /> > <input type="hidden" name="tbr" value="[% hold.homebranch %]" /> > <input type="hidden" name="tab" value="[% tab %]"> >- [% IF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') == 'yes' %] >+ [% IF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') == 'allow' %] > <input type="hidden" name="op" value="mark_as_lost" /> > <input type="submit" value="Mark item as lost" /> >- [% ELSIF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') == 'yes_and_notify' %] >+ [% ELSIF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') == 'allow_and_notify' %] > <input type="hidden" name="op" value="mark_as_lost_and_notify" /> > <input type="submit" value="Mark item as lost and notify the patron" /> > [% END %] >-- >2.11.0
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 19287
:
68226
|
68227
|
68228
|
68229
|
68230
|
68251
|
68252
|
68253
|
68254
|
68255
|
68284
|
69746
|
70705
|
70764
|
70918
|
70919
|
73881
|
73882
|
73883
|
73884
|
73885
|
73886
|
73887
|
73888
|
73889
|
74696
|
74697
|
74698
|
74699
|
74700
|
74701
|
74702
|
74703
|
74704
|
74705
|
74749
|
75535