Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt
Viktor Sarge 61b9396ba0 Bug 5672: Gives RSS icons to catalog search history
This patch adds an extra column to the table for the search history (this session and previous searches) with RSS icons for each search.

Test plan:
* Verify that there is no RSS icons for saved searches in opac
* Install the patch
* Verify that there is no RSS icons for saved searches and searches for the current session in Opac.
* Test that the RSS links produce the expected result.

Note: I left out authority searches since I have very little experience with authority searches and didn't feel I could test it properly.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-08-10 09:46:41 -03:00

203 lines
11 KiB
Text

[% USE Koha %]
[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your search history
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
<body id="opac-search-history" class="scrollto">
[% INCLUDE 'masthead.inc' %]
<div class="main">
<ul class="breadcrumb">
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
[% IF ( loggedinusername ) %]
<li><a href="#">Your search history</a></li>
[% ELSE %]
<li><a href="#">Search history</a></li>
[% END %]
</ul>
<div class="container-fluid">
<div class="row-fluid">
[% IF ( OpacNav||loggedinusername ) %]
<div class="span2">
<div id="navigation">
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
<div class="span10">
[% ELSE %]
<div class="span12">
[% END %]
<div id="searchhistory" class="maincontent">
<h1>Search history</h1>
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
<div id="tabs" class="toptabs">
<ul>
<li><a href="#biblio_tab">Catalog searches</a></li>
<li><a href="#authority_tab">Authority searches</a></li>
</ul>
[% END %]
<div id="biblio_tab">
[% IF ( current_biblio_searches ) %]
<h2>Current session</h2>
<form action="/cgi-bin/koha/opac-search-history.pl" method="get">
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="previous" value="0" />
<input type="hidden" name="type" value="biblio" />
<input type="submit" class="deleteshelf" value="Delete your current catalog history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
</form>
<table class="historyt table table-bordered table-condensed table-striped">
<thead>
<tr>
<th>Date</th>
<th>Subscribe</th>
<th>Search</th>
<th>Results</th>
</tr>
</thead>
<tbody>
[% FOREACH s IN current_biblio_searches %]
<tr>
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
<td><a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&amp;[% s.query_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a></td>
<td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
<td>[% s.total %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF ( previous_biblio_searches ) %]
<h2>Previous sessions</h2>
<form action="/cgi-bin/koha/opac-search-history.pl" method="get">
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="previous" value="1" />
<input type="hidden" name="type" value="biblio" />
<input type="submit" class="deleteshelf" value="Delete your previous catalog search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
</form>
<table class="historyt table table-bordered table-condensed table-striped">
<thead>
<tr>
<th>Date</th>
<th>Subscribe</th>
<th>Search</th>
<th>Results</th>
</tr>
</thead>
<tbody>
[% FOREACH s IN previous_biblio_searches %]
<tr>
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
<td><a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&amp;[% s.query_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a></td>
<td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
<td>[% s.total %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF !current_biblio_searches && !previous_biblio_searches %]
<p>Your catalog search history is empty.</p>
[% END %]
</div>
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
<div id="authority_tab">
[% IF ( current_authority_searches ) %]
<h2>Current session</h2>
<form action="/cgi-bin/koha/opac-search-history.pl" method="get">
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="previous" value="0" />
<input type="hidden" name="type" value="authority" />
<input type="submit" class="deleteshelf" value="Delete your current authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
</form>
<table class="historyt table table-bordered table-condensed table-striped">
<thead>
<tr>
<th>Date</th>
<th>Search</th>
<th>Results</th>
</tr>
</thead>
<tbody>
[% FOREACH s IN current_authority_searches %]
<tr>
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
<td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
<td>[% s.total %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF ( previous_authority_searches ) %]
<h2>Previous sessions</h2>
<form action="/cgi-bin/koha/opac-search-history.pl" method="get">
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="previous" value="1" />
<input type="hidden" name="type" value="authority" />
<input type="submit" class="deleteshelf" value="Delete your previous authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
</form>
<table class="historyt table table-bordered table-condensed table-striped">
<thead>
<tr>
<th>Date</th>
<th>Search</th>
<th>Results</th>
</tr>
</thead>
<tbody>
[% FOREACH s IN previous_authority_searches %]
<tr>
<td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
<td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
<td>[% s.total %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF !current_authority_searches && !previous_authority_searches %]
<p>Your authority search history is empty.</p>
[% END %]
</div>
</div>
[% END %]
</div>
</div>
</div>
</div>
</div>
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete your search history?");
$(document).ready(function() {
// We show table ordered by descending dates by default
// (so that the more recent query is shown first)
$(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [[ 0, "desc" ]],
"aoColumns": [
{ "sType": "title-string" },
null,
null
]
}));
});
[% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
//]]>
</script>
[% END %]