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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-1 / +1 lines)
Lines 18-24 Link Here
18
            <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" >[% d.desk_name | html %]</option>
18
            <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" >[% d.desk_name | html %]</option>
19
          [% END %]
19
          [% END %]
20
        [% ELSE %]
20
        [% ELSE %]
21
            <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" disabled hidden>[% d.desk_name | html %]</option>
21
            <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" disabled style="display: none">[% d.desk_name | html %]</option>
22
        [% END %]
22
        [% END %]
23
    [% END %]
23
    [% END %]
24
[% END %]
24
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/desk_selection.js (-21 / +7 lines)
Lines 1-22 Link Here
1
$(document).ready(function() {
1
$(document).ready(function() {
2
    $("#desk_id").children().each(function() {
3
        var selectedBranch = $("#branch"). children("option:selected"). val();
4
        if ($(this).attr('id') === "nodesk") { //set no desk by default, should be first element
5
            $(this).prop("selected", true);
6
            $(this).prop("disabled", false);
7
            $(this).show();
8
        }
9
        else if ($(this).hasClass(selectedBranch)) {
10
            $('#nodesk').prop("disabled", true); // we have desk, no need for nodesk option
11
            $('#nodesk').hide();
12
            $(this).prop("disabled", false);
13
            $(this).show();
14
            $(this).prop("selected", true)
15
        } else {
16
            $(this).prop("disabled", true);
17
            $(this).hide();
18
        }
19
    });
20
2
21
    $("#branch").on("change", function() {
3
    $("#branch").on("change", function() {
22
4
Lines 32-42 $(document).ready(function() { Link Here
32
                $('#nodesk').hide();
14
                $('#nodesk').hide();
33
                $(this).prop("disabled", false);
15
                $(this).prop("disabled", false);
34
                $(this).show();
16
                $(this).show();
35
                $(this).prop("selected", true)
17
                if ( selectedBranch == $(".logged-in-branch-code").html() ) {
18
                    $("#desk_id").val($(".logged-in-desk-id").html());
19
                } 
20
                else {
21
                    $("#desk_id").val($("#desk_id option:not([disabled]):first").val());
22
                }
36
            } else {
23
            } else {
37
                $(this).prop("disabled", true);
24
                $(this).prop("disabled", true);
38
                $(this).hide();
25
                $(this).hide();
39
            }
26
            }
40
        });
27
        });
41
    });
28
    });
42
}) ;
29
});
43
- 

Return to bug 30123