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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-1 / +1 lines)
Lines 12-18 Link Here
12
    <option id="nodesk" value="">---</option>
12
    <option id="nodesk" value="">---</option>
13
    [% FOREACH d IN desks %]
13
    [% FOREACH d IN desks %]
14
        [% IF d.branchcode == branch %]
14
        [% IF d.branchcode == branch %]
15
          [% IF selected == d.desk_id %]
15
          [% IF selected == d.desk_id || ( selected == '' && loop.first ) %]
16
            <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" selected="selected">[% d.desk_name | html %]</option>
16
            <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" selected="selected">[% d.desk_name | html %]</option>
17
          [% ELSE %]
17
          [% ELSE %]
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>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt (-1 / +1 lines)
Lines 74-80 Link Here
74
                            <ol>
74
                            <ol>
75
                                <li><label for="set-library-desk_id">Choose desk:</label>
75
                                <li><label for="set-library-desk_id">Choose desk:</label>
76
                                <select name="desk_id" id="set-library-desk_id">
76
                                <select name="desk_id" id="set-library-desk_id">
77
                                    [% PROCESS options_for_desks desks => Desks.all(), selected => desk_id  %]
77
                                    [% PROCESS options_for_desks desks => Desks.all(), selected => desk_id, branch => branch  %]
78
                                </select></li>
78
                                </select></li>
79
                            </ol>
79
                            </ol>
80
                        </fieldset>
80
                        </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-3 / +2 lines)
Lines 305-311 $(document).ready(function () { Link Here
305
        $("#set-library-desk_id")
305
        $("#set-library-desk_id")
306
            .children()
306
            .children()
307
            .each(function () {
307
            .each(function () {
308
                console.log( $(this) );
309
                if ($(this).attr("id") === "nodesk") {
308
                if ($(this).attr("id") === "nodesk") {
310
                    // set no desk by default, should be first element
309
                    // set no desk by default, should be first element
311
                    $(this).prop("selected", true);
310
                    $(this).prop("selected", true);
Lines 316-322 $(document).ready(function () { Link Here
316
                    $("#nodesk").hide();
315
                    $("#nodesk").hide();
317
                    $(this).prop("disabled", false);
316
                    $(this).prop("disabled", false);
318
                    $(this).show();
317
                    $(this).show();
319
                    if ( selectedBranch == $(".logged-in-branch-code").html() ) {
318
                    if ( selectedBranch == $(".logged-in-branch-code").html() && $(".logged-in-desk-id").length ) {
320
                        $("#set-library-desk_id").val( $(".logged-in-desk-id").html() );
319
                        $("#set-library-desk_id").val( $(".logged-in-desk-id").html() );
321
                    } else {
320
                    } else {
322
                        $("#nodesk").hide();
321
                        $("#nodesk").hide();
Lines 330-335 $(document).ready(function () { Link Here
330
                }
329
                }
331
            });
330
            });
332
331
332
        $("#set-library-register_id").val("");
333
        $("#set-library-register_id").children().each(function() {
333
        $("#set-library-register_id").children().each(function() {
334
            // default to no-register
334
            // default to no-register
335
            if ($(this).is("#noregister")) {
335
            if ($(this).is("#noregister")) {
336
- 

Return to bug 36844