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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc (+61 lines)
Line 0 Link Here
1
<div class="actions-menu noprint">
2
    [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
3
        [% UNLESS ( items.norequests ) %]
4
            [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
5
                [% IF ( shelf AND op == 'view' ) # Lists view has more granular checking of hold availability %]
6
                    [% IF ( items.allow_onshelf_holds ) %]
7
                        <span class="actions"><a class="btn btn-link hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark"></i> Place hold</a></span>
8
                    [% ELSE %]
9
                        [% IF ( items.itemsissued ) %]
10
                            <span class="actions"><a class="btn btn-link hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark"></i> Place hold</a></span>
11
                        [% END %]
12
                    [% END %]
13
                [% ELSE %]
14
                    <span class="actions"><a class="btn btn-link hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark"></i> Place hold</a></span>
15
                [% END %]
16
            [% END # / IF opacuserlogin %]
17
        [% END # / UNLESS items.norequests %]
18
    [% END # / RequestOnOpac %]
19
20
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
21
        [% IF items.artreqpossible %]
22
            <span class="actions"><a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% items.biblionumber | uri %]" class="btn btn-link"><i class="fa fa-file-text"></i> Request article</a></span>
23
        [% END %]
24
    [% END %]
25
26
    [% IF ( TagsInputEnabled ) %]
27
        [% IF ( loggedinusername ) %]
28
            <span class="actions"><a id="tag_add[% items.biblionumber | html %]" href="#" class="tag_add btn btn-link"><i class="fa fa-tag"></i> Add tag</a></span>
29
            <div id="tagform[% items.biblionumber | html %]" class="tag_results_input" style="display:none;">
30
                <label for="newtag[% items.biblionumber | html %]">New tag(s), separated by a comma:</label>
31
                <input type="text" name="newtag[% items.biblionumber | html %]" id="newtag[% items.biblionumber | html %]" class="newtag" maxlength="100" />
32
                <input name="tagbutton" class="btn btn-small tagbutton" title="[% items.biblionumber | html %]" type="submit" value="Add" />
33
                <a class="cancel_tag_add" id="cancel[% items.biblionumber | html %]" href="#">(done)</a>
34
            </div>
35
            <span id="newtag[% items.biblionumber | html %]_status" class="tagstatus" style="display:none;">
36
                Tag status here.
37
            </span>
38
        [% ELSE %]
39
            <span class="actions"><span id="login4tags"><a class="btn btn-link loginModal-trigger" href="/cgi-bin/koha/opac-user.pl"><i class="fa fa-tag"></i> Log in to add tags</a></span></span>
40
        [% END # IF loggedinusername %]
41
    [% END # if TagsInputEnabled %]
42
43
    [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
44
        [% IF ( shelf AND op == 'view' ) %]
45
            <span class="actions"><a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | uri %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | uri %]'); return false;" class="btn btn-link"><i class="fa fa-list"></i> Save to another list</a></span>
46
            [% IF can_remove_biblios %]
47
                <span class="actions"><a class="btn btn-link removefromlist" href="/cgi-bin/koha/opac-shelves.pl?op=remove_biblios&amp;shelfnumber=[% shelf.shelfnumber | html %]&amp;biblionumber=[% items.biblionumber | html %]"><i class="fa fa-remove"></i> Remove from this list</a></span>
48
            [% END %]
49
        [% ELSE %]
50
            <span class="actions"><a class="addtoshelf btn btn-link" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | html %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% items.biblionumber | html %]'); return false;"><i class="fa fa-list"></i> Save to lists</a></span>
51
        [% END # /IF ( shelf AND op == 'view' ) %]
52
    [% END # /IF Koha.Preference( 'opacuserlogin' ) %]
53
54
    [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
55
        [% IF ( items.incart ) %]
56
            <span class="actions"><a data-biblionumber="[% items.biblionumber | html %]" class="btn btn-link cart cart[% items.biblionumber | html %]" href="#"><i class="fa fa-shopping-cart"></i> In your cart</a> <a data-biblionumber="[% items.biblionumber | html %]" class="btn btn-link remove cartRemove cartR[% items.biblionumber | html %]" href="#">(remove)</a></span>
57
        [% ELSE %]
58
            <span class="actions"><a data-biblionumber="[% items.biblionumber | html %]" class="btn btn-link addtocart cart cart[% items.biblionumber | html %]" href="#"><i class="fa fa-shopping-cart"></i> Add to cart</a> <a style="display:none;" data-biblionumber="[% items.biblionumber | html %]" class="btn btn-link remove cartRemove cartR[% items.biblionumber | html %]" href="#">(remove)</a></span>
59
        [% END %]
60
    [% END # / IF opacbookbag %]
61
</div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-43 / +1 lines)
Lines 536-585 Link Here
536
                                                    </div> <!-- / .results_summary -->
536
                                                    </div> <!-- / .results_summary -->
537
                                                [% END # / IF OpacStarRatings %]
537
                                                [% END # / IF OpacStarRatings %]
538
538
539
                                                <div class="actions-menu noprint">
539
                                                    [% INCLUDE 'title-actions-menu.inc' items=SEARCH_RESULT %]
540
                                                        [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
541
                                                            [% UNLESS ( SEARCH_RESULT.norequests ) %]
542
                                                                [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
543
                                                                    <span class="actions"><a href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" class="btn btn-link"><i class="fa fa-bookmark"></i> Place hold</a></span><!-- add back when available 0 holds in queue-->
544
                                                                [% END # / IF opacuserlogin && holdable %]
545
                                                            [% END # UNLESS SEARCH_RESULT.norequests %]
546
                                                        [% END # IF RequestOnOpac %]
547
548
                                                        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
549
                                                            [% IF SEARCH_RESULT.artreqpossible %]
550
                                                                <span class="actions"><a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" class="btn btn-link"><i class="fa fa-file-text"></i> Request article</a></span>
551
                                                            [% END %]
552
                                                        [% END %]
553
554
                                                        [% IF ( TagsInputEnabled ) %]
555
                                                            [% IF ( loggedinusername ) %]
556
                                                                <span class="actions"><a id="tag_add[% SEARCH_RESULT.biblionumber | html %]" href="#" class="tag_add btn btn-link"><i class="fa fa-tag"></i> Add tag</a></span>
557
                                                                <div id="tagform[% SEARCH_RESULT.biblionumber | html %]" class="tag_results_input" style="display:none;">
558
                                                                        <label for="newtag[% SEARCH_RESULT.biblionumber | html %]">New tag(s), separated by a comma:</label>
559
                                                                        <input type="text" name="newtag[% SEARCH_RESULT.biblionumber | html %]" id="newtag[% SEARCH_RESULT.biblionumber | html %]" class="newtag" maxlength="100" />
560
                                                                        <input name="tagbutton" class="btn btn-small tagbutton" title="[% SEARCH_RESULT.biblionumber | html %]" type="submit" value="Add" />
561
                                                                        <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber | html %]" href="#">(done)</a>
562
                                                                </div>
563
                                                                <span id="newtag[% SEARCH_RESULT.biblionumber | html %]_status" class="tagstatus" style="display:none;">
564
                                                                    Tag status here.
565
                                                                </span>
566
                                                            [% ELSE %]
567
                                                                <span class="actions"><span id="login4tags"><a class="btn btn-link loginModal-trigger" href="/cgi-bin/koha/opac-user.pl"><i class="fa fa-tag"></i> Log in to add tags</a></span></span>
568
                                                            [% END # IF loggedinusername %]
569
                                                        [% END # if TagsInputEnabled %]
570
571
                                                        [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
572
                                                            <span class="actions"><a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]'); return false;" class="btn btn-link"><i class="fa fa-list"></i> Save to lists</a></span>
573
                                                        [% END %]
574
540
575
                                                        [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
576
                                                            [% IF ( SEARCH_RESULT.incart ) %]
577
                                                                <span class="actions"><a data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" class="btn btn-link cart cart[% SEARCH_RESULT.biblionumber | html %]" href="#"><i class="fa fa-shopping-cart"></i> In your cart</a> <a data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" class="btn btn-link remove cartRemove cartR[% SEARCH_RESULT.biblionumber | html %]" href="#">(remove)</a></span>
578
                                                            [% ELSE %]
579
                                                                <span class="actions"><a data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" class="btn btn-link addtocart cart cart[% SEARCH_RESULT.biblionumber | html %]" href="#"><i class="fa fa-shopping-cart"></i> Add to cart</a> <a style="display:none;" data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" class="btn btn-link remove cartRemove cartR[% SEARCH_RESULT.biblionumber | html %]" href="#">(remove)</a></span>
580
                                                            [% END %]
581
                                                        [% END # / IF opacbookbag %]
582
                                                </div>
583
                                                </div>
541
                                                </div>
584
                                                [% INCLUDE "openlibrary-readapi.inc" bib = SEARCH_RESULT %]
542
                                                [% INCLUDE "openlibrary-readapi.inc" bib = SEARCH_RESULT %]
585
543
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-49 / +1 lines)
Lines 463-517 Link Here
463
                                                        </div>
463
                                                        </div>
464
                                                    [% END %]
464
                                                    [% END %]
465
465
466
                                                    <span class="results_summary">
466
                                                    [% INCLUDE 'title-actions-menu.inc' items=itemsloo %]
467
468
                                                        [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
469
                                                            [% UNLESS ( itemsloo.norequests ) %]
470
                                                                [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
471
                                                                    [% IF ( itemsloo.allow_onshelf_holds ) %]
472
                                                                        <span class="actions"><a class="btn btn-link hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber | html %]"><i class="fa fa-fw fa-bookmark"></i> Place hold</a><!-- add back when available 0 holds in queue--></span>
473
                                                                    [% ELSE %]
474
                                                                        [% IF ( itemsloo.itemsissued ) %]
475
                                                                            <span class="actions"><a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% itemsloo.biblionumber | html %]"><i class="fa fa-fw fa-bookmark"></i> Place hold</a><!-- add back when available 0 holds in queue--></span>
476
                                                                        [% END %]
477
                                                                    [% END %]
478
                                                                [% END # / IF opacuserlogin %]
479
                                                            [% END # / UNLESS itemsloo.norequests %]
480
                                                        [% END # / RequestOnOpac %]
481
482
                                                        [% IF ( TagsInputEnabled ) %]
483
                                                            [% IF ( loggedinusername ) %]
484
                                                                <span class="actions"><a class="btn btn-link tag_add hidden" id="tag_add[% itemsloo.biblionumber | html %]" href="#"><i class="fa fa-fw fa-tag"></i> Add tag</a></span>
485
                                                                <div id="tagform[% itemsloo.biblionumber | html %]" class="tag_results_input" style="display:none;">
486
                                                                    <label for="newtag[% itemsloo.biblionumber | html %]">New tag(s), separated by a comma:</label>
487
                                                                    <input type="text" name="newtag[% itemsloo.biblionumber | html %]" id="newtag[% itemsloo.biblionumber | html %]" maxlength="100" />
488
                                                                    <input name="tagbutton" class="tagbutton btn btn-small" title="[% itemsloo.biblionumber | html %]" type="submit" value="Add" />
489
                                                                    <a class="cancel_tag_add" id="cancel[% itemsloo.biblionumber | html %]" href="#">(done)</a>
490
                                                                </div>
491
                                                                <div id="newtag[% itemsloo.biblionumber | html %]_status" class="tagstatus" style="display:none;">
492
                                                                Tag status here.
493
                                                                </div>
494
                                                            [% ELSIF ( loop.first ) %]
495
                                                                <span class="tagstatus" id="login4tags">Log in to add tags.</span>
496
                                                            [% END # / IF loggedinusername %]
497
                                                        [% END # / IF TagsInputEnabled %]
498
499
                                                        [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
500
                                                            <span class="actions"><a class="btn btn-link addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber | uri %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber | uri %]'); return false;"><i class="fa fa-fw fa-list"></i> Save to another list</a></span>
501
                                                        [% END %]
502
503
                                                        [% IF can_remove_biblios %]
504
                                                            <span class="actions"><a class="btn btn-link btn-disabled remove removefromlist" href="/cgi-bin/koha/opac-shelves.pl?op=remove_biblios&amp;shelfnumber=[% shelf.shelfnumber | html %]&amp;biblionumber=[% itemsloo.biblionumber | html %]"><i class="fa fa-fw fa-remove"></i> Remove from this list</a></span>
505
                                                        [% END %]
506
507
                                                        [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
508
                                                            [% IF ( itemsloo.incart ) %]
509
                                                                <span class="actions"><a data-biblionumber="[% itemsloo.biblionumber | html %]" class="btn btn-link addtocart cart[% itemsloo.biblionumber | html %] hidden" href="#"><i class="fa fa-fw fa-shopping-cart"></i> In your cart</a> <a data-biblionumber="[% itemsloo.biblionumber | html %]" class="btn btn-link cartRemove cartR[% itemsloo.biblionumber | html %] hidden" href="#">(remove)</a></span>
510
                                                            [% ELSE %]
511
                                                                <span class="actions"><a data-biblionumber="[% itemsloo.biblionumber | html %]" class="btn btn-link addtocart cart[% itemsloo.biblionumber | html %] hidden" href="#"><i class="fa fa-fw fa-shopping-cart"></i> Add to cart</a> <a style="display:none;" data-biblionumber="[% itemsloo.biblionumber | html %]" class="btn btn-link cartRemove cartR[% itemsloo.biblionumber | html %] hidden" href="#">(remove)</a></span>
512
                                                            [% END %]
513
                                                        [% END # / IF opacbookbag %]
514
                                                    </span> <!-- / .results_summary .actions -->
515
467
516
                                                    <!-- COinS / Openurl -->
468
                                                    <!-- COinS / Openurl -->
517
                                                    <span class="Z3988" title="[% itemsloo.coins | html %]"></span>
469
                                                    <span class="Z3988" title="[% itemsloo.coins | html %]"></span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt (+2 lines)
Lines 155-160 Link Here
155
                                                        by [% MY_TAG.author | html %]
155
                                                        by [% MY_TAG.author | html %]
156
                                                    [% END %]
156
                                                    [% END %]
157
                                                [% END # /IF MY_TAG.XSLTBloc %]
157
                                                [% END # /IF MY_TAG.XSLTBloc %]
158
159
                                                [% INCLUDE 'title-actions-menu.inc' items=MY_TAG %]
158
                                            </td>
160
                                            </td>
159
                                            <td>
161
                                            <td>
160
                                                <span title="[% MY_TAG.date_created | html %]">
162
                                                <span title="[% MY_TAG.date_created | html %]">
(-)a/opac/opac-shelves.pl (+13 lines)
Lines 267-278 if ( $op eq 'view' ) { Link Here
267
267
268
            my $patron = Koha::Patrons->find( $loggedinuser );
268
            my $patron = Koha::Patrons->find( $loggedinuser );
269
269
270
            my $categorycode; # needed for may_article_request
271
            if( C4::Context->preference('ArticleRequests') ) {
272
                $categorycode = $patron ? $patron->categorycode : undef;
273
            }
274
270
            # Lists display falls back to search results configuration
275
            # Lists display falls back to search results configuration
271
            my $xslfile = C4::Context->preference('OPACXSLTListsDisplay');
276
            my $xslfile = C4::Context->preference('OPACXSLTListsDisplay');
272
            my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
277
            my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
273
            my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
278
            my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
274
279
275
            my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
280
            my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
281
282
            my $art_req_itypes;
283
            if( C4::Context->preference('ArticleRequests') ) {
284
                $art_req_itypes = Koha::IssuingRules->guess_article_requestable_itemtypes({ $patron ? ( categorycode => $patron->categorycode ) : () });
285
            }
286
276
            my @items;
287
            my @items;
277
            while ( my $content = $contents->next ) {
288
            while ( my $content = $contents->next ) {
278
                my $biblionumber = $content->biblionumber;
289
                my $biblionumber = $content->biblionumber;
Lines 304-309 if ( $op eq 'view' ) { Link Here
304
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
315
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
305
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
316
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
306
                $this_item->{'normalized_isbn'} = GetNormalizedISBN( undef, $record, $marcflavour );
317
                $this_item->{'normalized_isbn'} = GetNormalizedISBN( undef, $record, $marcflavour );
318
                # BZ17530: 'Intelligent' guess if result can be article requested
319
                $this_item->{artreqpossible} = ( $art_req_itypes->{ $this_item->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{};
307
320
308
                unless ( defined $this_item->{size} ) {
321
                unless ( defined $this_item->{size} ) {
309
322
(-)a/opac/opac-tags.pl (-1 / +20 lines)
Lines 236-241 if ($loggedinuser) { Link Here
236
    $should_hide = ( $should_hide =~ /\S/ ) ? 1 : 0;
236
    $should_hide = ( $should_hide =~ /\S/ ) ? 1 : 0;
237
    $my_tags = get_tag_rows({borrowernumber=>$loggedinuser});
237
    $my_tags = get_tag_rows({borrowernumber=>$loggedinuser});
238
    my $my_approved_tags = get_approval_rows({ approved => 1 });
238
    my $my_approved_tags = get_approval_rows({ approved => 1 });
239
240
    my $art_req_itypes;
241
    if( C4::Context->preference('ArticleRequests') ) {
242
        $art_req_itypes = Koha::IssuingRules->guess_article_requestable_itemtypes({ $patron ? ( categorycode => $patron->categorycode ) : () });
243
    }
244
245
    # get biblionumbers stored in the cart
246
    my @cart_list;
247
248
    if($query->cookie("bib_list")){
249
        my $cart_list = $query->cookie("bib_list");
250
        @cart_list = split(/\//, $cart_list);
251
    }
252
239
    foreach my $tag (@$my_tags) {
253
    foreach my $tag (@$my_tags) {
240
        $tag->{visible} = 0;
254
        $tag->{visible} = 0;
241
        my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
255
        my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
Lines 262-267 if ($loggedinuser) { Link Here
262
        $tag->{part_number} = $biblio->part_number;
276
        $tag->{part_number} = $biblio->part_number;
263
        $tag->{part_name} = $biblio->part_name;
277
        $tag->{part_name} = $biblio->part_name;
264
        $tag->{author} = $biblio->author;
278
        $tag->{author} = $biblio->author;
279
        # BZ17530: 'Intelligent' guess if result can be article requested
280
        $tag->{artreqpossible} = ( $art_req_itypes->{ $tag->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{};
265
281
266
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
282
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
267
        my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
283
        my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
Lines 279-284 if ($loggedinuser) { Link Here
279
        $tag->{time_created_display} = $1;
295
        $tag->{time_created_display} = $1;
280
        $tag->{approved} = ( grep { $_->{term} eq $tag->{term} and $_->{approved} } @$my_approved_tags );
296
        $tag->{approved} = ( grep { $_->{term} eq $tag->{term} and $_->{approved} } @$my_approved_tags );
281
        $tag->{visible} = 1;
297
        $tag->{visible} = 1;
298
        # while we're checking each line, see if item is in the cart
299
        if ( grep {$_ eq $biblio->biblionumber} @cart_list) {
300
            $tag->{incart} = 1;
301
        }
282
    }
302
    }
283
}
303
}
284
304
285
- 

Return to bug 13121