Merge remote-tracking branch 'origin/new/bug_8204'
[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; Upload patron images </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         <div class="yui-g">
28             <div class="yui-u first">
29             [% IF ( ERRORS ) %]
30                                 [% IF ( TCOUNTS ) %]
31                                         <div class="dialog alert">
32                     <h3>Patron Image(s) Uploaded with some errors</h3>
33                                 [% ELSE %]
34                                         <div class="dialog alert">
35                     <h3>Patron image failed to upload</h3>
36                                 [% END %]
37             [% ELSE %]
38                 <div class="dialog message">
39                 <h3>Patron image(s) successfully uploaded</h3>
40             [% END %]
41                 <ul class="data">
42                     <li>Unpacking completed</li>
43                   <li>[% TOTAL %] directories scanned.</li>
44                     <li>[% HANDLED %] directories processed.</li>
45                 </ul>
46
47                 [% FOREACH COUNT IN COUNTS %]
48                     <ul class="data">
49                         [% IF ( COUNT.TCOUNTS ) %]<li>[% COUNT.TCOUNTS %] image(s) moved into the database:</li>[% END %]
50                             [% FOREACH filename IN COUNT.filenames %]
51                                 <li>[% filename.source %] - Cardnumber: [% filename.cardnumber %]
52                                 [% IF ( filename.filerrors ) %]
53                                     [% FOREACH filerror IN filename.filerrors %]
54                                         [% IF ( filerror.DBERR ) %]<br /><b>ERROR:</b> Image not imported because the database returned an error. Please refer to the error log for more details.
55                                         [% ELSIF ( filerror.IMGEXISTS ) %]<br /><b>ERROR:</b> Image not imported because this patron does not exist in the database.
56                                         [% ELSIF ( filerror.MIMERR ) %]<br /><b>ERROR:</b> Image not imported because the image format is unrecognized.
57                                         [% ELSIF ( filerror.CORERR ) %]<br /><b>ERROR:</b> Image not imported because the image file is corrupted.
58                                         [% ELSIF ( filerror.OPNERR ) %]<br /><b>ERROR:</b> Image not imported because Koha was unable to open the image for reading.
59                                         [% ELSIF ( filerror.OVRSIZ ) %]<br /><b>ERROR:</b> Image not imported because the image file is too big (see online help for maximum size).
60                                         [% ELSIF ( filerror.CRDFIL ) %]<br /><b>ERROR:</b> Image not imported ([% filerror.CRDFIL %] missing).
61                                         [% ELSE %]<br /><b>ERROR:</b> Image not imported because of an unknown error. Please refer to the error log for more details.
62                                         [% END %]
63                                     [% END %]
64                                 [% ELSE %] imported successfully.
65                                 [% END %]
66                                 </li>
67                         [% END %]
68                     </ul>
69                 [% END %]
70
71                                 </div>
72                                 [% IF ( borrowernumber ) %]
73                     <a id="member" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Return to patron detail</a>
74                                 [% ELSE %]
75                     <a id="uploadmore" href="/cgi-bin/koha/tools/picture-upload.pl">Upload more images</a>
76                     <a id="doneupload" href="/cgi-bin/koha/tools/tools-home.pl">Return to tools</a>
77                 [% END %]
78             </div>
79 [% ELSE %]
80     <div class="yui-b">
81         <div class="yui-g">
82             <div class="yui-u first">
83                 <h1>Upload patron images</h1>
84                 [% IF ( ERRORS ) %]
85                 <div class="dialog alert">
86                     [% FOREACH ERROR IN ERRORS %]
87                         [% IF ( ERROR.NOTZIP ) %]<li><b>The upload file does not appear to be a zip file.  The extension is not '.zip'.</b></li>
88                         [% ELSIF ( ERROR.NOWRITETEMP ) %]<li><b>This script is not able to create/write to the necessary temporary directory.</b></li>
89                         [% ELSIF ( ERROR.EMPTYUPLOAD ) %]<li><b>The upload file appears to be empty.</b></li>
90                         [% ELSIF ( ERROR.OPNLINK ) %]<li><b>Cannot open [% ERROR.OPNLINK %] to read.<br />Please verify that it exists.</b></li>
91                         [% ELSIF ( ERROR.OPNIMG ) %]<li><b>Cannot open [% ERROR.OPNIMG %] to read.<br />Please verify that it exists.</b></li>
92                         [% 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>
93                         [% ELSIF ( ERROR.UZIPFAIL ) %]<li><b>[% ERROR.UZIPFAIL %] failed to unpack.<br />Please verify the integrity of the ZIP file and retry.</b></li>
94                         [% ELSE %]<li><b>[% ERROR.CORERR %] An unknown error has occurred.<br />Please review the error log for more details.</b></li>[% END %]
95                     [% END %]
96                 </div>
97                 [% END %]
98                 <form method="post" action="/cgi-bin/koha/tools/picture-upload.pl" enctype="multipart/form-data">
99                     <fieldset class="brief">
100                          <div class="hint"><b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported.</div>
101                         <ol class="radio">
102                             <li class="radio">
103                                 <label for="zipfile"><input type="radio" id="zipfile" name="filetype" value="zip" checked="checked" /> zip file</label></li>
104                                 <li>
105                                 <label for="image">
106                                                                 [% 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 %]
107                                                                  image file</label>
108                         <ol>
109                             <li>
110                                 <label for="uploadfile">Select the file to upload: </label><input type="file" id="uploadfile" name="uploadfile" />
111                                 [% 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>
112                             </li>
113                         </ol>
114                                         </li></ol>
115                     </fieldset>
116                     <fieldset class="action">
117                         <input type="hidden" name="op" value="Upload" />
118                         <input type="submit" value="Upload" class="submit" />
119                                                 <a href="/cgi-bin/koha/tools/tools-home.pl" class="cancel">Cancel</a>
120                     </fieldset>
121                 </form>
122         
123             </div>      
124 [% END %]
125         </div>
126     </div>
127 </div>
128 <div class="yui-b noprint">
129     [% INCLUDE 'tools-menu.inc' %]
130 </div>
131 </div>
132 [% INCLUDE 'intranet-bottom.inc' %]