Bugzilla – Attachment 188498 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), 4.73 KB, created by
Arthur Suzuki
on 2025-10-28 09:49:38 UTC
(
hide
)
Description:
Bug 38776: (QA follow-up) UI improvement + category renamed
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2025-10-28 09:49:38 UTC
Size:
4.73 KB
patch
obsolete
>From 600d2017e44ca8a22d02bcbc041b2b67e7db23c8 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 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >- 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). > >Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com> >--- > installer/data/mysql/atomicupdate/bug_38776.pl | 13 +++++++++++++ > .../prog/en/includes/patron-restrictions-tab.inc | 12 +++++++----- > .../prog/en/modules/admin/authorised_values.tt | 2 +- > .../intranet-tmpl/prog/js/patron-restrictions.js | 14 ++++++++++++++ > 4 files changed, 35 insertions(+), 6 deletions(-) > create mode 100644 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 100644 >index 0000000000..33693880d7 >--- /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 d7e527ee2b..6f7bcb90f3 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' ) %] >+ <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 92030f0c4e..b752411f8e 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 >@@ -549,7 +549,7 @@ > > > [% 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/js/patron-restrictions.js b/koha-tmpl/intranet-tmpl/prog/js/patron-restrictions.js >new file mode 100644 >index 0000000000..7246eab02c >--- /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
|
177857
|
177858
|
177859
|
188497
| 188498 |
188499
|
188500