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 4351-4357 input.renew { Link Here
4351
        left: 0;
4351
        left: 0;
4352
        right: 0;
4352
        right: 0;
4353
        bottom: 0;
4353
        bottom: 0;
4354
        background-color: #ccc;
4354
        background-color: #CCC;
4355
        -webkit-transition: .4s;
4355
        -webkit-transition: .4s;
4356
        transition: .4s;
4356
        transition: .4s;
4357
        border-radius: 34px;
4357
        border-radius: 34px;
Lines 4695-4700 div .suggestion_note { Link Here
4695
    }
4695
    }
4696
}
4696
}
4697
4697
4698
#set_library_controls {
4699
    align-items: center;
4700
    display: flex;
4701
4702
    div:first-child {
4703
        flex-grow: 1;
4704
    }
4705
4706
    a.btn {
4707
        border-radius: 0;
4708
        font-size: 13px;
4709
    }
4710
}
4711
4712
#setlibrary_panel {
4713
    .setlibrary_panel_open {
4714
        border-bottom:1px solid #CCC;
4715
        border-top:1px solid #CCC;
4716
    }
4717
4718
    fieldset {
4719
        background-color: #554B4D;
4720
        margin: 0;
4721
4722
        &.rows {
4723
            float: none;
4724
            padding: 0;
4725
            width: auto;
4726
        }
4727
4728
        &.action {
4729
            padding: .5em 0 1em 1em;
4730
        }
4731
    }
4732
4733
    legend {
4734
        display: none;
4735
    }
4736
4737
    label {
4738
        color: #FFF;
4739
        display: block;
4740
        float: none;
4741
        font-weight: normal;
4742
        margin: 0;
4743
        padding-bottom: .2em;
4744
        text-align: left;
4745
        width: unset;
4746
    }
4747
4748
    select {
4749
        width: 80%;
4750
    }
4751
}
4752
4698
@import "header";
4753
@import "header";
4699
@import "toolbar";
4754
@import "toolbar";
4700
@import "forms";
4755
@import "forms";
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (-29 / +52 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 163-201 Link Here
163
                        </li>
164
                        </li>
164
                    [% END %]
165
                    [% END %]
165
166
166
                    [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
167
                    [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary || Koha.Preference('UseCirculationDesks') || Koha.Preference('UseCashRegisters') ) %]
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 ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
173
                        [% ELSIF Koha.Preference('UseCashRegisters') %]
174
                                            [% IF ( Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') ) %]
174
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library and cash register</a>
175
                                                [% t("Set library, desk, and register") | html %]
175
                        [% ELSE %]
176
                                            [% ELSIF ( Koha.Preference('UseCirculationDesks') ) %]
176
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set library</a>
177
                                                [% t("Set library and desk") | html %]
177
                        [% END %]
178
                                            [% ELSIF ( Koha.Preference('UseCashRegisters') ) %]
178
                    </li>
179
                                                [% t("Set library and cash register") | html %]
180
                                            [% ELSE %]
181
                                                [% t("Set library") | html %]
182
                                            [% END %]
183
                                        [% ELSIF ( Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') ) %]
184
                                            [% t("Set desk and cash register") | html %]
185
                                        [% ELSIF ( Koha.Preference('UseCashRegisters') ) %]
186
                                            [% t("Set cash register") | html %]
187
                                        [% ELSIF ( Koha.Preference('UseCirculationDesks') ) %]
188
                                            [% t("Set desk") | html %]
189
                                        [% END %]
190
                                    </a>
191
                                </div>
192
                                [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary || Koha.Preference('UseCirculationDesks') || Koha.Preference('UseCashRegisters') ) %]
193
                                    <div>
194
                                        <a id="branch_select_cog" class="btn btn-link" href="#"><i class="fa fa-cog" aria-label="Toggle panel for login settings"></i></a>
195
                                    </div>
196
                                [% END %]
197
                            </div>
198
                        </li>
199
200
                        <li id="setlibrary_panel" style="display:none"></li>
201
                        <li>
179
                    [% ELSIF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %]
202
                    [% ELSIF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %]
180
                    <li role="separator" class="loggedin-menu-label divider"></li>
203
                        <li role="separator" class="loggedin-menu-label divider"></li>
181
                    <li>
204
                        <li>
182
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set desk and cash register</a>
205
                            <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set desk and cash register</a>
183
                    </li>
206
                        </li>
184
                    [% ELSIF Koha.Preference('UseCirculationDesks') %]
207
                    [% ELSIF Koha.Preference('UseCirculationDesks') %]
185
                    <li role="separator" class="loggedin-menu-label divider"></li>
208
                        <li role="separator" class="loggedin-menu-label divider"></li>
186
                    <li>
209
                        <li>
187
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set desk</a>
210
                            <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set desk</a>
188
                    </li>
211
                        </li>
189
                    [% ELSIF Koha.Preference('UseCashRegisters') %]
212
                    [% ELSIF Koha.Preference('UseCashRegisters') %]
190
                    <li role="separator" class="loggedin-menu-label divider"></li>
213
                        <li role="separator" class="loggedin-menu-label divider"></li>
191
                    <li>
214
                        <li>
192
                        <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set cash register</a>
215
                            <a class="toplinks" href="/cgi-bin/koha/circ/set-library.pl">Set cash register</a>
193
                    </li>
216
                        </li>
194
                    [% END %]
217
                    [% END %]
195
                    [% IF EnableSearchHistory %]
218
                    [% IF EnableSearchHistory %]
196
                    <li>
219
                        <li>
197
                        <a class="toplinks" href="/cgi-bin/koha/catalogue/search-history.pl">Search history</a>
220
                            <a class="toplinks" href="/cgi-bin/koha/catalogue/search-history.pl">Search history</a>
198
                    </li>
221
                        </li>
199
                    [% END %]
222
                    [% END %]
200
223
201
                    [% IF loggedinusernumber %]
224
                    [% IF loggedinusernumber %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-1 / +1 lines)
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 (-29 lines)
Lines 1-29 Link Here
1
$(document).ready(function() {
2
3
    $("#branch").on("change", function() {
4
5
        $("#desk_id").children().each(function() {
6
            var selectedBranch = $("#branch"). children("option:selected"). val();
7
            if ($(this).attr('id') === "nodesk") { //set no desk by default, should be first element
8
                $(this).prop("selected", true);
9
                $(this).prop("disabled", false);
10
                $(this).show();
11
            }
12
            else if ($(this).hasClass(selectedBranch)) {
13
                $('#nodesk').prop("disabled", true); // we have desk, no need for nodesk option
14
                $('#nodesk').hide();
15
                $(this).prop("disabled", false);
16
                $(this).show();
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
                }
23
            } else {
24
                $(this).prop("disabled", true);
25
                $(this).hide();
26
            }
27
        });
28
    });
29
});
(-)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 / +74 lines)
Lines 284-289 $(document).ready(function () { Link Here
284
    $("#bookbag_form a[href*='detail.pl?']").click(function () {
284
    $("#bookbag_form a[href*='detail.pl?']").click(function () {
285
        resetSearchContext();
285
        resetSearchContext();
286
    });
286
    });
287
287
    // add back to top button on each staff page
288
    // add back to top button on each staff page
288
    $("body").append('<button id="backtotop" class="btn btn-default" aria-label="' + __("Back to top") + '"><i class="fa fa-arrow-up" aria-hidden="true"></i></button>');
289
    $("body").append('<button id="backtotop" class="btn btn-default" aria-label="' + __("Back to top") + '"><i class="fa fa-arrow-up" aria-hidden="true"></i></button>');
289
    $("#backtotop").hide();
290
    $("#backtotop").hide();
Lines 298-303 $(document).ready(function () { Link Here
298
        e.preventDefault();
299
        e.preventDefault();
299
        $("html,body").animate({scrollTop: 0}, "slow");
300
        $("html,body").animate({scrollTop: 0}, "slow");
300
    });
301
    });
302
303
    $("body").on("change", "#set-library-branch", function () {
304
        var selectedBranch = $("#set-library-branch").val();
305
        $("#set-library-desk_id")
306
            .children()
307
            .each(function () {
308
                console.log( $(this) );
309
                if ($(this).attr("id") === "nodesk") {
310
                    // set no desk by default, should be first element
311
                    $(this).prop("selected", true);
312
                    $(this).prop("disabled", false);
313
                    $(this).show();
314
                } else if ( $(this).hasClass(selectedBranch) ) {
315
                    $("#nodesk").prop("disabled", true); // we have desk, no need for nodesk option
316
                    $("#nodesk").hide();
317
                    $(this).prop("disabled", false);
318
                    $(this).show();
319
                    if ( selectedBranch == $(".logged-in-branch-code").html() ) {
320
                        $("#set-library-desk_id").val( $(".logged-in-desk-id").html() );
321
                    } else {
322
                        $("#nodesk").hide();
323
                        $("#set-library-desk_id").val(
324
                            $("#set-library-desk_id option:not([disabled]):first").val()
325
                        );
326
                    }
327
                } else {
328
                    $(this).prop("disabled", true);
329
                    $(this).hide();
330
                }
331
            });
332
333
        $("#set-library-register_id").children().each(function() {
334
            // default to no-register
335
            if ($(this).is("#noregister")) {
336
                $(this).prop("selected", true)
337
            } else if ($(this).hasClass(selectedBranch)) {
338
                // display branch registers
339
                $(this).prop("disabled", false);
340
                $(this).show();
341
                // default to branch default if there is one
342
                if ($(this).hasClass("default")) {
343
                    $(this).prop("selected", true)
344
                }
345
            } else {
346
                // hide non-branch registers
347
                $(this).hide();
348
                $(this).prop("disabled", true);
349
            }
350
        });
351
    });
352
353
    $("body").on("click", "#setlibrary_panel #cancel_set_library", function(e){
354
        e.preventDefault();
355
        $("#setlibrary_panel").removeClass("setlibrary_panel_open").html("").hide();
356
    });
357
358
    $("#branch_select_cog").on("click", function(e){
359
        e.stopPropagation();
360
        let setlibrary_panel = $("#setlibrary_panel");
361
        if( setlibrary_panel.hasClass("setlibrary_panel_open") ){
362
            setlibrary_panel.removeClass("setlibrary_panel_open").html("").hide();
363
        } else {
364
            setlibrary_panel.addClass("setlibrary_panel_open").show();
365
            $("#setlibrary_panel").load( "/cgi-bin/koha/circ/set-library.pl #set-library-form", function(){
366
                // setLibraryDeskOptions();
367
            });
368
        }
369
    });
370
371
    $("#logged-in-dropdown").on('hidden.bs.dropdown', function () {
372
        $("#setlibrary_panel").removeClass("setlibrary_panel_open").html("").hide();
373
    });
374
301
});
375
});
302
376
303
function removeLastBorrower() {
377
function removeLastBorrower() {
304
- 

Return to bug 36582