From 92c7c96ea9fc4a145e5c9fe1315e55505329f77b Mon Sep 17 00:00:00 2001 From: Aleisha Amohia 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 --- C4/SIP/ILS/Transaction/Checkout.pm | 12 ++++---- Koha/Schema/Result/Category.pm | 18 ++++++------ .../bug_19787_-_SIP_Message_sysprefs.perl | 14 ++++++++++ installer/data/mysql/sysprefs.sql | 6 ++++ .../intranet-tmpl/prog/en/includes/prefs-menu.inc | 10 +++++++ .../prog/en/modules/admin/preferences/sip.pref | 32 ++++++++++++++++++++++ 6 files changed, 77 insertions(+), 15 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 01aa8fbc60..203b6cfbde 100644 --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ b/C4/SIP/ILS/Transaction/Checkout.pm @@ -68,26 +68,26 @@ 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' or $confirmation eq 'RESERVE_WAITING') { my $x = $self->{item}->available($patron->borrowernumber); if ($x) { - $self->screen_msg("Item was reserved for you."); + $self->screen_msg( C4::Context->preference('ReservedWaitingSIPMessage') ); } else { - $self->screen_msg("Item is reserved for another patron upon return."); + $self->screen_msg( C4::Context->preference('ReservedSIPMessage') ); $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/Koha/Schema/Result/Category.pm b/Koha/Schema/Result/Category.pm index 363329d265..fb13a1919d 100644 --- a/Koha/Schema/Result/Category.pm +++ b/Koha/Schema/Result/Category.pm @@ -133,11 +133,6 @@ __PACKAGE__->table("categories"); data_type: 'tinyint' is_nullable: 1 -=head2 exclude_from_local_holds_priority - - data_type: 'tinyint' - is_nullable: 1 - =head2 min_password_length data_type: 'smallint' @@ -148,6 +143,11 @@ __PACKAGE__->table("categories"); data_type: 'tinyint' is_nullable: 1 +=head2 exclude_from_local_holds_priority + + data_type: 'tinyint' + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -204,12 +204,12 @@ __PACKAGE__->add_columns( { data_type => "tinyint", is_nullable => 1 }, "change_password", { data_type => "tinyint", is_nullable => 1 }, - "exclude_from_local_holds_priority", - { data_type => "tinyint", is_nullable => 1 }, "min_password_length", { data_type => "smallint", is_nullable => 1 }, "require_strong_password", { data_type => "tinyint", is_nullable => 1 }, + "exclude_from_local_holds_priority", + { data_type => "tinyint", is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -302,8 +302,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-09-02 12:50:50 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JOzFLxLwouaTl5dQJrOdZA +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-09-15 10:31:51 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wlBdudAHY6dDNX0J4OUgFg __PACKAGE__->add_columns( '+exclude_from_local_holds_priority' => { is_boolean => 1 }, 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/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 1df6a1fb53..7b991f9ecd 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -122,6 +122,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'), ('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'), +('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'), ('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'), ('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'), @@ -143,6 +144,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',NULL,'','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'), @@ -222,6 +224,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'), ('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'), +('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'), @@ -537,6 +540,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'), @@ -544,6 +548,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 7024bd0ae2..18d09622b2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc @@ -138,6 +138,16 @@ [% END %] + [% IF ( sip ) %] +
  • + SIP + [% PROCESS subtabs %] + [% ELSE %] +
  • + SIP + [% END %] +
  • + [% IF ( staff_interface ) %]
  • Staff interface 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.11.0