@@ -, +, @@
"Add tag," etc) into include file
- Search results
- Shelf contents view
- User tags list
- Place hold
- Request art
- Add tag
- Save to lists
- Add to cart
---
.../bootstrap/en/includes/title-actions-menu.inc | 61 ++++++++++++++++++++++
.../opac-tmpl/bootstrap/en/modules/opac-results.tt | 44 +---------------
.../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 50 +-----------------
.../opac-tmpl/bootstrap/en/modules/opac-tags.tt | 2 +
opac/opac-shelves.pl | 13 +++++
opac/opac-tags.pl | 20 +++++++
6 files changed, 98 insertions(+), 92 deletions(-)
create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc
@@ -0,0 +1,61 @@
+
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
@@ -536,50 +536,8 @@
[% END # / IF OpacStarRatings %]
-
[% INCLUDE "openlibrary-readapi.inc" bib = SEARCH_RESULT %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
@@ -463,55 +463,7 @@
[% END %]
-
-
- [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
- [% UNLESS ( itemsloo.norequests ) %]
- [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
- [% IF ( itemsloo.allow_onshelf_holds ) %]
- Place hold
- [% ELSE %]
- [% IF ( itemsloo.itemsissued ) %]
- Place hold
- [% END %]
- [% END %]
- [% END # / IF opacuserlogin %]
- [% END # / UNLESS itemsloo.norequests %]
- [% END # / RequestOnOpac %]
-
- [% IF ( TagsInputEnabled ) %]
- [% IF ( loggedinusername ) %]
- Add tag
-
-
- Tag status here.
-
- [% ELSIF ( loop.first ) %]
- Log in to add tags.
- [% END # / IF loggedinusername %]
- [% END # / IF TagsInputEnabled %]
-
- [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
- Save to another list
- [% END %]
-
- [% IF can_remove_biblios %]
- Remove from this list
- [% END %]
-
- [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
- [% IF ( itemsloo.incart ) %]
- In your cart (remove)
- [% ELSE %]
- Add to cart (remove)
- [% END %]
- [% END # / IF opacbookbag %]
-
+ [% INCLUDE 'title-actions-menu.inc' items=itemsloo %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt
@@ -155,6 +155,8 @@
by [% MY_TAG.author | html %]
[% END %]
[% END # /IF MY_TAG.XSLTBloc %]
+
+ [% INCLUDE 'title-actions-menu.inc' items=MY_TAG %]
--- a/opac/opac-shelves.pl
+++ a/opac/opac-shelves.pl
@@ -267,12 +267,23 @@ if ( $op eq 'view' ) {
my $patron = Koha::Patrons->find( $loggedinuser );
+ my $categorycode; # needed for may_article_request
+ if( C4::Context->preference('ArticleRequests') ) {
+ $categorycode = $patron ? $patron->categorycode : undef;
+ }
+
# Lists display falls back to search results configuration
my $xslfile = C4::Context->preference('OPACXSLTListsDisplay');
my $lang = $xslfile ? C4::Languages::getlanguage() : undef;
my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
+
+ my $art_req_itypes;
+ if( C4::Context->preference('ArticleRequests') ) {
+ $art_req_itypes = Koha::IssuingRules->guess_article_requestable_itemtypes({ $patron ? ( categorycode => $patron->categorycode ) : () });
+ }
+
my @items;
while ( my $content = $contents->next ) {
my $biblionumber = $content->biblionumber;
@@ -304,6 +315,8 @@ if ( $op eq 'view' ) {
$this_item->{'normalized_ean'} = GetNormalizedEAN( $record, $marcflavour );
$this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
$this_item->{'normalized_isbn'} = GetNormalizedISBN( undef, $record, $marcflavour );
+ # BZ17530: 'Intelligent' guess if result can be article requested
+ $this_item->{artreqpossible} = ( $art_req_itypes->{ $this_item->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{};
unless ( defined $this_item->{size} ) {
--- a/opac/opac-tags.pl
+++ a/opac/opac-tags.pl
@@ -236,6 +236,20 @@ if ($loggedinuser) {
$should_hide = ( $should_hide =~ /\S/ ) ? 1 : 0;
$my_tags = get_tag_rows({borrowernumber=>$loggedinuser});
my $my_approved_tags = get_approval_rows({ approved => 1 });
+
+ my $art_req_itypes;
+ if( C4::Context->preference('ArticleRequests') ) {
+ $art_req_itypes = Koha::IssuingRules->guess_article_requestable_itemtypes({ $patron ? ( categorycode => $patron->categorycode ) : () });
+ }
+
+ # get biblionumbers stored in the cart
+ my @cart_list;
+
+ if($query->cookie("bib_list")){
+ my $cart_list = $query->cookie("bib_list");
+ @cart_list = split(/\//, $cart_list);
+ }
+
foreach my $tag (@$my_tags) {
$tag->{visible} = 0;
my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
@@ -262,6 +276,8 @@ if ($loggedinuser) {
$tag->{part_number} = $biblio->part_number;
$tag->{part_name} = $biblio->part_name;
$tag->{author} = $biblio->author;
+ # BZ17530: 'Intelligent' guess if result can be article requested
+ $tag->{artreqpossible} = ( $art_req_itypes->{ $tag->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{};
my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
my $lang = $xslfile ? C4::Languages::getlanguage() : undef;
@@ -279,6 +295,10 @@ if ($loggedinuser) {
$tag->{time_created_display} = $1;
$tag->{approved} = ( grep { $_->{term} eq $tag->{term} and $_->{approved} } @$my_approved_tags );
$tag->{visible} = 1;
+ # while we're checking each line, see if item is in the cart
+ if ( grep {$_ eq $biblio->biblionumber} @cart_list) {
+ $tag->{incart} = 1;
+ }
}
}
--
|