Merge remote branch 'kc/master' into new/enh/bug_5917
[koha.git] / koha-tt / 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 [% INCLUDE 'background-job.inc' %]
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         $("#uploadfile").submit(function(){
15                 alert("Heyexclamation");
16         });
17 });
18 function CheckForm(f) {
19     if ($("#fileToUpload").value == '') {
20         alert('Please upload a file first.');
21     } else {
22         return submitBackgroundJob(f);
23     }
24     return false;
25 }
26
27 //]]>
28 </script>
29 </head>
30 <body>
31 [% INCLUDE 'header.inc' %]
32 [% INCLUDE 'cat-search.inc' %]
33
34 <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>
35
36 <div id="doc3" class="yui-t2">
37    
38    <div id="bd">
39         <div id="yui-main">
40         <div class="yui-b">
41
42 <h1>Stage MARC Records For Import</h1>
43 [% IF ( uploadmarc ) %]
44 <p>MARC Staging results :</p>
45 <ul>
46         <li>[% total %]  records in file</li>
47         <li>[% import_errors %] records not staged because of MARC error</li>
48         <li>[% staged %] records staged</li>
49     [% IF ( checked_matches ) %]
50         <li>[% matched %] records with at least one match in catalog per matching rule 
51         &quot;[% matcher_code %]&quot;</li>
52     [% ELSE %]
53         [% IF ( matcher_failed ) %]
54           <li>Record matching failed -- unable to retrieve selected matching rule.</li>
55         [% ELSE %]
56           <li>Did not check for matches with existing records in catalog</li>
57         [% END %]
58     [% END %]
59         <li>[% num_items %] item records found and staged</li>
60         [% IF ( label_batch ) %]
61           <li>New label batch created: # [% label_batch %] </li>
62     [% END %]
63         <li><a href="/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=[% import_batch_id %]">Manage staged records</a></li>
64         <li><a href="/cgi-bin/koha/tools/tools-home.pl">Back</a></li>
65 </ul>
66 [% ELSE %]
67 <ul>
68         <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>
69         <li>You can enter a name for this import. It may be useful, when creating a biblio, to remember where the suggested MARC data comes from!</li>
70 </ul>
71 <form method="post" action="[% SCRIPT_NAME %]" id="uploadfile" enctype="multipart/form-data">
72 <fieldset class="rows" id="uploadform">
73 <legend>Stage records into the reservoir</legend>
74 <ol>
75         <li>
76         <div id="fileuploadform">
77                 <label for="fileToUpload">Select the file to stage: </label>
78                 <input type="file" id="fileToUpload" name="fileToUpload" />
79         </div>  </li>
80 </ol>
81         <fieldset class="action"><button class="submit" onclick="return ajaxFileUpload();">Upload file</button></fieldset>
82 </fieldset>
83                 
84         <div id="uploadpanel"><div id="fileuploadstatus">Upload progress: <div id="fileuploadprogress"></div> <span id="fileuploadpercent">0</span>%</div>
85         <div id="fileuploadfailed"></div></div>
86 </form>
87
88     <form method="post" id="processfile" action="[% SCRIPT_NAME %]" enctype="multipart/form-data">
89 <fieldset class="rows">
90         <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
91         <input type="hidden" name="runinbackground" id="runinbackground" value="" />
92         <input type="hidden" name="completedJobID" id="completedJobID" value="" />
93         <ol><li>
94                 <label for="comments">Comments about this file: </label>
95                 <input type="text" id="comments" name="comments" />
96                 
97         </li>
98         <li>
99                 <label for="syntax">Character encoding: </label>
100         [% IF ( UNIMARC ) %]
101             <select name="syntax" id="syntax"><option value="MARC21">MARC21</option><option value="UNIMARC" selected="selected">UNIMARC</option></select>
102         [% ELSE %]
103             <select name="syntax" id="syntax"><option value="MARC21" selected="selected">MARC21</option><option value="UNIMARC">UNIMARC</option></select>
104         [% END %]
105                 
106         </li>
107 </ol></fieldset>
108   <fieldset class="rows">
109     <legend>Look for existing records in catalog?</legend>
110     <ol><li><label for="matcher">Record matching rule:</label>
111     <select name="matcher" id="matcher">
112        <option value="">Do not look for matching records</option> 
113        [% FOREACH available_matcher IN available_matchers %]
114           <option value="[% available_matcher.matcher_id %]">[% available_matcher.code %] ([% available_matcher.description %])
115           </option>
116        [% END %]
117     </select>
118     </li>
119       <li><label for="overlay_action">Action if matching bibliographic record found: </label>
120            [% INCLUDE 'tools-overlay-action.inc' %]
121       </li>
122       <li><label for="nomatch_action">Action if no match is found: </label>
123            [% INCLUDE 'tools-nomatch-action.inc' %]
124       </li>
125     </ol>
126   </fieldset>
127   <fieldset class="rows">
128     <legend>Check for embedded item record data?</legend>
129     <ol>
130       <li class="radio">
131         <input type="radio" id="parse_itemsyes" name="parse_items" value="1" checked="checked" />
132         <label for="parse_itemsyes">Yes</label>
133       </li>
134       <li class="radio">
135         <input type="radio" id="parse_itemsno" name="parse_items" value="0" />
136         <label for="parse_itemsno">No</label>
137       </li>
138     </ol>
139     <ol>
140       <li><label for="item_action">How to process items: </label>
141            [% INCLUDE 'tools-item-action.inc' %]
142       </li>
143     </ol>
144   </fieldset>
145   <fieldset class="action"><input type="button" id="mainformsubmit" onclick="return CheckForm(this.form);" value="Stage for import" /></fieldset>
146  
147        <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
148      <div id="jobfailed"></div></div>
149   
150 </form>
151 [% END %]
152
153 </div>
154 </div>
155 <div class="yui-b">
156 [% INCLUDE 'tools-menu.inc' %]
157 </div>
158 </div>
159 [% INCLUDE 'intranet-bottom.inc' %]