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