Bugzilla – Attachment 170302 Details for
Bug 37641
Add syspref to make claim returned note mandatory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37641: Add syspref to make claim returned note mandatory
Bug-37641-Add-syspref-to-make-claim-returned-note-.patch (text/plain), 5.57 KB, created by
Wainui Witika-Park
on 2024-08-14 02:57:53 UTC
(
hide
)
Description:
Bug 37641: Add syspref to make claim returned note mandatory
Filename:
MIME Type:
Creator:
Wainui Witika-Park
Created:
2024-08-14 02:57:53 UTC
Size:
5.57 KB
patch
obsolete
>From 5ad05258b86b99245ca9435e5f77188f4b4bef09 Mon Sep 17 00:00:00 2001 >From: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> >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 >--- > .../bug_37641-add_mynewpref_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_mynewpref_syspref.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_37641-add_mynewpref_syspref.pl b/installer/data/mysql/atomicupdate/bug_37641-add_mynewpref_syspref.pl >new file mode 100755 >index 00000000000..b50ef599dcb >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_37641-add_mynewpref_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' %] > <script> >+ // MANDATORY NOTE >+ var ClaimReturnedMandatoryNote = "[% Koha.Preference('ClaimReturnedMandatoryNote') | html %]"; >+ // if syspref is enabled, make the note mandatory >+ if (ClaimReturnedMandatoryNote == 1) { >+ // Disable the "Make claim" button until text has been added to the "Notes" field on the claims returned modal >+ $('#claims-returned-modal-btn-submit').attr('disabled','disabled').attr('title', _('You can\'t submit this form with an empty note')); >+ $('#claims-returned-notes').attr('placeholder', _('Please add note explaining the reason for the claim')); >+ $('#claims-returned-notes').keyup(function() { >+ $('#claims-returned-modal-btn-submit').removeAttr('title'); >+ $('#claims-returned-modal-btn-submit').removeAttr('disabled'); >+ }); >+ } > > // Verify if the syspref is defined > var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]"; >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 76983576a6a..b9d7de913e8 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 >@@ -1436,6 +1436,12 @@ Circulation: > class: integer > - days. > - <span class="hint">This system preference is used by the cleanup_database.pl cronjob.</span> >+ - >+ - pref: ClaimReturnedMandatoryNote >+ choices: >+ 1: Enable >+ 0: Disable >+ - " a check to ensure the note is not empty before making a claim." > > Recalls: > - >-- >2.39.2
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 37641
:
170302
|
170304