Bugzilla – Attachment 116380 Details for
Bug 27634
Turn off patron self-registration if no default category is set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27634: Add the ability to exclude fields from "modal" sysprefs
Bug-27634-Add-the-ability-to-exclude-fields-from-m.patch (text/plain), 4.04 KB, created by
Jonathan Druart
on 2021-02-05 10:47:33 UTC
(
hide
)
Description:
Bug 27634: Add the ability to exclude fields from "modal" sysprefs
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-02-05 10:47:33 UTC
Size:
4.04 KB
patch
obsolete
>From 37e449bd696e53331f309a04d7cf047ddf6bb4d9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 5 Feb 2021 11:08:37 +0100 >Subject: [PATCH] Bug 27634: Add the ability to exclude fields from "modal" > sysprefs > >--- > admin/preferences.pl | 1 + > .../intranet-tmpl/prog/en/modules/admin/preferences.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js | 7 +++++++ > 3 files changed, 9 insertions(+), 1 deletion(-) > >diff --git a/admin/preferences.pl b/admin/preferences.pl >index 1353397b9b..ab6d948b1b 100755 >--- a/admin/preferences.pl >+++ b/admin/preferences.pl >@@ -68,6 +68,7 @@ sub _get_chunk { > if( $options{'type'} && $options{'type'} eq 'modalselect' ){ > $chunk->{'source'} = $options{'source'}; > $chunk->{'exclusions'} = $options{'exclusions'} // ""; >+ $chunk->{'inclusions'} = $options{'inclusions'} // ""; > $chunk->{'type'} = 'modalselect'; > } > >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 dc9377fc01..2a89074ddf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >@@ -112,7 +112,7 @@ > [% END %] > </select> > [% 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-exclusions="[% CHUNK.exclusions | html %]" readonly="readonly" value="[% CHUNK.value | html %]"/> >+ <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-exclusions="[% CHUNK.exclusions | html %]" data-inclusions="[% CHUNK.inclusions | 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 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >index e7d8dad01a..e97b016e11 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >@@ -226,6 +226,7 @@ $( document ).ready( function () { > $(".modalselect").on("click", function(){ > var datasource = $(this).data("source"); > var exclusions = $(this).data("exclusions").split('|'); >+ var inclusions = $(this).data("inclusions").split('|'); > var pref_name = this.id.replace(/pref_/, ''); > var pref_value = this.value; > var prefs = pref_value.split("|"); >@@ -244,10 +245,16 @@ $( document ).ready( function () { > style = "disabled"; > disabled = ' disabled="disabled" '; > checked = ""; >+ } >+ else if( inclusions.indexOf( val ) >= 0 ){ >+ style = "disabled"; >+ disabled = ' disabled="disabled" '; >+ checked = ' checked="checked" '; > } else { > style = ""; > disabled = ""; > } >+ > items.push('<label class="' + style +'"><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + disabled + ' name="pref" value="' + val + '" /> ' + key + '</label>'); > }); > $("<div/>", { >-- >2.20.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 27634
:
116378
|
116379
| 116380 |
116381
|
116382
|
116383
|
116491