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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-3 / +28 lines)
Lines 12-18 Link Here
12
[% BLOCK list_permissions %]
12
[% BLOCK list_permissions %]
13
    <li>
13
    <li>
14
        <label for="allow_changes_from">Allow changes to contents from: </label>
14
        <label for="allow_changes_from">Allow changes to contents from: </label>
15
        <select name="allow_changes_from" id="allow_changes_from">
15
        <select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()">
16
16
17
            [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
17
            [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
18
18
Lines 25-31 Link Here
25
            [% IF shelf.allow_change_from_others %]<option value="2" selected="selected">Anyone seeing this list</option>[% ELSE %]<option value="2">Anyone seeing this list</option>[% END %]
25
            [% IF shelf.allow_change_from_others %]<option value="2" selected="selected">Anyone seeing this list</option>[% ELSE %]<option value="2">Anyone seeing this list</option>[% END %]
26
26
27
        </select>
27
        </select>
28
        &emsp; <span id="anyone_remark" style="color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
28
        &emsp; <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
29
    </li>
29
    </li>
30
[% END %]
30
[% END %]
31
31
Lines 217-222 $(document).ready(function(){ Link Here
217
});
217
});
218
[% END %]
218
[% END %]
219
219
220
[% IF shelf AND op == 'edit_form' %]
221
$(document).ready(function(){
222
    AdjustRemark();
223
});
224
[% END %]
225
220
    /**
226
    /**
221
     * This function checks if the adequate number of records are checked for merging
227
     * This function checks if the adequate number of records are checked for merging
222
     */
228
     */
Lines 305-310 function placeHold () { Link Here
305
            return false;
311
            return false;
306
        }
312
        }
307
    }
313
    }
314
315
function AdjustRemark() {
316
    var category = $("#category").val();
317
    var perms = $("#allow_changes_from").val();
318
319
    if( perms < 2 ) {
320
        $("#anyone_remark").hide();
321
    } else if( category==1 ) {
322
        // If we move to Private (without shares), show Anyone remark
323
        // Note: the number of shares is not tested real-time
324
        [% IF !shelf.is_shared %]
325
            $("#anyone_remark").show();
326
        [% ELSE %]
327
            $("#anyone_remark").hide();
328
        [% END %]
329
    } else { // category==2
330
        $("#anyone_remark").hide();
331
    }
332
}
308
//]]>
333
//]]>
309
</script>
334
</script>
310
</head>
335
</head>
Lines 556-562 function placeHold () { Link Here
556
            [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
581
            [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
557
            </select></li>
582
            </select></li>
558
            <li><label for="category">Category: </label>
583
            <li><label for="category">Category: </label>
559
                <select id="category" name="category">
584
                <select id="category" name="category" onchange="AdjustRemark()">
560
                [% IF shelf.is_private %]
585
                [% IF shelf.is_private %]
561
                    <option value="1" selected="selected">Private</option>
586
                    <option value="1" selected="selected">Private</option>
562
                [% ELSE %]
587
                [% ELSE %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-4 / +29 lines)
Lines 13-19 Link Here
13
[% BLOCK list_permissions %]
13
[% BLOCK list_permissions %]
14
    <li>
14
    <li>
15
        <label for="allow_changes_from">Allow changes to contents from: </label>
15
        <label for="allow_changes_from">Allow changes to contents from: </label>
16
        <select name="allow_changes_from" id="allow_changes_from">
16
        <select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()">
17
17
18
            [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
18
            [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
19
19
Lines 26-32 Link Here
26
            [% IF shelf.allow_change_from_others %]<option value="2" selected="selected">Anyone seeing this list</option>[% ELSE %]<option value="2">Anyone seeing this list</option>[% END %]
26
            [% IF shelf.allow_change_from_others %]<option value="2" selected="selected">Anyone seeing this list</option>[% ELSE %]<option value="2">Anyone seeing this list</option>[% END %]
27
27
28
        </select>
28
        </select>
29
        &emsp; <span id="anyone_remark" style="color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
29
        &emsp; <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
30
    </li>
30
    </li>
31
[% END %]
31
[% END %]
32
32
Lines 578-584 Link Here
578
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
578
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
579
                                        <li>
579
                                        <li>
580
                                            <label for="category">Category:</label>
580
                                            <label for="category">Category:</label>
581
                                            <select name="category" id="category">
581
                                            <select name="category" id="category" onchange="AdjustRemark()">
582
                                                [% IF shelf.is_private %]
582
                                                [% IF shelf.is_private %]
583
                                                        <option value="1" selected="selected">Private</option>
583
                                                        <option value="1" selected="selected">Private</option>
584
                                                    [% ELSE %]
584
                                                    [% ELSE %]
Lines 934-939 $(function() { Link Here
934
        window.print();
934
        window.print();
935
        setTimeout('window.close()', 1);
935
        setTimeout('window.close()', 1);
936
    [% END %]
936
    [% END %]
937
938
    AdjustRemark();
937
}); // document.ready
939
}); // document.ready
938
940
939
function Check(f) {
941
function Check(f) {
Lines 953-958 function Check(f) { Link Here
953
        alert(alertString2);
955
        alert(alertString2);
954
    }
956
    }
955
}
957
}
958
959
function AdjustRemark() {
960
    var category;
961
    if( $("#category").length > 0 ) {
962
        category = $("#category").val();
963
    } else {
964
        category = [% category %];
965
    }
966
    var perms = $("#allow_changes_from").val();
967
968
    if( perms < 2 ) {
969
        $("#anyone_remark").hide();
970
    } else if( category==1 ) {
971
        // If we move to Private (without shares), show Anyone remark
972
        // Note: the number of shares is not tested real-time
973
        [% IF !shelf.is_shared %]
974
            $("#anyone_remark").show();
975
        [% ELSE %]
976
            $("#anyone_remark").hide();
977
        [% END %]
978
    } else { // category==2
979
        $("#anyone_remark").hide();
980
    }
981
}
956
//]]>
982
//]]>
957
</script>
983
</script>
958
[% END %]
984
[% END %]
959
- 

Return to bug 18980