Bugzilla – Attachment 118623 Details for
Bug 19787
Adding system preferences to configure the screen messages for SIP checkout flags in Self-Checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19787: Add sysprefs to hide SIP screen messages in self checkout
Bug-19787-Add-sysprefs-to-hide-SIP-screen-messages.patch (text/plain), 16.87 KB, created by
Martin Renvoize (ashimema)
on 2021-03-22 18:49:05 UTC
(
hide
)
Description:
Bug 19787: Add sysprefs to hide SIP screen messages in self checkout
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-03-22 18:49:05 UTC
Size:
16.87 KB
patch
obsolete
>From 0cc39f0b87f2b4690bd3d2bda4f07f42dff8af50 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 14 Dec 2017 22:45:25 +0000 >Subject: [PATCH] Bug 19787: Add sysprefs to hide SIP screen messages in self > checkout > >You'll need two patrons set up for testing the functionality of the >patch. I have only created messages for the check out transaction as >this was the main request. The remaining transactions can be dealt with >in follow-ups. > >Test plan: >Apply patch >Update database >Create your SIP librarian user >Restart SIP server >Go to Administration -> Preferences -> SIP >Confirm that all system preferences for SIP messages are filled with >default messages > >RenewItemSIPMessage >Check out an item to Patron1 using SIP and confirm the 'Item already >checked out to you: renewing item.' message shows >Change the RenewItemSIPMessage syspref to another message, or leave it >empty >Check out the item again and confirm the message has changed >appropriately, but the item is still renewed as expected. > >CheckedToAnotherSIPMessage >Check out an item to Patron2 in the intranet >Check the same item out to Patron1 using SIP and confirm the 'Item >already checked out to another person.' message shows >Change the CheckedToAnotherSIPMessage syspref to another message, or >leave it empty >Check out the item again and confirm the message has changed >appropriately. The item should not be checked out Patron1, it should >stay checked out to Patron2, as expected. > >ReservedSIPMessage >Reserve an item to Patron2 in the intranet >Check out the same item to Patron1 using SIP and confirm the 'Item is >reserved for another patron upon return.' message shows >Change the ReservedSIPMessage syspref to another message, or leave it >empty >Check out the item again and confirm the message has changed >appropriately. The item should not be checked out to Patron1, it should >stay reserved for Patron2, as expected. > >DebtSIPMessage >Create a manual invoice for Patron1 to add some fines to their account >Check out an item to Patron1 using SIP and confirm the 'Outstanding >fines, block issue.' message shows >Change the DebtSIPMessage syspref to another message, or leave it empty >Check out the item again and confirm the message has changed >appropriately. The item should not be checked out to Patron1 and their >fines should not change. > >ReservedWaitingSIPMessage >I've made this syspref but unfortunately couldn't work out where to put >it as I couldn't trigger the message. I've put it where it makes sense >to go (where all the other sysprefs are) but at this point, no message >shows when I do the following: >Reserve an item to Patron1 in the intranet >Check out the item to Patron1 using SIP - I can't see a message here. >Corresponding syspref is ReservedWaitingSIPMessage. > >HighHoldsSIPMessage >Enable the decreaseLoanHighHolds syspref and any other info you need for >testing. (I had 5 days for items with more than 1 hold on the record). >Reserve an item to Patron1 on the intranet. >Reserve the same item to Patron2 on the intranet. >Check out the item to Patron1 using SIP and confirm the 'Loan period >reduced for high-demand item' message shows >Change the HighHoldsSIPMessage syspref to another message, or leave it >empty >Redo both reserves (ensure in the correct priority order) and check out >the item again. Confirm the message has changed appropriately. The item >should be checked out and the hold for that patron removed, as expected. > >Sponsored-by: Whanganui District Council >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/SIP/ILS/Transaction/Checkout.pm | 12 +++---- > .../bug_19787_-_SIP_Message_sysprefs.perl | 14 ++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 7 ++++ > .../prog/en/includes/prefs-menu.inc | 10 ++++++ > .../en/modules/admin/preferences/sip.pref | 32 +++++++++++++++++++ > 5 files changed, 69 insertions(+), 6 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_19787_-_SIP_Message_sysprefs.perl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/sip.pref > >diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm >index 2386d90fa1..82326f175b 100644 >--- a/C4/SIP/ILS/Transaction/Checkout.pm >+++ b/C4/SIP/ILS/Transaction/Checkout.pm >@@ -68,9 +68,9 @@ sub do_checkout { > } else { > foreach my $confirmation (keys %{$needsconfirmation}) { > if ($confirmation eq 'RENEW_ISSUE'){ >- $self->screen_msg("Item already checked out to you: renewing item."); >+ $self->screen_msg( C4::Context->preference('RenewItemSIPMessage') ); > } elsif ($confirmation eq 'RESERVED' and !C4::Context->preference("AllowItemsOnHoldCheckoutSIP")) { >- $self->screen_msg("Item is reserved for another patron upon return."); >+ $self->screen_msg( C4::Context->preference('ReservedSIPMessage') ); > $noerror = 0; > } elsif ($confirmation eq 'RESERVED' and C4::Context->preference("AllowItemsOnHoldCheckoutSIP")) { > next; >@@ -78,19 +78,19 @@ sub do_checkout { > or $confirmation eq 'TRANSFERRED' > or $confirmation eq 'PROCESSING') { > $debug and warn "Item is on hold for another patron."; >- $self->screen_msg("Item is on hold for another patron."); >+ $self->screen_msg( C4::Context->preference('ReservedWaitingSIPMessage') ); > $noerror = 0; > } elsif ($confirmation eq 'ISSUED_TO_ANOTHER') { >- $self->screen_msg("Item already checked out to another patron. Please return item for check-in."); >+ $self->screen_msg( C4::Context->preference('CheckedToAnotherSIPMessage') ); > $noerror = 0; > last; > } elsif ($confirmation eq 'DEBT') { >- $self->screen_msg('Outstanding Fines block issue'); >+ $self->screen_msg( C4::Context->preference('DebtSIPMessage') ); > $noerror = 0; > last; > } elsif ($confirmation eq 'HIGHHOLDS') { > $overridden_duedate = $needsconfirmation->{$confirmation}->{returndate}; >- $self->screen_msg('Loan period reduced for high-demand item'); >+ $self->screen_msg( C4::Context->preference('HighHoldsSIPMessage') ); > } elsif ($confirmation eq 'RENTALCHARGE') { > if ($self->{fee_ack} ne 'Y') { > $noerror = 0; >diff --git a/installer/data/mysql/atomicupdate/bug_19787_-_SIP_Message_sysprefs.perl b/installer/data/mysql/atomicupdate/bug_19787_-_SIP_Message_sysprefs.perl >new file mode 100644 >index 0000000000..1d79818e1a >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_19787_-_SIP_Message_sysprefs.perl >@@ -0,0 +1,14 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('RenewItemSIPMessage','Item already checked out to you: renewing item.',NULL,'Message to be shown when renewing item in self-checkout','Free'), >+ ('ReservedSIPMessage','Item was reserved for you.',NULL,'Message to be shown when attempting to check out an item in self-checkout reserved by another patron','Free'), >+ ('ReservedWaitingSIPMessage','Item is reserved for another patron upon return.',NULL,'Message to be shown when checking out an item in self-checkout that the user has reserved', 'Free'), >+ ('CheckedToAnotherSIPMessage','Item already checked out to another person.', NULL, 'Message to be shown when attempting to check out an item in self-checkout already checked out by another patron', 'Free'), >+ ('DebtSIPMessage','Outstanding fines, block checkout.',NULL,'Message to be shown when patron attempting to check out in self-checkout has outstanding fines','Free'), >+ ('HighHoldsSIPMessage','Loan period reduced for high-demand item',NULL,'Message to be shown when checking out a high demand item','Free') >+ }); >+ >+ NewVersion( $DBversion, 19787, "Add SIP message system preferences (RenewItemSIPMessage, ReservedSIPMessage, ReservedWaitingSIPMessage, CheckedToAnotherSIPMessage, DebtSIPMessage, HighHoldsSIPMessage)" ); >+} >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 1034313061..f94938c2bd 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -123,6 +123,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'), > ('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'), > ('ChargeFinesOnClosedDays','0',NULL,'Charge fines on days the library is closed.','YesNo'), >+('CheckedToAnotherSIPMessage','Item already checked out to another person.', NULL, 'Message to be shown when attempting to check out an item in self-checkout already checked out by another patron', 'Free'), > ('CheckPrevCheckout','hardno','hardyes|softyes|softno|hardno','By default, for every item checked out, should we warn if the patron has borrowed that item in the past?','Choice'), > ('CheckPrevCheckoutDelay','0', NULL,'Maximum number of days that will trigger a warning if the patron has borrowed that item in the past when CheckPrevCheckout is enabled.','free'), > ('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'), >@@ -146,6 +147,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('CustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed in the staff interface. CustomCoverImagesURL must be defined.','YesNo'), > ('CustomCoverImagesURL','',NULL,'Define an URL serving book cover images, using the following patterns: %issn%, %isbn%, FIXME ADD MORE (use it with CustomCoverImages and/or OPACCustomCoverImages)','free'), > ('dateformat','us','metric|us|iso|dmydot','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd, dmydot dd.mm.yyyy)','Choice'), >+('DebtSIPMessage','Outstanding fines, block issue.',NULL,'Message to be shown when patron attempting to check out in self-checkout has outstanding fines','Free'), > ('DebugLevel','2','0|1|2','Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','Choice'), > ('decreaseLoanHighHolds','0','','Decreases the loan period for items with number of holds above the threshold specified in decreaseLoanHighHoldsValue','YesNo'), > ('decreaseLoanHighHoldsControl', 'static', 'static|dynamic', "Chooses between static and dynamic high holds checking", 'Choice'), >@@ -228,6 +230,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'), > ('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'), > ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from their home library will be emphasized and shown first in search results and item details.','YesNo'), >+('HighHoldsSIPMessage','Loan period reduced for high-demand item',NULL,'Message to be shown when checking out a high demand item','Free'), >+('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo'), > ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch\'s items to emphasize. If PatronBranch, emphasize the logged in user\'s library\'s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha\'s Apache configuration file.','Choice'), > ('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'), > ('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'), >@@ -552,6 +556,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('RenewalLog','0','','If ON, log information about renewals','YesNo'), > ('RenewalPeriodBase','date_due','date_due|now','Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','Choice'), > ('RenewalSendNotice','0','',NULL,'YesNo'), >+('RenewItemSIPMessage','Item already checked out to you: renewing item.',NULL,'Message to be shown when checking out an item already checked out to that user in self-checkout','Free'), > ('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'), > ('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo'), > ('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'), >@@ -559,6 +564,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'), > ('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'), > ('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'), >+('ReservedSIPMessage','Item was reserved for you.',NULL,'Message to be shown when attempting to check out an item in self-checkout reserved by another patron','Free'), >+('ReservedWaitingSIPMessage','Item is reserved for another patron upon return.',NULL,'Message to be shown when checking out an item in self-checkout that the user has reserved', 'Free'), > ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'), > ('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'), > ('ReservesNeedReturns','1','','If ON, a hold placed on an item available in this library must be checked-in, otherwise, a hold on a specific item, that is in the library & available is considered available','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc >index 055069e75c..cdc45f27fe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc >@@ -139,6 +139,16 @@ > [% END %] > </li> > >+ [% IF ( sip ) %] >+ <li class="active"> >+ <a title="SIP" href="/cgi-bin/koha/admin/preferences.pl?tab=sip">SIP</a> >+ [% PROCESS subtabs %] >+ [% ELSE %] >+ <li> >+ <a title="SIP" href="/cgi-bin/koha/admin/preferences.pl?tab=sip">SIP</a> >+ [% END %] >+ </li> >+ > [% IF ( staff_interface ) %] > <li class="active"> > <a title="Staff interface" href="/cgi-bin/koha/admin/preferences.pl?tab=staff_interface">Staff interface</a> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/sip.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/sip.pref >new file mode 100644 >index 0000000000..52cf415115 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/sip.pref >@@ -0,0 +1,32 @@ >+SIP: >+ Custom SIP messages: >+ - >+ - "When renewing an item in self-checkout, show the message:" >+ - pref: RenewItemSIPMessage >+ class: multi >+ - or leave blank to show no message. >+ - >+ - "When checking out an item in self-checkout reserved to another patron, show the message:" >+ - pref: ReservedSIPMessage >+ class: multi >+ - or leave blank to show no message. >+ - >+ - "When checking out an item in self-checkout that the user has reserved, show the message:" >+ - pref: ReservedWaitingSIPMessage >+ class: multi >+ - or leave blank to show no message. >+ - >+ - "When checking out an item in self-checkout that is already checked out to another patron, show the message:" >+ - pref: CheckedToAnotherSIPMessage >+ class: multi >+ - or leave blank to show no message. >+ - >+ - "When patron attempting to check out an item in self-checkout has outstanding fines, show the message:" >+ - pref: DebtSIPMessage >+ class: multi >+ - or leave blank to show no message. >+ - >+ - "When checking out an item in high demand, show the message:" >+ - pref: HighHoldsSIPMessage >+ class: multi >+ - or leave blank to show no message. >-- >2.20.1
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 19787
:
69809
|
90537
|
110077
| 118623