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