Bug 14790 - Add OPAC view link to items editor
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / manage-marc-import.tt
index 67cf116..e1119d1 100644 (file)
@@ -10,9 +10,9 @@
         <tr>
             <td />
             [% IF ( record.record_type == 'biblio' ) %]
-                <td class="highlight" colspan="5">Matches biblio [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record_lis.match_id %]">[% record_lis.match_citation %]</a></td>
+                <td colspan="5">Matches biblio [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record_lis.match_id %]">[% record_lis.match_citation %]</a></td>
             [% ELSIF ( record.record_type == 'auth' ) %]
-                <td class="highlight" colspan="5">Matches authority [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record_lis.match_id %]">[% record_lis.match_citation %]</a> |
+                <td colspan="5">Matches authority [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record_lis.match_id %]">[% record_lis.match_citation %]</a> |
         <a href="/cgi-bin/koha/authorities/merge.pl?mergereference=breeding&authid=[% record_lis.match_id %]&authid=[% record_lis.import_record_id %]">Merge</a>
                 </td>
             [% END %]
@@ -20,7 +20,7 @@
     [% ELSIF ( record.record_type == 'auth') %]
         <tr data-authid="[% record_lis.import_record_id %]">
             <td />
-            <td class="highlight" colspan="4"><a href="#" class="merge_auth">Search for a record to merge in a new window</a></td>
+            <td  colspan="4"><a href="#" class="merge_auth">Search for a record to merge in a new window</a></td>
         </tr>
     [% END %]
 [% END %]
 [% END %]
 </title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script>
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
 [% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 //<![CDATA[
 var MSG_CONFIRM_CLEAN = _("Clear all reservoir records staged in this batch?  This cannot be undone.");
+var MSG_CONFIRM_UNDO_IMPORT = _("Are you sure you want to undo the import of this batch into the catalog?");
+var MSG_CONFIRM_DELETE = _("Are you sure you want to permanently delete this batch?");
 
 $(document).ready(function(){
   $("#staged-record-matching-rules select").change(function(){
@@ -90,7 +92,7 @@ $(document).ready(function(){
             [% END %]
 
             $('td:eq(1)', nRow).html(
-                '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '" class="previewMARC">' + aData['citation'] + '</a>'
+                '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a>'
             );
 
             $('td:eq(2)', nRow).html(
@@ -123,7 +125,7 @@ $(document).ready(function(){
             }
             if (aData['diff_url']){
                 $('td:eq(5)', nRow).html(
-                    '<a rel="gb_page_center[960,600]" href="'+aData['diff_url']+'">View</a>'
+                    '<a href="'+aData['diff_url']+'">View</a>'
                 );
             }
             $('td:eq(6)', nRow).html(
@@ -138,7 +140,7 @@ $(document).ready(function(){
         var ltitle = $(this).text();
         var page = $(this).attr("href");
         $("#marcPreviewLabel").text(ltitle);
-        $("#marcPreview .modal-body").load(page + " pre");
+        $("#marcPreview .modal-body").load(page + " table");
         $('#marcPreview').modal({show:true});
     });
     $("#marcPreview").on("hidden", function(){
@@ -194,6 +196,10 @@ $(document).ready(function(){
   <div class="dialog message">Cleaned import batch #[% import_batch_id %]</div>
 [% END %]
 
+[% IF ( did_delete ) %]
+  <div class="dialog message">Import batch deleted successfully</div>
+[% END %]
+
 [% UNLESS ( batch_list ) %]
    [% UNLESS ( batch_info ) %]
    <div class="dialog message">
@@ -363,7 +369,7 @@ $(document).ready(function(){
     <input type="hidden" name="runinbackground" value="" />
     <input type="hidden" name="completedJobID" value="" />
     <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
-    <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
+    <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return confirm(MSG_CONFIRM_UNDO_IMPORT) && submitBackgroundJob(this.form);" /></fieldset>
   </form>
   <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
      <div id="jobfailed"></div></div>
@@ -379,7 +385,7 @@ $(document).ready(function(){
       <tr><td>Number of items added</td><td>[% num_items_added %]</td></tr>
       <tr><td>Number of items replaced</td><td>[% num_items_replaced %]</td></tr>
       <tr><td>Number of items ignored because of duplicate barcode</td><td>[% num_items_errored %]</td></tr>
-  [ % END %]
+  [% END %]
   </table>
   [% END %]
   [% IF ( did_revert ) %]
@@ -423,7 +429,7 @@ Page
     <th>Action</th>
   </tr>
   [% FOREACH batch_lis IN batch_list %]
-  [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
+    <tr>
     <td>[% batch_lis.import_batch_id %]</td>
     <td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
     <td>[% batch_lis.comments %]</td>
@@ -448,11 +454,18 @@ Page
     <td>[% batch_lis.upload_timestamp %]</td>
     <td>[% batch_lis.num_records %]</td>
     <td>[% batch_lis.num_items %][% IF ( batch_lis.num_items ) %] <a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]&amp;op=create_labels">(Create label batch)</a>[% END %]</td>
-    <td>[% IF ( batch_lis.can_clean ) %]
+    <td class="actions">
+        [% IF ( batch_lis.can_clean ) %]
           <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
             <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" />
             <input type="hidden" name="op" value="clean-batch" />
-            <input type="submit" class="button" value="Clean" onclick="return confirm(MSG_CONFIRM_CLEAN);" />
+            <button class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_CLEAN);"><i class="fa fa-eraser"></i> Clean</button>
+          </form>
+        [% ELSIF ( batch_lis.import_status == 'cleaned' ) %]
+          <form method="post" action="/cgi-bin/koha/tools/manage-marc-import.pl" name="delete_batch_[% batch_lis.import_batch_id %]" id="delete_batch_[% batch_lis.import_batch_id %]">
+            <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" />
+            <input type="hidden" name="op" value="delete-batch" />
+            <button class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);"><i class="fa fa-trash"></i> Delete</button>
           </form>
         [% END %]
     </td>