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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt (-46 / +3 lines)
Lines 7-26 Link Here
7
   <Tags>koha opac [% LibraryName |html %]</Tags>
7
   <Tags>koha opac [% LibraryName |html %]</Tags>
8
   <Contact>[% KohaAdminEmailAddress |html %]</Contact>
8
   <Contact>[% KohaAdminEmailAddress |html %]</Contact>
9
   <Url type="application/rss+xml"
9
   <Url type="application/rss+xml"
10
        template="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?q={searchTerms}&amp;pw={startPage?}&amp;format=rss2"/>
10
        template="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?q={searchTerms}&amp;pw={startPage?}&amp;format=rss"/>
11
</OpenSearchDescription>
11
</OpenSearchDescription>
12
12
13
[% ELSE %]
13
[% ELSE %]
14
14
15
[% IF ( rss2 ) %]
16
<rss version="2.0"
15
<rss version="2.0"
17
      xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
16
      xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
18
      xmlns:dc="http://purl.org/dc/elements/1.1/"
17
      xmlns:dc="http://purl.org/dc/elements/1.1/"
19
      xmlns:atom="http://www.w3.org/2005/Atom">
18
      xmlns:atom="http://www.w3.org/2005/Atom">
20
   <channel>
19
   <channel>
21
     <title><![CDATA[[% LibraryName |html %] Search [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %]]]></title>
20
     <title><![CDATA[[% LibraryName |html %] Search [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %]]]></title>
22
     <link>[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=rss2</link>
21
     <link>[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=rss</link>
23
     <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %]&amp;sort_by=[% sort_by | uri %]&amp;format=rss2"/>
22
     <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %]&amp;sort_by=[% sort_by |uri %]&amp;format=rss"/>
24
     <description><![CDATA[ Search results [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %] at [% LibraryName |html %]]]></description>
23
     <description><![CDATA[ Search results [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %] at [% LibraryName |html %]]]></description>
25
     <opensearch:totalResults>[% total %]</opensearch:totalResults>
24
     <opensearch:totalResults>[% total %]</opensearch:totalResults>
26
     <opensearch:startIndex>[% offset %]</opensearch:startIndex>
25
     <opensearch:startIndex>[% offset %]</opensearch:startIndex>
Lines 62-108 Link Here
62
	 [% END %]
61
	 [% END %]
63
   </channel>
62
   </channel>
64
</rss>
63
</rss>
65
[% END %]
66
67
[% IF ( atom ) %]
68
<feed xmlns="http://www.w3.org/2005/Atom"
69
       xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
70
   <id>[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=atom</id>
71
   <title>[% LibraryName |html %] Search [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc |html %]'[% END %]</title>
72
    <link href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %]&amp;format=rss2"/>
73
   <updated>[% timestamp %]</updated>
74
   <author>
75
     <name>[% LibraryName |html %]</name>
76
   </author>
77
   <!-- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> -->
78
   <opensearch:totalResults>[% total %]</opensearch:totalResults>
79
   <opensearch:startIndex>[% page %]</opensearch:startIndex>
80
   [% IF ( results_per_page ) %]
81
     <opensearch:itemsPerPage>[% results_per_page %]</opensearch:itemsPerPage>
82
   [% ELSE %]
83
     <opensearch:itemsPerPage>20</opensearch:itemsPerPage>
84
   [% END %]
85
   <opensearch:Query role="request" searchTerms="[% query_desc |html %] [% limit_desc |html %]" startPage="[% page |html %]" />
86
   <link rel="alternate" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=[% page %]&amp;format=atom" type="application/atom+xml"/>
87
   <link rel="self" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]&amp;format=atom" type="application/atom+xml"/>
88
   <link rel="first" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=1&amp;format=atom" type="application/atom+xml"/>
89
   <link rel="previous" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=2&amp;format=atom" type="application/atom+xml"/>
90
   <link rel="next" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=4&amp;format=atom" type="application/atom+xml"/>
91
   <link rel="last" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=42299&amp;format=atom" type="application/atom+xml"/>
92
   <link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?format=opensearchdescription"/>
93
94
   [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
95
   <entry>
96
     <title>[% SEARCH_RESULT.title |html %]</title>
97
     <link href="[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]"/>
98
     <!-- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> -->
99
     <updated>[% SEARCH_RESULT.timestamp %]</updated>
100
     <content type="text"><!-- put content here -->
101
     </content>
102
     <id>[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]</id>
103
   </entry>
104
   [% END %]
105
 </feed>
106
[% END %]
107
64
108
[% END %]
65
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-3 / +3 lines)
Lines 17-23 Link Here
17
    [% END %]
17
    [% END %]
18
[% END %]
18
[% END %]
19
19
20
<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS feed" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi | url %][% limit_cgi |uri %]&amp;count=[% countrss |uri %]&amp;sort_by=acqdate_dsc&amp;format=rss2" />
20
<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS feed" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi | url %][% limit_cgi |uri %]&amp;count=[% countrss |uri %]&amp;sort_by=acqdate_dsc&amp;format=rss" />
21
</head>
21
</head>
22
22
23
[% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %]
23
[% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %]
Lines 42-48 Link Here
42
                        <strong>No results found!</strong>
42
                        <strong>No results found!</strong>
43
                        <p>
43
                        <p>
44
                            [% IF ( searchdesc ) %]
44
                            [% IF ( searchdesc ) %]
45
                                No results found for that in [% LibraryName %] catalog. <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi | url %][% limit_cgi | html | url %]&amp;format=rss2" class="rsssearchlink noprint"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" class="rsssearchicon"/></a>
45
                                No results found for that in [% LibraryName %] catalog. <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi | url %][% limit_cgi | html | url %]&amp;format=rss" class="rsssearchlink noprint"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" class="rsssearchicon"/></a>
46
                            [% ELSE %]
46
                            [% ELSE %]
47
                                You did not specify any search criteria.
47
                                You did not specify any search criteria.
48
                            [% END %]
48
                            [% END %]
Lines 86-92 Link Here
86
                                [% END %]
86
                                [% END %]
87
                            ).
87
                            ).
88
                        [% END %]
88
                        [% END %]
89
                        <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi | url %][% limit_cgi |html | url %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" class="rsssearchlink noprint"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a>
89
                        <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi | url %][% limit_cgi |html | url %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss" class="rsssearchlink noprint"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a>
90
                    [% END # / IF total %]
90
                    [% END # / IF total %]
91
                    </p>
91
                    </p>
92
                [% END # / IF searchdesc %]
92
                [% END # / IF searchdesc %]
(-)a/opac/opac-search.pl (-9 / +7 lines)
Lines 101-108 my @params = $cgi->multi_param("limit"); Link Here
101
my @searchCategories = $cgi->multi_param('searchcat');
101
my @searchCategories = $cgi->multi_param('searchcat');
102
102
103
my $format = $cgi->param("format") || '';
103
my $format = $cgi->param("format") || '';
104
# Accept "rss" or the older "rss2" parameter
105
$format = 'rss' if $format =~ /rss/;
106
104
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
107
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
105
if ($format =~ /(rss|atom|opensearchdescription)/) {
108
if ($format =~ /(rss|opensearchdescription)/) {
106
    $template_name = 'opac-opensearch.tt';
109
    $template_name = 'opac-opensearch.tt';
107
}
110
}
108
elsif (@params && $build_grouped_results) {
111
elsif (@params && $build_grouped_results) {
Lines 138-148 if($cgi->cookie("bib_list")){ Link Here
138
    @cart_list = split(/\//, $cart_list);
141
    @cart_list = split(/\//, $cart_list);
139
}
142
}
140
143
141
if ($format eq 'rss2' or $format eq 'opensearchdescription' or $format eq 'atom') {
144
if ($format eq 'rss' or $format eq 'opensearchdescription' ) {
142
    $template->param($format => 1);
145
    $template->param($format => 1);
143
    $template->param(timestamp => strftime("%Y-%m-%dT%H:%M:%S-00:00", gmtime)) if ($format eq 'atom'); 
144
    # FIXME - the timestamp is a hack - the biblio update timestamp should be used for each
145
    # entry, but not sure if that's worth an extra database query for each bib
146
}
146
}
147
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
147
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
148
    $template->param('UNIMARC' => 1);
148
    $template->param('UNIMARC' => 1);
Lines 735-742 for (my $i=0;$i<@servers;$i++) { Link Here
735
        }
735
        }
736
736
737
        ## If there's just one result, redirect to the detail page
737
        ## If there's just one result, redirect to the detail page
738
        if ($total == 1 && $format ne 'rss2'
738
        if ($total == 1 && $format ne 'rss' && $format ne 'opensearchdescription' ) {
739
        && $format ne 'opensearchdescription' && $format ne 'atom') {
740
            my $biblionumber=$newresults[0]->{biblionumber};
739
            my $biblionumber=$newresults[0]->{biblionumber};
741
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
740
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
742
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
741
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
Lines 971-977 $template->param( Link Here
971
    add_to_some_public_shelves  => $some_public_shelves,
970
    add_to_some_public_shelves  => $some_public_shelves,
972
);
971
);
973
972
974
my $content_type = ($format eq 'rss' or $format eq 'atom') ? $format : 'html';
973
my $content_type = ( $format eq 'rss' ) ? $format : 'html';
975
974
976
# If GoogleIndicTransliteration system preference is On Set parameter to load Google's javascript in OPAC search screens
975
# If GoogleIndicTransliteration system preference is On Set parameter to load Google's javascript in OPAC search screens
977
if (C4::Context->preference('GoogleIndicTransliteration')) {
976
if (C4::Context->preference('GoogleIndicTransliteration')) {
978
- 

Return to bug 16111