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

(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-1 / +56 lines)
Lines 4340-4346 input.renew { Link Here
4340
        left: 0;
4340
        left: 0;
4341
        right: 0;
4341
        right: 0;
4342
        bottom: 0;
4342
        bottom: 0;
4343
        background-color: #ccc;
4343
        background-color: #CCC;
4344
        -webkit-transition: .4s;
4344
        -webkit-transition: .4s;
4345
        transition: .4s;
4345
        transition: .4s;
4346
        border-radius: 34px;
4346
        border-radius: 34px;
Lines 4684-4689 div .suggestion_note { Link Here
4684
    }
4684
    }
4685
}
4685
}
4686
4686
4687
#set_library_controls {
4688
    align-items: center;
4689
    display: flex;
4690
4691
    div:first-child {
4692
        flex-grow: 1;
4693
    }
4694
4695
    a.btn {
4696
        border-radius: 0;
4697
        font-size: 13px;
4698
    }
4699
}
4700
4701
#setlibrary_panel {
4702
    .setlibrary_panel_open {
4703
        border-bottom:1px solid #CCC;
4704
        border-top:1px solid #CCC;
4705
    }
4706
4707
    fieldset {
4708
        background-color: #554B4D;
4709
        margin: 0;
4710
4711
        &.rows {
4712
            float: none;
4713
            padding: 0;
4714
            width: auto;
4715
        }
4716
4717
        &.action {
4718
            padding: .5em 0 1em 1em;
4719
        }
4720
    }
4721
4722
    legend {
4723
        display: none;
4724
    }
4725
4726
    label {
4727
        color: #FFF;
4728
        display: block;
4729
        float: none;
4730
        font-weight: normal;
4731
        margin: 0;
4732
        padding-bottom: .2em;
4733
        text-align: left;
4734
        width: unset;
4735
    }
4736
4737
    select {
4738
        width: 80%;
4739
    }
4740
}
4741
4687
@import "header";
4742
@import "header";
4688
@import "toolbar";
4743
@import "toolbar";
4689
@import "forms";
4744
@import "forms";
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (-28 / +41 lines)
Lines 3-8 Link Here
3
[% USE Desks %]
3
[% USE Desks %]
4
[% USE Registers %]
4
[% USE Registers %]
5
[% USE Koha %]
5
[% USE Koha %]
6
[% PROCESS 'i18n.inc' %]
6
[% IF Koha.Preference( 'CookieConsent' ) %]
7
[% IF Koha.Preference( 'CookieConsent' ) %]
7
    [% USE JSConsents %]
8
    [% USE JSConsents %]
8
[% END %]
9
[% END %]
Lines 85-91 Link Here
85
86
86
        <ul id="user-menu" class="nav navbar-nav navbar-right">
87
        <ul id="user-menu" class="nav navbar-nav navbar-right">
87
            [% IF ( loggedinusername ) %]
88
            [% IF ( loggedinusername ) %]
88
            <li class="dropdown">
89
            <li class="dropdown" id="logged-in-dropdown">
89
                <a href="#" id="logged-in-menu" role="button" class="dropdown-toggle" data-toggle="dropdown">
90
                <a href="#" id="logged-in-menu" role="button" class="dropdown-toggle" data-toggle="dropdown">
90
                    <span id="logged-in-info-brief">
91
                    <span id="logged-in-info-brief">
91
                        <i class="fa fa-user"></i>
92
                        <i class="fa fa-user"></i>
Lines 164-201 Link Here
164
                    [% END %]
165
                    [% END %]
165
166
166
                    [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
167
                    [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
167
                    <li role="separator" class="loggedin-menu-label divider"></li>
168
                        <li role="separator" class="loggedin-menu-label divider"></li>
168
                    <li>
169
                        <li>
169
                        [% IF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %]
170
                            <div id="set_library_controls">
170
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library, desk and register</a>
171
                                <div>
171
                        [% ELSIF Koha.Preference('UseCirculationDesks') %]
172
                                    <a class="btn btn-link" href="/cgi-bin/koha/circ/set-library.pl">
172
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library and desk</a>
173
                                        [% IF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %]
173
                        [% ELSIF Koha.Preference('UseCashRegisters') %]
174
                                            [% t("Set library, desk, and register") | html %]
174
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library and cash register</a>
175
                                        [% ELSIF Koha.Preference('UseCirculationDesks') %]
175
                        [% ELSE %]
176
                                            [% t("Set library and desk") | html %]
176
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library</a>
177
                                        [% ELSIF Koha.Preference('UseCashRegisters') %]
177
                        [% END %]
178
                                            [% t("Set library and cash register") | html %]
178
                    </li>
179
                                        [% ELSE %]
180
                                            [% t("Set library") | html %]
181
                                        [% END %]
182
                                    </a>
183
                                </div>
184
                                <div>
185
                                    <a id="branch_select_cog" class="btn btn-link" href="#"><i class="fa fa-cog" aria-label="Toggle panel for login settings"></i></a>
186
                                </div>
187
                            </div>
188
                        </li>
189
190
                        <li id="setlibrary_panel" style="display:none"></li>
191
                        <li>
179
                    [% ELSIF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %]
192
                    [% ELSIF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %]
180
                    <li role="separator" class="loggedin-menu-label divider"></li>
193
                        <li role="separator" class="loggedin-menu-label divider"></li>
181
                    <li>
194
                        <li>
182
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set desk and cash register</a>
195
                            <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set desk and cash register</a>
183
                    </li>
196
                        </li>
184
                    [% ELSIF Koha.Preference('UseCirculationDesks') %]
197
                    [% ELSIF Koha.Preference('UseCirculationDesks') %]
185
                    <li role="separator" class="loggedin-menu-label divider"></li>
198
                        <li role="separator" class="loggedin-menu-label divider"></li>
186
                    <li>
199
                        <li>
187
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set desk</a>
200
                            <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set desk</a>
188
                    </li>
201
                        </li>
189
                    [% ELSIF Koha.Preference('UseCashRegisters') %]
202
                    [% ELSIF Koha.Preference('UseCashRegisters') %]
190
                    <li role="separator" class="loggedin-menu-label divider"></li>
203
                        <li role="separator" class="loggedin-menu-label divider"></li>
191
                    <li>
204
                        <li>
192
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set cash register</a>
205
                            <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set cash register</a>
193
                    </li>
206
                        </li>
194
                    [% END %]
207
                    [% END %]
195
                    [% IF EnableSearchHistory %]
208
                    [% IF EnableSearchHistory %]
196
                    <li>
209
                        <li>
197
                        <a class="toplinks" href="/cgi-bin/koha/catalogue/search-history.pl">Search history</a>
210
                            <a class="toplinks" href="/cgi-bin/koha/catalogue/search-history.pl">Search history</a>
198
                    </li>
211
                        </li>
199
                    [% END %]
212
                    [% END %]
200
213
201
                    [% IF loggedinusernumber %]
214
                    [% IF loggedinusernumber %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-2 / +2 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="disabled" style="display: none">[% d.desk_name | html %]</option>
22
        [% END %]
22
        [% END %]
23
    [% END %]
23
    [% END %]
24
[% END %]
24
[% END %]
Lines 32-38 Link Here
32
                <option class="[%- r.branch | html -%][%- IF r.branch_default -%] default[%- END -%]" value="[% r.id | html %]">[% r.name | html %]</option>
32
                <option class="[%- r.branch | html -%][%- IF r.branch_default -%] default[%- END -%]" value="[% r.id | html %]">[% r.name | html %]</option>
33
            [% END%]
33
            [% END%]
34
        [% ELSE %]
34
        [% ELSE %]
35
            <option class="[%- r.branch | html -%][%- IF r.branch_default -%] default[%- END -%]" value="[% r.id | html %]" disabled style="display: none">[% r.name | html %]</option>
35
            <option class="[%- r.branch | html -%][%- IF r.branch_default -%] default[%- END -%]" value="[% r.id | html %]" disabled="disabled" style="display: none">[% r.name | html %]</option>
36
        [% END %]
36
        [% END %]
37
    [% END %]
37
    [% END %]
38
[% END %]
38
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt (-13 / +9 lines)
Lines 49-69 Link Here
49
                    [% END %]
49
                    [% END %]
50
                    [% INCLUDE 'messages.inc' %]
50
                    [% INCLUDE 'messages.inc' %]
51
                    <h1>Set library</h1>
51
                    <h1>Set library</h1>
52
                    <form method="post" action="set-library.pl">
52
                    <form method="post" action="/cgi-bin/koha/circ/set-library.pl" id="set-library-form">
53
                        [% INCLUDE 'csrf-token.inc' %]
53
                        [% INCLUDE 'csrf-token.inc' %]
54
                        <input type="hidden" name="op" value="cud-set-library" />
54
                        <input type="hidden" name="op" value="cud-set-library" />
55
                        [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
55
                        [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
56
                            <fieldset class="rows">
56
                            <fieldset class="rows">
57
                                <legend>Set library</legend>
57
                                <legend>Set library</legend>
58
                                <ol>
58
                                <ol>
59
                                    <li><label for="branch">Choose library:</label>
59
                                    <li><label for="set-library-branch">Choose library:</label>
60
                                    <select name="branch" id="branch">
60
                                    <select name="branch" id="set-library-branch">
61
                                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
61
                                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
62
                                    </select></li>
62
                                    </select></li>
63
                                </ol>
63
                                </ol>
64
                            </fieldset>
64
                            </fieldset>
65
                        [% ELSE %]
65
                        [% ELSE %]
66
                            <select name="branch" id="branch" style="visibility:hidden;">
66
                            <select name="branch" id="set-library-branch" style="visibility:hidden;">
67
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
67
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
68
                            </select>
68
                            </select>
69
                        [% END %]
69
                        [% END %]
Lines 72-79 Link Here
72
                        <fieldset class="rows">
72
                        <fieldset class="rows">
73
                            <legend>Set desk</legend>
73
                            <legend>Set desk</legend>
74
                            <ol>
74
                            <ol>
75
                                <li><label for="desk_id">Choose desk:</label>
75
                                <li><label for="set-library-desk_id">Choose desk:</label>
76
                                <select name="desk_id" id="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  %]
78
                                </select></li>
78
                                </select></li>
79
                            </ol>
79
                            </ol>
Lines 84-92 Link Here
84
                            <legend>Set cash register</legend>
84
                            <legend>Set cash register</legend>
85
                            <ol>
85
                            <ol>
86
                                <li>
86
                                <li>
87
                                    <label for="register_id">Choose cash register:</label>
87
                                    <label for="set-library-register_id">Choose cash register:</label>
88
                                    <select name="register_id" id="register_id">
88
                                    <select name="register_id" id="set-library-register_id">
89
                                        <option id="noregister" selected="selected" value="">-- None --</option>
89
                                        <option id="set-library-noregister" selected="selected" value="">-- None --</option>
90
                                        [% PROCESS options_for_registers registers => Registers.all() %]
90
                                        [% PROCESS options_for_registers registers => Registers.all() %]
91
                                    </select>
91
                                    </select>
92
                                </li>
92
                                </li>
Lines 114-122 Link Here
114
        </main>
114
        </main>
115
    </div> <!-- /.col-sm-12 -->
115
    </div> <!-- /.col-sm-12 -->
116
</div> <!-- /.row -->
116
</div> <!-- /.row -->
117
[% MACRO jsinclude BLOCK %]
118
  [% Asset.js("js/desk_selection.js") | $raw %]
119
  [% Asset.js("js/register_selection.js") | $raw %]
120
[% END %]
121
117
122
[% INCLUDE 'intranet-bottom.inc' %]
118
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-3 / +1 lines)
Lines 301-314 Link Here
301
301
302
[% MACRO jsinclude BLOCK %]
302
[% MACRO jsinclude BLOCK %]
303
    <script>
303
    <script>
304
    //<![CDATA[
304
        var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this news item? This cannot be undone.");
305
    var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this news item? This cannot be undone.");
306
        $(document).ready(function(){
305
        $(document).ready(function(){
307
            $(".news_delete").on("click", function(){
306
            $(".news_delete").on("click", function(){
308
                return confirmDelete(MSG_CONFIRM_DELETE);
307
                return confirmDelete(MSG_CONFIRM_DELETE);
309
            });
308
            });
310
        });
309
        });
311
    //]]>
312
    </script>
310
    </script>
313
[% END %]
311
[% END %]
314
<!-- the main div is closed in intranet-bottom.inc -->
312
<!-- the main div is closed in intranet-bottom.inc -->
(-)a/koha-tmpl/intranet-tmpl/prog/js/desk_selection.js (-37 lines)
Lines 1-37 Link Here
1
$(document).ready(function () {
2
    $("#branch")
3
        .on("change", function () {
4
            $("#desk_id")
5
                .children()
6
                .each(function () {
7
                    var selectedBranch = $("#branch")
8
                        .children("option:selected")
9
                        .val();
10
                    if ($(this).attr("id") === "nodesk") {
11
                        // set no desk by default, should be first element
12
                        $(this).prop("selected", true);
13
                        $(this).prop("disabled", false);
14
                        $(this).show();
15
                    } else if ($(this).hasClass(selectedBranch)) {
16
                        $("#nodesk").prop("disabled", true); // we have desk, no need for nodesk option
17
                        $("#nodesk").hide();
18
                        $(this).prop("disabled", false);
19
                        $(this).show();
20
                        if (
21
                            selectedBranch == $(".logged-in-branch-code").html()
22
                        ) {
23
                            $("#desk_id").val($(".logged-in-desk-id").html());
24
                        } else {
25
                            $("#nodesk").hide();
26
                            $("#desk_id").val(
27
                                $("#desk_id option:not([disabled]):first").val()
28
                            );
29
                        }
30
                    } else {
31
                        $(this).prop("disabled", true);
32
                        $(this).hide();
33
                    }
34
                });
35
        })
36
        .change();
37
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/register_selection.js (-27 lines)
Lines 1-27 Link Here
1
$(document).ready(function() {
2
    $("#branch").on("change", function() {
3
        var selectedBranch = $("#branch").children(
4
            "option:selected").val();
5
6
        $("#register_id").children().each(function() {
7
            // default to no-register
8
            if ($(this).is("#noregister")) {
9
                $(this).prop("selected", true)
10
            }
11
            // display branch registers
12
            else if ($(this).hasClass(selectedBranch)) {
13
                $(this).prop("disabled", false);
14
                $(this).show();
15
                // default to branch default if there is one
16
                if ($(this).hasClass("default")) {
17
                    $(this).prop("selected", true)
18
                }
19
            }
20
            // hide non-branch registers
21
            else {
22
                $(this).hide();
23
                $(this).prop("disabled", true);
24
            }
25
        });
26
    });
27
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-1 / +72 lines)
Lines 244-249 $(document).ready(function() { Link Here
244
        resetSearchContext();
244
        resetSearchContext();
245
    });
245
    });
246
246
247
    $("body").on("change", "#set-library-branch", function () {
248
        var selectedBranch = $("#set-library-branch").val();
249
        $("#set-library-desk_id")
250
            .children()
251
            .each(function () {
252
                console.log( $(this) );
253
                if ($(this).attr("id") === "nodesk") {
254
                    // set no desk by default, should be first element
255
                    $(this).prop("selected", true);
256
                    $(this).prop("disabled", false);
257
                    $(this).show();
258
                } else if ( $(this).hasClass(selectedBranch) ) {
259
                    $("#nodesk").prop("disabled", true); // we have desk, no need for nodesk option
260
                    $("#nodesk").hide();
261
                    $(this).prop("disabled", false);
262
                    $(this).show();
263
                    if ( selectedBranch == $(".logged-in-branch-code").html() ) {
264
                        $("#set-library-desk_id").val( $(".logged-in-desk-id").html() );
265
                    } else {
266
                        $("#nodesk").hide();
267
                        $("#set-library-desk_id").val(
268
                            $("#set-library-desk_id option:not([disabled]):first").val()
269
                        );
270
                    }
271
                } else {
272
                    $(this).prop("disabled", true);
273
                    $(this).hide();
274
                }
275
            });
276
277
        $("#set-library-register_id").children().each(function() {
278
            // default to no-register
279
            if ($(this).is("#noregister")) {
280
                $(this).prop("selected", true)
281
            } else if ($(this).hasClass(selectedBranch)) {
282
                // display branch registers
283
                $(this).prop("disabled", false);
284
                $(this).show();
285
                // default to branch default if there is one
286
                if ($(this).hasClass("default")) {
287
                    $(this).prop("selected", true)
288
                }
289
            } else {
290
                // hide non-branch registers
291
                $(this).hide();
292
                $(this).prop("disabled", true);
293
            }
294
        });
295
    });
296
297
    $("body").on("click", "#setlibrary_panel #cancel_set_library", function(e){
298
        e.preventDefault();
299
        $("#setlibrary_panel").removeClass("setlibrary_panel_open").html("").hide();
300
    });
301
302
    $("#branch_select_cog").on("click", function(e){
303
        e.stopPropagation();
304
        let setlibrary_panel = $("#setlibrary_panel");
305
        if( setlibrary_panel.hasClass("setlibrary_panel_open") ){
306
            setlibrary_panel.removeClass("setlibrary_panel_open").html("").hide();
307
        } else {
308
            setlibrary_panel.addClass("setlibrary_panel_open").show();
309
            $("#setlibrary_panel").load( "/cgi-bin/koha/circ/set-library.pl #set-library-form", function(){
310
                // setLibraryDeskOptions();
311
            });
312
        }
313
    });
314
315
    $("#logged-in-dropdown").on('hidden.bs.dropdown', function () {
316
        $("#setlibrary_panel").removeClass("setlibrary_panel_open").html("").hide();
317
    });
318
247
});
319
});
248
320
249
function removeLastBorrower(){
321
function removeLastBorrower(){
250
- 

Return to bug 36582