Bugzilla – Attachment 145601 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.15 KB, created by
Jonathan Druart
on 2023-01-24 10:54:46 UTC
(
hide
)
Description:
Bug 27634: Add the ability to exclude fields from "modal" sysprefs
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-01-24 10:54:46 UTC
Size:
4.15 KB
patch
obsolete
>From c7213fb7ce14ec13f53287b8b6bb03e59871cfeb 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 | 6 ++++++ > 3 files changed, 8 insertions(+), 1 deletion(-) > >diff --git a/admin/preferences.pl b/admin/preferences.pl >index 45a5891c623..4595ac64988 100755 >--- a/admin/preferences.pl >+++ b/admin/preferences.pl >@@ -63,6 +63,7 @@ sub _get_chunk { > if( $options{'type'} && $options{'type'} eq 'modalselect' ){ > $chunk->{'source'} = $options{'source'}; > $chunk->{'exclusions'} = $options{'exclusions'} // ""; >+ $chunk->{'inclusions'} = $options{'inclusions'} // ""; > $chunk->{'required'} = $options{'required'} // ""; > $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 b219e449838..1e85a60f686 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >@@ -136,7 +136,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-required="[% CHUNK.required | 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-required="[% CHUNK.required | 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 f5da1d92c4b..fd836f2da10 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 required = $(this).data("required").split('|'); > var pref_name = this.id.replace(/pref_/, ''); > var pref_value = this.value; >@@ -250,10 +251,15 @@ $( document ).ready( function () { > style = "disabled"; > disabled = ' disabled="disabled" '; > checked = ""; >+ } else if( inclusions.indexOf( key ) >= 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="' + key + '" /> ' + data[key]+ ' (' + key + ')</label>'); > }); > $("<div/>", { >-- >2.25.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
|
145599
|
145600
|
145601
|
145602
|
145603
|
145604
|
145605
|
145922
|
147531
|
147532
|
147533
|
147534
|
147535
|
147536
|
147537
|
149746
|
149747
|
149748
|
149896
|
149897
|
149898
|
149899
|
149900
|
149901
|
149902
|
150083
|
150084
|
150085
|
150086
|
150087
|
150088
|
150089
|
150090
|
151046
|
151047
|
151048
|
151049
|
155863
|
155864
|
155865
|
155866
|
155867
|
155868
|
155869
|
155870
|
156203