Bug 9130 follow up: add statesave cookie and "all" option for parcel drop-down menu
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / z3950_search.tt
index 1f2ad60..483bf65 100644 (file)
@@ -1,20 +1,24 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]Order from external source &rsaquo; Search results[% END %]</title>
 [% INCLUDE 'greybox.inc' %]
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+
 <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">
 //<![CDATA[
-$.tablesorter.addParser({
-    id: 'articles',
-    is: function(s) {return false;  },
-    format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
-    type: 'text'
-});
+    $(document).ready(function(){
+
+    var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
+        ],
+        "bPaginate": false
+    } ) );
 
-       $(document).ready(function(){
-    $.tablesorter.defaults.widgets = ['zebra'];
     $("#CheckAll").click(function(){
         $(".checkboxed").checkCheckboxes();
         return false;
@@ -29,10 +33,6 @@ $.tablesorter.addParser({
         $("tr").removeClass("selected");
     });
 
-       $("#resultst").tablesorter({
-               sortList: [[1,0]],
-               headers: { 1: { sorter: 'articles' },5: { sorter: false },6: { sorter: false }}
-       });
         /* Inline edit/delete links */
         $("td").click(function(event){
             var $tgt = $(event.target);
@@ -50,6 +50,24 @@ $.tablesorter.addParser({
             row.addClass("selected");
         });
 });
+
+[% 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 ") + [% total_pages %] + ".");
+        return false;
+    }
+    else {
+        return true;
+    }
+}
+[% END %]
+
 //]]>
 </script>
 <style type="text/css">
@@ -59,11 +77,12 @@ $.tablesorter.addParser({
 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent !important; }
 </style>
 </head>
-<body>
+<body id="acq_z3950_search" class="acq">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'acquisitions-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% booksellerid %]">[% name %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]<a href="/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Order from external source</a> &rsaquo; Search results[% END %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]<a href="/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Order from external source</a> &rsaquo; Search results[% END %]</div>
+
 <div id="doc3" class="yui-t7">
       <div id="bd">
          [% IF ( opsearch ) %]
@@ -74,15 +93,16 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
     <div class="yui-u first">
            <fieldset class="rows">
                 <ol><li><label for="searchtitle">Title: </label> <input type="text" id="searchtitle"  name="title" value="[% title |html %]" /></li>
-                <li><label for="isbn">ISBN/ISSN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
-                <li><label for="lccall">LC Call Number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
-         <li><label for="controlnumber">Control No.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
+                <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
+         <li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
+         <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
 </ol>
                </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>
-                <li> <label for="subject">Subject Heading: </label> <input type="text" id="subject" name="subject" value="" /></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></ol></fieldset>
             <fieldset class="rows" >
                  <ol>
@@ -107,7 +127,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
            </div>
 </div>
 <div class="yui-g">
-<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select All</a></span><span class="clearall"><a id="CheckNone" href="#">Clear All</a></span></span></h2>
+<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select all</a></span><span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></span></h2>
 
     [% FOREACH serverloo IN serverloop %]
         <p>
@@ -135,34 +155,70 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
         <th>Author</th>
         <th>ISBN</th>
         <th>LCCN</th>
-        <th colspan="2">Preview</th>
+        <th>Preview</th>
                <th>&nbsp;</th>
     </tr></thead>
     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
         [% IF ( breeding_loo.breedingid ) %]
 
         [% IF ( breeding_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
-            <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" rel="gb_page_center[600,500]">Preview MARC</a> <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" rel="gb_page_center[600,500]">Preview Card</a> <a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode %]&amp;breedingid=[% breeding_loo.breedingid %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Order</a> <a href="#" id="closemenu" title="Close this menu"> X </a></div></td>
+            <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" rel="gb_page_center[600,500]">Preview MARC</a> <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" rel="gb_page_center[600,500]">Preview card</a> <a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode %]&amp;breedingid=[% breeding_loo.breedingid %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Order</a> <a href="#" id="closemenu" title="Close this menu"> X </a></div></td>
             <td>[% breeding_loo.title |html %]</td>
             <td>[% breeding_loo.author %]</td>
             <td>[% breeding_loo.isbn %]</td>
             <td>[% breeding_loo.lccn %]</td>
-            <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td><td><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
+            <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" title="Card" rel="gb_page_center[600,500]">Card</a></td>
                        <td><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode %]&amp;breedingid=[% breeding_loo.breedingid %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Order</a></td>
 
         </tr>
         [% 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="searchtitle"  name="title" value="[% title |html %]" />
+        <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
+        <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
+        <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" name="frameworkcode" value="[% frameworkcode %]" />
+        <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+        <input type="hidden" name="controlnumber" value="[% controlnumber %]" />
+        <input type="hidden" name="basketno" value="[% basketno %]" />
+        <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
+
+        [% 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>
+
     [% ELSE %]
         [% IF ( emptyserverlist ) %]
-            You didn't select any Z39.50 target.
+            <div class="dialog alert">You didn't select any Z39.50 target.</div>
         [% ELSE %]
-            [% FOREACH errcon IN errconn %]
-                Connection failed to [% errcon.server %]
+            [% IF ( errconn ) %]
+                <div class="dialog alert">
+                    <ul>
+                    [% FOREACH errcon IN errconn %]
+                        <li>Connection failed to [% errcon.server %]</li>
+                    [% END %]
+                    </ul>
+                </div>
             [% END %]
         [% END %]
-        <p>Nothing found. <a href="javascript: history.back()">Try another search</a>.</p>
+        <div class="dialog message">Nothing found. <a href="javascript: history.back()">Try another search</a>.</div>
     [% END %]