|
Line 0
Link Here
|
|
|
1 |
[% USE Koha %] |
| 2 |
[% INCLUDE 'doc-head-open.inc' %] |
| 3 |
Koha › Z39.50/SRU search results |
| 4 |
[% INCLUDE 'doc-head-close.inc' %] |
| 5 |
[% INCLUDE 'greybox.inc' %] |
| 6 |
[% BLOCK cssinclude %][% END %] |
| 7 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
| 8 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/staff-global.css" /> |
| 9 |
|
| 10 |
<style type="text/css"> |
| 11 |
.linktools { background-color:#FFF;border-top:1px solid #DDD; border-left: 1px solid #DDD; border-right: 1px solid #666; border-bottom:1px solid #666;display: none; white-space: nowrap;} |
| 12 |
.linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;} |
| 13 |
.linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;} |
| 14 |
tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; } |
| 15 |
|
| 16 |
.input-prepend.input-block-level { |
| 17 |
display: table; |
| 18 |
margin: 2px; |
| 19 |
} |
| 20 |
.input-prepend.input-block-level .add-on { |
| 21 |
display: table-cell; |
| 22 |
width: 1%; /* remove this if you want default bootstrap button width */ |
| 23 |
} |
| 24 |
.input-prepend.input-block-level > input { |
| 25 |
box-sizing: border-box; /* use bootstrap mixin or include vendor variants */ |
| 26 |
-moz-box-sizing: border-box; /* for Firefox */ |
| 27 |
display: table; /* table-cell is not working well in Chrome for small widths */ |
| 28 |
min-height: inherit; |
| 29 |
width: 100%; |
| 30 |
} |
| 31 |
.input-prepend.input-block-level > input { |
| 32 |
border-left: 0; |
| 33 |
} |
| 34 |
.marginbot{ |
| 35 |
margin-bottom:10px; |
| 36 |
} |
| 37 |
</style> |
| 38 |
</head> |
| 39 |
[% IF ( opsearch ) %] |
| 40 |
<body id="cat_z3950_search"> |
| 41 |
[% ELSE %] |
| 42 |
<body style="padding:.5em;"> |
| 43 |
[% END %] |
| 44 |
<div class="main"> |
| 45 |
<div class="container-fluid"> |
| 46 |
[% search_fields = [ |
| 47 |
{ label => "ISBN", prop => 'isbn' }, |
| 48 |
{ label => "ISSN", prop => 'issn' }, |
| 49 |
{ label => "Title", prop => 'title' }, |
| 50 |
{ label => "Author", prop => 'author' }, |
| 51 |
{ label => "Subject Heading", prop => 'subject' }, |
| 52 |
{ label => "Keyword (any)", prop => 'srchany' }, |
| 53 |
{ label => "LC call number", prop => 'lccall' }, |
| 54 |
{ label => "Control no.", prop => 'controlnumber' }, |
| 55 |
{ label => "Dewey", prop => 'dewey' }, |
| 56 |
{ label => "Standard ID", prop => 'stdid' } |
| 57 |
] %] |
| 58 |
[% IF ( opsearch ) %] |
| 59 |
<div class="row-fluid"> |
| 60 |
<h2>Z39.50/SRU search</h2> |
| 61 |
</div> |
| 62 |
<form method="post" action="opac-z3950-search.pl" name="f"> |
| 63 |
<div class="row-fluid"> |
| 64 |
<input type="hidden" name="op" id="op" value="do_search" /> |
| 65 |
<input type="hidden" name="biblionumber" value="[% biblionumber %]" /> |
| 66 |
<input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> |
| 67 |
<div id="search_params" class="span6 form-horizontal"> |
| 68 |
<h2>Search Parameters</h2> |
| 69 |
<div id="search_field" class="well"> |
| 70 |
[% FOREACH field IN search_fields %] |
| 71 |
<div class="input-prepend input-block-level"> |
| 72 |
<span class="add-on">[% field.label %]</span> |
| 73 |
<input type="text" id="[% field.prop %]" name="[% field.prop %]" value="[% ${field.prop} %]" /> |
| 74 |
</div> |
| 75 |
[% END %] |
| 76 |
</div> |
| 77 |
<div class="control-group"> |
| 78 |
<div calss="controls"> |
| 79 |
<button onclick="$("form[name='f']").submit();" class="btn search-submit">Search</button> |
| 80 |
<a href="#">Cancel</a> |
| 81 |
</div> |
| 82 |
</div> |
| 83 |
</div> |
| 84 |
<div class="span5"> |
| 85 |
<h2> |
| 86 |
Search targets |
| 87 |
<span style="display: inline; font-size: 70%; padding-left: 1em;"> |
| 88 |
<span class="checkall"> |
| 89 |
<a id="CheckAll" href="#">Select all</a> |
| 90 |
</span> |
| 91 |
<span class="clearall"> |
| 92 |
<a id="CheckNone" href="#">Clear all</a> |
| 93 |
</span> |
| 94 |
</span> |
| 95 |
</h2> |
| 96 |
<div id="z3950_search_targets" class="well checkboxed"> |
| 97 |
[% FOREACH serverloo IN serverloop %] |
| 98 |
<div class="input-group"> |
| 99 |
<label for="z3950_[% serverloo.id %]"> |
| 100 |
<input style="vertical-align:-2px" type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" /> |
| 101 |
[% serverloo.servername %] |
| 102 |
</label> |
| 103 |
</div> |
| 104 |
[% END %] |
| 105 |
</div> |
| 106 |
</div> |
| 107 |
</form> |
| 108 |
|
| 109 |
[% ELSE %] |
| 110 |
<div class="row-fluid"> |
| 111 |
<h2>Results</h2> |
| 112 |
<p>You searched for: |
| 113 |
[% FOREACH field IN search_fields %] |
| 114 |
[% IF ( ${field.prop} ) %]<em>[% field.label %]: </em><span class=term>[% ${field.prop} %]</span> [% END %] |
| 115 |
[% END %] |
| 116 |
</p> |
| 117 |
</div> |
| 118 |
[% IF ( errconn ) %] |
| 119 |
<div class="alert alert-danger"> |
| 120 |
<ul> |
| 121 |
[% FOREACH errcon IN errconn %] |
| 122 |
[% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li> |
| 123 |
[% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li> |
| 124 |
[% ELSIF ( errcon.error == 'xslt_err' ) %]<li>[% errcon.server %]: Warning: XSLT error on search result [% errcon.seq %]</li> |
| 125 |
[% ELSE %]<li>[% errcon.server %] record [% errcon.seq %]: [% errcon.error %]</li> |
| 126 |
[% END %] |
| 127 |
[% END %] |
| 128 |
</ul> |
| 129 |
</div> |
| 130 |
[% END %] |
| 131 |
<div class="row-fluid marginbot"> |
| 132 |
<div class="span12"> |
| 133 |
[% IF ( breeding_loop ) %] |
| 134 |
<table id="resultst" class="table table-condensed"> |
| 135 |
<thead> <tr> |
| 136 |
<th>Server</th> |
| 137 |
<th>Title</th> |
| 138 |
<th>Author</th> |
| 139 |
<th>Date</th> |
| 140 |
<th>Edition</th> |
| 141 |
<th>ISBN</th> |
| 142 |
<th>LCCN</th> |
| 143 |
<th>MARC</th> |
| 144 |
<th>Card</th> |
| 145 |
<th> </th> |
| 146 |
</tr></thead> |
| 147 |
<tbody>[% FOREACH breeding_loo IN breeding_loop %] |
| 148 |
[% IF ( breeding_loo.breedingid ) %] |
| 149 |
<tr id="row[% breeding_loo.breedingid %]"> |
| 150 |
<td>[% breeding_loo.server %] </td> |
| 151 |
<td>[% breeding_loo.title |html %]</td> |
| 152 |
<td>[% breeding_loo.author %]</td> |
| 153 |
<td>[% breeding_loo.date %]</td> |
| 154 |
<td>[% breeding_loo.edition %]</td> |
| 155 |
<td>[% breeding_loo.isbn %]</td> |
| 156 |
<td>[% breeding_loo.lccn %]</td> |
| 157 |
<td><a href="/cgi-bin/koha/opac-showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td> |
| 158 |
<td><a href="/cgi-bin/koha/opac-showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> |
| 159 |
<td><a target="_blank" href="http://[% breeding_loo.host %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% breeding_loo.biblionumber %]">Show</a></td> |
| 160 |
</tr> |
| 161 |
[% END %] |
| 162 |
[% END %]</tbody> |
| 163 |
</table> |
| 164 |
</div> |
| 165 |
</div> |
| 166 |
|
| 167 |
<form method="post" action="opac-z3950-search.pl" id="page_form" name="page_form"> |
| 168 |
<input type="hidden" name="op" id="op" value="do_search" /> |
| 169 |
<input type="hidden" name="current_page" id="current_page" value="[% current_page %]" /> |
| 170 |
<input type="hidden" name="biblionumber" value="[% biblionumber %]" /> |
| 171 |
<input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> |
| 172 |
[% FOREACH field IN search_fields %] |
| 173 |
<input type="hidden" name="[% field.prop %]" value="[% ${field.prop} %]" /> |
| 174 |
[% END %] |
| 175 |
|
| 176 |
[% FOREACH server IN servers %] |
| 177 |
<input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" /> |
| 178 |
[% END %] |
| 179 |
[% IF total_pages > 1 %] |
| 180 |
<div class="row-fluid"> |
| 181 |
<div class="span4"> |
| 182 |
<div class="input-prepend input-append"> |
| 183 |
[% IF ( show_prevbutton ) %] |
| 184 |
<button class="btn" type="button" name="changepage_prev" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();">Previous Page</button> |
| 185 |
[% END %] |
| 186 |
<span class="add-on">Page [% current_page %] / [% total_pages %]</span> |
| 187 |
[% IF ( show_nextbutton ) %] |
| 188 |
<button class="btn" type="button" name="changepage_next" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();">Next Page</button> |
| 189 |
[% END %] |
| 190 |
</div> |
| 191 |
</div> |
| 192 |
<div class="span2 offset5"> |
| 193 |
<div class="input-prepend input-append"> |
| 194 |
<span class="add-on">Go to page</span> |
| 195 |
<input id="goto_page" name="goto_page" value="[% current_page %]" size="4" type="text"/> |
| 196 |
<button class="btn" type="submit" name="changepage_goto" onclick="return validate_goto_page();">Go</button> |
| 197 |
</div> |
| 198 |
</div> |
| 199 |
[% END %] |
| 200 |
</form> |
| 201 |
|
| 202 |
|
| 203 |
[% ELSE %] |
| 204 |
<div class="alert alert-warning">Nothing found.</div> |
| 205 |
[% END %] |
| 206 |
<div class="row-fluid marginbot"> |
| 207 |
<div class="span12"> |
| 208 |
<a class="btn" href="/cgi-bin/koha/opac-z3950-search.pl">Try another search</a> |
| 209 |
</div> |
| 210 |
</div> |
| 211 |
</div> |
| 212 |
[% END %] |
| 213 |
|
| 214 |
</div> |
| 215 |
</div> |
| 216 |
|
| 217 |
[% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %] |
| 218 |
|
| 219 |
[% INCLUDE 'opac-bottom.inc' %] |
| 220 |
[% BLOCK jsinclude %][% END %] |
| 221 |
[% INCLUDE 'datatables.inc' %] |
| 222 |
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> |
| 223 |
|
| 224 |
<script type="text/javascript"> |
| 225 |
//<![CDATA[ |
| 226 |
function Import(GetThisOne,biblionumber) { |
| 227 |
opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne; |
| 228 |
window.close(); |
| 229 |
return false; |
| 230 |
} |
| 231 |
|
| 232 |
function closemenu(){ |
| 233 |
$(".linktools").hide(); |
| 234 |
$("tr").removeClass("selected"); |
| 235 |
} |
| 236 |
|
| 237 |
$(document).ready(function(){ |
| 238 |
$("#CheckAll").click(function(){ |
| 239 |
$(".checkboxed").checkCheckboxes(); |
| 240 |
return false; |
| 241 |
}); |
| 242 |
$("#CheckNone").click(function(){ |
| 243 |
$(".checkboxed").unCheckCheckboxes(); |
| 244 |
return false; |
| 245 |
}); |
| 246 |
$("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 247 |
"sDom": 't', |
| 248 |
"aoColumnDefs": [ |
| 249 |
{ "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false }, |
| 250 |
{ "aTargets": [ 1 ], "sType": "nsb-nse" }, |
| 251 |
], |
| 252 |
"aaSorting": [[ 1, "asc" ]], |
| 253 |
"bPaginate": false |
| 254 |
})); |
| 255 |
/* Inline edit/delete links */ |
| 256 |
$("td").click(function(event){ |
| 257 |
var $tgt = $(event.target); |
| 258 |
var row = $(this).parent(); |
| 259 |
$(".linktools").hide(); |
| 260 |
$("tr").removeClass("selected"); |
| 261 |
row.addClass("selected"); |
| 262 |
if($tgt.is("a")||$tgt.is(":nth-child(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){ |
| 263 |
//Don't show inline links for cells containing links of their own. |
| 264 |
} else { |
| 265 |
var position = $(this).offset(); |
| 266 |
var top = position.top+5; |
| 267 |
var left = position.left+5; |
| 268 |
$(".linktools",row).show().css("position","absolute").css("top",top).css("left",left); |
| 269 |
} |
| 270 |
}); |
| 271 |
$("form[name='f']").submit(function(){ |
| 272 |
if ($('input[type=checkbox]').filter(':checked').length == 0) { |
| 273 |
alert(_("Please choose at least one external target")); |
| 274 |
return false; |
| 275 |
} else { |
| 276 |
$("*").css("cursor", "progress"); |
| 277 |
return true; |
| 278 |
} |
| 279 |
}); |
| 280 |
}); |
| 281 |
|
| 282 |
[% IF ( total_pages ) %] |
| 283 |
function validate_goto_page(){ |
| 284 |
var page = $('#goto_page').val(); |
| 285 |
if(isNaN(page)) { |
| 286 |
alert(_("The page entered is not a number.")); |
| 287 |
return false; |
| 288 |
} |
| 289 |
else if(page < 1 || page > [% total_pages %] ) { |
| 290 |
alert(_("The page should be a number between 1 and %s.").format([% total_pages %])); |
| 291 |
return false; |
| 292 |
} |
| 293 |
else { |
| 294 |
return true; |
| 295 |
} |
| 296 |
} |
| 297 |
[% END %] |
| 298 |
</script> |