Bug 7720: add options for controlling display of an item's home and/or holdings location
[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('[% interface %]/[% theme %]/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     $("#uploadfile").validate({
21         submitHandler: function(form) {
22             ajaxFileUpload();
23         }
24     });
25 });
26 //]]>
27 </script>
28 </head>
29 <body id="tools_upload-images" class="tools">
30 [% INCLUDE 'header.inc' %]
31 [% INCLUDE 'cat-search.inc' %]
32
33 <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>
34
35 <div id="doc3" class="yui-t2">
36
37    <div id="bd">
38         <div id="yui-main">
39         <div class="yui-b">
40
41 <h1>Upload local cover image</h1>
42 [% IF ( uploadimage ) %]
43 <p>Image upload results :</p>
44 <ul>
45     <li>[% total %] images found</li>
46     [% IF ( error ) %]
47     <div class="dialog alert">
48     [% IF ( error == 'UZIPFAIL' ) %]<p><b>Failed to unzip archive.<br />Please ensure you are uploading a valid zip file and try again.</b></p>
49     [% ELSIF ( error == 'OPNLINK' ) %]<p><b>Cannot open folder index (idlink.txt or datalink.txt) to read.<br />Please verify that it exists.</b></p>
50     [% 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>
51     [% 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>
52     [% ELSIF ( error == 'DBERR' ) %]<p><b>Unable to save image to database.</b></p>
53     [% ELSE %]<p><b>An unknown error has occurred.<br />Please review the error log for more details.</b></p>[% END %]
54     </div>
55     </li>
56     [% END %]
57     <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">View final record</a></li>
58         <li><a href="/cgi-bin/koha/tools/tools-home.pl">Back</a></li>
59 </ul>
60 <hr />
61 [% END %]
62 <ul>
63         <li>Select an image file or ZIP file to upload. The tool will accept images in GIF, JPEG, PNG, and XPM formats.</li>
64 </ul>
65 <form method="post" action="[% SCRIPT_NAME %]" id="uploadfile" enctype="multipart/form-data">
66 <fieldset class="rows" id="uploadform">
67 <legend>Upload images</legend>
68 <ol>
69         <li>
70         <div id="fileuploadform">
71         <label for="fileToUpload" class="required">Select the file to upload: </label>
72         <input type="file" id="fileToUpload" name="fileToUpload" required="required" class="required" />
73     <span class="required">Required</span>
74         </div>  </li>
75 </ol>
76     <fieldset class="action"><button class="submit">Upload file</button></fieldset>
77 </fieldset>
78
79         <div id="uploadpanel"><div id="fileuploadstatus">Upload progress: <div id="fileuploadprogress"></div> <span id="fileuploadpercent">0</span>%</div>
80         <div id="fileuploadfailed"></div></div>
81 </form>
82
83     <form method="post" id="processfile" action="[% SCRIPT_NAME %]" enctype="multipart/form-data">
84 <fieldset class="rows">
85         <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
86         <input type="hidden" name="runinbackground" id="runinbackground" value="" />
87         <input type="hidden" name="completedJobID" id="completedJobID" value="" />
88         </fieldset>
89   <fieldset class="rows">
90     <legend>File type</legend>
91     <ol>
92       <li class="radio">
93         [% 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 %]
94         <label for="zipfile">ZIP file</label>
95       </li>
96       <li class="radio">
97         [% 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 %]
98         <label for="imagefile">Image file</label>
99       </li>
100       <li class="radio">
101         [% 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>
102       </li>
103     </ol>
104   </fieldset>
105   <fieldset class="rows">
106     <legend>Options</legend>
107     <ol>
108       <li class="checkbox">
109         [% 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 %]
110         <label for="replace">Replace existing covers</label>
111       </li>
112     </ol>
113   </fieldset>
114   <fieldset class="action"><input type="submit" value="Process images" /></fieldset>
115
116        <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
117      <div id="jobfailed"></div></div>
118
119 </form>
120
121 </div>
122 </div>
123 <div class="yui-b">
124 [% INCLUDE 'tools-menu.inc' %]
125 </div>
126 </div>
127 [% INCLUDE 'intranet-bottom.inc' %]