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 (-2 / +2 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 %]
(-)a/opac/opac-search.pl (-9 / +4 lines)
Lines 90-96 my @searchCategories = $cgi->param('searchcat'); Link Here
90
90
91
my $format = $cgi->param("format") || '';
91
my $format = $cgi->param("format") || '';
92
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
92
my $build_grouped_results = C4::Context->preference('OPACGroupResults');
93
if ($format =~ /(rss|atom|opensearchdescription)/) {
93
if ($format =~ /(rss|opensearchdescription)/) {
94
    $template_name = 'opac-opensearch.tt';
94
    $template_name = 'opac-opensearch.tt';
95
}
95
}
96
elsif (@params && $build_grouped_results) {
96
elsif (@params && $build_grouped_results) {
Lines 126-136 if($cgi->cookie("bib_list")){ Link Here
126
    @cart_list = split(/\//, $cart_list);
126
    @cart_list = split(/\//, $cart_list);
127
}
127
}
128
128
129
if ($format eq 'rss2' or $format eq 'opensearchdescription' or $format eq 'atom') {
129
if ($format eq 'rss' or $format eq 'opensearchdescription' ) {
130
    $template->param($format => 1);
130
    $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
}
131
}
135
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
132
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
136
    $template->param('UNIMARC' => 1);
133
    $template->param('UNIMARC' => 1);
Lines 736-743 for (my $i=0;$i<@servers;$i++) { Link Here
736
        }
733
        }
737
734
738
        ## If there's just one result, redirect to the detail page
735
        ## If there's just one result, redirect to the detail page
739
        if ($total == 1 && $format ne 'rss2'
736
        if ($total == 1 && $format ne 'rss' && $format ne 'opensearchdescription' ) {
740
        && $format ne 'opensearchdescription' && $format ne 'atom') {
741
            my $biblionumber=$newresults[0]->{biblionumber};
737
            my $biblionumber=$newresults[0]->{biblionumber};
742
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
738
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
743
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
739
                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,
966
    add_to_some_public_shelves  => $some_public_shelves,
971
);
967
);
972
968
973
my $content_type = ($format eq 'rss' or $format eq 'atom') ? $format : 'html';
969
my $content_type = ( $format eq 'rss' ) ? $format : 'html';
974
970
975
# If GoogleIndicTransliteration system preference is On Set parameter to load Google's javascript in OPAC search screens
971
# If GoogleIndicTransliteration system preference is On Set parameter to load Google's javascript in OPAC search screens
976
if (C4::Context->preference('GoogleIndicTransliteration')) {
972
if (C4::Context->preference('GoogleIndicTransliteration')) {
977
- 

Return to bug 16111