Bug 5917 : Converted templates
[koha.git] / koha-tt / intranet-tmpl / prog / en / modules / tools / manage-marc-import.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Manage Staged MARC Records
3 [% IF ( import_batch_id ) %]
4  &rsaquo; Batch [% import_batch_id %]
5 [% END %]
6 </title>
7 [% INCLUDE 'greybox.inc' %]
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% INCLUDE 'background-job.inc' %]
10 <script type="text/JavaScript" language="JavaScript">
11 //<![CDATA[
12 $(document).ready(function(){
13   $("#staged-record-matching-rules select").change(function(){
14       var str = $(this).attr("id");
15       $("#reset_"+str).parent().show();
16   });
17   $("a.reset").click(function(){
18       var str = $(this).attr("id");
19       str = str.replace("reset_","")
20       $("#"+str+" option[selected='selected']").attr("selected","selected");
21       $(this).parent().hide();
22   });
23 });
24 //]]>
25 </script>
26 <style type="text/css">
27         #jobpanel,#jobstatus,#jobfailed { display : none; }
28         #jobstatus { margin:.4em; }
29         #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>
30 </head>
31 <body>
32 [% INCLUDE 'header.inc' %]
33 [% INCLUDE 'cat-search.inc' %]
34
35 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> 
36 [% IF ( import_batch_id ) %]
37  &rsaquo;
38  <a href="[% script_name %]">Manage Staged MARC Records</a>
39  &rsaquo; Batch [% import_batch_id %]
40 [% ELSE %]
41  &rsaquo; Manage Staged MARC Records
42 [% END %]
43 </div>
44
45 <div id="doc3" class="yui-t2">
46    
47    <div id="bd">
48         <div id="yui-main">
49         <div class="yui-b">
50
51 <h1>Manage Staged MARC Records
52 [% IF ( import_batch_id ) %]
53  &rsaquo; Batch [% import_batch_id %]
54 [% END %]
55 </h1>
56 [% IF ( label_batch_msg ) %]
57 [% IF ( alert ) %]
58 <div class="alert">
59 [% ELSE %]
60 <div class="dialog">
61 [% END %]
62 <b><p>[% label_batch_msg %]</p></b>
63 </div>
64 [% END %]
65
66 [% IF ( did_clean ) %]
67   <div class="dialog message">Cleaned import batch #[% import_batch_id %]</div>
68 [% END %]
69
70 [% UNLESS ( batch_list ) %]
71    [% UNLESS ( batch_info ) %]
72    <div class="dialog message">
73      <p>No records have been staged.</p>
74      <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
75    </div>
76    [% END %]
77 [% END %]
78
79 [% IF ( batch_info ) %]
80
81 [% IF ( can_commit ) %]
82 <form action="[% script_name %]" method="post">
83 <input type="hidden" name="op" value="redo-matching" />
84 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
85 <input type="hidden" name="current_matcher_id" value="[% current_matcher_id %]" />
86 [% END %]
87
88   [% IF ( rematch_attempted ) %]
89     [% IF ( rematch_failed ) %]
90       <div class="dialog alert">Failed to apply different matching rule</div>
91     [% ELSE %]
92       <div class="dialog message">Applied different matching rule.  Number of records matched now
93        [% num_with_matches %]
94       </div>
95     [% END %]
96   [% END %]
97   [% IF ( changed_overlay_action ) %]
98       <div class="dialog message">Changed action if matching record found</div>
99   [% END %]
100   [% IF ( changed_nomatch_action ) %]
101       <div class="dialog message">Changed action if no match found</div>
102   [% END %]
103   [% IF ( changed_item_action ) %]
104       <div class="dialog message">Changed item processing option</div>
105   [% END %]
106
107 <fieldset class="rows" id="staged-record-matching-rules">
108   <ol>
109     <li><span class="label">File name:</span> [% file_name %]</li>
110     <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %](none)[% END %]</li>
111     <li><span class="label">Staged:</span> [% upload_timestamp %]</li>
112     <li><span class="label">Status:</span> [% import_status %]</li>
113     <li> 
114 [% IF ( can_commit ) %]<label for="new_matcher_id">Matching rule applied:</label><select name="new_matcher_id" id="new_matcher_id">
115        <option value="">Do not look for matching records</option> 
116        [% FOREACH available_matcher IN available_matchers %]
117           [% IF ( available_matcher.selected ) %]
118           <option value="[% available_matcher.matcher_id %]" selected="selected">
119              [% available_matcher.code %] ([% available_matcher.description %])
120           </option>
121           [% ELSE %]
122           <option value="[% available_matcher.matcher_id %]">
123             [% available_matcher.code %] ([% available_matcher.description %])
124           </option>
125           [% END %]
126        [% END %]
127     </select> <span class="change-status">Changed. <a href="#" class="reset" id="reset_new_matcher_id">Reset</a></span>[% ELSE %]<span class="label">Matching rule applied</span>[% IF ( current_matcher_id ) %]
128   [% current_matcher_code %] ([% current_matcher_description %])
129 [% ELSE %]
130   No matching rule in effect
131 [% END %][% END %]
132     </li>
133     <li>[% IF ( can_commit ) %] <label for="overlay_action">Action if matching record found:</label>
134      [% INCLUDE 'tools-overlay-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_overlay_action">Reset</a></span>[% ELSE %]<span class="label">Action if matching record found:</span>[% overlay_action %][% END %]</li>
135      
136     <li>[% IF ( can_commit ) %]<label for="nomatch_action">Action if no match found:</label>
137      [% INCLUDE 'tools-nomatch-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_nomatch_action">Reset</a></span>[% ELSE %]<span class="label">Action if no match found:</span>[% nomatch_action %][% END %]</li>
138     
139     <li>[% IF ( can_commit ) %]<label for="item_action">Item processing:</label>
140      [% INCLUDE 'tools-item-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_item_action">Reset</a></span>[% ELSE %]<span class="label">Item processing:</span>[% item_action %][% END %]</li>
141   </ol>
142 [% IF ( can_commit ) %]<fieldset class="action"><input type="submit" value="Apply different matching rules" class="button" /></fieldset></form>[% END %]
143 </fieldset>
144
145
146 <div>
147   [% IF ( can_commit ) %]
148   <form action="[% script_name %]" method="post">
149     <input type="hidden" name="op" value="commit-batch" />
150     <input type="hidden" name="runinbackground" value="" />
151     <input type="hidden" name="completedJobID" value="" />
152     <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
153     <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
154   </form>
155   <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
156      <div id="jobfailed"></div></div>
157   [% END %]
158   [% IF ( can_revert ) %]
159   <form action="[% script_name %]" method="post">
160     <input type="hidden" name="op" value="revert-batch" />
161     <input type="hidden" name="runinbackground" value="" />
162     <input type="hidden" name="completedJobID" value="" />
163     <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
164     <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
165   </form>
166   <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
167      <div id="jobfailed"></div></div>
168   [% END %]
169 </div>
170   [% IF ( did_commit ) %]
171   <div class="dialog message">Completed import of records</div>
172   <table>
173   <tr><td>Number of records added</td><td>[% num_added %]</td></tr>
174   <tr><td>Number of records updated</td><td>[% num_updated %]</td></tr>
175   <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
176   <tr><td>Number of items added</td><td>[% num_items_added %]</td></tr>
177   <tr><td>Number of items ignored because of duplicate barcode</td><td>[% num_items_errored %]</td></tr>
178   </table>
179   [% END %]
180   [% IF ( did_revert ) %]
181   <div class="dialog message">Undid import of records</div>
182   <table>
183   <tr><td>Number of records deleted</td><td>[% num_deleted %]</td></tr>
184   <tr><td>Number of items deleted</td><td>[% num_items_deleted %]</td></tr>
185   <tr><td>Number of records not deleted due to items on loan</td><td>[% num_errors %]</td></tr>
186   <tr><td>Number of records changed back</td><td>[% num_reverted %]</td></tr>
187   <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
188   </table>
189   [% END %]
190 [% END %]
191 <br style="clear:both;" />
192
193 [% IF ( batch_list ) %]
194   [% IF ( pages ) %]
195 <div class="pages">
196 Page 
197     [% FOREACH page IN pages %]
198       [% IF ( page.current_page ) %]
199       <span class="current">[% page.page_number %]</span>
200       [% ELSE %]
201       <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
202       [% END %]
203     [% END %]
204 </div>
205   [% END %]
206 <table>
207   <tr>
208     <th>#</th>
209     <th>File name</th>
210     <th>Comments</th>
211     <th>Status</th>
212     <th>Staged</th>
213     <th># Bibs</th>
214     <th># Items</th>
215     <th>Action</th>
216   </tr>
217   [% FOREACH batch_lis IN batch_list %]
218   [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
219     <td>[% batch_lis.import_batch_id %]</td>
220     <td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
221     <td>[% batch_lis.comments %]</td>
222     <td>[% batch_lis.import_status %]</td>
223     <td>[% batch_lis.upload_timestamp %]</td>
224     <td>[% batch_lis.num_biblios %]</td>
225     <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>
226     <td>[% IF ( batch_lis.can_clean ) %]
227           <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
228             <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" />
229             <input type="hidden" name="op" value="clean-batch" />
230             <input type="submit" class="button" value="Clean" onclick="return confirm(_('Clear all reservoir records staged in this batch?  This cannot be undone.'));" />
231           </form>
232         [% END %]
233     </td>
234   </tr>
235   [% END %]
236 </table>
237   [% IF ( pages ) %]
238 <div class="pages">
239 Page 
240     [% FOREACH page IN pages %]
241       [% IF ( page.current_page ) %]
242       <span class="current">[% page.page_number %]</span>
243       [% ELSE %]
244       <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
245       [% END %]
246     [% END %]
247 </div>
248   [% END %]
249 [% END %]
250
251 [% IF ( biblio_list ) %]
252   [% IF ( pages ) %]
253 <div class="pages">
254 Page 
255     [% FOREACH page IN pages %]
256       [% IF ( page.current_page ) %]
257       <span class="current">[% page.page_number %]</span>
258       [% ELSE %]
259       <a class="nav" href="[% page.script_name %]?import_batch_id=[% page.import_batch_id %]&amp;offset=[% page.offset %]">[% page.page_number %]</a>
260       [% END %]
261     [% END %]
262 </div>
263   [% END %]
264 <table>
265   <tr>
266     <th>#</th>
267     <th>Citation</th>
268     <th>Status</th>
269     <th>Match?</th>
270     <th>Bib</th>
271
272   </tr>
273   [% FOREACH biblio_lis IN biblio_list %]
274   [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
275     <td>[% biblio_lis.record_sequence %]</td>
276     <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>
277     <td>[% biblio_lis.status %]</td>
278     <td>[% biblio_lis.overlay_status %]</td>
279     <td>[% IF ( biblio_lis.final_match_biblionumber ) %]
280         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_lis.final_match_biblionumber %]">[% biblio_lis.final_match_biblionumber %]</a>
281         [% END %]
282     </td>
283   </tr>
284     [% IF ( biblio_lis.match_biblionumber ) %]
285     <tr>
286       <td />
287       <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>
288     </tr>
289     [% END %]
290   [% END %]
291 </table>
292   [% IF ( pages ) %]
293 <div class="pages">
294 Page 
295     [% FOREACH page IN pages %]
296       [% IF ( page.current_page ) %]
297       <span class="current">[% page.page_number %]</span>
298       [% ELSE %]
299       <a class="nav" href="[% page.script_name %]?import_batch_id=[% page.import_batch_id %]&amp;offset=[% page.offset %]">[% page.page_number %]</a>
300       [% END %]
301     [% END %]
302 </div>
303   [% END %]
304 [% ELSE %]
305   [% IF ( batch_info ) %]
306     <div class="dialog alert">There are no records in this batch to import.
307     <a href="/cgi-bin/koha/tools/manage-marc-import.pl">Manage staged MARC records</a>.</div>
308
309   [% END %]
310 [% END %]
311
312 </div>
313 </div>
314 <div class="yui-b">
315 [% INCLUDE 'tools-menu.inc' %]
316 </div>
317 </div>
318 [% INCLUDE 'intranet-bottom.inc' %]