@@ -, +, @@
---
admin/preferences.pl | 15 ++++++++++-----
koha-tmpl/intranet-tmpl/prog/css/preferences.css | 9 ++++++---
.../prog/en/modules/admin/preferences.tt | 2 ++
.../intranet-tmpl/prog/js/pages/preferences.js | 4 ++++
4 files changed, 22 insertions(+), 8 deletions(-)
--- a/admin/preferences.pl
+++ a/admin/preferences.pl
@@ -64,11 +64,16 @@ sub _get_chunk {
if( $options{'syntax'} ){
$chunk->{'syntax'} = $options{'syntax'};
}
-
- if( $options{'type'} && $options{'type'} eq 'modalselect' ){
- $chunk->{'source'} = $options{'source'};
- $chunk->{'exclusions'} = $options{'exclusions'} // "";
- $chunk->{'type'} = 'modalselect';
+ if( $options{'type'} ) {
+ if( $options{'type'} eq 'modalselect' ){
+ $chunk->{'source'} = $options{'source'};
+ $chunk->{'exclusions'} = $options{'exclusions'} // "";
+ $chunk->{'type'} = 'modalselect';
+ } elsif( $options{'type'} eq 'modaljs' ){
+ $chunk->{'type'} = 'modaljs';
+ $chunk->{'initiator'} = $options{'initiator'};
+ $chunk->{'processor'} = $options{'processor'};
+ }
}
if ( $options{'class'} && $options{'class'} eq 'password' ) {
--- a/koha-tmpl/intranet-tmpl/prog/css/preferences.css
+++ a/koha-tmpl/intranet-tmpl/prog/css/preferences.css
@@ -2,7 +2,8 @@
.preference-multi,
.preference-long,
.preference-file,
-.preference-modalselect {
+.preference-modalselect,
+.preference-modaljs {
width: 20em;
}
@@ -14,11 +15,13 @@
width: 5em;
}
-input[type="text"].modalselect {
+input[type="text"].modalselect,
+input[type="text"].modaljs {
cursor: pointer;
}
-input[type="text"].modalselect:hover {
+input[type="text"].modalselect:hover,
+input[type="text"].modaljs:hover {
background-color: #FFC;
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
@@ -113,6 +113,8 @@
[% ELSIF ( CHUNK.type_modalselect ) %]
+ [% ELSIF ( CHUNK.type_modaljs ) %]
+
[% ELSIF ( CHUNK.type_multiple ) %]