Bug 8942: Translation process breaks javascript
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / upload-images.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Upload images</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         $("#zipfile").click(function(){
15                 $("#bibnum").hide();
16         });
17         $("#image").click(function(){
18                 $("#bibnum").show();
19         });
20 });
21 function CheckForm(f) {
22     if ($("#fileToUpload").value == '') {
23         alert(_("Please upload a file first."));
24     } else {
25         return submitBackgroundJob(f);
26     }
27     return false;
28 }
29
30 //]]>
31 </script>
32 </head>
33 <body id="tools_upload-images" class="tools">
34 [% INCLUDE 'header.inc' %]
35 [% INCLUDE 'cat-search.inc' %]
36
37 <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 ( uploadimage ) %]<a href="/cgi-bin/koha/tools/upload-cover-image.pl">Upload local cover image</a> &rsaquo; Upload results[% ELSE %]Upload local cover image[% END %]</div>
38
39 <div id="doc3" class="yui-t2">
40
41    <div id="bd">
42         <div id="yui-main">
43         <div class="yui-b">
44
45 <h1>Upload local cover image</h1>
46 [% IF ( uploadimage ) %]
47 <p>Image upload results :</p>
48 <ul>
49     <li>[% total %] images found</li>
50     [% IF ( error ) %]
51     <div class="dialog alert">
52     [% IF ( error == 'UZIPFAIL' ) %]<p><b>Failed to unzip archive.<br />Please ensure you are uploading a valid zip file and try again.</b></p>
53     [% ELSIF ( error == 'OPNLINK' ) %]<p><b>Cannot open folder index (idlink.txt or datalink.txt) to read.<br />Please verify that it exists.</b></p>
54     [% ELSIF ( error == 'OPNIMG' ) %]<p><b>Cannot process file as an image.<br />Please ensure you only upload GIF, JPEG, PNG, or XPM images.</b></p>
55     [% ELSIF ( error == 'DELERR' ) %]<p><b>Unrecognized or missing field delimiter.<br />Please verify that you are using either a single quote or a tab.</b></p>
56     [% ELSIF ( error == 'DBERR' ) %]<p><b>Unable to save image to database.</b></p>
57     [% ELSE %]<p><b>An unknown error has occurred.<br />Please review the error log for more details.</b></p>[% END %]
58     </div>
59     </li>
60     [% END %]
61     <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">View final record</a></li>
62         <li><a href="/cgi-bin/koha/tools/tools-home.pl">Back</a></li>
63 </ul>
64 <hr />
65 [% END %]
66 <ul>
67         <li>Select an image file or ZIP file to upload. The tool will accept images in GIF, JPEG, PNG, and XPM formats.</li>
68 </ul>
69 <form method="post" action="[% SCRIPT_NAME %]" id="uploadfile" enctype="multipart/form-data">
70 <fieldset class="rows" id="uploadform">
71 <legend>Upload images</legend>
72 <ol>
73         <li>
74         <div id="fileuploadform">
75                 <label for="fileToUpload">Select the file to upload: </label>
76                 <input type="file" id="fileToUpload" name="fileToUpload" />
77         </div>  </li>
78 </ol>
79   <fieldset class="action"><button class="submit" onclick="return ajaxFileUpload();">Upload file</button></fieldset>
80 </fieldset>
81
82         <div id="uploadpanel"><div id="fileuploadstatus">Upload progress: <div id="fileuploadprogress"></div> <span id="fileuploadpercent">0</span>%</div>
83         <div id="fileuploadfailed"></div></div>
84 </form>
85
86     <form method="post" id="processfile" action="[% SCRIPT_NAME %]" enctype="multipart/form-data">
87 <fieldset class="rows">
88         <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
89         <input type="hidden" name="runinbackground" id="runinbackground" value="" />
90         <input type="hidden" name="completedJobID" id="completedJobID" value="" />
91         </fieldset>
92   <fieldset class="rows">
93     <legend>File type</legend>
94     <ol>
95       <li class="radio">
96         [% IF (filetype != 'image' ) %]<input type="radio" id="zipfile" name="filetype" value="zip" checked="checked" />[% ELSE %]<input type="radio" id="zipfile" name="filetype" value="zip" />[% END %]
97         <label for="zipfile">ZIP file</label>
98       </li>
99       <li class="radio">
100         [% IF (filetype == 'image' ) %]<input type="radio" id="image" name="filetype" value="image" checked="checked" />[% ELSE %]<input type="radio" id="image" name="filetype" value="image" />[% END %]
101         <label for="imagefile">Image file</label>
102       </li>
103       <li class="radio">
104         [% IF ( filetype == 'image' ) %]<span id="bibnum">[% ELSE %]<span id="bibnum" style="display: none">[% END %]<label for="biblionumber">Enter cover biblionumber: </label><input type="text" id="biblionumber" name="biblionumber" value="[% biblionumber %]" size="15" /></span>
105       </li>
106     </ol>
107   </fieldset>
108   <fieldset class="rows">
109     <legend>Options</legend>
110     <ol>
111       <li class="checkbox">
112         [% IF AllowMultipleCovers == 0 %]<input type="checkbox" id="replace" name="replace" checked="checked" disabled="disabled" value="1" />[% ELSE %]<input type="checkbox" id="replace" name="replace" value="1" />[% END %]
113         <label for="replace">Replace existing covers</label>
114       </li>
115     </ol>
116   </fieldset>
117   <fieldset class="action"><input type="submit" value="Process images" /></fieldset>
118
119        <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
120      <div id="jobfailed"></div></div>
121
122 </form>
123
124 </div>
125 </div>
126 <div class="yui-b">
127 [% INCLUDE 'tools-menu.inc' %]
128 </div>
129 </div>
130 [% INCLUDE 'intranet-bottom.inc' %]