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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-1 / +21 lines)
Lines 306-311 function placeHold () { Link Here
306
            return false;
306
            return false;
307
        }
307
        }
308
    }
308
    }
309
310
function AdjustPerms() {
311
    var category = $("#category").val();
312
    var count_perms = $("#allow_changes_from option").length;
313
314
    // If we move to Private, remove Anyone if we did not have shares
315
    // Note: the number of shares is not tested real-time (just template var)
316
    if( category == 1 ) {
317
        [% IF !shelf.is_shared %]
318
            $("#allow_changes_from option[value='2']").remove();
319
        [% END %]
320
    }
321
    // But if we move to Public, we may need to add it (again)
322
    else if( category == 2 && count_perms == 2 ) {
323
        $("#allow_changes_from").append( $('<option>', {
324
            value: 2,
325
            text:  _("Anyone seeing this list"),
326
        }));
327
    }
328
}
309
//]]>
329
//]]>
310
</script>
330
</script>
311
</head>
331
</head>
Lines 557-563 function placeHold () { Link Here
557
            [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
577
            [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
558
            </select></li>
578
            </select></li>
559
            <li><label for="category">Category: </label>
579
            <li><label for="category">Category: </label>
560
                <select id="category" name="category">
580
                <select id="category" name="category" onchange="AdjustPerms()">
561
                [% IF shelf.is_private %]
581
                [% IF shelf.is_private %]
562
                    <option value="1" selected="selected">Private</option>
582
                    <option value="1" selected="selected">Private</option>
563
                [% ELSE %]
583
                [% ELSE %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-2 / +21 lines)
Lines 579-585 Link Here
579
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
579
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
580
                                        <li>
580
                                        <li>
581
                                            <label for="category">Category:</label>
581
                                            <label for="category">Category:</label>
582
                                            <select name="category" id="category">
582
                                            <select name="category" id="category" onchange="AdjustPerms()">
583
                                                [% IF shelf.is_private %]
583
                                                [% IF shelf.is_private %]
584
                                                        <option value="1" selected="selected">Private</option>
584
                                                        <option value="1" selected="selected">Private</option>
585
                                                    [% ELSE %]
585
                                                    [% ELSE %]
Lines 954-959 function Check(f) { Link Here
954
        alert(alertString2);
954
        alert(alertString2);
955
    }
955
    }
956
}
956
}
957
958
function AdjustPerms() {
959
    var category = $("#category").val();
960
    var count_perms = $("#allow_changes_from option").length;
961
962
    // If we move to Private, remove Anyone if we did not have shares
963
    // Note: the number of shares is not tested real-time (just template var)
964
    if( category == 1 ) {
965
        [% IF !shelf.is_shared %]
966
            $("#allow_changes_from option[value='2']").remove();
967
        [% END %]
968
    }
969
    // But if we move to Public, we may need to add it (again)
970
    else if( category == 2 && count_perms == 2 ) {
971
        $("#allow_changes_from").append( $('<option>', {
972
            value: 2,
973
            text:  _("Anyone seeing this list"),
974
        }));
975
    }
976
}
957
//]]>
977
//]]>
958
</script>
978
</script>
959
[% END %]
979
[% END %]
960
- 

Return to bug 18834