From edaeec4b0ca5e514805bf29e3c4558e15594eed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Fri, 4 Mar 2011 18:18:16 +0100 Subject: [PATCH] Bug 5830 Using XSLT on OPAC Lists page On OPAC Lists page (opac-shelves.pl), biblio records are now displayed accordingly to OPACXSLTResultsDisplay system preference. --- C4/VirtualShelves/Page.pm | 9 ++- .../opac-tmpl/prog/en/includes/biblioresult.inc | 61 +++++++++++++++++++ .../opac-tmpl/prog/en/modules/opac-results.tmpl | 64 +------------------- .../opac-tmpl/prog/en/modules/opac-shelves.tmpl | 24 +------- 4 files changed, 71 insertions(+), 87 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/prog/en/includes/biblioresult.inc diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 66c614d..4d9ccb6 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -35,6 +35,7 @@ use C4::Tags qw(get_tags); use Exporter; use Data::Dumper; use C4::Csv; +use C4::XSLT; use vars qw($debug @EXPORT @ISA $VERSION); @@ -201,7 +202,11 @@ sub shelfpage ($$$$$) { } ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset ); for my $this_item (@$items) { - my $record = GetMarcBiblio( $this_item->{'biblionumber'} ); + my $biblionumber = $this_item->{'biblionumber'}; + my $record = GetMarcBiblio($biblionumber); + $this_item->{XSLTResultsRecord} = + XSLTParse4Display($biblionumber, $record, 'Results', 'opac') + if C4::Context->preference("OPACXSLTResultsDisplay"); # the virtualshelfcontents table does not store these columns nor are they retrieved from the items # and itemtypes tables, so I'm commenting them out for now to quiet the log -crn @@ -218,7 +223,7 @@ sub shelfpage ($$$$$) { # Getting items infos for location display my @items_infos = &GetItemsInfo( $this_item->{'biblionumber'}, $type ); $this_item->{'itemsissued'} = CountItemsIssued( $this_item->{'biblionumber'} ); - $this_item->{'ITEM_RESULTS'} = \@items_infos; + $this_item->{available_items_loop} = \@items_infos; if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnList')) { $this_item->{'TagLoop'} = get_tags({ diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/biblioresult.inc b/koha-tmpl/opac-tmpl/prog/en/includes/biblioresult.inc new file mode 100644 index 0000000..ab404f5 --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/includes/biblioresult.inc @@ -0,0 +1,61 @@ + + + +" title="View details for this title"> + +" title="View details for this title"> +" title="View details for this title"> + + + No title +by " title="Search for works by this author" class="author"> +  + + Publication: + + +. +, + + (modified on ) + + + + + + +Date: + + +Availability: + +Copies available: + + + + + + + + + + +[">] + +(), + + + +No items available: + + + Checked out (), + Withdrawn (), + Lost (), + Damaged (), + On order (), + On hold (), + In transit (), + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl index d7aff2e..9a646ad 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl @@ -398,68 +398,8 @@ $(document).ready(function(){ "> - - - - " title="View details for this title"> - - " title="View details for this title"> - " title="View details for this title"> - - - No title - by " title="Search for works by this author" class="author"> -   - - Publication: - - - . - , - - (modified on ) - - - - - - - Date: - - - Availability: - - Copies available: - - - - - - - - - - - [">] - - (), - - - - No items available: - - - Checked out (), - Withdrawn (), - Lost (), - Damaged (), - On order (), - On hold (), - In transit (), - - + -
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl index 1e1d2d5..b882cd7 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl @@ -249,29 +249,7 @@ $(function() { - " title="View details for this title"> - - " title="View details for this title"> - " title="View details for this title"> - - - No title - by " title="Search for works by this author" class="author"> -   - - Publication: - - - . - , - - - Holdings: - , - - ()., - - This record has no items. + -- 1.7.4