Bugzilla – Attachment 176160 Details for
Bug 38776
Propose a list of value for restriction comment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38776: (QA follow-up) UI improvement + category renamed
Bug-38776-QA-follow-up-UI-improvement--category-re.patch (text/plain), 5.51 KB, created by
Arthur Suzuki
on 2025-01-06 15:33:06 UTC
(
hide
)
Description:
Bug 38776: (QA follow-up) UI improvement + category renamed
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2025-01-06 15:33:06 UTC
Size:
5.51 KB
patch
obsolete
>From 093b71a09e28076a853ae8b1fd8c0a0593bba36e Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Mon, 6 Jan 2025 16:23:10 +0100 >Subject: [PATCH] Bug 38776: (QA follow-up) UI improvement + category renamed > >- The authorised value category was renamed from "R_COMMENTS" to a >more explicit value : "RESTRICTION_COMMENTS" >- It is now easier in the patron detail page to either select one of >the defined value or to fill in a custom value (select "other" then >type your comment). >--- > installer/data/mysql/atomicupdate/bug_38776.pl | 13 +++++++++++++ > .../prog/en/includes/patron-restrictions-tab.inc | 14 ++++++++------ > .../prog/en/modules/admin/authorised_values.tt | 2 +- > .../prog/en/modules/members/moremember.tt | 1 + > .../intranet-tmpl/prog/js/patron-restrictions.js | 14 ++++++++++++++ > 5 files changed, 37 insertions(+), 7 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_38776.pl > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/patron-restrictions.js > >diff --git a/installer/data/mysql/atomicupdate/bug_38776.pl b/installer/data/mysql/atomicupdate/bug_38776.pl >new file mode 100755 >index 00000000000..33693880d7c >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_38776.pl >@@ -0,0 +1,13 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "BUG_38776", >+ description => "Add RESTRICTION_COMMENTS authorised_value category", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{INSERT INTO authorised_value_categories VALUES ('RESTRICTION_COMMENTS',0,0);}); >+ say $out "Added 'RESTRICTION_COMMENTS' authorised_values category"; >+ }, >+}; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc >index aadf9f5bebe..93ed35c104e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc >@@ -82,13 +82,15 @@ > [% END %] > <li> > <label for="rcomment">Comment:</label> >- <input type="text" id="rcomment" list="rcomments" name="comment"/> >- <datalist id="rcomments"> >- [% FOREACH rcomment IN AuthorisedValues.Get( 'R_COMMENTS' ) %] >- <option value="[% rcomment.lib | html %]">[% rcomment.lib | html %]</option> >+ <select class="select-reason" id="restriction-reason"> >+ <option value=""> -- Choose a reason -- </option> >+ [% FOREACH rcomment IN AuthorisedValues.Get( 'RESTRICTION_COMMENTS' ) %] >+ <option value="[% rcomment.lib | html %]">[% rcomment.lib | html %]</option> > [% END %] >- </datalist> >- <input type="submit"> >+ <option value="other">Others...</option> >+ </select> >+ <input type="text" id="other_reason" placeholder="please note your reason here..." /> >+ <input type="hidden" id="rcomment" name="comment"> > </li> > <li> > <label for="rexpiration">Expiration:</label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >index 9dd5f46a4bb..6acd1391b27 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >@@ -543,7 +543,7 @@ > <p>Can be used to further sort and filter your reports. This category is empty by default. Values here need to include the authorized value code from REPORT_GROUP in the Description (OPAC) field to link the subgroup to the appropriate group.</p> > [% CASE 'RESTRICTED' %] > <p>Restricted status of an item</p> >- [% CASE 'R_COMMENTS' %] >+ [% CASE 'RESTRICTION_COMMENTS' %] > <p>Values for custom patron restriction comments to pre-fill the manual restrictions. The value in the description field should be the message text and is limited to 200 characters</p> > [% CASE 'ROADTYPE' %] > <p>Road types to be used in patron addresses</p> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index a12b9e3a504..8b8fdccd511 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -840,6 +840,7 @@ > </script> > [% Asset.js("js/checkouts.js") | $raw %] > [% Asset.js("js/tables/bookings.js") | $raw %] >+ [% Asset.js("js/patron-restrictions.js") | $raw %] > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/patron-restrictions.js b/koha-tmpl/intranet-tmpl/prog/js/patron-restrictions.js >new file mode 100644 >index 00000000000..9d2f5085831 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/patron-restrictions.js >@@ -0,0 +1,14 @@ >+$(document).ready(function(){ >+ $("#other_reason").on('change', function(){ >+ $("#rcomment").val($(this).val()); >+ }); >+ $("select#restriction-reason").on('change', function(){ >+ if($(this).val() == "other"){ >+ $("#other_reason").show(); >+ $("#rcomment").val(''); >+ return; >+ } >+ $("#other_reason").hide(); >+ $("#rcomment").val($(this).val()); >+ }) >+}); >-- >2.39.5
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 38776
:
175912
|
176160
|
176493
|
176496
|
176497
|
176498