Merge remote-tracking branch 'origin/new/bug_8382'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / stage-marc-import.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Stage MARC records for import</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'file-upload.inc' %]
5 <script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
6 <style type="text/css">
7         #uploadpanel,#fileuploadstatus,#fileuploadfailed,#jobpanel,#jobstatus,#jobfailed { display : none; }
8         #fileuploadstatus,#jobstatus { margin:.4em; }
9         #fileuploadprogress,#jobprogress{ width:150px;height:10px;border:1px solid #666;background:url('/intranet-tmpl/prog/img/progress.png') -300px 0px no-repeat; }</style>
10 <script type="text/javascript">
11 //<![CDATA[
12 $(document).ready(function(){
13         $("#processfile").hide();
14     $("#record_type").change(function() {
15         if ($(this).val() == 'auth') {
16             $('#items').hide();
17         } else {
18             $('#items').show();
19         }
20     });
21 });
22 function CheckForm(f) {
23     if ($("#fileToUpload").value == '') {
24         alert(_('Please upload a file first.'));
25     } else {
26         return submitBackgroundJob(f);
27     }
28     return false;
29 }
30
31 //]]>
32 </script>
33 </head>
34 <body id="tools_stage-marc-import" class="tools">
35 [% INCLUDE 'header.inc' %]
36 [% INCLUDE 'cat-search.inc' %]
37
38 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; [% IF ( uploadmarc ) %]<a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a> &rsaquo; Upload Results[% ELSE %]Stage MARC records for import[% END %]</div>
39
40 <div id="doc3" class="yui-t2">
41    
42    <div id="bd">
43         <div id="yui-main">
44         <div class="yui-b">
45
46 <h1>Stage MARC records for import</h1>
47 [% IF ( uploadmarc ) %]
48 <p>MARC staging results :</p>
49 <ul>
50     [% SWITCH (record_type) %]
51     [% CASE 'biblio' %]
52         <li>Processing bibliographic records</li>
53     [% CASE 'auth' %]
54         <li>Processing authority records</li>
55     [% END %]
56         <li>[% total %]  records in file</li>
57         <li>[% import_errors %] records not staged because of MARC error</li>
58         <li>[% staged %] records staged</li>
59     [% IF ( checked_matches ) %]
60         <li>[% matched %] records with at least one match in catalog per matching rule 
61         &quot;[% matcher_code %]&quot;</li>
62     [% ELSE %]
63         [% IF ( matcher_failed ) %]
64           <li>Record matching failed -- unable to retrieve selected matching rule.</li>
65         [% ELSE %]
66           <li>Did not check for matches with existing records in catalog</li>
67         [% END %]
68     [% END %]
69         <li>[% num_items %] item records found and staged</li>
70         [% IF ( label_batch ) %]
71           <li>New label batch created: # [% label_batch %] </li>
72     [% END %]
73         <li><a href="/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=[% import_batch_id %]">Manage staged records</a></li>
74         <li><a href="/cgi-bin/koha/tools/tools-home.pl">Back</a></li>
75 </ul>
76 [% ELSE %]
77 <ul>
78     <li>Select a MARC file to stage in the import reservoir.  It will be parsed, and each valid record staged for later import into the catalog.</li>
79     <li>You can enter a name for this import. It may be useful, when creating a record, to remember where the suggested MARC data comes from!</li>
80 </ul>
81 <form method="post" action="[% SCRIPT_NAME %]" id="uploadfile" enctype="multipart/form-data">
82 <fieldset class="rows" id="uploadform">
83 <legend>Stage records into the reservoir</legend>
84 <ol>
85         <li>
86         <div id="fileuploadform">
87                 <label for="fileToUpload">Select the file to stage: </label>
88                 <input type="file" id="fileToUpload" name="fileToUpload" />
89         </div>  </li>
90 </ol>
91         <fieldset class="action"><button class="submit" onclick="return ajaxFileUpload();">Upload file</button></fieldset>
92 </fieldset>
93                 
94         <div id="uploadpanel"><div id="fileuploadstatus">Upload progress: <div id="fileuploadprogress"></div> <span id="fileuploadpercent">0</span>%</div>
95         <div id="fileuploadfailed"></div></div>
96 </form>
97
98     <form method="post" id="processfile" action="[% SCRIPT_NAME %]" enctype="multipart/form-data">
99 <fieldset class="rows">
100         <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
101         <input type="hidden" name="runinbackground" id="runinbackground" value="" />
102         <input type="hidden" name="completedJobID" id="completedJobID" value="" />
103         <ol><li>
104                 <label for="comments">Comments about this file: </label>
105                 <input type="text" id="comments" name="comments" />
106                 
107         </li>
108     <li>
109         <label for='record_type'>Record type:</label>
110         <select name='record_type' id='record_type'>
111             <option value='biblio' selected='selected'>Bibliographic</option>
112             <option value='auth'>Authority</option>
113         </select>
114     </li>
115         <li>
116                 <label for="encoding">Character encoding: </label>
117             <select name="encoding" id="encoding"><option value="utf8" selected="selected">UTF-8 (Default)</option><option value="MARC-8">MARC 8</option><option value="ISO_5426">ISO 5426</option><option value="ISO_6937">ISO 6937</option><option value=ISO_8859-1">ISO 8859-1</option><option value="EUC-KR">EUC-KR</option></select>
118         </li>
119 </ol></fieldset>
120   <fieldset class="rows">
121     <legend>Look for existing records in catalog?</legend>
122     <ol><li><label for="matcher">Record matching rule:</label>
123     <select name="matcher" id="matcher">
124        <option value="">Do not look for matching records</option> 
125        [% FOREACH available_matcher IN available_matchers %]
126           <option value="[% available_matcher.matcher_id %]">[% available_matcher.code %] ([% available_matcher.description %])
127           </option>
128        [% END %]
129     </select>
130     </li>
131       <li><label for="overlay_action">Action if matching record found: </label>
132            [% INCLUDE 'tools-overlay-action.inc' %]
133       </li>
134       <li><label for="nomatch_action">Action if no match is found: </label>
135            [% INCLUDE 'tools-nomatch-action.inc' %]
136       </li>
137     </ol>
138   </fieldset>
139   <fieldset class="rows" id="items">
140     <legend>Check for embedded item record data?</legend>
141     <ol>
142       <li class="radio">
143         <input type="radio" id="parse_itemsyes" name="parse_items" value="1" checked="checked" />
144         <label for="parse_itemsyes">Yes</label>
145       </li>
146       <li class="radio">
147         <input type="radio" id="parse_itemsno" name="parse_items" value="0" />
148         <label for="parse_itemsno">No</label>
149       </li>
150     </ol>
151     <ol>
152       <li><label for="item_action">How to process items: </label>
153            [% INCLUDE 'tools-item-action.inc' %]
154       </li>
155     </ol>
156   </fieldset>
157   <fieldset class="action"><input type="button" id="mainformsubmit" onclick="return CheckForm(this.form);" value="Stage for import" /></fieldset>
158  
159        <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
160      <div id="jobfailed"></div></div>
161   
162 </form>
163 [% END %]
164
165 </div>
166 </div>
167 <div class="yui-b">
168 [% INCLUDE 'tools-menu.inc' %]
169 </div>
170 </div>
171 [% INCLUDE 'intranet-bottom.inc' %]