Bug 2774 - Path to theme is hard-coded in many places
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / manage-marc-import.tt
index 042b15c..391dda7 100644 (file)
@@ -1,3 +1,22 @@
+[% BLOCK final_match_link %]
+    [% IF ( record.record_type == 'biblio' ) %]
+        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record.final_match_id %]">[% record.final_match_id %]</a>
+    [% ELSIF ( record.record_type == 'auth' ) %]
+        <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record.final_match_id %]">[% record.final_match_id %]</a>
+    [% END %]
+[% END %]
+[% BLOCK match_link %]
+    [% IF ( record_lis.match_id ) %]
+        <tr>
+            <td />
+            [% IF ( record.record_type == 'biblio' ) %]
+                <td class="highlight" colspan="4">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="4">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>
+            [% END %]
+        </tr>
+    [% END %]
+[% END %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Tools &rsaquo; Manage staged MARC records
 [% IF ( import_batch_id ) %]
@@ -6,9 +25,11 @@
 </title>
 [% INCLUDE 'greybox.inc' %]
 [% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'background-job.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
 <script type="text/JavaScript" language="JavaScript">
 //<![CDATA[
+var MSG_CONFIRM_CLEAN = _("Clear all reservoir records staged in this batch?  This cannot be undone.");
+
 $(document).ready(function(){
   $("#staged-record-matching-rules select").change(function(){
       var str = $(this).attr("id");
@@ -26,7 +47,7 @@ $(document).ready(function(){
 <style type="text/css">
        #jobpanel,#jobstatus,#jobfailed { display : none; }
        #jobstatus { margin:.4em; }
-       #jobprogress{ width:200px;height:10px;border:1px solid #666;background:url('/intranet-tmpl/prog/img/progress.png') -300px 0px no-repeat; } span.change-status { font-style:italic; color:#666; display:none; }</style>
+    #jobprogress{ width:200px;height:10px;border:1px solid #666;background:url('[% interface %]/[% theme %]/img/progress.png') -300px 0px no-repeat; } span.change-status { font-style:italic; color:#666; display:none; }</style>
 </head>
 <body id="tools_manage-marc-import" class="tools">
 [% INCLUDE 'header.inc' %]
@@ -107,10 +128,27 @@ $(document).ready(function(){
 <fieldset class="rows" id="staged-record-matching-rules">
   <ol>
     <li><span class="label">File name:</span> [% file_name %]</li>
-    <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %](none)[% END %]</li>
+    <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %][% ELSE %](none)[% END %]</li>
+    <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
     <li><span class="label">Staged:</span> [% upload_timestamp %]</li>
-    <li><span class="label">Status:</span> [% import_status %]</li>
-    <li> 
+    <li><span class="label">Status:</span>
+      [% IF ( import_status == 'cleaned' ) %]
+         Cleaned
+      [% ELSIF ( import_status == 'imported' ) %]
+        Imported
+      [% ELSIF ( import_status == 'importing' ) %]
+        Importing
+      [% ELSIF ( import_status == 'reverted' ) %]
+         Reverted
+      [% ELSIF ( import_status == 'reverting' ) %]
+         Reverting
+      [% ELSIF ( import_status == 'staged' ) %]
+          Staged
+      [% ELSE %]
+          [% import_status %]
+      [% END %]
+      </li>
+    <li>
 [% IF ( can_commit ) %]<label for="new_matcher_id">Matching rule applied:</label><select name="new_matcher_id" id="new_matcher_id">
        <option value="">Do not look for matching records</option> 
        [% FOREACH available_matcher IN available_matchers %]
@@ -153,6 +191,7 @@ $(document).ready(function(){
     <fieldset class="action">
     <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" />
     <br/>
+    [% IF ( record_type != 'auth' ) %]
     Add new bibliographic records into this framework:
     <select name="framework" id="frameworks">
       <option value="">Default</option>
@@ -160,6 +199,7 @@ $(document).ready(function(){
           <option value="[% framework.value %]">[% framework.label %]</option>
       [% END %]
     </select>
+    [% END %]
     </fieldset>
   </form>
   <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
@@ -188,7 +228,7 @@ $(document).ready(function(){
   </table>
   [% END %]
   [% IF ( did_revert ) %]
-  <div class="dialog message">Undid import of records</div>
+  <div class="dialog message">Success: Import reversed</div>
   <table>
   <tr><td>Number of records deleted</td><td>[% num_deleted %]</td></tr>
   <tr><td>Number of items deleted</td><td>[% num_items_deleted %]</td></tr>
@@ -218,9 +258,10 @@ Page
     <th>#</th>
     <th>File name</th>
     <th>Comments</th>
+    <th>Type</th>
     <th>Status</th>
     <th>Staged</th>
-    <th># Bibs</th>
+    <th># Records</th>
     <th># Items</th>
     <th>Action</th>
   </tr>
@@ -229,15 +270,32 @@ Page
     <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>
-    <td>[% batch_lis.import_status %]</td>
+    <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
+    <td>
+      [% IF ( batch_lis.import_status == 'cleaned' ) %]
+         Cleaned
+      [% ELSIF ( batch_lis.import_status == 'imported' ) %]
+        Imported
+      [% ELSIF ( batch_lis.import_status == 'importing' ) %]
+        Importing
+      [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
+         Reverted
+      [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
+         Reverting
+      [% ELSIF ( batch_lis.import_status == 'staged' ) %]
+          Staged
+      [% ELSE %]
+          [% batch_lis.import_status %]
+      [% END %]
+    </td>
     <td>[% batch_lis.upload_timestamp %]</td>
-    <td>[% batch_lis.num_biblios %]</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 ) %]
           <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(_('Clear all reservoir records staged in this batch?  This cannot be undone.'));" />
+            <input type="submit" class="button" value="Clean" onclick="return confirm(MSG_CONFIRM_CLEAN);" />
           </form>
         [% END %]
     </td>
@@ -258,7 +316,7 @@ Page
   [% END %]
 [% END %]
 
-[% IF ( biblio_list ) %]
+[% IF ( record_list ) %]
   [% IF ( pages ) %]
 <div class="pages">
 Page 
@@ -277,26 +335,21 @@ Page
     <th>Citation</th>
     <th>Status</th>
     <th>Match?</th>
-    <th>Bib</th>
+    <th>Record</th>
 
   </tr>
-  [% FOREACH biblio_lis IN biblio_list %]
+  [% FOREACH record_lis IN record_list %]
   [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
-    <td>[% biblio_lis.record_sequence %]</td>
-    <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio_lis.import_record_id %]" rel="gb_page_center[600,500]">[% biblio_lis.citation %]</a></td>
-    <td>[% biblio_lis.status %]</td>
-    <td>[% biblio_lis.overlay_status %]</td>
-    <td>[% IF ( biblio_lis.final_match_biblionumber ) %]
-        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_lis.final_match_biblionumber %]">[% biblio_lis.final_match_biblionumber %]</a>
+    <td>[% record_lis.record_sequence %]</td>
+    <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% record_lis.import_record_id %]" rel="gb_page_center[600,500]">[% record_lis.citation %]</a></td>
+    <td>[% record_lis.status %]</td>
+    <td>[% record_lis.overlay_status %]</td>
+    <td>[% IF ( record_lis.final_match_id ) %]
+        [% PROCESS final_match_link record=record_lis %]
         [% END %]
     </td>
   </tr>
-    [% IF ( biblio_lis.match_biblionumber ) %]
-    <tr>
-      <td />
-      <td class="highlight" colspan="4">Matches biblio [% biblio_lis.match_biblionumber %] (score = [% biblio_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_lis.match_biblionumber %]">[% biblio_lis.match_citation %]</a></td>
-    </tr>
-    [% END %]
+    [% PROCESS match_link record=record_lis %]
   [% END %]
 </table>
   [% IF ( pages ) %]