Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / z3950_search.tt
index 7775f1f..c7bc15a 100644 (file)
@@ -1,42 +1,23 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Z39.50 Search Results</title>
-[% INCLUDE 'greybox.inc' %]
+<title>Koha &rsaquo; Z39.50/SRU search results</title>
 [% 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="[% interface %]/[% theme %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 //<![CDATA[
-function Import(GetThisOne,biblionumber) {
-    opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne;
-    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();
-    $("tr").removeClass("selected");
-}
 
 $(document).ready(function(){
-    $("#CheckAll").click(function(){
-        $(".checkboxed").checkCheckboxes();
-        return false;
-    });
-    $("#CheckNone").click(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);
@@ -44,8 +25,8 @@ $(document).ready(function(){
             $(".linktools").hide();
             $("tr").removeClass("selected");
             row.addClass("selected");
-            if($tgt.is("a")||$tgt.is(":nth-child(7)")||$tgt.is(":nth-child(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){
-                return true;
+            if($tgt.is("a")||$tgt.is(":nth-child(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){
+                //Don't show inline links for cells containing links of their own.
             } else {
                 var position = $(this).offset();
                 var top = position.top+5;
@@ -53,64 +34,60 @@ $(document).ready(function(){
                 $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
             }
         });
-    $("form[name='f']").submit(function(){
-        if ($('input[type=checkbox]').filter(':checked').length == 0) {
-            alert(_("Please choose at least one Z39.50 target"));
-            return false;
-        } else
-            return true;
-    });
+
 });
 
 //]]>
 </script>
+[% INCLUDE 'z3950_search.inc' %]
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/z3950_search.js"></script>
 <style type="text/css">
 .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;}
 .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
 .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }
+#dataPreview { width : 90%; margin-left : -45%; top: 5%; } .modal-body { max-height: 380px; } .modal-header { padding: 0 14px; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }
 </style>
       [% IF ( opsearch ) %]
    <style type="text/css">
           #custom-doc { width:53em;*width:51.72em;min-width:689px; margin:auto; text-align:left; }
    </style>
 </head>
-<body>
+<body id="cat_z3950_search" class="cat">
 
 <div id="custom-doc" class="yui-t7">
 [% ELSE %]
 </head>
-<body style="padding:.5em;">
+<body id="cat_z3950_search" class="cat" style="padding:.5em;">
 <div>
 [% END %]
       <div id="bd">
          [% IF ( opsearch ) %]
-<h2>Z39.50 Search Points</h2>
+<h2>Z39.50/SRU search</h2>
     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
     <input type="hidden" name="op" id="op" value="do_search" />
        <div class="yui-g">
     <div class="yui-u first">
            <fieldset class="rows"> 
-                <ol><li><label for="title">Title: </label> <input type="text" id="title"  name="title" value="[% title %]" /></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="srchany">Raw (any): </label> <input type="text" id="srchany" name="srchany" 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="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
-                <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li></ol>
-    </fieldset>
-    <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
-    <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
-           </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>
-
+        <ol>
+        <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" /></li>
+        <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn | html %]" /></li>
+        <li><label for="title">Title: </label> <input type="text" id="title"  name="title" value="[% title |html %]" /></li>
+        <li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author | html %]" /></li>
+        <li><label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
+        <li><label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></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="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
+        <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li>
+        <li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li>
+        </ol>
+    <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
+    <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
+    </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="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></span></h2>
+      <div id="z3950_search_targets">
     [% FOREACH serverloo IN serverloop %]
         <p> 
             [% IF ( serverloo.checked ) %]
@@ -118,17 +95,44 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
             [% ELSE %]
                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" />
             [% END %]
-            <label for="z3950_[% serverloo.id %]">[% serverloo.name %]</label>  
+            <label for="z3950_[% serverloo.id %]">[% serverloo.servername %]</label>
 
         </p>
     [% END %]
-        </div>
-    <fieldset class="action"><input type="submit"  class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
+      </div>
+    </div>
+    <fieldset class="action"><input type="submit"  class="submit" value="Search" /> <a class="cancel close" href="#">Cancel</a></fieldset>
     </form>
 
 
 [% ELSE %]
     <h2>Results</h2>
+    <p>You searched for:
+        [% IF ( title ) %]<em>Title: </em><span class=term>[% title | html %]</span> [% END %]
+        [% IF ( author ) %]<em>Author: </em><span class=term>[% author | html %]</span> [% END %]
+        [% IF ( isbn ) %]<em>ISBN: </em><span class=term>[% isbn | html %]</span> [% END %]
+        [% IF ( issn ) %]<em>ISSN: </em><span class=term>[% issn | html %]</span> [% END %]
+        [% IF ( lccall ) %]<em>LC call number: </em><span class=term>[% lccall | html %]</span> [% END %]
+        [% IF ( subject ) %]<em>Subject heading: </em><span class=term>[% subject | html %]</span> [% END %]
+        [% IF ( controlnumber ) %]<em>Control no: </em><span class=term>[% controlnumber | html %]</span> [% END %]
+        [% IF ( dewey ) %]<em>Dewey: </em><span class=term>[% dewey | html %]</span> [%END %]
+        [% IF ( srchany ) %]<em>Raw (any): </em><span class=term>[% srchany | html %]</span> [% END %]
+        [% IF ( stdid ) %]<em>Standard ID: </em><span class=term>[% stdid | html %]</span> [% END %]
+    </p>
+    [% IF ( errconn ) %]
+            <div class="dialog alert">
+                <ul>
+                [% FOREACH errcon IN errconn %]
+                    [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li>
+                    [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li>
+                    [% ELSIF ( errcon.error == 'xslt_err' ) %]<li>[% errcon.server %]: Warning: XSLT error on search result [% errcon.seq %]</li>
+                    [% ELSE %]<li>[% errcon.server %] record [% errcon.seq %]: [% errcon.error %]</li>
+                    [% END %]
+                [% END %]
+                </ul>
+            </div>
+    [% END %]
+
     [% IF ( breeding_loop ) %]
     <table id="resultst">
 <thead>    <tr>
@@ -139,42 +143,74 @@ 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 %]
         [% IF ( breeding_loo.breedingid ) %]
 
            <tr id="row[% breeding_loo.breedingid %]">
-               <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="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a><a href="#" onclick="closemenu();return false;" 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 %]" class="previewData">Preview MARC</a> <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" class="previewData">Preview card</a> <a href="#" class="import_record" data-breedingid="[% breeding_loo.breedingid %]" data-biblionumber="[% breeding_loo.biblionumber %]" data-frameworkcode="[% frameworkcode | uri %]">Import</a><a href="#" id="close_menu" title="Close this menu"> X </a></div> </td>
             <td>[% breeding_loo.title |html %]</td>
             <td>[% breeding_loo.author %]</td>
             <td>[% breeding_loo.date %]</td>
             <td>[% breeding_loo.edition %]</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="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a></td> 
+            <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewData">MARC</a></td>
+            <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" class="previewData">Card</a></td>
+            <td><a href="#" class="import_record" data-breedingid="[% breeding_loo.breedingid %]" data-biblionumber="[% breeding_loo.biblionumber %]" data-frameworkcode="[% frameworkcode | uri %]">Import</a></td>
         </tr>
         [% END %]
     [% END %]</tbody>
 </table>
-<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 id="dataPreview" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
+        <h3 id="dataPreviewLabel">Preview</h3>
+    </div>
+    <div class="modal-body">
+        <div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
+    </div>
+
+</div>
+
+
+    <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 | html %]" />
+        <input type="hidden" id="isbn" name="isbn" value="[% isbn | html %]" />
+        <input type="hidden" id="lccall" name="lccall" value="[% lccall | html %]" />
+        <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
+        <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
+        <input type="hidden" id="author" name="author" value="[% author | html %]" />
+        <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
+        <input type="hidden" id="dewey" name="dewey" value="[% dewey | html %]" />
+        <input type="hidden" id="stdid" name="stdid" value="[% stdid | html %]" />
+        <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
+        <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
+
+        [% 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" data-currentpage="[% current_page %]" />
+        [% END %]
+        Page [% current_page %] / [% total_pages %]
+        [% IF ( show_nextbutton ) %]
+            <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page %]" />
+        [% END %]
+        <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" value="Go" />
+    </form>
+
     [% ELSE %]
-        [% IF ( errconn ) %]
-            <div class="dialog alert">
-                <ul>
-                [% FOREACH errcon IN errconn %]
-                    <li>Connection failed to [% errcon.server %]</li>
-                [% END %]
-                </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">Nothing found.</div>
     [% END %]
-
+<p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]"/><input type="submit" value="Try another search"/></form></p>
 
 [% END %]