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