Bug 9310 - Patron image upload template corrections
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / picture-upload.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Upload patron images</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
5  $(document).ready(function() {
6         $("#zipfile").click(function(){
7                 $("#cardnum").hide();
8         });
9         $("#image").click(function(){
10                 $("#cardnum").show();
11         });
12 });
13 </script>
14 </head>
15 <body id="tools_picture-upload" class="tools">
16
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'patron-search.inc' %]
19
20 <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 ( TOTAL ) %]<a href="/cgi-bin/koha/tools/picture-upload.pl">Upload patron images</a> &rsaquo; Results[% ELSE %]Upload patron images[% END %] </div>
21
22 <div id="doc3" class="yui-t2">
23     <div id="bd">
24         <div id="yui-main">
25 [% IF ( TOTAL ) %]
26     <div class="yui-b">
27             [% IF ( ERRORS ) %]
28                                 [% IF ( TCOUNTS ) %]
29                                         <div class="dialog alert">
30                     <h3>Patron image(s) uploaded with some errors</h3>
31                     </div>
32                                 [% ELSE %]
33                                         <div class="dialog alert">
34                     <h3>Patron image failed to upload</h3>
35                     </div>
36                                 [% END %]
37             [% ELSE %]
38                 <div class="dialog message">
39                 <h3>Patron image(s) successfully uploaded</h3>
40                 </div>
41             [% END %]
42                 <ul class="data">
43                     <li>Unpacking completed</li>
44                   <li>[% TOTAL %] directories scanned.</li>
45                     <li>[% HANDLED %] directories processed.</li>
46                 </ul>
47
48                 [% FOREACH COUNT IN COUNTS %]
49                 <div class="container">
50                     <table>
51                         <caption>Results</caption>
52                         <thead>
53                             <tr><th>File name</th><th>Card number</th><th>Result</th></tr>
54                         </thead>
55                         <tbody>
56                         [% IF ( COUNT.TCOUNTS ) %]<li>[% COUNT.TCOUNTS %] image(s) moved into the database:</li>[% END %]
57                             [% FOREACH filename IN COUNT.filenames %]
58                                 <tr>
59                                 <td>[% filename.source %]</td>
60                                 <td><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% filename.cardnumber %]">[% filename.cardnumber %]</a></td>
61                                 <td>
62                                     [% IF ( filename.filerrors ) %]
63                                     [% FOREACH filerror IN filename.filerrors %]
64                                         [% IF ( filerror.DBERR ) %]<b>ERROR:</b> Image not imported because the database returned an error. Please refer to the error log for more details.
65                                         [% ELSIF ( filerror.IMGEXISTS ) %]<b>ERROR:</b> Image not imported because this patron does not exist in the database.
66                                         [% ELSIF ( filerror.MIMERR ) %]<b>ERROR:</b> Image not imported because the image format is unrecognized.
67                                         [% ELSIF ( filerror.CORERR ) %]<b>ERROR:</b> Image not imported because the image file is corrupted.
68                                         [% ELSIF ( filerror.OPNERR ) %]<b>ERROR:</b> Image not imported because Koha was unable to open the image for reading.
69                                         [% ELSIF ( filerror.OVRSIZ ) %]<b>ERROR:</b> Image not imported because the image file is too big (see online help for maximum size).
70                                         [% ELSIF ( filerror.CRDFIL ) %]<b>ERROR:</b> Image not imported ([% filerror.CRDFIL %] missing).
71                                         [% ELSE %]<b>ERROR:</b> Image not imported because of an unknown error. Please refer to the error log for more details.
72                                         [% END %]
73                                     [% END %]
74                                 [% ELSE %] imported successfully.
75                                     [% END %]</td>
76                                 </tr>
77                         [% END %]
78                         </tbody>
79                     </table>
80                     </div>
81                 [% END %]
82 <ul>
83                 [% IF ( borrowernumber ) %]
84                     <li><a id="member" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Return to patron detail</a></li>
85                 [% ELSE %]
86                     <li><a id="uploadmore" href="/cgi-bin/koha/tools/picture-upload.pl">Upload more images</a></li>
87                     <li><a id="doneupload" href="/cgi-bin/koha/tools/tools-home.pl">Return to tools</a></li>
88                 [% END %]</ul>
89             </div>
90 [% ELSE %]
91     <div class="yui-b">
92                 <h1>Upload patron images</h1>
93                 [% IF ( ERRORS ) %]
94                 <div class="dialog alert">
95                     [% FOREACH ERROR IN ERRORS %]
96                         [% IF ( ERROR.NOTZIP ) %]<li><b>The upload file does not appear to be a zip file.  The extension is not '.zip'.</b></li>
97                         [% ELSIF ( ERROR.NOWRITETEMP ) %]<li><b>This script is not able to create/write to the necessary temporary directory.</b></li>
98                         [% ELSIF ( ERROR.EMPTYUPLOAD ) %]<li><b>The upload file appears to be empty.</b></li>
99                         [% ELSIF ( ERROR.OPNLINK ) %]<li><b>Cannot open [% ERROR.OPNLINK %] to read.<br />Please verify that it exists.</b></li>
100                         [% ELSIF ( ERROR.OPNIMG ) %]<li><b>Cannot open [% ERROR.OPNIMG %] to read.<br />Please verify that it exists.</b></li>
101                         [% ELSIF ( ERROR.DELERR ) %]<li><b>Unrecognized or missing field delimiter.<br />Please verify that you are using either a single quote or a tab.</b></li>
102                         [% ELSIF ( ERROR.UZIPFAIL ) %]<li><b>[% ERROR.UZIPFAIL %] failed to unpack.<br />Please verify the integrity of the ZIP file and retry.</b></li>
103                         [% ELSE %]<li><b>[% ERROR.CORERR %] An unknown error has occurred.<br />Please review the error log for more details.</b></li>[% END %]
104                     [% END %]
105                 </div>
106                 [% END %]
107                 <form method="post" action="/cgi-bin/koha/tools/picture-upload.pl" enctype="multipart/form-data">
108                     <fieldset class="brief">
109                          <div class="hint"><b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported.</div>
110                         <ol class="radio">
111                             <li class="radio">
112                                 <label for="zipfile"><input type="radio" id="zipfile" name="filetype" value="zip" checked="checked" /> zip file</label></li>
113                                 <li>
114                                 <label for="image">
115                                                                 [% 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 %]
116                                                                  image file</label>
117                         <ol>
118                             <li>
119                                 <label for="uploadfile">Select the file to upload: </label><input type="file" id="uploadfile" name="uploadfile" />
120                                 [% IF ( filetype == 'image' ) %]<span id="cardnum">[% ELSE %]<span id="cardnum" style="display: none">[% END %]<label for="cardnumber">Enter patron cardnumber: </label><input type="text" id="cardnumber" name="cardnumber" value="[% cardnumber %]" size="15" /></span>
121                             </li>
122                         </ol>
123                                         </li></ol>
124                     </fieldset>
125                     <fieldset class="action">
126                         <input type="hidden" name="op" value="Upload" />
127                         <input type="submit" value="Upload" class="submit" />
128                                                 <a href="/cgi-bin/koha/tools/tools-home.pl" class="cancel">Cancel</a>
129                     </fieldset>
130                 </form>
131         
132             </div>      
133 [% END %]
134 </div>
135 <div class="yui-b noprint">
136     [% INCLUDE 'tools-menu.inc' %]
137 </div>
138 </div>
139 [% INCLUDE 'intranet-bottom.inc' %]