diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index 898f57ab5d..d26780a8e2 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -49,6 +49,7 @@ use C4::Search; # enabled_staff_search_views use Koha::Biblios; use Koha::Patrons; use Koha::RecordProcessor; +use Koha::Virtualshelves; my $query = CGI->new; @@ -138,6 +139,38 @@ if ($subscriptionsnumber) { ); } +# get biblionumbers stored in the cart +my @cart_list; + +if($query->cookie("intranet_bib_list")){ + my $cart_list = $query->cookie("intranet_bib_list"); + @cart_list = split(/\//, $cart_list); + if ( grep {$_ eq $biblionumber} @cart_list) { + $template->param( incart => 1 ); + } +} + +my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $loggedinuser, + add_allowed => 1, + category => 1, + } +); +my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $loggedinuser, + add_allowed => 1, + category => 2, + } +); + + +$template->param( + add_to_some_private_shelves => $some_private_shelves, + add_to_some_public_shelves => $some_public_shelves, +); + $template->param ( ISBD => $res, biblionumber => $biblionumber, diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 4f30839f2c..97ce943a2f 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -62,6 +62,7 @@ use Koha::Biblios; use Koha::BiblioFrameworks; use Koha::Patrons; use Koha::DateUtils; +use Koha::Virtualshelves; use List::MoreUtils qw( uniq ); @@ -325,6 +326,38 @@ if ($subscriptionscount) { ); } +# get biblionumbers stored in the cart +my @cart_list; + +if($query->cookie("intranet_bib_list")){ + my $cart_list = $query->cookie("intranet_bib_list"); + @cart_list = split(/\//, $cart_list); + if ( grep {$_ eq $biblionumber} @cart_list) { + $template->param( incart => 1 ); + } +} + +my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $loggedinuser, + add_allowed => 1, + category => 1, + } +); +my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $loggedinuser, + add_allowed => 1, + category => 2, + } +); + + +$template->param( + add_to_some_private_shelves => $some_private_shelves, + add_to_some_public_shelves => $some_public_shelves, +); + $template->param ( item_loop => \@item_loop, item_header_loop => \@item_header_loop, @@ -337,6 +370,7 @@ $template->param ( C4::Search::enabled_staff_search_views, searchid => scalar $query->param('searchid'), biblio => $biblio_object, + loggedinuser => $loggedinuser, ); $template->param( holdcount => $biblio_object->holds->count ); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 7b7f4d2944..9cb607b1e1 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -438,6 +438,27 @@ if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { } } +my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $borrowernumber, + add_allowed => 1, + category => 1, + } +); +my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $borrowernumber, + add_allowed => 1, + category => 2, + } +); + + +$template->param( + add_to_some_private_shelves => $some_private_shelves, + add_to_some_public_shelves => $some_public_shelves, +); + $template->param( MARCNOTES => $marcnotesarray, itemdata_ccode => $itemfields{ccode}, @@ -580,6 +601,17 @@ if ($StaffDetailItemSelection) { } } +# get biblionumbers stored in the cart +my @cart_list; + +if($query->cookie("intranet_bib_list")){ + my $cart_list = $query->cookie("intranet_bib_list"); + @cart_list = split(/\//, $cart_list); + if ( grep {$_ eq $biblionumber} @cart_list) { + $template->param( incart => 1 ); + } +} + $template->param(biblio => $biblio); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl index 16eb6cacd1..47ce79024d 100755 --- a/catalogue/labeledMARCdetail.pl +++ b/catalogue/labeledMARCdetail.pl @@ -32,6 +32,7 @@ use C4::Serials; use Koha::Biblios; use Koha::BiblioFrameworks; use Koha::Patrons; +use Koha::Virtualshelves; my $query = CGI->new; my $dbh = C4::Context->dbh; @@ -120,6 +121,38 @@ for my $field ($record->fields) }; } +# get biblionumbers stored in the cart +my @cart_list; + +if($query->cookie("intranet_bib_list")){ + my $cart_list = $query->cookie("intranet_bib_list"); + @cart_list = split(/\//, $cart_list); + if ( grep {$_ eq $biblionumber} @cart_list) { + $template->param( incart => 1 ); + } +} + +my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $loggedinuser, + add_allowed => 1, + category => 1, + } +); +my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $loggedinuser, + add_allowed => 1, + category => 2, + } +); + + +$template->param( + add_to_some_private_shelves => $some_private_shelves, + add_to_some_public_shelves => $some_public_shelves, +); + $template->param ( marc_data => \@marc_data, biblionumber => $biblionumber, diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 3dca1f4f3b..94a7eab12f 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -265,6 +265,38 @@ $template->param(count => $data->{'count'}, C4::Search::enabled_staff_search_views, ); +# get biblionumbers stored in the cart +my @cart_list; + +if($query->cookie("intranet_bib_list")){ + my $cart_list = $query->cookie("intranet_bib_list"); + @cart_list = split(/\//, $cart_list); + if ( grep {$_ eq $biblionumber} @cart_list) { + $template->param( incart => 1 ); + } +} + +my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $loggedinuser, + add_allowed => 1, + category => 1, + } +); +my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( + { + borrowernumber => $loggedinuser, + add_allowed => 1, + category => 2, + } +); + + +$template->param( + add_to_some_private_shelves => $some_private_shelves, + add_to_some_public_shelves => $some_public_shelves, +); + $template->param( ITEM_DATA => \@items, moredetailview => 1, diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 4d64e2c9a9..6d03d1a310 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1365,6 +1365,24 @@ dd { margin-top: 0; z-index: 300; } + + a.addtocart { + display: block; + } + + a.cartRemove { + padding: 6px 12px; + font-size: 12px; + display: none; + } + + a.addtocart.incart { + display: none; + } + + a.cartRemove.incart { + display: block; + } } #disabled { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index 4d07b26ce6..b004628bcb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -100,19 +100,68 @@ CAN_user_serials_create_subscription ) %] -[% IF ( virtualshelves && intranetbookbag ) %] -