From bb6d5c41bcd4686ef679e41e2ad8eff6a041de4c Mon Sep 17 00:00:00 2001 From: Wainui Witika-Park Date: Wed, 14 Aug 2024 13:45:36 +1200 Subject: [PATCH] Bug 37641: Add syspref to make claim returned note mandatory To test: 1) Make sure ClaimReturnedLostValue syspref is set 2) Check out an item 3) Go to the account of the borrower who checked out the patron 4) Go to the checkouts table 5) There should be a column "Return claims" with a button "Claims returned" 6) Click the "Claims returned" button 7) Notice the pop up 8) Don't write anything in the note 9) Submit - make the claim 10) Notice it will let you make the claim without putting any notes in 11) Apply patch 12) Enable syspref ClaimReturnedMandatoryNote 13) Do steps 2-9 again 14) Notice it will not let you make the claim without putting any notes in it 15) Extra testing - Disable syspref ClaimReturnedMandatoryNote, run through steps 2-10 Sponsored-by: Pymble Ladies' College --- ...1-add_ClaimReturnedMandatoryNote_syspref.pl | 18 ++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../prog/en/includes/modal-claims.inc | 12 ++++++++++++ .../modules/admin/preferences/circulation.pref | 6 ++++++ 4 files changed, 37 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_37641-add_ClaimReturnedMandatoryNote_syspref.pl diff --git a/installer/data/mysql/atomicupdate/bug_37641-add_ClaimReturnedMandatoryNote_syspref.pl b/installer/data/mysql/atomicupdate/bug_37641-add_ClaimReturnedMandatoryNote_syspref.pl new file mode 100755 index 00000000000..b50ef599dcb --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37641-add_ClaimReturnedMandatoryNote_syspref.pl @@ -0,0 +1,18 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "37641", + description => "Ability to make claim returned note mandatory", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + + $dbh->do( + q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('ClaimReturnedMandatoryNote', '0', NULL, 'If enabled, claims note will be mandatory - there must be something in the note field', 'YesNo') } + ); + + say $out "Added new system preference 'ClaimReturnedMandatoryNote'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 1a7cd033e90..b16eb3f67ab 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -160,6 +160,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'), ('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'), ('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'), +('ClaimReturnedMandatoryNote','0',NULL,'If enabled, claims note will be mandatory - there must be something in the note field', 'YesNo'), ('ClaimsBccCopy','0','','Bcc the ClaimAcquisition and ClaimIssues alerts','YesNo'), ('ClaimsLog','1',NULL,'If ON, log all notices sent','YesNo'), ('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' ), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modal-claims.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modal-claims.inc index be16faa851a..08e58f03d4d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/modal-claims.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modal-claims.inc @@ -42,6 +42,18 @@ [% BLOCK 'modal-claims-js' %]