Bug 1561: Typo gut was not good; should be get !
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / z3950_search.tt
index ac473db..962fdaa 100644 (file)
@@ -2,8 +2,9 @@
 <title>Koha &rsaquo; Z39.50 search results</title>
 [% INCLUDE 'greybox.inc' %]
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 //<![CDATA[
 function Import(GetThisOne,biblionumber) {
@@ -11,12 +12,6 @@ function Import(GetThisOne,biblionumber) {
     window.close();
     return false;
 }
-$.tablesorter.addParser({
-    id: 'articles', 
-    is: function(s) {return false;  }, 
-    format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
-    type: 'text' 
-});
 
 function closemenu(){
     $(".linktools").hide();
@@ -32,11 +27,15 @@ $(document).ready(function(){
         $(".checkboxed").unCheckCheckboxes();
         return false;
     });
-    $("#resultst").tablesorter({
-        sortList: [[1,0]],
-        headers: { 1: { sorter: 'articles' },7: { sorter: false },8: { sorter: false } },
-        widgets: ['zebra']
-    }); 
+    $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "sDom": 't',
+        "aoColumnDefs": [
+            { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false },
+            { "aTargets": [ 1 ], "sType": "nsb-nse" },
+        ],
+        "aaSorting": [[ 1, "asc" ]],
+        "bPaginate": false
+    }));
         /* Inline edit/delete links */
         $("td").click(function(event){
             var $tgt = $(event.target);
@@ -62,6 +61,23 @@ $(document).ready(function(){
     });
 });
 
+[% IF ( total_pages ) %]
+function validate_goto_page(){
+    var page = $('#goto_page').val();
+    if(isNaN(page)) {
+        alert(_("The page entered is not a number."));
+        return false;
+    }
+    else if(page < 1 || page > [% total_pages %] ) {
+        alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
+        return false;
+    }
+    else {
+        return true;
+    }
+}
+[% END %]
+
 //]]>
 </script>
 <style type="text/css">
@@ -99,7 +115,9 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
                </fieldset>
            </div>
     <div class="yui-u">
-       <fieldset class="rows">          <ol><li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author %]" /><!--  <label for="Keyword">Keyword</label> <input type="text" name="keyword" value="" /> --></li>
+    <fieldset class="rows">
+        <ol>
+        <li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author %]" /></li>
         <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn %]" /></li>
         <li> <label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
                 <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
@@ -130,6 +148,19 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
 
 [% ELSE %]
     <h2>Results</h2>
+    <p>You searched for:
+        [% IF ( title ) %]<em>Title: </em><span class=term>[% title %]</span> [% END %]
+        [% IF ( author ) %]<em>Author: </em><span class=term>[% author %]</span> [% END %]
+        [% IF ( isbn ) %]<em>ISBN: </em><span class=term>[% isbn %]</span> [% END %]
+        [% IF ( issn ) %]<em>ISSN: </em><span class=term>[% issn %]</span> [% END %]
+        [% IF ( lccall ) %]<em>LC call number: </em><span class=term>[% lccall %]</span> [% END %]
+        [% IF ( subject ) %]<em>Subject heading: </em><span class=term>[% subject %]</span> [% END %]
+        [% IF ( controlnumber ) %]<em>Control no: </em><span class=term>[% controlnumber %]</span> [% END %]
+        [% IF ( dewey ) %]<em>Dewey: </em><span class=term>[% dewey %]</span> [%END %]
+        [% IF ( srchany ) %]<em>Raw (any): </em><span class=term>[% srchany %]</span> [% END %]
+        [% IF ( stdid ) %]<em>Standard ID: </em><span class=term>[% stdid %]</span> [% END %]
+    </p>
+
     [% IF ( breeding_loop ) %]
     <table id="resultst">
 <thead>    <tr>
@@ -140,7 +171,8 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
         <th>Edition</th>
         <th>ISBN</th>
         <th>LCCN</th>
-        <th colspan="2">Preview</th>
+        <th>MARC</th>
+        <th>Card</th>
                <th>&nbsp;</th>
     </tr></thead>
     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
@@ -161,6 +193,36 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
         [% END %]
     [% END %]</tbody>
 </table>
+
+    <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
+        <input type="hidden" name="op" id="op" value="do_search" />
+        <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
+        <input type="hidden" id="title"  name="title" value="[% title %]" />
+        <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
+        <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
+        <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber %]" />
+        <input type="hidden" id="srchany" name="srchany" value="[% srchany %]" />
+        <input type="hidden" id="author" name="author" value="[% author %]" />
+        <input type="hidden" id="subject" name="subject" value="[% subject %]" />
+        <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
+        <input type="hidden" id="stdid" name="stdid" value="[% stdid %]" />
+        <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+        <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
+
+        [% FOREACH server IN servers %]
+        <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
+        [% END %]
+
+        [% IF ( show_prevbutton ) %]
+            <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
+        [% END %]
+        Page [% current_page %] / [% total_pages %]
+        [% IF ( show_nextbutton ) %]
+            <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
+        [% END %]
+        <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" />
+    </form>
+
 <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode %]"/><input type="submit" value="Try Another Search"/></form></p>
     [% ELSE %]
         [% IF ( errconn ) %]
@@ -173,8 +235,8 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
                 </ul>
             </div>
          [% END %]
-   <div class="dialog message">Nothing found.</div>
-       <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode %]"/><input type="submit" value="Try Another Search"/></form></p>
+    <div class="dialog message"><h3>Nothing found</h3>
+    <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode %]"/><input type="submit" value="Try Another Search"/></form></p>
     [% END %]