Bug 10170: strings in MARC import made translatable
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / manage-marc-import.tt
1 [% BLOCK final_match_link %]
2     [% IF ( record.record_type == 'biblio' ) %]
3         <a target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record.final_match_id %]">[% record.final_match_id %]</a>
4     [% ELSIF ( record.record_type == 'auth' ) %]
5         <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record.final_match_id %]">[% record.final_match_id %]</a>
6     [% END %]
7 [% END %]
8 [% BLOCK match_link %]
9     [% IF ( record_lis.match_id ) %]
10         <tr>
11             <td />
12             [% IF ( record.record_type == 'biblio' ) %]
13                 <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>
14             [% ELSIF ( record.record_type == 'auth' ) %]
15                 <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>
16             [% END %]
17         </tr>
18     [% END %]
19 [% END %]
20 [% INCLUDE 'doc-head-open.inc' %]
21 <title>Koha &rsaquo; Tools &rsaquo; Manage staged MARC records
22 [% IF ( import_batch_id ) %]
23  &rsaquo; Batch [% import_batch_id %]
24 [% END %]
25 </title>
26 [% INCLUDE 'greybox.inc' %]
27 [% INCLUDE 'doc-head-close.inc' %]
28 <script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
29 <script type="text/JavaScript" language="JavaScript">
30 //<![CDATA[
31 var MSG_CONFIRM_CLEAN = _("Clear all reservoir records staged in this batch?  This cannot be undone.");
32
33 $(document).ready(function(){
34   $("#staged-record-matching-rules select").change(function(){
35       var str = $(this).attr("id");
36       $("#reset_"+str).parent().show();
37   });
38   $("a.reset").click(function(){
39       var str = $(this).attr("id");
40       str = str.replace("reset_","")
41       $("#"+str+" option[selected='selected']").attr("selected","selected");
42       $(this).parent().hide();
43   });
44 });
45 //]]>
46 </script>
47 <style type="text/css">
48         #jobpanel,#jobstatus,#jobfailed { display : none; }
49         #jobstatus { margin:.4em; }
50     #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>
51 </head>
52 <body id="tools_manage-marc-import" class="tools">
53 [% INCLUDE 'header.inc' %]
54 [% INCLUDE 'cat-search.inc' %]
55
56 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> 
57 [% IF ( import_batch_id ) %]
58  &rsaquo;
59  <a href="[% script_name %]">Manage staged MARC records</a>
60  &rsaquo; Batch [% import_batch_id %]
61 [% ELSE %]
62  &rsaquo; Manage staged MARC records
63 [% END %]
64 </div>
65
66 <div id="doc3" class="yui-t2">
67    
68    <div id="bd">
69         <div id="yui-main">
70         <div class="yui-b">
71
72 <h1>Manage staged MARC records
73 [% IF ( import_batch_id ) %]
74  &rsaquo; Batch [% import_batch_id %]
75 [% END %]
76 </h1>
77 [% IF ( label_batch_msg ) %]
78 [% IF ( alert ) %]
79 <div class="alert">
80 [% ELSE %]
81 <div class="dialog">
82 [% END %]
83 <b><p>[% label_batch_msg %]</p></b>
84 </div>
85 [% END %]
86
87 [% IF ( did_clean ) %]
88   <div class="dialog message">Cleaned import batch #[% import_batch_id %]</div>
89 [% END %]
90
91 [% UNLESS ( batch_list ) %]
92    [% UNLESS ( batch_info ) %]
93    <div class="dialog message">
94      <p>No records have been staged.</p>
95      <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
96    </div>
97    [% END %]
98 [% END %]
99
100 [% IF ( batch_info ) %]
101
102 [% IF ( can_commit ) %]
103 <form action="[% script_name %]" method="post">
104 <input type="hidden" name="op" value="redo-matching" />
105 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
106 <input type="hidden" name="current_matcher_id" value="[% current_matcher_id %]" />
107 [% END %]
108
109   [% IF ( rematch_attempted ) %]
110     [% IF ( rematch_failed ) %]
111       <div class="dialog alert">Failed to apply different matching rule</div>
112     [% ELSE %]
113       <div class="dialog message">Applied different matching rule.  Number of records matched now
114        [% num_with_matches %]
115       </div>
116     [% END %]
117   [% END %]
118   [% IF ( changed_overlay_action ) %]
119       <div class="dialog message">Changed action if matching record found</div>
120   [% END %]
121   [% IF ( changed_nomatch_action ) %]
122       <div class="dialog message">Changed action if no match found</div>
123   [% END %]
124   [% IF ( changed_item_action ) %]
125       <div class="dialog message">Changed item processing option</div>
126   [% END %]
127
128 <fieldset class="rows" id="staged-record-matching-rules">
129   <ol>
130     <li><span class="label">File name:</span> [% file_name %]</li>
131     <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %][% ELSE %](none)[% END %]</li>
132     <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
133     <li><span class="label">Staged:</span> [% upload_timestamp %]</li>
134     <li><span class="label">Status:</span>
135       [% IF ( import_status == 'cleaned' ) %]
136          Cleaned
137       [% ELSIF ( import_status == 'imported' ) %]
138         Imported
139       [% ELSIF ( import_status == 'importing' ) %]
140         Importing
141       [% ELSIF ( import_status == 'reverted' ) %]
142          Reverted
143       [% ELSIF ( import_status == 'reverting' ) %]
144          Reverting
145       [% ELSIF ( import_status == 'staged' ) %]
146           Staged
147       [% ELSE %]
148           [% import_status %]
149       [% END %]
150       </li>
151     <li>
152 [% IF ( can_commit ) %]<label for="new_matcher_id">Matching rule applied:</label><select name="new_matcher_id" id="new_matcher_id">
153        <option value="">Do not look for matching records</option> 
154        [% FOREACH available_matcher IN available_matchers %]
155           [% IF ( available_matcher.selected ) %]
156           <option value="[% available_matcher.matcher_id %]" selected="selected">
157              [% available_matcher.code %] ([% available_matcher.description %])
158           </option>
159           [% ELSE %]
160           <option value="[% available_matcher.matcher_id %]">
161             [% available_matcher.code %] ([% available_matcher.description %])
162           </option>
163           [% END %]
164        [% END %]
165     </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 ) %]
166   [% current_matcher_code %] ([% current_matcher_description %])
167 [% ELSE %]
168   No matching rule in effect
169 [% END %][% END %]
170     </li>
171     <li>
172         [% IF ( can_commit ) %]
173             <label for="overlay_action">Action if matching record found:</label>
174             [% INCLUDE 'tools-overlay-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_overlay_action">Reset</a></span>
175         [% ELSE %]
176             <span class="label">Action if matching record found:</span>
177             [% IF ( overlay_action == 'replace' ) %]
178                 Replace existing record with incoming record
179             [% ELSIF ( overlay_action == 'create_new' ) %]
180                 Add incoming record
181             [% ELSIF ( overlay_action == 'ignore' ) %]
182                 Ignore incoming record (its items may still be processed)
183             [% ELSE %]
184                 [% overlay_action %]
185             [% END %]
186         [% END %]</li>
187      
188     <li>
189         [% IF ( can_commit ) %]
190             <label for="nomatch_action">Action if no match found:</label>
191             [% INCLUDE 'tools-nomatch-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_nomatch_action">Reset</a></span>
192         [% ELSE %]
193             <span class="label">Action if no match found:</span>
194             [% IF ( nomatch_action == 'create_new' ) %]
195                 Add incoming record
196             [% ELSIF ( nomatch_action == 'ignore' ) %]
197                 Ignore incoming record (its items may still be processed)
198             [% ELSE %]
199                 [% nomatch_action %]
200             [% END %]
201         [% END %]
202     </li>
203     
204     <li>
205         [% IF ( can_commit ) %]
206             <label for="item_action">Item processing:</label>
207             [% INCLUDE 'tools-item-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_item_action">Reset</a></span>
208         [% ELSE %]
209             <span class="label">Item processing:</span>
210             [% IF ( item_action == 'always_add' ) %]
211                 Always add items
212             [% ELSIF ( item_action == 'add_only_for_matches' ) %]
213                 Add items only if matching bib was found
214             [% ELSIF ( item_action == 'add_only_for_new' ) %]
215                 Add items only if no matching bib was found
216             [% ELSIF ( item_action == 'ignore' ) %]
217                 Ignore items
218             [% ELSE %]
219                 [% item_action %]
220             [% END %]
221         [% END %]
222     </li>
223   </ol>
224 [% IF ( can_commit ) %]<fieldset class="action"><input type="submit" value="Apply different matching rules" class="button" /></fieldset></form>[% END %]
225 </fieldset>
226
227
228 <div>
229   [% IF ( can_commit ) %]
230   <form action="[% script_name %]" method="post">
231     <input type="hidden" name="op" value="commit-batch" />
232     <input type="hidden" name="runinbackground" value="" />
233     <input type="hidden" name="completedJobID" value="" />
234     <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
235     <fieldset class="action">
236     <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" />
237     <br/>
238     [% IF ( record_type != 'auth' ) %]
239     Add new bibliographic records into this framework:
240     <select name="framework" id="frameworks">
241       <option value="">Default</option>
242       [% FOREACH framework IN frameworks %]
243           <option value="[% framework.value %]">[% framework.label %]</option>
244       [% END %]
245     </select>
246     [% END %]
247     </fieldset>
248   </form>
249   <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
250      <div id="jobfailed"></div></div>
251   [% END %]
252   [% IF ( can_revert ) %]
253   <form action="[% script_name %]" method="post">
254     <input type="hidden" name="op" value="revert-batch" />
255     <input type="hidden" name="runinbackground" value="" />
256     <input type="hidden" name="completedJobID" value="" />
257     <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
258     <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
259   </form>
260   <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
261      <div id="jobfailed"></div></div>
262   [% END %]
263 </div>
264   [% IF ( did_commit ) %]
265   <div class="dialog message">Completed import of records</div>
266   <table>
267   <tr><td>Number of records added</td><td>[% num_added %]</td></tr>
268   <tr><td>Number of records updated</td><td>[% num_updated %]</td></tr>
269   <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
270   <tr><td>Number of items added</td><td>[% num_items_added %]</td></tr>
271   <tr><td>Number of items ignored because of duplicate barcode</td><td>[% num_items_errored %]</td></tr>
272   </table>
273   [% END %]
274   [% IF ( did_revert ) %]
275   <div class="dialog message">Success: Import reversed</div>
276   <table>
277   <tr><td>Number of records deleted</td><td>[% num_deleted %]</td></tr>
278   <tr><td>Number of items deleted</td><td>[% num_items_deleted %]</td></tr>
279   <tr><td>Number of records not deleted due to items on loan</td><td>[% num_errors %]</td></tr>
280   <tr><td>Number of records changed back</td><td>[% num_reverted %]</td></tr>
281   <tr><td>Number of records ignored</td><td>[% num_ignored %]</td></tr>
282   </table>
283   [% END %]
284 [% END %]
285 <br style="clear:both;" />
286
287 [% IF ( batch_list ) %]
288   [% IF ( pages ) %]
289 <div class="pages">
290 Page 
291     [% FOREACH page IN pages %]
292       [% IF ( page.current_page ) %]
293       <span class="current">[% page.page_number %]</span>
294       [% ELSE %]
295       <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
296       [% END %]
297     [% END %]
298 </div>
299   [% END %]
300 <table>
301   <tr>
302     <th>#</th>
303     <th>File name</th>
304     <th>Comments</th>
305     <th>Type</th>
306     <th>Status</th>
307     <th>Staged</th>
308     <th># Records</th>
309     <th># Items</th>
310     <th>Action</th>
311   </tr>
312   [% FOREACH batch_lis IN batch_list %]
313   [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
314     <td>[% batch_lis.import_batch_id %]</td>
315     <td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
316     <td>[% batch_lis.comments %]</td>
317     <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
318     <td>
319       [% IF ( batch_lis.import_status == 'cleaned' ) %]
320          Cleaned
321       [% ELSIF ( batch_lis.import_status == 'imported' ) %]
322         Imported
323       [% ELSIF ( batch_lis.import_status == 'importing' ) %]
324         Importing
325       [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
326          Reverted
327       [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
328          Reverting
329       [% ELSIF ( batch_lis.import_status == 'staged' ) %]
330           Staged
331       [% ELSE %]
332           [% batch_lis.import_status %]
333       [% END %]
334     </td>
335     <td>[% batch_lis.upload_timestamp %]</td>
336     <td>[% batch_lis.num_records %]</td>
337     <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>
338     <td>[% IF ( batch_lis.can_clean ) %]
339           <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
340             <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" />
341             <input type="hidden" name="op" value="clean-batch" />
342             <input type="submit" class="button" value="Clean" onclick="return confirm(MSG_CONFIRM_CLEAN);" />
343           </form>
344         [% END %]
345     </td>
346   </tr>
347   [% END %]
348 </table>
349   [% IF ( pages ) %]
350 <div class="pages">
351 Page 
352     [% FOREACH page IN pages %]
353       [% IF ( page.current_page ) %]
354       <span class="current">[% page.page_number %]</span>
355       [% ELSE %]
356       <a class="nav" href="[% page.script_name %]?offset=[% page.offset %]">[% page.page_number %]</a>
357       [% END %]
358     [% END %]
359 </div>
360   [% END %]
361 [% END %]
362
363 [% IF ( record_list ) %]
364   [% IF ( pages ) %]
365 <div class="pages">
366 Page 
367     [% FOREACH page IN pages %]
368       [% IF ( page.current_page ) %]
369       <span class="current">[% page.page_number %]</span>
370       [% ELSE %]
371       <a class="nav" href="[% page.script_name %]?import_batch_id=[% import_batch_id %]&amp;offset=[% page.offset %]">[% page.page_number %]</a>
372       [% END %]
373     [% END %]
374 </div>
375   [% END %]
376 <table>
377   <tr>
378     <th>#</th>
379     <th>Citation</th>
380     <th>Status</th>
381     <th>Match?</th>
382     <th>Record</th>
383
384   </tr>
385   [% FOREACH record_lis IN record_list %]
386   [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
387     <td>[% record_lis.record_sequence %]</td>
388     <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>
389     <td>
390         [% IF ( record_lis.status == 'imported' ) %]
391             Imported
392         [% ELSIF ( record_lis.status == 'ignored' ) %]
393             Ignored
394         [% ELSIF ( record_lis.status == 'reverted' ) %]
395             Reverted
396         [% ELSE %]
397           [% record_lis.status %]
398         [% END %]
399     </td>
400     <td>
401         [% IF ( record_lis.overlay_status == 'no_match' ) %]
402             No&nbsp;match
403         [% ELSIF ( record_lis.overlay_status == 'match_applied' ) %]
404             Match applied
405         [% ELSE %]
406             [% record_lis.overlay_status %]
407         [% END %]
408     </td>
409     <td>[% IF ( record_lis.final_match_id ) %]
410         [% PROCESS final_match_link record=record_lis %]
411         [% END %]
412     </td>
413   </tr>
414     [% PROCESS match_link record=record_lis %]
415   [% END %]
416 </table>
417   [% IF ( pages ) %]
418 <div class="pages">
419 Page 
420     [% FOREACH page IN pages %]
421       [% IF ( page.current_page ) %]
422       <span class="current">[% page.page_number %]</span>
423       [% ELSE %]
424       <a class="nav" href="[% page.script_name %]?import_batch_id=[% import_batch_id %]&amp;offset=[% page.offset %]">[% page.page_number %]</a>
425       [% END %]
426     [% END %]
427 </div>
428   [% END %]
429 [% ELSE %]
430   [% IF ( batch_info ) %]
431     <div class="dialog alert">There are no records in this batch to import.
432     <a href="/cgi-bin/koha/tools/manage-marc-import.pl">Manage staged MARC records</a>.</div>
433
434   [% END %]
435 [% END %]
436
437 </div>
438 </div>
439 <div class="yui-b">
440 [% INCLUDE 'tools-menu.inc' %]
441 </div>
442 </div>
443 [% INCLUDE 'intranet-bottom.inc' %]