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

(-)a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss (-3 / +5 lines)
Lines 619-624 th { Link Here
619
    white-space: nowrap;
619
    white-space: nowrap;
620
}
620
}
621
621
622
.dropdown-menu > .dropdown-header:first-child {
623
    border-top: 0;
624
}
625
622
.btn-group.open {
626
.btn-group.open {
623
    .btn-link {
627
    .btn-link {
624
        &.dropdown-toggle {
628
        &.dropdown-toggle {
Lines 1127-1133 fieldset { Link Here
1127
1131
1128
.toolbar {
1132
.toolbar {
1129
    background-color: #EEEEEE;
1133
    background-color: #EEEEEE;
1130
    border: 1px solid #E8E8E8;
1131
    font-size: .9rem;
1134
    font-size: .9rem;
1132
    padding: 3px 3px 5px 5px;
1135
    padding: 3px 3px 5px 5px;
1133
    vertical-align: middle;
1136
    vertical-align: middle;
Lines 1197-1208 fieldset { Link Here
1197
1200
1198
.selections-toolbar {
1201
.selections-toolbar {
1199
    background: linear-gradient( #B2B2B2 0%, #E0E0E0 14%, #E8E8E8 100% );
1202
    background: linear-gradient( #B2B2B2 0%, #E0E0E0 14%, #E8E8E8 100% );
1200
    border-bottom: none;
1201
    display: flex;
1203
    display: flex;
1204
    flex-wrap: wrap;
1202
    margin: 0;
1205
    margin: 0;
1203
    padding-left: 10px;
1206
    padding-left: 10px;
1204
    padding-top: .5em;
1207
    padding-top: .5em;
1205
    flex-wrap: wrap;
1206
1208
1207
    > div:first-child::before {
1209
    > div:first-child::before {
1208
        content: "";
1210
        content: "";
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/result-batch-controls.inc (+90 lines)
Line 0 Link Here
1
<div class="selections-toolbar toolbar noprint">
2
    [% IF ( OpacHighlightedWords && results ) %]
3
        <div class="highlight_controls noprint">
4
            <a href="#" class="btn btn-link btn-sm highlight_toggle" id="highlight_toggle_off"><i class="fa-fw fa-solid fa-pencil" aria-hidden="true"></i> Unhighlight</a>
5
            <a href="#" class="btn btn-link btn-sm highlight_toggle" id="highlight_toggle_on"><i class="fa-fw fa-solid fa-pencil" aria-hidden="true"></i> Highlight</a>
6
        </div>
7
    [% END %]
8
9
    <div class="check_control">
10
        <!-- checkall, clearall are now needed for placehold -->
11
        <span class="clearall">
12
            <a id="CheckAll" class="btn btn-link btn-sm" href="#">Select all</a>
13
        </span>
14
        <span class="checkall">
15
            <a id="CheckNone" class="btn btn-link btn-sm" href="#">Clear all</a>
16
        </span>
17
    </div>
18
19
    <div class="links">
20
        [% IF ( TagsInputEnabled || CartEnabled || ListsEnabled || MultiHolds ) %]
21
            <span class="selections">Select titles to:</span>
22
        [% END %]
23
24
        [% IF ( CartEnabled ) %]
25
            <div class="btn-group">
26
                <a id="addtocart" class="btn btn-link btn-xs" href="#"><i class="fa fa-shopping-cart" aria-hidden="true"></i> Add to cart</a>
27
            </div>
28
        [% END %]
29
30
        [% IF ( ListsEnabled ) %]
31
            <div class="btn-group">
32
                <button type="button" class="btn btn-link btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
33
                    <i class="fa fa-list" aria-hidden="true"></i> Add to list <span class="caret"></span>
34
                </button>
35
                <div class="dropdown-menu">
36
                    [% IF add_to_some_private_shelves.count %]
37
                        <h6 class="dropdown-header">Your lists</h6>
38
                        [% SET number_of_private_shelves = 0 %]
39
                        [% FOREACH s IN add_to_some_private_shelves %]
40
                            [% IF shelfnumber != s.shelfnumber %]
41
                                <a href="#" class="dropdown-item addtolist" data-shelfnumber="[% s.shelfnumber | html %]">[% s.shelfname | html %]</a>
42
                                [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
43
                                [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
44
                            [% END %]
45
                        [% END %]
46
                    [% END %]
47
                    [% IF add_to_some_public_shelves.count %]
48
                        <h6 class="dropdown-header">Public lists</h6>
49
                        [% SET number_of_public_shelves = 0 %]
50
                        [% FOREACH s IN add_to_some_public_shelves %]
51
                            [% IF shelfnumber != s.shelfnumber %]
52
                                <a href="#" data-shelfnumber="[% s.shelfnumber | html %]" class="dropdown-item addtolist">[% s.shelfname | html %]</a>
53
                                [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
54
                                [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
55
                            [% END %]
56
                        [% END %]
57
                    [% END %]
58
                    <div class="dropdown-divider"></div>
59
                    [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
60
                        <a href="#" class="dropdown-item addtolist morelists">More lists</a>
61
                    [% END %]
62
                    <a href="#" class="dropdown-item addtolist newlist">New list</a>
63
                </div>
64
            </div>
65
        [% END # /IF virtualshelves %]
66
67
        [% IF ( MultiHolds ) %]
68
            <button class="btn btn-link btn-sm hold disabled" type="button">
69
                <i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold
70
            </button>
71
        [% END %]
72
73
        [% IF ( TagsInputEnabled ) %]
74
            <span id="tagsel_span">
75
                <button id="tagsel_tag" class="btn btn-link btn-sm disabled" type="submit" style="display:none"><i class="fa fa-fw fa-tag" aria-hidden="true"></i> Tag</button>
76
            </span>
77
        [% END %]
78
    </div> <!-- / .links -->
79
    [% IF ( TagsInputEnabled ) %]
80
        <div id="tagsel_form" style="display:none">
81
            <label for="tagsel_new">New tag:</label>
82
            <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
83
            <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-sm btn-primary" title="Add" type="submit" value="Add" />
84
            <a href="#" id="tagsel_cancel">(done)</a>
85
        </div>
86
        <div id="tagsel_status" class="tagsel_tatus" style="display:none;">
87
            Tag status here.
88
        </div>
89
    [% END %]
90
</div> <!-- / .selections-toolbar -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc (-15 / +13 lines)
Lines 1-27 Link Here
1
<div class="actions-menu noprint">
1
<div class="actions-menu noprint">
2
    [% IF Koha.Preference( 'OPACHoldRequests' ) == 1 %]
2
    [% IF ( HoldsEnabled ) %]
3
        [% UNLESS ( items.norequests ) %]
3
        [% UNLESS ( items.norequests ) %]
4
            [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
4
            [% IF ( shelf AND op == 'view' ) # Lists view has more granular checking of hold availability %]
5
                [% IF ( shelf AND op == 'view' ) # Lists view has more granular checking of hold availability %]
5
                [% IF ( items.allow_onshelf_holds ) %]
6
                    [% IF ( items.allow_onshelf_holds ) %]
6
                    <span class="actions"><a class="btn btn-link btn-sm" aria-label="Place a hold on [% items.title | html %]" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a></span>
7
                [% ELSE %]
8
                    [% IF ( items.itemsissued ) %]
7
                        <span class="actions"><a class="btn btn-link btn-sm" aria-label="Place a hold on [% items.title | html %]" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a></span>
9
                        <span class="actions"><a class="btn btn-link btn-sm" aria-label="Place a hold on [% items.title | html %]" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a></span>
8
                    [% ELSE %]
9
                        [% IF ( items.itemsissued ) %]
10
                            <span class="actions"><a class="btn btn-link btn-sm" aria-label="Place a hold on [% items.title | html %]" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a></span>
11
                        [% END %]
12
                    [% END %]
10
                    [% END %]
13
                [% ELSE %]
14
                    <span class="actions"><a class="btn btn-link btn-sm" aria-label="Place a hold on [% items.title | html %]" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a></span>
15
                [% END %]
11
                [% END %]
16
            [% END # / IF opacuserlogin %]
12
            [% ELSE %]
13
                <span class="actions"><a class="btn btn-link btn-sm" aria-label="Place a hold on [% items.title | html %]" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a></span>
14
            [% END %]
17
        [% END # / UNLESS items.norequests %]
15
        [% END # / UNLESS items.norequests %]
18
    [% END # / OPACHoldRequests %]
16
    [% END # / OPACHoldRequests %]
19
17
20
    [% IF Koha.Preference('UseRecalls') %]
18
    [% IF ( RecallsEnabled ) %]
21
        <span class="actions"><a class="btn btn-link btn-sm recall" href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa-solid fa-book-bookmark" aria-hidden="true"></i> Place recall</a></span>
19
        <span class="actions"><a class="btn btn-link btn-sm recall" href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa-solid fa-book-bookmark" aria-hidden="true"></i> Place recall</a></span>
22
    [% END %]
20
    [% END %]
23
21
24
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
22
    [% IF ( LoginEnabled ) %]
25
        [% IF items.artreqpossible %]
23
        [% IF items.artreqpossible %]
26
            <span class="actions"><a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% items.biblionumber | uri %]" class="btn btn-link btn-sm"><i class="fa-solid fa-file-lines" aria-hidden="true"></i> Request article</a></span>
24
            <span class="actions"><a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% items.biblionumber | uri %]" class="btn btn-link btn-sm"><i class="fa-solid fa-file-lines" aria-hidden="true"></i> Request article</a></span>
27
        [% END %]
25
        [% END %]
Lines 48-54 Link Here
48
        [% END # IF loggedinusername %]
46
        [% END # IF loggedinusername %]
49
    [% END # if TagsInputEnabled %]
47
    [% END # if TagsInputEnabled %]
50
48
51
    [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
49
    [% IF ( ListsEnabled ) %]
52
        [% IF ( shelf AND op == 'view' ) %]
50
        [% IF ( shelf AND op == 'view' ) %]
53
            <span class="actions"><a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | uri %]" class="addtoshelf btn btn-link btn-sm"><i class="fa fa-list" aria-hidden="true"></i> Save to another list</a></span>
51
            <span class="actions"><a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | uri %]" class="addtoshelf btn btn-link btn-sm"><i class="fa fa-list" aria-hidden="true"></i> Save to another list</a></span>
54
            [% IF can_remove_biblios %]
52
            [% IF can_remove_biblios %]
Lines 59-65 Link Here
59
        [% END # /IF ( shelf AND op == 'view' ) %]
57
        [% END # /IF ( shelf AND op == 'view' ) %]
60
    [% END # /IF Koha.Preference( 'opacuserlogin' ) %]
58
    [% END # /IF Koha.Preference( 'opacuserlogin' ) %]
61
59
62
    [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
60
    [% IF ( CartEnabled ) %]
63
        [% IF ( items.incart ) %]
61
        [% IF ( items.incart ) %]
64
            <span class="actions cart-actions"><a data-biblionumber="[% items.biblionumber | html %]" class="btn btn-link btn-sm addtocart cart[% items.biblionumber | html %]" href="#"><i class="fa fa-shopping-cart" aria-hidden="true"></i> In your cart</a> <a data-biblionumber="[% items.biblionumber | html %]" class="btn btn-link btn-sm remove cartRemove cartR[% items.biblionumber | html %]" href="#">(remove)</a></span>
62
            <span class="actions cart-actions"><a data-biblionumber="[% items.biblionumber | html %]" class="btn btn-link btn-sm addtocart cart[% items.biblionumber | html %]" href="#"><i class="fa fa-shopping-cart" aria-hidden="true"></i> In your cart</a> <a data-biblionumber="[% items.biblionumber | html %]" class="btn btn-link btn-sm remove cartRemove cartR[% items.biblionumber | html %]" href="#">(remove)</a></span>
65
        [% ELSE %]
63
        [% ELSE %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-297 / +18 lines)
Lines 3-11 Link Here
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE KohaPlugins %]
4
[% USE KohaPlugins %]
5
[% USE To %]
5
[% USE To %]
6
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
6
[% SET LoginEnabled = ( Koha.Preference('opacuserlogin') == 1 ) %]
7
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
7
[% IF ( Koha.Preference('TagsEnabled') ) %]
8
[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %]
8
    [% SET TagsShowEnabled = ( ( Koha.Preference('TagsEnabled') == 1 ) && ( Koha.Preference('TagsShowOnList') > 0 ) ) %]
9
    [% SET TagsInputEnabled = LoginEnabled && TagsShowEnabled && ( Koha.Preference('TagsInputOnList') > 0 ) %]
10
[% END %]
11
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
12
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
13
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
14
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %]
15
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
16
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
9
17
10
[% IF firstPage %]
18
[% IF firstPage %]
11
     [% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
19
     [% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
Lines 192-285 Link Here
192
                                        [% END # /UNLESS tag %]
200
                                        [% END # /UNLESS tag %]
193
                                    </div> <!-- / #toolbar -->
201
                                    </div> <!-- / #toolbar -->
194
202
195
                                    <div class="selections-toolbar toolbar noprint">
203
                                    [% INCLUDE 'result-batch-controls.inc' results=1 %]
196
                                        [% IF ( OpacHighlightedWords ) %]
197
                                            <div class="highlight_controls noprint">
198
                                                <a href="#" class="btn btn-link btn-sm highlight_toggle" id="highlight_toggle_off"><i class="fa-fw fa-solid fa-pencil" aria-hidden="true"></i> Unhighlight</a>
199
                                                <a href="#" class="btn btn-link btn-sm highlight_toggle" id="highlight_toggle_on"><i class="fa-fw fa-solid fa-pencil" aria-hidden="true"></i> Highlight</a>
200
                                            </div>
201
                                        [% END %]
202
203
                                        <div class="check_control">
204
                                            <!-- checkall, clearall are now needed for placehold -->
205
                                            <span class="clearall">
206
                                                <a id="CheckAll" class="btn btn-link btn-sm" href="#">Select all</a>
207
                                            </span>
208
                                            <span class="checkall">
209
                                                <a id="CheckNone" class="btn btn-link btn-sm" href="#">Clear all</a>
210
                                            </span>
211
                                        </div>
212
213
                                        <div class="links">
214
                                            [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'opacuserlogin' ) == 1 && Koha.Preference('virtualshelves') ) || loggedinusername ) %]
215
                                                <span class="selections">Select titles to:</span>
216
                                            [% END %]
217
                                            [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'opacuserlogin' ) == 1 && Koha.Preference('virtualshelves') ) ) %]
218
                                                <span class="addto">
219
                                                    <select class="disabled form-control form-control-sm" name="addto" id="addto">
220
                                                        <option>Add to...</option>
221
                                                        [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
222
                                                            <option value="addtocart">Cart</option>
223
                                                        [% END %]
224
                                                        [% IF Koha.Preference('virtualshelves') && Koha.Preference('opacuserlogin') == 1 %]
225
                                                            [% IF loggedinusername AND add_to_some_private_shelves.count %]
226
                                                                <optgroup label="Your lists:">
227
                                                                [% SET number_of_private_shelves = 0 %]
228
                                                                [% FOREACH s IN add_to_some_private_shelves %]
229
                                                                    [% IF shelfnumber != s.shelfnumber %]
230
                                                                        <option id="s[% s.shelfnumber | html %]" value="addtolist">[% s.shelfname | html %]</option>
231
                                                                        [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
232
                                                                        [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
233
                                                                    [% END %]
234
                                                                [% END %]
235
                                                                </optgroup>
236
                                                            [% END %]
237
                                                            [% IF add_to_some_public_shelves.count %]
238
                                                                <optgroup label="Public lists:">
239
                                                                [% SET number_of_public_shelves = 0 %]
240
                                                                [% FOREACH s IN add_to_some_public_shelves %]
241
                                                                    [% IF shelfnumber != s.shelfnumber %]
242
                                                                        <option id="s[% s.shelfnumber | html %]" value="addtolist">[% s.shelfname | html %]</option>
243
                                                                        [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
244
                                                                        [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
245
                                                                    [% END %]
246
                                                                [% END %]
247
                                                                </optgroup>
248
                                                            [% END %]
249
                                                            [% IF ( add_to_some_private_shelves and add_to_some_private_shelves.count > 10 ) or ( add_to_some_public_shelves and add_to_some_public_shelves.count > 10 ) %]
250
                                                                <option value="morelists">[ More lists ]</option>
251
                                                            [% END %]
252
                                                            <option value="newlist">[ New list ]</option>
253
                                                        [% END # /IF virtualshelves and opacuserlogin %]
254
                                                    </select>
255
                                                    <input type="submit" class="btn btn-sm btn-primary" value="Save" />
256
                                                </span>
257
                                            [% END # /IF opacbookbag || virtualshelves %]
258
259
                                            [% IF ( ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %]
260
                                                <button class="btn btn-link btn-sm hold disabled" type="button">
261
                                                    <i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold
262
                                                </button>
263
                                            [% END %]
264
265
                                            [% IF ( TagsInputEnabled && loggedinusername ) %]
266
                                                <span id="tagsel_span">
267
                                                    <button id="tagsel_tag" class="btn btn-link btn-sm disabled" type="submit" style="display:none"><i class="fa fa-fw fa-tag" aria-hidden="true"></i> Tag</button>
268
                                                </span>
269
                                            [% END %]
270
                                        </div> <!-- / .links -->
271
                                        [% IF ( TagsInputEnabled && loggedinusername ) %]
272
                                            <div id="tagsel_form" style="display:none">
273
                                                <label for="tagsel_new">New tag:</label>
274
                                                <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
275
                                                <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-sm btn-primary" title="Add" type="submit" value="Add" />
276
                                                <a href="#" id="tagsel_cancel">(done)</a>
277
                                            </div>
278
                                            <div id="tagsel_status" class="tagsel_tatus" style="display:none;">
279
                                                Tag status here.
280
                                            </div>
281
                                        [% END %]
282
                                    </div> <!-- / .selections-toolbar -->
283
                                </div> <!-- /#floating -->
204
                                </div> <!-- /#floating -->
284
205
285
                                <!-- TABLE RESULTS START -->
206
                                <!-- TABLE RESULTS START -->
Lines 531-537 Link Here
531
                            </form> <!-- / #bookbag_form -->
452
                            </form> <!-- / #bookbag_form -->
532
453
533
                            <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
454
                            <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
534
                                <legend class="sr-only">Pages</legend>
535
                                <!-- The value will be set by holdBiblioNums() in basket.js -->
455
                                <!-- The value will be set by holdBiblioNums() in basket.js -->
536
                                <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
456
                                <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
537
                            </form>
457
                            </form>
Lines 581-671 Link Here
581
    [% END %]
501
    [% END %]
582
    [% CoverImagePlugins | $raw %]
502
    [% CoverImagePlugins | $raw %]
583
    <script>
503
    <script>
584
        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) %]
504
        const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %];
585
            function holdMultiple() {
505
        const opacbookbag = [% ( opacbookbag ) ? 1 : 0 | html %];
586
                var checkedBiblioNums = ""; // Separated by "/"
506
        const virtualshelves = [% ( virtualshelves ) ? 1 : 0 | html %];
587
                var checkedCount = 0;
507
    </script>
588
                if(document.bookbag_form.biblionumber.length > 0) {
508
    [% Asset.js("js/results-list.js") | $raw %]
589
                    for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
509
    <script>
590
                        if (document.bookbag_form.biblionumber[i].checked) {
591
                            checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
592
                            checkedCount++;
593
                        }
594
                    }
595
                }
596
597
                if (checkedCount > 0) {
598
                    holdBiblioNums(checkedBiblioNums);
599
                } else {
600
                    alert( _("No item was selected") );
601
                }
602
            }
603
604
            function holdBiblioNums(numList) {
605
                // numList: biblio numbers separated by "/"
606
                $("#hold_form_biblios").attr("value", numList);
607
                $("#hold_form").submit();
608
            }
609
        [% END # /IF opacuserlogin && OPACHoldRequests %]
610
611
        [% IF ( TagsInputEnabled && loggedinusername ) %]
612
            function tagSelected() {
613
                var checkedBoxes = $(".searchresults :checkbox:checked");
614
                if ($(checkedBoxes).size() == 0) {
615
                    alert( _("No item was selected") );
616
                } else {
617
                    $("#tagsel_tag").hide();
618
                    $(".resort").hide();
619
                    $("#tagsel_form").show();
620
                }
621
            }
622
623
            function tagCanceled() {
624
                $("#tagsel_form").hide();
625
                $("#tagsel_tag").show();
626
                $(".resort").show();
627
                $("#tagsel_new").val("");
628
                $("#tagsel_status, .tagstatus").empty().hide();
629
            }
630
631
            function tagAdded() {
632
                var checkedBoxes = $(".searchresults :checkbox:checked");
633
                if ($(checkedBoxes).size() == 0) {
634
                    alert( _("No item was selected") );
635
                    return false;
636
                }
637
638
                var tag = $("#tagsel_new").val();
639
                if (!tag || (tag == "")) {
640
                    alert( _("No tag was specified.") );
641
                    return false;
642
                }
643
644
                var bibs = [];
645
                for (var i = 0; i < $(checkedBoxes).size(); i++) {
646
                    var box = $(checkedBoxes).get(i);
647
                    bibs[i] = $(box).val();
648
                }
649
650
                KOHA.Tags.add_multitags_button(bibs, tag);
651
                return false;
652
            }
653
        [% END # /IF TagsInputEnabled && loggedinusername %]
654
655
656
        function enableCheckboxActions(){
657
            // Enable/disable controls if checkboxes are checked
658
            var checkedBoxes = $(".cb:checked");
659
            var controls = $(".selections-toolbar .links a, .selections-toolbar .links input, .selections-toolbar .links select, .selections-toolbar .links label, .selections-toolbar .links button");
660
            if ($(checkedBoxes).size()) {
661
                $(".selections").html(_("With selected titles: "));
662
                $(controls).removeClass("disabled");
663
            } else {
664
                $(".selections").html(_("Select titles to: "));
665
                $(controls).addClass("disabled");
666
            }
667
        }
668
669
        [% IF ( OpacHighlightedWords ) %]
510
        [% IF ( OpacHighlightedWords ) %]
670
            var q_array = new Array();  // holds search terms if available
511
            var q_array = new Array();  // holds search terms if available
671
512
Lines 704-714 Link Here
704
                });
545
                });
705
            [% END %]
546
            [% END %]
706
547
707
            $(".cb").click(function(){
708
                enableCheckboxActions();
709
            });
710
            enableCheckboxActions();
711
712
            $(".br-readonly a").on("click", function(e){
548
            $(".br-readonly a").on("click", function(e){
713
                e.preventDefault();
549
                e.preventDefault();
714
            });
550
            });
Lines 721-790 Link Here
721
                $('#bookbag_form').submit();
557
                $('#bookbag_form').submit();
722
            });
558
            });
723
559
724
            [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
725
                [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
726
                    $("#addto").on("change",function(){
727
                        cartList();
728
                    });
729
                    $(".addto").find("input:submit").click(function(){
730
                        cartList();
731
                        return false;
732
                    });
733
                [% ELSE %]
734
                    $("#addto").on("click",function(){
735
                        cartList();
736
                        return false;
737
                    });
738
                [% END %]
739
            [% END %]
740
741
            function cartList(){
742
                addtoOption = $("#addto").find("option:selected");
743
                addtoval = addtoOption.val();
744
                if(addtoval == "addtolist"){
745
                    var shelfnumber = addtoOption.attr("id").replace("s","");
746
                    if (vShelfAdd()) {
747
                        Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
748
                    }
749
                    return false;
750
                } else if(addtoval == "newlist"){
751
                    [% IF ( loggedinusername ) %]if (vShelfAdd()) {
752
                        Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
753
                    }[% ELSE %]
754
                        alert(_("You must be logged in to create or add to lists"));
755
                    [% END %]
756
                    return false;
757
                } else if(addtoval == "morelists"){
758
                    [% IF ( loggedinusername ) %]
759
                        if (vShelfAdd()) {
760
                            Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
761
                        }
762
                    [% ELSE %]
763
                        alert(_("You must be logged in to create or add to lists"));
764
                    [% END %]
765
                    return false;
766
                }
767
                if(addtoval == "addtocart" || $("#addto").attr("class") == "addtocart"){
768
                    addMultiple();
769
                    return false;
770
                }
771
            }
772
            $("#CheckAll").on("click",function(e){
773
                e.preventDefault();
774
                $(".cb").prop("checked", true);
775
                enableCheckboxActions();
776
            });
777
            $("#CheckNone").on("click",function(e){
778
                e.preventDefault();
779
                $(".cb").prop("checked", false);
780
                enableCheckboxActions();
781
            });
782
783
            $(".hold").on("click", function(e){
784
                e.preventDefault();
785
                holdMultiple();
786
            });
787
788
            [% IF ( query_desc ) %]
560
            [% IF ( query_desc ) %]
789
                [% IF ( OpacHighlightedWords ) %]
561
                [% IF ( OpacHighlightedWords ) %]
790
                    q_array = query_desc.split(" ");
562
                    q_array = query_desc.split(" ");
Lines 842-891 Link Here
842
                [% END # /IF OpenLibrarySearch %]
614
                [% END # /IF OpenLibrarySearch %]
843
            [% END # /IF query_desc %]
615
            [% END # /IF query_desc %]
844
616
845
            [% IF ( TagsInputEnabled && loggedinusername ) %]
846
                $("#tagsel_tag").show().click(function(){
847
                    tagSelected();
848
                    return false;
849
                });
850
                $("#tagsel_cancel").click(function(){
851
                    tagCanceled();
852
                    return false;
853
                });
854
                $("#tagsel_button").click(function(){
855
                    tagAdded();
856
                    return false;
857
                });
858
859
                $(".tag_add").click(function(){
860
                    var thisid = $(this).attr("id");
861
                    thisid = thisid.replace("tag_add","");
862
                    $(this).addClass("hidden");
863
                    $("#tagform"+thisid).show();
864
                    $("#newtag"+thisid).focus();
865
                    $("#newtag"+thisid+"_status").empty().hide();
866
                    return false;
867
                });
868
                $(".cancel_tag_add").click(function(){
869
                    var thisid = $(this).attr("id");
870
                    thisid = thisid.replace("cancel","");
871
                    $("#tagform"+thisid).hide();
872
                    $("#tag_add"+thisid).removeClass("hidden");
873
                    $("#newtag"+thisid).val("");
874
                    $("#newtag"+thisid+"_status").empty().hide();
875
                    return false;
876
                });
877
                $(".tagbutton").click(function(){
878
                    var thisid = $(this).attr("title");
879
                    var tag = $("#newtag"+thisid).val();
880
                    if (!tag || (tag == "")) {
881
                        alert( _("No tag was specified.") );
882
                        return false;
883
                    }
884
                    KOHA.Tags.add_tag_button(thisid, tag);
885
                    return false;
886
                });
887
            [% END # /IF TagsInputEnabled && loggedinusername %]
888
889
            [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
617
            [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
890
            [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
618
            [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
891
            [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
619
            [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
Lines 903-915 Link Here
903
            $("input.newtag").on('keydown', function(e){
631
            $("input.newtag").on('keydown', function(e){
904
                if (e.keyCode == 13) { e.preventDefault(); }
632
                if (e.keyCode == 13) { e.preventDefault(); }
905
            });
633
            });
906
907
            Sticky = $("#floating");
908
            Sticky.hcSticky({
909
                stickTo: ".searchresults",
910
                stickyClass: "floating"
911
            });
912
913
        });
634
        });
914
    </script>
635
    </script>
915
[% END %]
636
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-123 / +22 lines)
Lines 5-12 Link Here
5
[% USE AdditionalContents %]
5
[% USE AdditionalContents %]
6
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
6
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
7
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
7
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
8
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsShowOnList') ) %]
8
[% SET LoginEnabled = ( Koha.Preference('opacuserlogin') == 1 ) %]
9
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsInputOnList') ) %]
9
[% IF ( Koha.Preference('TagsEnabled') ) %]
10
    [% SET TagsShowEnabled = ( ( Koha.Preference('TagsEnabled') == 1 ) && ( Koha.Preference('TagsShowOnList') > 0 ) ) %]
11
    [% SET TagsInputEnabled = LoginEnabled && TagsShowEnabled && ( Koha.Preference('TagsInputOnList') > 0 ) %]
12
[% END %]
13
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
14
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
15
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
16
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %]
17
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
18
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
10
19
11
[% BLOCK delete_shelf %]
20
[% BLOCK delete_shelf %]
12
    <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="deleteshelf[% shelf.shelfnumber | html %]" class="d-inline">
21
    <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="deleteshelf[% shelf.shelfnumber | html %]" class="d-inline">
Lines 345-392 Link Here
345
                                    </form> <!-- /#sorting-form -->
354
                                    </form> <!-- /#sorting-form -->
346
355
347
                                </div> <!-- / #toolbar -->
356
                                </div> <!-- / #toolbar -->
348
357
                                [% INCLUDE 'result-batch-controls.inc' %]
349
                                <div class="selections-toolbar toolbar noprint">
350
                                    <div class="check_control">
351
                                        <span class="checkall">
352
                                            <a id="CheckAll" class="btn btn-link btn-sm" href="#">Select all</a>
353
                                        </span>
354
                                        <span class="clearall">
355
                                            <a id="CheckNone" class="btn btn-link btn-sm" href="#">Clear all</a>
356
                                        </span>
357
                                    </div>
358
                                    <div class="links">
359
                                        <span class="selections">Select titles to: </span>
360
                                        [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) ) %]
361
                                            <span id="placehold">
362
                                                <a href="#" class="btn btn-link hold tag_hides disabled"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a>
363
                                            </span>
364
                                        [% END %]
365
366
                                        [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
367
                                            <a href="#" class="btn btn-link listaddtocart disabled"><i class="fa fa-shopping-cart" aria-hidden="true"></i> Add to cart</a>
368
                                        [% END %]
369
370
                                        [% IF Koha.Preference('virtualshelves') %]
371
                                            <a href="#" class="btn btn-link addtolist disabled"><i class="fa fa-list" aria-hidden="true"></i> Add to list</a>
372
                                        [% END %]
373
374
                                        [% IF ( TagsInputEnabled && loggedinusername ) %]
375
                                            <span id="addtags">
376
                                                <a id="tagsel_tag" href="#" class="btn btn-link disabled"><i class="fa fa-fw fa-tag" aria-hidden="true"></i> Tag</a>
377
                                            </span>
378
                                            <span id="tagsel_form" class="form-inline" style="display:none">
379
                                                <label for="tagsel_new">New tag(s), separated by a comma:</label>
380
                                                <input class="form-control form-control-sm" type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
381
                                                <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-primary btn-sm" title="tagsel_button" type="submit" value="Add" />
382
                                                <a href="#" id="tagsel_cancel">Cancel</a>
383
                                            </span>
384
                                        [% END %]
385
                                        [% IF loggedinusername && can_remove_biblios %]
386
                                            <a href="#" class="btn btn-link disabled removeitems tag_hides"><i class="fa fa-fw fa-remove" aria-hidden="true"></i> Remove from list</a>
387
                                        [% END %]
388
                                    </div> <!-- / .links -->
389
                                </div> <!-- / .selections-toolbar -->
390
                            </div> <!-- /#floating -->
358
                            </div> <!-- /#floating -->
391
359
392
                            <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="bookbag_form">
360
                            <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="bookbag_form">
Lines 556-561 Link Here
556
                                    <input type="hidden" name="modifyshelfcontents" value="1" />
524
                                    <input type="hidden" name="modifyshelfcontents" value="1" />
557
                                </form>
525
                                </form>
558
                            [% END %]
526
                            [% END %]
527
                            <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
528
                                <!-- The value will be set by holdBiblioNums() in basket.js -->
529
                                <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
530
                            </form>
559
                        [% ELSE %]
531
                        [% ELSE %]
560
                            <div id="toolbar" class="toolbar clearfix">
532
                            <div id="toolbar" class="toolbar clearfix">
561
                                <div class="list-actions">
533
                                <div class="list-actions">
Lines 846-866 Link Here
846
    [% Asset.js("js/openlibrary.js") | $raw %]
818
    [% Asset.js("js/openlibrary.js") | $raw %]
847
[% END %]
819
[% END %]
848
<script>
820
<script>
849
821
    const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %];
850
[% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) ) %]
822
    const opacbookbag = [% ( opacbookbag ) ? 1 : 0 | html %];
851
    function holdSelections() {
823
    const virtualshelves = [% ( virtualshelves ) ? 1 : 0 | html %];
852
        var checkedBoxes = $("input:checkbox:checked");
824
</script>
853
        if ($(checkedBoxes).size() == 0) {
825
[% Asset.js("js/results-list.js") | $raw %]
854
            alert( _("No item was selected") );
826
<script>
855
        } else {
856
            var bibs = "";
857
            $(checkedBoxes).each(function(){
858
                bibs += $(this).val() + "/";
859
            });
860
            document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers="+bibs;
861
        }
862
    }
863
[% END %]
864
[% IF ( TagsInputEnabled && loggedinusername ) %]
827
[% IF ( TagsInputEnabled && loggedinusername ) %]
865
    function tagSelected() {
828
    function tagSelected() {
866
        var checkedBoxes = $("input:checkbox:checked");
829
        var checkedBoxes = $("input:checkbox:checked");
Lines 905-950 Link Here
905
    }
868
    }
906
[% END %]
869
[% END %]
907
870
908
function enableCheckboxActions(){
909
    // Enable/disable controls if checkboxes are checked
910
    var checkedBoxes = $(".cb:checked");
911
    if ($(checkedBoxes).size()) {
912
      $(".selections").html(_("With selected titles: "));
913
      $(".selections-toolbar .links a").removeClass("disabled");
914
    } else {
915
      $(".selections").html(_("Select titles to: "));
916
      $(".selections-toolbar .links a").addClass("disabled");
917
    }
918
}
919
920
$(function() {
871
$(function() {
921
    [% IF Koha.Preference( 'opacbookbag' ) == 1 %]$(".addtocart,.cartRemove").removeClass("hidden");[% END %]
922
923
    [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) ) %]
924
        $(".selections-toolbar a.hold").click(function(e){
925
            e.preventDefault();
926
            holdSelections();
927
        });
928
    [% END %]
929
930
    $("a.print").show();
872
    $("a.print").show();
931
873
932
    $("#CheckAll").on("click",function(e){
933
        e.preventDefault();
934
        $(".cb").prop("checked", true);
935
        enableCheckboxActions();
936
    });
937
    $("#CheckNone").on("click",function(e){
938
        e.preventDefault();
939
        $(".cb").prop("checked", false);
940
        enableCheckboxActions();
941
    });
942
943
    $(".cb").click(function(){
944
      enableCheckboxActions();
945
    });
946
    enableCheckboxActions();
947
948
    [% IF ( TagsInputEnabled && loggedinusername ) %]
874
    [% IF ( TagsInputEnabled && loggedinusername ) %]
949
        var tagAdd = $(".tag_add");
875
        var tagAdd = $(".tag_add");
950
        tagAdd.removeClass("hidden");
876
        tagAdd.removeClass("hidden");
Lines 1057-1068 $(function() { Link Here
1057
983
1058
    AdjustRemark();
984
    AdjustRemark();
1059
985
1060
    Sticky = $("#floating");
1061
    Sticky.hcSticky({
1062
        stickTo: "#usershelves",
1063
        stickyClass: "floating"
1064
    });
1065
1066
    [% IF itemsloop %]
986
    [% IF itemsloop %]
1067
        sortMenu( $("#sorting-form") );
987
        sortMenu( $("#sorting-form") );
1068
988
Lines 1121-1147 $(function() { Link Here
1121
        Dopop( link );
1041
        Dopop( link );
1122
    });
1042
    });
1123
1043
1124
    $(".listaddtocart").on("click", function(e){
1125
        e.preventDefault();
1126
        addMultiple();
1127
    });
1128
1129
    $(".addtolist").on("click", function(e){
1130
        e.preventDefault();
1131
        cartList();
1132
    });
1133
1134
    function cartList(){
1135
        [% IF ( loggedinusername ) %]
1136
            if (vShelfAdd()) {
1137
                Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
1138
            }
1139
        [% ELSE %]
1140
            alert(_("You must be logged in to create or add to lists"));
1141
        [% END %]
1142
        return false;
1143
    }
1144
1145
}); // document.ready
1044
}); // document.ready
1146
1045
1147
function sortMenu( sorting_form ){
1046
function sortMenu( sorting_form ){
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt (+18 lines)
Lines 4-9 Link Here
4
[% USE AdditionalContents %]
4
[% USE AdditionalContents %]
5
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
5
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
6
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
6
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
7
[% SET LoginEnabled = ( Koha.Preference('opacuserlogin') == 1 ) %]
8
[% IF ( Koha.Preference('TagsEnabled') ) %]
9
    [% SET TagsShowEnabled = ( ( Koha.Preference('TagsEnabled') == 1 ) && ( Koha.Preference('TagsShowOnList') > 0 ) ) %]
10
    [% SET TagsInputEnabled = LoginEnabled && TagsShowEnabled && ( Koha.Preference('TagsInputOnList') > 0 ) %]
11
[% END %]
12
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
13
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
14
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
15
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %]
16
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
17
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
7
[% INCLUDE 'doc-head-open.inc' %]
18
[% INCLUDE 'doc-head-open.inc' %]
8
<title>Tags &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
19
<title>Tags &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
9
[% INCLUDE 'doc-head-close.inc' %]
20
[% INCLUDE 'doc-head-close.inc' %]
Lines 195-200 Link Here
195
[% INCLUDE 'opac-bottom.inc' %]
206
[% INCLUDE 'opac-bottom.inc' %]
196
[% BLOCK jsinclude %]
207
[% BLOCK jsinclude %]
197
[% INCLUDE 'datatables.inc' %]
208
[% INCLUDE 'datatables.inc' %]
209
[% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
210
<script>
211
    const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %];
212
    const opacbookbag = [% ( opacbookbag ) ? 1 : 0 | html %];
213
    const virtualshelves = [% ( virtualshelves ) ? 1 : 0 | html %];
214
</script>
215
[% Asset.js("js/results-list.js") | $raw %]
198
<script>
216
<script>
199
217
200
    $(document).ready(function(){
218
    $(document).ready(function(){
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/results-list.js (+223 lines)
Line 0 Link Here
1
/* global __ */
2
function holdMultiple() {
3
    var checkedBiblioNums = ""; // Separated by "/"
4
    var checkedCount = 0;
5
    if(document.bookbag_form.biblionumber.length > 0) {
6
        for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
7
            if (document.bookbag_form.biblionumber[i].checked) {
8
                checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
9
                checkedCount++;
10
            }
11
        }
12
    }
13
14
    if (checkedCount > 0) {
15
        holdBiblioNums(checkedBiblioNums);
16
    } else {
17
        alert( __("No item was selected") );
18
    }
19
}
20
21
function holdBiblioNums(numList) {
22
    // numList: biblio numbers separated by "/"
23
    $("#hold_form_biblios").attr("value", numList);
24
    $("#hold_form").submit();
25
}
26
27
function enableCheckboxActions(){
28
    // Enable/disable controls if checkboxes are checked
29
    var checkedBoxes = $(".cb:checked");
30
    var controls = $(".selections-toolbar .links a, .selections-toolbar .links input, .selections-toolbar .links select, .selections-toolbar .links label, .selections-toolbar .links button");
31
    if ($(checkedBoxes).size()) {
32
        $(".selections").html(__("With selected titles: "));
33
        $(controls).removeClass("disabled");
34
    } else {
35
        $(".selections").html(__("Select titles to: "));
36
        $(controls).addClass("disabled");
37
    }
38
}
39
40
function cartList(){
41
    let addtoOption = $("#addto").find("option:selected");
42
    let addtoval = addtoOption.val();
43
    if(addtoval == "addtolist"){
44
        var shelfnumber = addtoOption.attr("id").replace("s","");
45
        if (vShelfAdd()) {
46
            Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
47
        }
48
        return false;
49
    } else if(addtoval == "newlist"){
50
        if( loggedinusername ) {
51
            if (vShelfAdd()) {
52
                Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
53
            }
54
        } else {
55
            alert(__("You must be logged in to create or add to lists"));
56
        }
57
        return false;
58
    } else if(addtoval == "morelists"){
59
        if( loggedinusername ){
60
            if (vShelfAdd()) {
61
                Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
62
            }
63
        } else {
64
            alert(__("You must be logged in to create or add to lists"));
65
        }
66
        return false;
67
    }
68
    if(addtoval == "addtocart" || $("#addto").attr("class") == "addtocart"){
69
        addMultiple();
70
        return false;
71
    }
72
}
73
74
function tagSelected() {
75
    var checkedBoxes = $(".searchresults :checkbox:checked");
76
    if ($(checkedBoxes).size() == 0) {
77
        alert( __("No item was selected") );
78
    } else {
79
        $("#tagsel_tag").hide();
80
        $(".resort").hide();
81
        $("#tagsel_form").show();
82
    }
83
}
84
85
function tagCanceled() {
86
    $("#tagsel_form").hide();
87
    $("#tagsel_tag").show();
88
    $(".resort").show();
89
    $("#tagsel_new").val("");
90
    $("#tagsel_status, .tagstatus").empty().hide();
91
}
92
93
function tagAdded() {
94
    var checkedBoxes = $(".searchresults :checkbox:checked");
95
    if ($(checkedBoxes).size() == 0) {
96
        alert( __("No item was selected") );
97
        return false;
98
    }
99
100
    var tag = $("#tagsel_new").val();
101
    if (!tag || (tag == "")) {
102
        alert( __("No tag was specified.") );
103
        return false;
104
    }
105
106
    var bibs = [];
107
    for (var i = 0; i < $(checkedBoxes).size(); i++) {
108
        var box = $(checkedBoxes).get(i);
109
        bibs[i] = $(box).val();
110
    }
111
112
    KOHA.Tags.add_multitags_button(bibs, tag);
113
    return false;
114
}
115
116
$(document).ready(function(){
117
    $(".cb").click(function(){
118
        enableCheckboxActions();
119
    });
120
    enableCheckboxActions();
121
122
    if( opacbookbag == 1 || virtualshelves == 1 ){
123
        if( virtualshelves == 1 ){
124
            $("#addto").on("change",function(){
125
                cartList();
126
            });
127
            $(".addto").find("input:submit").click(function(){
128
                cartList();
129
                return false;
130
            });
131
        } else {
132
            $("#addto").on("click",function(){
133
                cartList();
134
                return false;
135
            });
136
        }
137
    }
138
139
    $("#addtocart").on("click", function(e){
140
        e.preventDefault();
141
        addMultiple();
142
    });
143
144
    $(".addtolist").on("click",function(e){
145
        e.preventDefault();
146
        var shelfnumber = $(this).data("shelfnumber");
147
        var vshelf = vShelfAdd();
148
        if( vshelf ){
149
            if( $(this).hasClass("morelists") ){
150
                Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vshelf );
151
            } else if( $(this).hasClass("newlist") ){
152
                Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vshelf );
153
            } else {
154
                Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vshelf);
155
            }
156
        }
157
    });
158
159
    $("#CheckAll").on("click",function(e){
160
        e.preventDefault();
161
        $(".cb").prop("checked", true);
162
        enableCheckboxActions();
163
    });
164
    $("#CheckNone").on("click",function(e){
165
        e.preventDefault();
166
        $(".cb").prop("checked", false);
167
        enableCheckboxActions();
168
    });
169
170
    $(".hold").on("click", function(e){
171
        e.preventDefault();
172
        holdMultiple();
173
    });
174
175
    $("#tagsel_tag").show().click(function(){
176
        tagSelected();
177
        return false;
178
    });
179
    $("#tagsel_cancel").click(function(){
180
        tagCanceled();
181
        return false;
182
    });
183
    $("#tagsel_button").click(function(){
184
        tagAdded();
185
        return false;
186
    });
187
188
    $(".tag_add").click(function(){
189
        var thisid = $(this).attr("id");
190
        thisid = thisid.replace("tag_add","");
191
        $(this).addClass("hidden");
192
        $("#tagform"+thisid).show();
193
        $("#newtag"+thisid).focus();
194
        $("#newtag"+thisid+"_status").empty().hide();
195
        return false;
196
    });
197
    $(".cancel_tag_add").click(function(){
198
        var thisid = $(this).attr("id");
199
        thisid = thisid.replace("cancel","");
200
        $("#tagform"+thisid).hide();
201
        $("#tag_add"+thisid).removeClass("hidden");
202
        $("#newtag"+thisid).val("");
203
        $("#newtag"+thisid+"_status").empty().hide();
204
        return false;
205
    });
206
    $(".tagbutton").click(function(){
207
        var thisid = $(this).attr("title");
208
        var tag = $("#newtag"+thisid).val();
209
        if (!tag || (tag == "")) {
210
            alert( __("No tag was specified.") );
211
            return false;
212
        }
213
        KOHA.Tags.add_tag_button(thisid, tag);
214
        return false;
215
    });
216
217
    Sticky = $("#floating");
218
    Sticky.hcSticky({
219
        stickTo: ".searchresults",
220
        stickyClass: "floating",
221
        bottom: 0
222
    });
223
});
(-)a/opac/opac-search.pl (-9 lines)
Lines 70-76 use URI::Escape; Link Here
70
use JSON qw/decode_json encode_json/;
70
use JSON qw/decode_json encode_json/;
71
use Business::ISBN;
71
use Business::ISBN;
72
72
73
my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold");
74
# create a new CGI object
73
# create a new CGI object
75
# FIXME: no_undef_params needs to be tested
74
# FIXME: no_undef_params needs to be tested
76
use CGI qw('-no_undef_params' -utf8);
75
use CGI qw('-no_undef_params' -utf8);
Lines 176-188 if (C4::Context->preference('BakerTaylorEnabled')) { Link Here
176
    );
175
    );
177
}
176
}
178
177
179
if (C4::Context->preference('TagsEnabled')) {
180
    $template->param(TagsEnabled => 1);
181
    foreach (qw(TagsShowOnList TagsInputOnList)) {
182
        C4::Context->preference($_) and $template->param($_ => 1);
183
    }
184
}
185
186
## URI Re-Writing
178
## URI Re-Writing
187
# Deprecated, but preserved because it's interesting :-)
179
# Deprecated, but preserved because it's interesting :-)
188
# The same thing can be accomplished with mod_rewrite in
180
# The same thing can be accomplished with mod_rewrite in
Lines 792-798 for (my $i=0;$i<@servers;$i++) { Link Here
792
            $template->param(query_desc => $query_desc);
784
            $template->param(query_desc => $query_desc);
793
            $template->param(limit_desc => $limit_desc);
785
            $template->param(limit_desc => $limit_desc);
794
            $template->param(offset     => $offset);
786
            $template->param(offset     => $offset);
795
            $template->param(DisplayMultiPlaceHold => $DisplayMultiPlaceHold);
796
            if ($query_desc || $limit_desc) {
787
            if ($query_desc || $limit_desc) {
797
                $template->param(searchdesc => 1);
788
                $template->param(searchdesc => 1);
798
            }
789
            }
(-)a/opac/opac-shelves.pl (-1 / +19 lines)
Lines 464-469 if ( $op eq 'view' ) { Link Here
464
                    ),
464
                    ),
465
                );
465
                );
466
            }
466
            }
467
            my $some_private_shelves = Koha::Virtualshelves->get_some_shelves(
468
                {
469
                    borrowernumber => $loggedinuser,
470
                    add_allowed    => 1,
471
                    public         => 0,
472
                }
473
            );
474
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
475
                {
476
                    borrowernumber => $loggedinuser,
477
                    add_allowed    => 1,
478
                    public         => 1,
479
                }
480
            );
481
482
            $template->param(
483
                add_to_some_private_shelves => $some_private_shelves,
484
                add_to_some_public_shelves  => $some_public_shelves,
485
            );
467
        } else {
486
        } else {
468
            push @messages, { type => 'error', code => 'unauthorized_on_view' };
487
            push @messages, { type => 'error', code => 'unauthorized_on_view' };
469
            undef $shelf;
488
            undef $shelf;
470
- 

Return to bug 36557