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 191-284 Link Here
191
                                        [% END # /UNLESS tag %]
199
                                        [% END # /UNLESS tag %]
192
                                    </div> <!-- / #toolbar -->
200
                                    </div> <!-- / #toolbar -->
193
201
194
                                    <div class="selections-toolbar toolbar noprint">
202
                                    [% INCLUDE 'result-batch-controls.inc' results=1 %]
195
                                        [% IF ( OpacHighlightedWords ) %]
196
                                            <div class="highlight_controls noprint">
197
                                                <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>
198
                                                <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>
199
                                            </div>
200
                                        [% END %]
201
202
                                        <div class="check_control">
203
                                            <!-- checkall, clearall are now needed for placehold -->
204
                                            <span class="clearall">
205
                                                <a id="CheckAll" class="btn btn-link btn-sm" href="#">Select all</a>
206
                                            </span>
207
                                            <span class="checkall">
208
                                                <a id="CheckNone" class="btn btn-link btn-sm" href="#">Clear all</a>
209
                                            </span>
210
                                        </div>
211
212
                                        <div class="links">
213
                                            [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'opacuserlogin' ) == 1 && Koha.Preference('virtualshelves') ) || loggedinusername ) %]
214
                                                <span class="selections">Select titles to:</span>
215
                                            [% END %]
216
                                            [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'opacuserlogin' ) == 1 && Koha.Preference('virtualshelves') ) ) %]
217
                                                <span class="addto">
218
                                                    <select class="disabled form-control form-control-sm" name="addto" id="addto">
219
                                                        <option>Add to...</option>
220
                                                        [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
221
                                                            <option value="addtocart">Cart</option>
222
                                                        [% END %]
223
                                                        [% IF Koha.Preference('virtualshelves') && Koha.Preference('opacuserlogin') == 1 %]
224
                                                            [% IF loggedinusername AND add_to_some_private_shelves.count %]
225
                                                                <optgroup label="Your lists:">
226
                                                                [% SET number_of_private_shelves = 0 %]
227
                                                                [% FOREACH s IN add_to_some_private_shelves %]
228
                                                                    [% IF shelfnumber != s.shelfnumber %]
229
                                                                        <option id="s[% s.shelfnumber | html %]" value="addtolist">[% s.shelfname | html %]</option>
230
                                                                        [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
231
                                                                        [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
232
                                                                    [% END %]
233
                                                                [% END %]
234
                                                                </optgroup>
235
                                                            [% END %]
236
                                                            [% IF add_to_some_public_shelves.count %]
237
                                                                <optgroup label="Public lists:">
238
                                                                [% SET number_of_public_shelves = 0 %]
239
                                                                [% FOREACH s IN add_to_some_public_shelves %]
240
                                                                    [% IF shelfnumber != s.shelfnumber %]
241
                                                                        <option id="s[% s.shelfnumber | html %]" value="addtolist">[% s.shelfname | html %]</option>
242
                                                                        [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
243
                                                                        [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
244
                                                                    [% END %]
245
                                                                [% END %]
246
                                                                </optgroup>
247
                                                            [% END %]
248
                                                            [% 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 ) %]
249
                                                                <option value="morelists">[ More lists ]</option>
250
                                                            [% END %]
251
                                                            <option value="newlist">[ New list ]</option>
252
                                                        [% END # /IF virtualshelves and opacuserlogin %]
253
                                                    </select>
254
                                                    <input type="submit" class="btn btn-sm btn-primary" value="Save" />
255
                                                </span>
256
                                            [% END # /IF opacbookbag || virtualshelves %]
257
258
                                            [% IF ( ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %]
259
                                                <button class="btn btn-link btn-sm hold disabled" type="button">
260
                                                    <i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold
261
                                                </button>
262
                                            [% END %]
263
264
                                            [% IF ( TagsInputEnabled && loggedinusername ) %]
265
                                                <span id="tagsel_span">
266
                                                    <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>
267
                                                </span>
268
                                            [% END %]
269
                                        </div> <!-- / .links -->
270
                                        [% IF ( TagsInputEnabled && loggedinusername ) %]
271
                                            <div id="tagsel_form" style="display:none">
272
                                                <label for="tagsel_new">New tag:</label>
273
                                                <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
274
                                                <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-sm btn-primary" title="Add" type="submit" value="Add" />
275
                                                <a href="#" id="tagsel_cancel">(done)</a>
276
                                            </div>
277
                                            <div id="tagsel_status" class="tagsel_tatus" style="display:none;">
278
                                                Tag status here.
279
                                            </div>
280
                                        [% END %]
281
                                    </div> <!-- / .selections-toolbar -->
282
                                </div> <!-- /#floating -->
203
                                </div> <!-- /#floating -->
283
204
284
                                <!-- TABLE RESULTS START -->
205
                                <!-- TABLE RESULTS START -->
Lines 530-536 Link Here
530
                            </form> <!-- / #bookbag_form -->
451
                            </form> <!-- / #bookbag_form -->
531
452
532
                            <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
453
                            <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
533
                                <legend class="sr-only">Pages</legend>
534
                                <!-- The value will be set by holdBiblioNums() in basket.js -->
454
                                <!-- The value will be set by holdBiblioNums() in basket.js -->
535
                                <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
455
                                <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
536
                            </form>
456
                            </form>
Lines 580-670 Link Here
580
    [% END %]
500
    [% END %]
581
    [% CoverImagePlugins | $raw %]
501
    [% CoverImagePlugins | $raw %]
582
    <script>
502
    <script>
583
        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) %]
503
        const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %];
584
            function holdMultiple() {
504
        const opacbookbag = [% ( opacbookbag ) ? 1 : 0 | html %];
585
                var checkedBiblioNums = ""; // Separated by "/"
505
        const virtualshelves = [% ( virtualshelves ) ? 1 : 0 | html %];
586
                var checkedCount = 0;
506
    </script>
587
                if(document.bookbag_form.biblionumber.length > 0) {
507
    [% Asset.js("js/results-list.js") | $raw %]
588
                    for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
508
    <script>
589
                        if (document.bookbag_form.biblionumber[i].checked) {
590
                            checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
591
                            checkedCount++;
592
                        }
593
                    }
594
                }
595
596
                if (checkedCount > 0) {
597
                    holdBiblioNums(checkedBiblioNums);
598
                } else {
599
                    alert( _("No item was selected") );
600
                }
601
            }
602
603
            function holdBiblioNums(numList) {
604
                // numList: biblio numbers separated by "/"
605
                $("#hold_form_biblios").attr("value", numList);
606
                $("#hold_form").submit();
607
            }
608
        [% END # /IF opacuserlogin && OPACHoldRequests %]
609
610
        [% IF ( TagsInputEnabled && loggedinusername ) %]
611
            function tagSelected() {
612
                var checkedBoxes = $(".searchresults :checkbox:checked");
613
                if ($(checkedBoxes).size() == 0) {
614
                    alert( _("No item was selected") );
615
                } else {
616
                    $("#tagsel_tag").hide();
617
                    $(".resort").hide();
618
                    $("#tagsel_form").show();
619
                }
620
            }
621
622
            function tagCanceled() {
623
                $("#tagsel_form").hide();
624
                $("#tagsel_tag").show();
625
                $(".resort").show();
626
                $("#tagsel_new").val("");
627
                $("#tagsel_status, .tagstatus").empty().hide();
628
            }
629
630
            function tagAdded() {
631
                var checkedBoxes = $(".searchresults :checkbox:checked");
632
                if ($(checkedBoxes).size() == 0) {
633
                    alert( _("No item was selected") );
634
                    return false;
635
                }
636
637
                var tag = $("#tagsel_new").val();
638
                if (!tag || (tag == "")) {
639
                    alert( _("No tag was specified.") );
640
                    return false;
641
                }
642
643
                var bibs = [];
644
                for (var i = 0; i < $(checkedBoxes).size(); i++) {
645
                    var box = $(checkedBoxes).get(i);
646
                    bibs[i] = $(box).val();
647
                }
648
649
                KOHA.Tags.add_multitags_button(bibs, tag);
650
                return false;
651
            }
652
        [% END # /IF TagsInputEnabled && loggedinusername %]
653
654
655
        function enableCheckboxActions(){
656
            // Enable/disable controls if checkboxes are checked
657
            var checkedBoxes = $(".cb:checked");
658
            var controls = $(".selections-toolbar .links a, .selections-toolbar .links input, .selections-toolbar .links select, .selections-toolbar .links label, .selections-toolbar .links button");
659
            if ($(checkedBoxes).size()) {
660
                $(".selections").html(_("With selected titles: "));
661
                $(controls).removeClass("disabled");
662
            } else {
663
                $(".selections").html(_("Select titles to: "));
664
                $(controls).addClass("disabled");
665
            }
666
        }
667
668
        [% IF ( OpacHighlightedWords ) %]
509
        [% IF ( OpacHighlightedWords ) %]
669
            var q_array = new Array();  // holds search terms if available
510
            var q_array = new Array();  // holds search terms if available
670
511
Lines 703-713 Link Here
703
                });
544
                });
704
            [% END %]
545
            [% END %]
705
546
706
            $(".cb").click(function(){
707
                enableCheckboxActions();
708
            });
709
            enableCheckboxActions();
710
711
            $(".br-readonly a").on("click", function(e){
547
            $(".br-readonly a").on("click", function(e){
712
                e.preventDefault();
548
                e.preventDefault();
713
            });
549
            });
Lines 720-789 Link Here
720
                $('#bookbag_form').submit();
556
                $('#bookbag_form').submit();
721
            });
557
            });
722
558
723
            [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
724
                [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
725
                    $("#addto").on("change",function(){
726
                        cartList();
727
                    });
728
                    $(".addto").find("input:submit").click(function(){
729
                        cartList();
730
                        return false;
731
                    });
732
                [% ELSE %]
733
                    $("#addto").on("click",function(){
734
                        cartList();
735
                        return false;
736
                    });
737
                [% END %]
738
            [% END %]
739
740
            function cartList(){
741
                addtoOption = $("#addto").find("option:selected");
742
                addtoval = addtoOption.val();
743
                if(addtoval == "addtolist"){
744
                    var shelfnumber = addtoOption.attr("id").replace("s","");
745
                    if (vShelfAdd()) {
746
                        Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
747
                    }
748
                    return false;
749
                } else if(addtoval == "newlist"){
750
                    [% IF ( loggedinusername ) %]if (vShelfAdd()) {
751
                        Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
752
                    }[% ELSE %]
753
                        alert(_("You must be logged in to create or add to lists"));
754
                    [% END %]
755
                    return false;
756
                } else if(addtoval == "morelists"){
757
                    [% IF ( loggedinusername ) %]
758
                        if (vShelfAdd()) {
759
                            Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
760
                        }
761
                    [% ELSE %]
762
                        alert(_("You must be logged in to create or add to lists"));
763
                    [% END %]
764
                    return false;
765
                }
766
                if(addtoval == "addtocart" || $("#addto").attr("class") == "addtocart"){
767
                    addMultiple();
768
                    return false;
769
                }
770
            }
771
            $("#CheckAll").on("click",function(e){
772
                e.preventDefault();
773
                $(".cb").prop("checked", true);
774
                enableCheckboxActions();
775
            });
776
            $("#CheckNone").on("click",function(e){
777
                e.preventDefault();
778
                $(".cb").prop("checked", false);
779
                enableCheckboxActions();
780
            });
781
782
            $(".hold").on("click", function(e){
783
                e.preventDefault();
784
                holdMultiple();
785
            });
786
787
            [% IF ( query_desc ) %]
559
            [% IF ( query_desc ) %]
788
                [% IF ( OpacHighlightedWords ) %]
560
                [% IF ( OpacHighlightedWords ) %]
789
                    q_array = query_desc.split(" ");
561
                    q_array = query_desc.split(" ");
Lines 841-890 Link Here
841
                [% END # /IF OpenLibrarySearch %]
613
                [% END # /IF OpenLibrarySearch %]
842
            [% END # /IF query_desc %]
614
            [% END # /IF query_desc %]
843
615
844
            [% IF ( TagsInputEnabled && loggedinusername ) %]
845
                $("#tagsel_tag").show().click(function(){
846
                    tagSelected();
847
                    return false;
848
                });
849
                $("#tagsel_cancel").click(function(){
850
                    tagCanceled();
851
                    return false;
852
                });
853
                $("#tagsel_button").click(function(){
854
                    tagAdded();
855
                    return false;
856
                });
857
858
                $(".tag_add").click(function(){
859
                    var thisid = $(this).attr("id");
860
                    thisid = thisid.replace("tag_add","");
861
                    $(this).addClass("hidden");
862
                    $("#tagform"+thisid).show();
863
                    $("#newtag"+thisid).focus();
864
                    $("#newtag"+thisid+"_status").empty().hide();
865
                    return false;
866
                });
867
                $(".cancel_tag_add").click(function(){
868
                    var thisid = $(this).attr("id");
869
                    thisid = thisid.replace("cancel","");
870
                    $("#tagform"+thisid).hide();
871
                    $("#tag_add"+thisid).removeClass("hidden");
872
                    $("#newtag"+thisid).val("");
873
                    $("#newtag"+thisid+"_status").empty().hide();
874
                    return false;
875
                });
876
                $(".tagbutton").click(function(){
877
                    var thisid = $(this).attr("title");
878
                    var tag = $("#newtag"+thisid).val();
879
                    if (!tag || (tag == "")) {
880
                        alert( _("No tag was specified.") );
881
                        return false;
882
                    }
883
                    KOHA.Tags.add_tag_button(thisid, tag);
884
                    return false;
885
                });
886
            [% END # /IF TagsInputEnabled && loggedinusername %]
887
888
            [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
616
            [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
889
            [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
617
            [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
890
            [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
618
            [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
Lines 902-914 Link Here
902
            $("input.newtag").on('keydown', function(e){
630
            $("input.newtag").on('keydown', function(e){
903
                if (e.keyCode == 13) { e.preventDefault(); }
631
                if (e.keyCode == 13) { e.preventDefault(); }
904
            });
632
            });
905
906
            Sticky = $("#floating");
907
            Sticky.hcSticky({
908
                stickTo: ".searchresults",
909
                stickyClass: "floating"
910
            });
911
912
        });
633
        });
913
    </script>
634
    </script>
914
[% END %]
635
[% 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
                                            <span id="removeitems"></span>
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 547-552 Link Here
547
                                    <input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger removeitems"/>
515
                                    <input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger removeitems"/>
548
                                [% END %]
516
                                [% END %]
549
                            </form> <!-- /myform -->
517
                            </form> <!-- /myform -->
518
                            <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
519
                                <!-- The value will be set by holdBiblioNums() in basket.js -->
520
                                <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
521
                            </form>
550
                        [% ELSE %]
522
                        [% ELSE %]
551
                            <div id="toolbar" class="toolbar clearfix">
523
                            <div id="toolbar" class="toolbar clearfix">
552
                                <div class="list-actions">
524
                                <div class="list-actions">
Lines 837-857 Link Here
837
    [% Asset.js("js/openlibrary.js") | $raw %]
809
    [% Asset.js("js/openlibrary.js") | $raw %]
838
[% END %]
810
[% END %]
839
<script>
811
<script>
840
812
    const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %];
841
[% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) ) %]
813
    const opacbookbag = [% ( opacbookbag ) ? 1 : 0 | html %];
842
    function holdSelections() {
814
    const virtualshelves = [% ( virtualshelves ) ? 1 : 0 | html %];
843
        var checkedBoxes = $("input:checkbox:checked");
815
</script>
844
        if ($(checkedBoxes).size() == 0) {
816
[% Asset.js("js/results-list.js") | $raw %]
845
            alert( _("No item was selected") );
817
<script>
846
        } else {
847
            var bibs = "";
848
            $(checkedBoxes).each(function(){
849
                bibs += $(this).val() + "/";
850
            });
851
            document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers="+bibs;
852
        }
853
    }
854
[% END %]
855
[% IF ( TagsInputEnabled && loggedinusername ) %]
818
[% IF ( TagsInputEnabled && loggedinusername ) %]
856
    function tagSelected() {
819
    function tagSelected() {
857
        var checkedBoxes = $("input:checkbox:checked");
820
        var checkedBoxes = $("input:checkbox:checked");
Lines 896-941 Link Here
896
    }
859
    }
897
[% END %]
860
[% END %]
898
861
899
function enableCheckboxActions(){
900
    // Enable/disable controls if checkboxes are checked
901
    var checkedBoxes = $(".cb:checked");
902
    if ($(checkedBoxes).size()) {
903
      $(".selections").html(_("With selected titles: "));
904
      $(".selections-toolbar .links a").removeClass("disabled");
905
    } else {
906
      $(".selections").html(_("Select titles to: "));
907
      $(".selections-toolbar .links a").addClass("disabled");
908
    }
909
}
910
911
$(function() {
862
$(function() {
912
    [% IF Koha.Preference( 'opacbookbag' ) == 1 %]$(".addtocart,.cartRemove").removeClass("hidden");[% END %]
913
914
    [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) ) %]
915
        $(".selections-toolbar a.hold").click(function(e){
916
            e.preventDefault();
917
            holdSelections();
918
        });
919
    [% END %]
920
921
    $("a.print").show();
863
    $("a.print").show();
922
864
923
    $("#CheckAll").on("click",function(e){
924
        e.preventDefault();
925
        $(".cb").prop("checked", true);
926
        enableCheckboxActions();
927
    });
928
    $("#CheckNone").on("click",function(e){
929
        e.preventDefault();
930
        $(".cb").prop("checked", false);
931
        enableCheckboxActions();
932
    });
933
934
    $(".cb").click(function(){
935
      enableCheckboxActions();
936
    });
937
    enableCheckboxActions();
938
939
    [% IF ( TagsInputEnabled && loggedinusername ) %]
865
    [% IF ( TagsInputEnabled && loggedinusername ) %]
940
        var tagAdd = $(".tag_add");
866
        var tagAdd = $(".tag_add");
941
        tagAdd.removeClass("hidden");
867
        tagAdd.removeClass("hidden");
Lines 1048-1059 $(function() { Link Here
1048
974
1049
    AdjustRemark();
975
    AdjustRemark();
1050
976
1051
    Sticky = $("#floating");
1052
    Sticky.hcSticky({
1053
        stickTo: "#usershelves",
1054
        stickyClass: "floating"
1055
    });
1056
1057
    [% IF itemsloop %]
977
    [% IF itemsloop %]
1058
        sortMenu( $("#sorting-form") );
978
        sortMenu( $("#sorting-form") );
1059
979
Lines 1112-1138 $(function() { Link Here
1112
        Dopop( link );
1032
        Dopop( link );
1113
    });
1033
    });
1114
1034
1115
    $(".listaddtocart").on("click", function(e){
1116
        e.preventDefault();
1117
        addMultiple();
1118
    });
1119
1120
    $(".addtolist").on("click", function(e){
1121
        e.preventDefault();
1122
        cartList();
1123
    });
1124
1125
    function cartList(){
1126
        [% IF ( loggedinusername ) %]
1127
            if (vShelfAdd()) {
1128
                Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
1129
            }
1130
        [% ELSE %]
1131
            alert(_("You must be logged in to create or add to lists"));
1132
        [% END %]
1133
        return false;
1134
    }
1135
1136
}); // document.ready
1035
}); // document.ready
1137
1036
1138
function sortMenu( sorting_form ){
1037
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 197-202 Link Here
197
[% INCLUDE 'opac-bottom.inc' %]
208
[% INCLUDE 'opac-bottom.inc' %]
198
[% BLOCK jsinclude %]
209
[% BLOCK jsinclude %]
199
[% INCLUDE 'datatables.inc' %]
210
[% INCLUDE 'datatables.inc' %]
211
[% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
212
<script>
213
    const loggedinusername = [% ( loggedinusername ) ? 1 : 0 | html %];
214
    const opacbookbag = [% ( opacbookbag ) ? 1 : 0 | html %];
215
    const virtualshelves = [% ( virtualshelves ) ? 1 : 0 | html %];
216
</script>
217
[% Asset.js("js/results-list.js") | $raw %]
200
<script>
218
<script>
201
219
202
    $(document).ready(function(){
220
    $(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