View | Details | Raw Unified | Return to bug 26296
Collapse All | Expand All

(-)a/admin/preferences.pl (+1 lines)
Lines 62-67 sub _get_chunk { Link Here
62
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
62
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
63
        $chunk->{'source'} = $options{'source'};
63
        $chunk->{'source'} = $options{'source'};
64
        $chunk->{'exclusions'} = $options{'exclusions'} // "";
64
        $chunk->{'exclusions'} = $options{'exclusions'} // "";
65
        $chunk->{'required'} = $options{'required'} // "";
65
        $chunk->{'type'} = 'modalselect';
66
        $chunk->{'type'} = 'modalselect';
66
    }
67
    }
67
68
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (-1 / +1 lines)
Lines 130-136 Link Here
130
                        [% END %]
130
                        [% END %]
131
                    </select>
131
                    </select>
132
                    [% ELSIF ( CHUNK.type_modalselect ) %]
132
                    [% ELSIF ( CHUNK.type_modalselect ) %]
133
                        <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 %]"/>
133
                        <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 %]"/>
134
                    [% ELSIF ( CHUNK.type_multiple ) %]
134
                    [% ELSIF ( CHUNK.type_multiple ) %]
135
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
135
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
136
                        [% 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 %]
136
                        [% 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 %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+2 lines)
Lines 609-620 OPAC: Link Here
609
            - pref: OPACSuggestionMandatoryFields
609
            - pref: OPACSuggestionMandatoryFields
610
              type: modalselect
610
              type: modalselect
611
              source: suggestions
611
              source: suggestions
612
              required: title
612
            - "<br />Note: if none of the above options are selected, 'Title' field would be mandatory anyway, by default."
613
            - "<br />Note: if none of the above options are selected, 'Title' field would be mandatory anyway, by default."
613
        -
614
        -
614
            - "Fields that should be hidden for patron purchase suggestions:"
615
            - "Fields that should be hidden for patron purchase suggestions:"
615
            - pref: OPACSuggestionUnwantedFields
616
            - pref: OPACSuggestionUnwantedFields
616
              type: modalselect
617
              type: modalselect
617
              source: suggestions
618
              source: suggestions
619
              exclusions: title
618
            - '<br />Note: Do not make <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACSuggestionMandatoryFields">OPACSuggestionMandatoryFields</a> unwanted fields '
620
            - '<br />Note: Do not make <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACSuggestionMandatoryFields">OPACSuggestionMandatoryFields</a> unwanted fields '
619
        -
621
        -
620
            - pref: OpacHiddenItems
622
            - pref: OpacHiddenItems
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/suggestions.json (+1 lines)
Lines 1-4 Link Here
1
{
1
{
2
    "title": "title",
2
    "author": "author",
3
    "author": "author",
3
    "copyrightdate": "copyrightdate",
4
    "copyrightdate": "copyrightdate",
4
    "isbn": "isbn",
5
    "isbn": "isbn",
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-3 / +15 lines)
Lines 226-238 $( document ).ready( function () { Link Here
226
    $(".modalselect").on("click", function(){
226
    $(".modalselect").on("click", function(){
227
        var datasource = $(this).data("source");
227
        var datasource = $(this).data("source");
228
        var exclusions = $(this).data("exclusions").split('|');
228
        var exclusions = $(this).data("exclusions").split('|');
229
        var required = $(this).data("required").split('|');
229
        var pref_name = this.id.replace(/pref_/, '');
230
        var pref_name = this.id.replace(/pref_/, '');
230
        var pref_value = this.value;
231
        var pref_value = this.value;
231
        var prefs = pref_value.split("|");
232
        var prefs = pref_value.split("|");
232
233
234
235
233
        $.getJSON( themelang + "/modules/admin/preferences/" + datasource + ".json", function( data ){
236
        $.getJSON( themelang + "/modules/admin/preferences/" + datasource + ".json", function( data ){
234
            var items = [];
237
            var items = [];
235
            var checked = "";
238
            var checked = "";
239
            var readonly = "";
240
            var disabled = "";
236
            var style = "";
241
            var style = "";
237
            $.each( data, function( key, val ){
242
            $.each( data, function( key, val ){
238
                if( prefs.indexOf( val ) >= 0 ){
243
                if( prefs.indexOf( val ) >= 0 ){
Lines 240-246 $( document ).ready( function () { Link Here
240
                } else {
245
                } else {
241
                    checked = "";
246
                    checked = "";
242
                }
247
                }
243
                if( exclusions.indexOf( val ) >= 0 ){
248
                if( required.indexOf( val ) >= 0 ){
249
                    style = "required";
250
                    checked  = ' checked="checked" ';
251
                } else if( exclusions.indexOf( val ) >= 0 ){
244
                    style = "disabled";
252
                    style = "disabled";
245
                    disabled = ' disabled="disabled" ';
253
                    disabled = ' disabled="disabled" ';
246
                    checked  = "";
254
                    checked  = "";
Lines 283-293 $( document ).ready( function () { Link Here
283
291
284
    $("#select_all").on("click",function(e){
292
    $("#select_all").on("click",function(e){
285
        e.preventDefault();
293
        e.preventDefault();
286
        $(".dbcolumn_selection:not(:disabled)").prop("checked", true);
294
        $("label:not(.required) .dbcolumn_selection:not(:disabled)").prop("checked", true);
287
    });
295
    });
288
    $("#clear_all").on("click",function(e){
296
    $("#clear_all").on("click",function(e){
289
        e.preventDefault();
297
        e.preventDefault();
290
        $(".dbcolumn_selection").prop("checked", false);
298
        $("label:not(.required) .dbcolumn_selection").prop("checked", false);
299
    });
300
301
    $("body").on("click", "label.required input.dbcolumn_selection", function(e){
302
        e.preventDefault();
291
    });
303
    });
292
304
293
} );
305
} );
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-13 / +12 lines)
Lines 79-85 Link Here
79
                                            [% IF ( title_required ) %]
79
                                            [% IF ( title_required ) %]
80
                                                <label for="title" class="required">Title:</label>
80
                                                <label for="title" class="required">Title:</label>
81
                                                <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" required="required" />
81
                                                <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" required="required" />
82
                                                <span class="required">Required</span>
82
                                                <div class="required_label required">Required</div>
83
                                            [% ELSE %]
83
                                            [% ELSE %]
84
                                                <label for="title">Title:</label>
84
                                                <label for="title">Title:</label>
85
                                                <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" />
85
                                                <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" />
Lines 90-96 Link Here
90
                                                    [% IF ( author_required ) %]
90
                                                    [% IF ( author_required ) %]
91
                                                        <label for="author" class="required">Author:</label>
91
                                                        <label for="author" class="required">Author:</label>
92
                                                        <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" required="required" />
92
                                                        <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" required="required" />
93
                                                        <span class="required">Required</span>
93
                                                        <div class="required_label required">Required</div>
94
                                                    [% ELSE %]
94
                                                    [% ELSE %]
95
                                                        <label for="author">Author:</label>
95
                                                        <label for="author">Author:</label>
96
                                                        <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" />
96
                                                        <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" />
Lines 103-109 Link Here
103
                                                    [% IF ( copyrightdate_required ) %]
103
                                                    [% IF ( copyrightdate_required ) %]
104
                                                        <label for="copyrightdate" class="required">Copyright date:</label>
104
                                                        <label for="copyrightdate" class="required">Copyright date:</label>
105
                                                        <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" required="required" />
105
                                                        <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" required="required" />
106
                                                    <span class="required">Required</span>
106
                                                    <div class="required_label required">Required</div>
107
                                                    [% ELSE %]
107
                                                    [% ELSE %]
108
                                                        <label for="copyrightdate">Copyright date:</label>
108
                                                        <label for="copyrightdate">Copyright date:</label>
109
                                                        <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" />
109
                                                        <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="4" maxlength="4" value="[% copyrightdate | html %]" />
Lines 116-122 Link Here
116
                                                [% IF ( isbn_required ) %]
116
                                                [% IF ( isbn_required ) %]
117
                                                    <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label>
117
                                                    <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label>
118
                                                    <input type="text" id="isbn" name="isbn"  maxlength="80" value="[% isbn | html %]" required="required" />
118
                                                    <input type="text" id="isbn" name="isbn"  maxlength="80" value="[% isbn | html %]" required="required" />
119
                                                    <span class="required">Required</span>
119
                                                    <div class="required_label required">Required</div>
120
                                                [% ELSE %]
120
                                                [% ELSE %]
121
                                                    <label for="isbn">Standard number (ISBN, ISSN or other):</label>
121
                                                    <label for="isbn">Standard number (ISBN, ISSN or other):</label>
122
                                                    <input type="text" id="isbn" name="isbn"  maxlength="80" value="[% isbn | html %]" />
122
                                                    <input type="text" id="isbn" name="isbn"  maxlength="80" value="[% isbn | html %]" />
Lines 128-134 Link Here
128
                                                [% IF ( publishercode_required ) %]
128
                                                [% IF ( publishercode_required ) %]
129
                                                    <label for="publishercode" class="required">Publisher:</label>
129
                                                    <label for="publishercode" class="required">Publisher:</label>
130
                                                    <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" required="required" />
130
                                                    <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" required="required" />
131
                                                    <span class="required">Required</span>
131
                                                    <div class="required_label required">Required</div>
132
                                                [% ELSE %]
132
                                                [% ELSE %]
133
                                                    <label for="publishercode">Publisher:</label>
133
                                                    <label for="publishercode">Publisher:</label>
134
                                                    <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" />
134
                                                    <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" />
Lines 140-146 Link Here
140
                                                [% IF ( collectiontitle_required ) %]
140
                                                [% IF ( collectiontitle_required ) %]
141
                                                    <label for="collectiontitle" class="required">Collection title:</label>
141
                                                    <label for="collectiontitle" class="required">Collection title:</label>
142
                                                    <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" required="required" />
142
                                                    <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" required="required" />
143
                                                    <span class="required">Required</span>
143
                                                    <div class="required_label required">Required</div>
144
                                                [% ELSE %]
144
                                                [% ELSE %]
145
                                                    <label for="collectiontitle">Collection title:</label>
145
                                                    <label for="collectiontitle">Collection title:</label>
146
                                                    <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" />
146
                                                    <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" />
Lines 152-158 Link Here
152
                                                [% IF ( place_required ) %]
152
                                                [% IF ( place_required ) %]
153
                                                    <label for="place" class="required">Publication place:</label>
153
                                                    <label for="place" class="required">Publication place:</label>
154
                                                    <input type="text" id="place" name="place" required="required" maxlength="80" value="[% place | html %]" />
154
                                                    <input type="text" id="place" name="place" required="required" maxlength="80" value="[% place | html %]" />
155
                                                    <span class="required">Required</span>
155
                                                    <div class="required_label required">Required</div>
156
                                                [% ELSE %]
156
                                                [% ELSE %]
157
                                                    <label for="place">Publication place:</label>
157
                                                    <label for="place">Publication place:</label>
158
                                                    <input type="text" id="place" name="place"  maxlength="80" value="[% place | html %]" />
158
                                                    <input type="text" id="place" name="place"  maxlength="80" value="[% place | html %]" />
Lines 164-170 Link Here
164
                                                [% IF ( quantity_required ) %]
164
                                                [% IF ( quantity_required ) %]
165
                                                    <label for="quantity" class="required">Quantity:</label>
165
                                                    <label for="quantity" class="required">Quantity:</label>
166
                                                    <input type="text" id="quantity" name="quantity" required="required" maxlength="4" size="4" />
166
                                                    <input type="text" id="quantity" name="quantity" required="required" maxlength="4" size="4" />
167
                                                    <span class="required">Required</span>
167
                                                    <div class="required_label required">Required</div>
168
                                                [% ELSE %]
168
                                                [% ELSE %]
169
                                                    <label for="quantity">Quantity:</label>
169
                                                    <label for="quantity">Quantity:</label>
170
                                                    <input type="text" id="quantity" name="quantity"  maxlength="4" size="4" />
170
                                                    <input type="text" id="quantity" name="quantity"  maxlength="4" size="4" />
Lines 176-182 Link Here
176
                                            [% IF ( itemtype_required ) %]
176
                                            [% IF ( itemtype_required ) %]
177
                                                <label for="itemtype" class="required">Item type:</label>
177
                                                <label for="itemtype" class="required">Item type:</label>
178
                                                [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, required = 1, blank = 1 %]
178
                                                [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, required = 1, blank = 1 %]
179
                                                <span class="required">Required</span>
179
                                                <div class="required_label required">Required</div>
180
                                            [% ELSE %]
180
                                            [% ELSE %]
181
                                                <label for="itemtype">Item type:</label>
181
                                                <label for="itemtype">Item type:</label>
182
                                                [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, blank = 1 %]
182
                                                [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, blank = 1 %]
Lines 190-196 Link Here
190
                                                    <select name="branchcode" id="branch" required="required">
190
                                                    <select name="branchcode" id="branch" required="required">
191
                                                        [% PROCESS options_for_libraries libraries => Branches.all %]
191
                                                        [% PROCESS options_for_libraries libraries => Branches.all %]
192
                                                    </select>
192
                                                    </select>
193
                                                    <span class="required">Required</span>
193
                                                    <div class="required_label required">Required</div>
194
                                                [% ELSE %]
194
                                                [% ELSE %]
195
                                                    <label for="branch">Library:</label>
195
                                                    <label for="branch">Library:</label>
196
                                                    <select name="branchcode" id="branch">
196
                                                    <select name="branchcode" id="branch">
Lines 210-216 Link Here
210
                                                            <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
210
                                                            <option value="[% patron_reason_loo.authorised_value | html %]">[% patron_reason_loo.lib | html %]</option>
211
                                                        [% END %]
211
                                                        [% END %]
212
                                                    </select>
212
                                                    </select>
213
                                                    <span class="required">Required</span>
213
                                                    <div class="required_label required">Required</div>
214
                                                [% ELSE %]
214
                                                [% ELSE %]
215
                                                    <label for="patronreason">Reason for suggestion: </label>
215
                                                    <label for="patronreason">Reason for suggestion: </label>
216
                                                    <select name="patronreason" id="patronreason">
216
                                                    <select name="patronreason" id="patronreason">
Lines 228-234 Link Here
228
                                                [% IF ( note_required ) %]
228
                                                [% IF ( note_required ) %]
229
                                                    <label for="note" class="required">Notes:</label>
229
                                                    <label for="note" class="required">Notes:</label>
230
                                                    <textarea name="note" id="note" rows="5" cols="40" required="required">[% note | html %]</textarea>
230
                                                    <textarea name="note" id="note" rows="5" cols="40" required="required">[% note | html %]</textarea>
231
                                                    <span class="required">Required</span>
231
                                                    <div class="required_label required">Required</div>
232
                                                [% ELSE %]
232
                                                [% ELSE %]
233
                                                    <label for="note">Notes:</label>
233
                                                    <label for="note">Notes:</label>
234
                                                    <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
234
                                                    <textarea name="note" id="note" rows="5" cols="40">[% note | html %]</textarea>
235
- 

Return to bug 26296