Bugzilla – Attachment 177858 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.34 KB, created by
Jonathan Druart
on 2025-02-12 13:18:30 UTC
(
hide
)
Description:
Bug 38776: (QA follow-up) UI improvement + category renamed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-02-12 13:18:30 UTC
Size:
5.34 KB
patch
obsolete
>From 15809094775d00d886617202836908943359ae4d 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 +- > .../prog/en/modules/members/moremember.tt | 1 + > .../intranet-tmpl/prog/js/patron-restrictions.js | 14 ++++++++++++++ > 5 files changed, 36 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 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 d7e527ee2b0..6f7bcb90f3f 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 f67d9570427..f7e0c3eccef 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 >@@ -545,7 +545,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/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index f0d61473a73..7b95ab24544 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -847,6 +847,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..7246eab02c1 >--- /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.34.1
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