@@ -, +, @@ for system preferences - BorrowerMandatoryField - BorrowerUnwantedField - PatronSelfModificationBorrowerUnwantedField - PatronSelfRegistrationBorrowerMandatoryField - PatronSelfRegistrationBorrowerUnwantedField - Go to Administration -> System preferences, and search for "PatronSelf" - The input fields for PatronSelfModificationBorrowerUnwantedField, PatronSelfRegistrationBorrowerMandatoryField, and PatronSelfRegistrationBorrowerUnwantedField should appear as "locked" (read-only) inputs. - Clicking the input field should trigger a modal window with checkboxes for each available column from the borrowers table. - Test that the "select all" and "clear all" links work correctly. - Test that the "cancel" link closes the modal without saving your selections. - Test that the "Save" button closes the modal, copies your selections to the form field, and triggers the preference-saving function (this eliminates the need to click a save button again after closing the modal). - Test this process by making modifications to all three different preferences, confirming that the right data is preselected each time the modal is shown and the right data is saved to the right field each time. --- admin/preferences.pl | 6 ++ .../intranet-tmpl/prog/css/preferences.css | 26 +++++++- .../prog/css/src/staff-global.scss | 5 ++ .../prog/en/modules/admin/preferences.tt | 29 ++++++++- .../modules/admin/preferences/borrowers.json | 53 ++++++++++++++++ .../en/modules/admin/preferences/opac.pref | 12 ++-- .../en/modules/admin/preferences/patrons.pref | 7 ++- .../prog/js/pages/preferences.js | 61 ++++++++++++++++++- 8 files changed, 187 insertions(+), 12 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/borrowers.json --- a/admin/preferences.pl +++ a/admin/preferences.pl @@ -64,6 +64,12 @@ sub _get_chunk { if( $options{'syntax'} ){ $chunk->{'syntax'} = $options{'syntax'}; } + + if( $options{'type'} && $options{'type'} eq 'modalselect' ){ + $chunk->{'source'} = $options{'source'}; + $chunk->{'type'} = 'modalselect'; + } + if ( $options{'class'} && $options{'class'} eq 'password' ) { $chunk->{'input_type'} = 'password'; } elsif ( $options{'class'} && $options{'class'} eq 'date' ) { --- a/koha-tmpl/intranet-tmpl/prog/css/preferences.css +++ a/koha-tmpl/intranet-tmpl/prog/css/preferences.css @@ -1,4 +1,8 @@ -.preference-url, .preference-multi, .preference-long, .preference-file { +.preference-url, +.preference-multi, +.preference-long, +.preference-file, +.preference-modalselect { width: 20em; } @@ -10,6 +14,14 @@ width: 5em; } +input[type="text"].modalselect { + cursor: pointer; +} + +input[type="text"].modalselect:hover { + background-color: #FFC; +} + textarea.preference { width: 35em; height: 20em; @@ -134,4 +146,16 @@ span.overridden { border: 1px solid #EEE; margin: 1em 1em 1em 0; resize: vertical; +} + +#prefModal label { + display: block; + font-weight: bold; + line-height: 1.5em; +} + +.dbcolumn { + font-weight: normal; + font-family: monospace; + color: #666; } --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -4024,6 +4024,11 @@ input.renew { margin: .5em 0; } +.columns-2 { + columns: 2 auto; + column-gap: 2.5em; +} + .columns-3 { columns: 3 auto; column-gap: 2.5em; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -98,6 +98,8 @@ [% END %] + [% ELSIF ( CHUNK.type_modalselect ) %] + [% ELSIF ( CHUNK.type_multiple ) %]