Bugzilla – Attachment 153514 Details for
Bug 31731
Offer user a dropdown of authorized values instead of a text field in preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31731: Offer user a dropdown of authorized values instead of a text field in preferences
Bug-31731-Offer-user-a-dropdown-of-authorized-valu.patch (text/plain), 6.02 KB, created by
Katrin Fischer
on 2023-07-16 11:30:16 UTC
(
hide
)
Description:
Bug 31731: Offer user a dropdown of authorized values instead of a text field in preferences
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-07-16 11:30:16 UTC
Size:
6.02 KB
patch
obsolete
>From ed67025d1939006a84acf083a33a3a512c8fc63b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 10 Jul 2023 13:46:48 +0000 >Subject: [PATCH] Bug 31731: Offer user a dropdown of authorized values instead > of a text field in preferences > >This patch updates the system preferences interface so that preferences >which ask for a single authorized value can offer a dropdown menu of >choices instead of a text field. > >The patch also updates a few existing preferences to use the new >feature: BundleLostValue, BundleNotLoanValue, and >ClaimReturnedLostValue. > >To test, apply the patch and restart services. > >- Go to Administration -> System preferences and search for "authorized > value." >- The search results should include the entries for BundleLostValue, > BundleNotLoanValue, and ClaimReturnedLostValue. >- Confirm that the dropdowns show the correct authorized value category > (LOST or NOT_LOAN) >- Confirm that setting or unsetting each of the preferences works > correctly. > >Signed-off-by: Sam Lau <samalau@gmail.com> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > admin/preferences.pl | 5 +++++ > .../prog/en/modules/admin/preferences.tt | 14 +++++++++++--- > .../en/modules/admin/preferences/circulation.pref | 6 ++++++ > 3 files changed, 22 insertions(+), 3 deletions(-) > >diff --git a/admin/preferences.pl b/admin/preferences.pl >index 45a5891c62..e43491c1ea 100755 >--- a/admin/preferences.pl >+++ b/admin/preferences.pl >@@ -102,6 +102,11 @@ sub _get_chunk { > } elsif ( $options{choices} eq 'patron-categories' ) { > $options{choices} = { map { $_->categorycode => $_->description } Koha::Patron::Categories->search->as_list }; > $add_blank = 1; >+ } elsif ( $options{'choices'} eq 'authval' ){ >+ if( $options{'source'} ){ >+ $options{'choices'} = { map { $_->authorised_value => $_->lib } Koha::AuthorisedValues->search( { category => $options{'source'} } )->as_list }; >+ $add_blank = 1; >+ } > } else { > die 'Unrecognized source of preference values: ' . $options{'choices'}; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >index 1bc1458141..aa93e7e622 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >@@ -131,9 +131,17 @@ > [% ELSIF ( CHUNK.type_modalselect ) %] > <input type="text" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="modalselect preference preference-[% CHUNK.type | html %]" data-source="[% CHUNK.source | html %]" data-required="[% CHUNK.required | html %]" data-exclusions="[% CHUNK.exclusions | html %]" readonly="readonly" value="[% CHUNK.value | html %]"/> > [% ELSIF ( CHUNK.type_multiple ) %] >- <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple"> >- [% FOREACH CHOICE IN CHUNK.CHOICES %][% IF ( CHOICE.selected ) %]<option value="[% CHOICE.value | html %]" selected="selected">[% ELSE %]<option value="[% CHOICE.value | html %]">[% END %][% CHOICE.text | html %]</option>[% END %] >- </select> >+ <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple"> >+ [% FOREACH CHOICE IN CHUNK.CHOICES %] >+ [% IF ( CHOICE.selected ) %] >+ <option value="[% CHOICE.value | html %]" selected="selected"> >+ [% ELSE %] >+ <option value="[% CHOICE.value | html %]"> >+ [% END %] >+ [% CHOICE.text | html %] >+ </option> >+ [% END %] >+ </select> > [% ELSIF ( CHUNK.type_textarea )%] > [% IF ( CHUNK.syntax == "text/html" && Koha.Preference('UseWYSIWYGinSystemPreferences') ) %] > <textarea name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %] mce" rows="20" cols="60">[% CHUNK.value | html %]</textarea> >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 ffe8481869..4a2975f51b 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 >@@ -1285,10 +1285,14 @@ Circulation: > - > - Use the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=LOST">LOST</a> authorized value > - pref: BundleLostValue >+ choices: authval >+ source: LOST > - to represent 'missing from bundle' at return. > - > - Use the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=NOT_LOAN">NOT_LOAN</a> authorized value > - pref: BundleNotLoanValue >+ choices: authval >+ source: NOT_LOAN > - to represent 'added to bundle' when an item is attached to bundle. > > Return claims: >@@ -1304,6 +1308,8 @@ Circulation: > - > - Use the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=LOST">LOST</a> authorized value > - pref: ClaimReturnedLostValue >+ choices: authval >+ source: LOST > - to represent 'claims returned'. > - > - Warn librarians that a patron has excessive return claims if the patron has claimed the return of more than >-- >2.30.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 31731
:
153269
|
153270
| 153514 |
153515