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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl (-15 / +18 lines)
Lines 353-373 Link Here
353
            </xsl:choose>
353
            </xsl:choose>
354
        </xsl:variable>
354
        </xsl:variable>
355
355
356
        <xsl:element name="span">
356
        <xsl:variable name="show_analytics_link" select="marc:variables/marc:variable[@name='show_analytics_link']" />
357
            <xsl:attribute name="class">results_summary analytics <xsl:value-of select="$leader7_class"/></xsl:attribute>
357
        <xsl:if test="$show_analytics_link='1'">
358
            <span class="label">Analytics: </span>
358
            <xsl:element name="span">
359
            <a>
359
                <xsl:attribute name="class">results_summary analytics <xsl:value-of select="$leader7_class"/></xsl:attribute>
360
            <xsl:choose>
360
                <span class="label">Analytics: </span>
361
                <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
361
                <a>
362
                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
362
                <xsl:choose>
363
                </xsl:when>
363
                    <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
364
                <xsl:otherwise>
364
                        <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
365
                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
365
                    </xsl:when>
366
                </xsl:otherwise>
366
                    <xsl:otherwise>
367
            </xsl:choose>
367
                        <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
368
            <xsl:text>Show analytics</xsl:text>
368
                    </xsl:otherwise>
369
            </a>
369
                </xsl:choose>
370
        </xsl:element>
370
                <xsl:text>Show analytics</xsl:text>
371
                </a>
372
            </xsl:element>
373
        </xsl:if>
371
374
372
        <!-- Volumes of sets and traced series -->
375
        <!-- Volumes of sets and traced series -->
373
        <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
376
        <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
(-)a/opac/opac-detail.pl (-2 / +17 lines)
Lines 61-66 use Koha::Virtualshelves; Link Here
61
use Koha::Patrons;
61
use Koha::Patrons;
62
use Koha::Ratings;
62
use Koha::Ratings;
63
use Koha::Reviews;
63
use Koha::Reviews;
64
use Koha::SearchEngine::Search;
64
65
65
my $query = CGI->new();
66
my $query = CGI->new();
66
67
Lines 171-178 my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; Link Here
171
172
172
if ( $xslfile ) {
173
if ( $xslfile ) {
173
174
175
    my $searcher = Koha::SearchEngine::Search->new(
176
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
177
    );
178
    my $cleaned_title = $biblio->title;
179
    $cleaned_title =~ tr|/||;
180
    my $query =
181
      ( C4::Context->preference('UseControlNumber') and $record->field('001') )
182
      ? 'rcn:'. $record->field('001')->data . ' and (bib-level:a or bib-level:b)'
183
      : "Host-item:$cleaned_title";
184
    my ( $err, $result, $count ) = $searcher->simple_search_compat( $query, 0, 0 );
185
186
    warn "Warning from simple_search_compat: $err"
187
        if $err;
188
174
    my $variables = {
189
    my $variables = {
175
        anonymous_session => ($borrowernumber) ? 0 : 1
190
        anonymous_session   => ($borrowernumber) ? 0 : 1,
191
        show_analytics_link => $count > 0 ? 1 : 0
176
    };
192
    };
177
193
178
    $template->param(
194
    $template->param(
179
- 

Return to bug 15851