Bug 13119 - Use XSLT to display tagged titles in the OPAC

This patch updates the display of a logged-in user's tagged titles to
use the same XSLT stylesheet used by search results and Lists. This
would make for a more consistent display of information.

Unrelated change: Corrected "My tags" header to read "Your tags,"
consistent with sidebar navigation.

To test you should have multiple titles in your catalog which you have
tagged in the OPAC.

- Set the OPACXSLTResultsDisplay system preference to 'default'
- Log in to the OPAC and view the "your tags" page.
- Confirm that title information is displayed correctly. Compare to
  search results.
- Empty the OPACXSLTResultsDisplay system preference and reload the
  "your tags" page. The display should revert to the old view, showing
  title, subtitle (if any) and author (if any).
- Set the OPACXSLTResultsDisplay to a custom path pointing to a custom
  XSL file and confirm that the list of your tagged titles changes
  accordingly.

Note: A follow-up will add "action" links ("place hold," "add to cart,"
etc) consistent with other pages.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

Works as described. opac-tag.pl page displays tagged titles the same way as
result & list pages.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Owen Leonard 2014-10-21 12:52:54 -04:00 committed by Tomas Cohen Arazi
parent 058470acee
commit e0122701aa
2 changed files with 22 additions and 4 deletions

View file

@ -113,7 +113,7 @@
[% IF ( MY_TAGS ) %]
<form method="post" action="opac-tags.pl">
<h2>My Tags</h2>
<h2>Your tags</h2>
<table id="mytagst" class="table table-bordered table-striped">
<thead><tr><th>Term</th><th>Title</th><th>Date added</th><th>Delete</th></tr></thead>
<tbody>
@ -124,9 +124,23 @@
<a href="/cgi-bin/koha/opac-search.pl?tag=[% MY_TAG.term |url %]&amp;q=[% MY_TAG.term |url %]">
[% MY_TAG.term |html %]</a></td>
<td>
[% IF ( MY_TAG.XSLTBloc ) %]
[% MY_TAG.XSLTBloc %]
[% ELSE %]
<span class="tdlabel">Title:</span>
<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% MY_TAG.biblionumber %]">
[% MY_TAG.title |html %][% IF ( MY_TAG.subtitle ) %][% FOREACH subtitle IN MY_TAG.subtitle %] [% subtitle.subfield |html %][% END %][% END %]</a> [% IF ( MY_TAG.author ) %]by [% MY_TAG.author %][% END %]</td>
[% MY_TAG.title |html %]
[% IF ( MY_TAG.subtitle ) %]
[% FOREACH subtitle IN MY_TAG.subtitle %]
[% subtitle.subfield |html %]
[% END %]
[% END %]
</a>
[% IF ( MY_TAG.author ) %]
by [% MY_TAG.author %]
[% END %]
[% END # /IF MY_TAG.XSLTBloc %]
</td>
<td>
<span title="[% MY_TAG.date_created %]">
<span class="tdlabel">Date added:</span>

View file

@ -42,6 +42,7 @@ use C4::Output qw(:html :ajax pagination_bar);
use C4::Scrubber;
use C4::Biblio;
use C4::Tags qw(add_tag get_approval_rows get_tag_rows remove_tag stratify_tags);
use C4::XSLT;
use Data::Dumper;
@ -232,6 +233,9 @@ if ($loggedinuser) {
$_->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $_->{biblionumber} ) );
$_->{title} = $biblio->{title};
$_->{author} = $biblio->{author};
if (C4::Context->preference("OPACXSLTResultsDisplay")) {
$_->{XSLTBloc} = XSLTParse4Display($_->{biblionumber}, $record, "OPACXSLTResultsDisplay");
}
my $date = $_->{date_created} || '';
$date =~ /\s+(\d{2}\:\d{2}\:\d{2})/;
$_->{time_created_display} = $1;