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 |html %][% limit_cgi |html %]&amp;sort_by=[% sort_by |html %]&amp;format=rss2"/>
22
     <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;sort_by=[% sort_by |html %]&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 |html %][% limit_cgi |html %]&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 16-22 Link Here
16
    [% END %]
16
    [% END %]
17
[% END %]
17
[% END %]
18
18
19
<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" />
19
<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" />
20
</head>
20
</head>
21
21
22
[% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %]
22
[% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %]
Lines 41-47 Link Here
41
                        <strong>No results found!</strong>
41
                        <strong>No results found!</strong>
42
                        <p>
42
                        <p>
43
                            [% IF ( searchdesc ) %]
43
                            [% IF ( searchdesc ) %]
44
                                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>
44
                                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>
45
                            [% ELSE %]
45
                            [% ELSE %]
46
                                You did not specify any search criteria.
46
                                You did not specify any search criteria.
47
                            [% END %]
47
                            [% END %]
Lines 85-91 Link Here
85
                                [% END %]
85
                                [% END %]
86
                            ).
86
                            ).
87
                        [% END %]
87
                        [% END %]
88
                        <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>
88
                        <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>
89
                    [% END # / IF total %]
89
                    [% END # / IF total %]
90
                    </p>
90
                    </p>
91
                [% END # / IF searchdesc %]
91
                [% END # / IF searchdesc %]
(-)a/opac/opac-search.pl (-9 / +7 lines)
Lines 89-96 my @params = $cgi->param("limit"); Link Here
89
my @searchCategories = $cgi->param('searchcat');
89
my @searchCategories = $cgi->param('searchcat');
90
90
91
my $format = $cgi->param("format") || '';
91
my $format = $cgi->param("format") || '';
92
# Accept "rss" or the older "rss2" parameter
93
$format = 'rss' if $format =~ /rss/;
94
92
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
95
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
93
if ($format =~ /(rss|atom|opensearchdescription)/) {
96
if ($format =~ /(rss|opensearchdescription)/) {
94
    $template_name = 'opac-opensearch.tt';
97
    $template_name = 'opac-opensearch.tt';
95
}
98
}
96
elsif (@params && $build_grouped_results) {
99
elsif (@params && $build_grouped_results) {
Lines 126-136 if($cgi->cookie("bib_list")){ Link Here
126
    @cart_list = split(/\//, $cart_list);
129
    @cart_list = split(/\//, $cart_list);
127
}
130
}
128
131
129
if ($format eq 'rss2' or $format eq 'opensearchdescription' or $format eq 'atom') {
132
if ($format eq 'rss' or $format eq 'opensearchdescription' ) {
130
    $template->param($format => 1);
133
    $template->param($format => 1);
131
    $template->param(timestamp => strftime("%Y-%m-%dT%H:%M:%S-00:00", gmtime)) if ($format eq 'atom'); 
132
    # FIXME - the timestamp is a hack - the biblio update timestamp should be used for each
133
    # entry, but not sure if that's worth an extra database query for each bib
134
}
134
}
135
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
135
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
136
    $template->param('UNIMARC' => 1);
136
    $template->param('UNIMARC' => 1);
Lines 736-743 for (my $i=0;$i<@servers;$i++) { Link Here
736
        }
736
        }
737
737
738
        ## If there's just one result, redirect to the detail page
738
        ## If there's just one result, redirect to the detail page
739
        if ($total == 1 && $format ne 'rss2'
739
        if ($total == 1 && $format ne 'rss' && $format ne 'opensearchdescription' ) {
740
        && $format ne 'opensearchdescription' && $format ne 'atom') {
741
            my $biblionumber=$newresults[0]->{biblionumber};
740
            my $biblionumber=$newresults[0]->{biblionumber};
742
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
741
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
743
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
742
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
Lines 970-976 $template->param( Link Here
970
    add_to_some_public_shelves  => $some_public_shelves,
969
    add_to_some_public_shelves  => $some_public_shelves,
971
);
970
);
972
971
973
my $content_type = ($format eq 'rss' or $format eq 'atom') ? $format : 'html';
972
my $content_type = ( $format eq 'rss' ) ? $format : 'html';
974
973
975
# If GoogleIndicTransliteration system preference is On Set parameter to load Google's javascript in OPAC search screens
974
# If GoogleIndicTransliteration system preference is On Set parameter to load Google's javascript in OPAC search screens
976
if (C4::Context->preference('GoogleIndicTransliteration')) {
975
if (C4::Context->preference('GoogleIndicTransliteration')) {
977
- 

Return to bug 16111