Bug 15711: Follow up batch_id not used
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patroncards / image-manage.tt
1     [% INCLUDE 'doc-head-open.inc' %]
2     <title>Koha &rsaquo; Tools &rsaquo; Patron card creator &rsaquo; Images</title>
3     [% INCLUDE 'doc-head-close.inc' %]
4     <script type="text/javascript">
5         //<![CDATA[
6             function DeleteConfirm() {
7                 var results = selected_images("delete");
8                 if (results.images) {
9                     var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
10                     var answer = confirm(msg);
11                     if (answer) {
12                         window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
13                     } else {
14                         return; // abort delete
15                     }
16                 } else {
17                     alert(_("Please select image(s) to delete."));
18                 }
19             }
20
21             function selected_images(op) {
22                 var selected = new Array;
23                 var image_ids = new Array;
24                 if (document.delete_images.action.length) {
25                     for (i=0;i<document.delete_images.action.length;i++){
26                         if (document.delete_images.action[i].checked){
27                             selected.push("image_id=" + document.delete_images.action[i].value);
28                             image_ids.push(document.delete_images.action[i].value);
29                         }
30                     }
31                     images = selected.join("&");
32                     return {images:images, image_ids:image_ids};
33                 }
34                 else if (document.delete_images.action.checked){
35                         return {images:"image_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
36                 }
37                 return (-1);
38             }
39         $(document).ready(function() {
40             $("#delete").click(function(){
41                 return DeleteConfirm();
42             });
43             $(".delete_image").on("click", function(){
44                 return confirmDelete( _("Are you sure you want to delete this image?") );
45             });
46          });
47         //]]>
48     </script>
49 </head>
50 <body id="pcard_image-manage" class="tools pcard">
51 [% INCLUDE 'header.inc' %]
52 [% INCLUDE 'cat-search.inc' %]
53 <div id="breadcrumbs">
54     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
55     <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
56     <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> &rsaquo;
57     Images
58 </div>
59 <div id="doc3" class="yui-t2">
60     <div id="bd">
61         <div id="yui-main">
62             <div class="yui-b">
63                     <div class="yui-g">
64                     [% INCLUDE 'patroncards-toolbar.inc' %]
65                         <div class="yui-u first">
66
67                         </div>
68                     </div>
69                 [% INCLUDE 'patroncards-errors.inc' %]
70                 <div class="yui-g">
71                     <div class="yui-u first">
72                         <h1>Upload images</h1>
73                         <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
74                             <fieldset class="brief">
75                                 <div class="hint">
76                                     <b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported. Images <b>must</b> be less than 500KB.
77                                 </div>
78                                 <ol>
79                                 <li>
80                                     <label for="uploadfile">Select the file to upload: </label>
81                                     <input type="file" id="uploadfile" name="uploadfile" />
82                                     <input type="hidden" id="image" name="filetype" value="image" />
83                                 </li>
84                                 <li>
85                                     <label for="image_name">Image name: </label>
86                                     <div class="hint">
87                                         This will be the name by which you will refer to this image in the patron card layout editor.
88                                     </div>
89                                     <input type="text" id="image_name" name="image_name" size="20" />
90                                 </li>
91                                 </ol>
92                                 <div class="action">
93                                     <input type="hidden" name="op" value="upload" />
94                                     <input class="btn btn-default" id="uploadsu" type="submit" value="Upload" />
95                                 </div>
96                                 [% IF ( IMPORT_SUCCESSFUL ) %]
97                                     <div class="dialog message">
98                                     <h3>Image successfully uploaded</h3>
99                                     <ul><li>File: [% SOURCE_FILE %]</li>
100                                     <li>Image name: [% IMAGE_NAME %]</li></ul>
101                                     </div>
102                                 [% END %]
103                             </fieldset>
104
105                         </form>
106                     </div>
107                     <div class="yui-u">
108                     <h1>Delete Images</h1>
109                         [% IF ( TABLE ) %]
110                         <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
111                             <fieldset class="brief">
112                                 <div class="hint">
113                                     Select one or more images to delete.
114                                 </div>
115                                <table>
116                                     [% FOREACH TABL IN TABLE %]
117
118                                     [% IF ( TABL.header_fields ) %]
119
120                                     <tr>
121                                     [% FOREACH header_field IN TABL.header_fields %]
122                                     [% SWITCH header_field.field_label -%]
123                                         [% CASE "ID" %]
124                                             <th>Image ID</th>
125                                         [% CASE "Name" %]
126                                             <th>Name</th>
127                                         [% CASE " " %]
128                                             <th>Delete</th>
129                                         [% CASE %]
130                                            <th>[% header_field.field_label %]</th>
131                                     [% END %]
132                                     [% END %]
133                                     </tr>
134                                     [% ELSE %]
135                                     <tr>
136                                     [% FOREACH text_field IN TABL.text_fields %]
137                                     [% IF ( text_field.select_field ) %]
138                                         <td>
139                                             <a class="delete_image btn btn-mini" href="/cgi-bin/koha/patroncards/image-manage.pl?op=delete&image_id=[% text_field.field_value %]"><i class="fa fa-trash"></i> Delete</a>
140                                         </td>
141                                         <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
142                                     [% ELSIF ( text_field.field_value ) %]
143                                         <td>[% text_field.field_value %]</td>
144                                     [% ELSE %]
145                                         <td>&nbsp;</td>
146                                     [% END %]
147                                     [% END %]
148                                     </tr>
149                                     [% END %]
150                                     [% END %]
151                                 </table>
152                                 <div class="action">
153                                     <input type="hidden" name="op" value="delete" />
154                                     <input class="btn btn-default" type="button" id="delete" value="Delete selected" />
155                                 </div>
156                                 [% IF ( DELETE_SUCCESSFULL ) %]
157                                 <div id="dialog" class="dialog message">
158                                     <h3>Image(s) successfully deleted</h3>
159                                 </div>
160                                 [% END %]
161                             </fieldset>
162                         </form>
163                         [% ELSE %]
164                         <fieldset class="brief">
165                             <div class="hint">
166                                 No images are currently available.
167                             </div>
168                             [% IF ( DELETE_SUCCESSFULL ) %]
169                                 <div id="dialog" class="dialog message">
170                                     <h3>Image(s) successfully deleted</h3>
171                                 </div>
172                             [% END %]
173                         </fieldset>
174                         [% END %]
175                     </div>
176                 </div>
177             </div>
178         </div>
179         <div class="yui-b">
180           [% INCLUDE 'tools-menu.inc' %]
181         </div>
182     </div>
183     [% INCLUDE 'intranet-bottom.inc' %]