Bug 2780 - Capitalize strings consistently (patron cards)
[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             function showHideLayers(element, time, action) {
39                 setTimeout("changeVisibility('" + element + "','" + action + "')", time)
40             }
41             function changeVisibility(element, action) {
42                 document.getElementById(element).style.display=action;
43             }
44     </script>
45     <script type="text/javascript">
46         //<![CDATA[
47         $(document).ready(function() {
48             $("#upload_cancel").empty();
49             $("#delete_cancel").empty();
50             $("#upload").empty();
51             $("#delete").empty();
52             buildButtons();
53             showHideLayers('dialog', 5000, 'none')
54          });
55
56         function buildButtons() {
57             new YAHOO.widget.Button({
58                 type: "link",
59                 label: _("Cancel"),
60                 id: "cancelul",
61                 href: "/cgi-bin/koha/patroncards/home.pl",
62                 container: "upload_cancel"
63             });
64
65             new YAHOO.widget.Button({
66                 type: "link",
67                 label: _("Cancel"),
68                 id: "canceldel",
69                 href: "/cgi-bin/koha/patroncards/home.pl",
70                 container: "delete_cancel"
71             });
72
73             new YAHOO.widget.Button({
74                 type: "submit",
75                 label: _("Upload"),
76                 id: "uploadsb",
77                 value: "upload",
78                 container: "upload"
79             });
80
81             var deleteButton = new YAHOO.widget.Button({
82                 type: "link",
83                 onclick: {fn: DeleteConfirm},
84                 label: _("Delete"),
85                 id: "deletesb",
86                 value: "delete",
87                 container: "delete",
88             });
89         }
90     </script>
91 </head>
92 <body id="pcard_image-manage" class="tools pcard">
93 [% INCLUDE 'header.inc' %]
94 [% INCLUDE 'cat-search.inc' %]
95 <div id="breadcrumbs">
96     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
97     <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
98     <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> &rsaquo;
99     Manage images
100 </div>
101 <div id="doc3" class="yui-t2">
102     <div id="bd">
103         <div id="yui-main">
104             <div class="yui-b">
105                 [% INCLUDE 'error-messages.inc' %]
106                 <div class="yui-g">
107                     <div class="yui-u first">
108                         <h1>Upload Images</h1>
109                         [% IF ( IMPORT_SUCCESSFUL ) %]
110                         <div id="dialog" class="dialog message">
111                             <li><h3>Image successfully uploaded.</h3></li>
112                             <li>File: [% SOURCE_FILE %]</li>
113                             <li>Image name: [% IMAGE_NAME %]</li>
114                         </div>
115                         [% END %]
116                         <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
117                             <fieldset class="brief">
118                                 <div class="hint">
119                                     <b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported. Images <b>must</b> be less than 500KB.
120                                 </div>
121                                 <li>
122                                     <label for="uploadfile">Select the file to upload: </label>
123                                     <input type="file" id="uploadfile" name="uploadfile" />
124                                     <input type="hidden" id="image" name="filetype" value="image" />
125                                 </li>
126                                 <li>
127                                     <label for="image_name">Image name: </label>
128                                     <div class="hint">
129                                         This will be the name by which you will refer to this image in the patron card layout editor.
130                                     </div>
131                                     <input type="text" id="image_name" name="image_name" size="20" />
132                                 </li>
133                             </fieldset>
134                             <fieldset class="action">
135                                 <input type="hidden" name="op" value="upload" />
136                                 <span id="upload"><input id="uploadsu" type="submit" value="upload" class="submit" /></span>
137                                 <span id="upload_cancel"><a id="cancelul" href="/cgi-bin/koha/patroncards/home.pl" class="cancel">Cancel</a></span>
138                             </fieldset>
139                         </form>
140                     </div>
141                     <div class="yui-u">
142                     <h1>Delete Images</h1>
143                         [% IF ( DELETE_SUCCESSFULL ) %]
144                         <div id="dialog" class="dialog message">
145                             <li><h3>Image(s) successfully deleted.</h3></li>
146                         </div>
147                         [% END %]
148                         [% IF ( TABLE ) %]
149                         <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
150                             <fieldset class="brief">
151                                 <div class="hint">
152                                     Select one or more images to delete.
153                                 </div>
154                            <li>
155                                <table>
156                                     [% FOREACH TABL IN TABLE %]
157                                     [% IF ( TABL.header_fields ) %]
158                                     <tr>
159                                     [% FOREACH header_field IN TABL.header_fields %]
160                                         <th>[% header_field.field_label %]</th>
161                                     [% END %]
162                                     </tr>
163                                     [% ELSE %]
164                                     <tr>
165                                     [% FOREACH text_field IN TABL.text_fields %]
166                                     [% IF ( text_field.select_field ) %]
167                                         <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
168                                     [% ELSIF ( text_field.field_value ) %]
169                                         <td>[% text_field.field_value %]</td>
170                                     [% ELSE %]
171                                         <td>&nbsp;</td>
172                                     [% END %]
173                                     [% END %]
174                                     </tr>
175                                     [% END %]
176                                     [% END %]
177                                 </table>
178                             </li>
179                             </fieldset>
180                             <fieldset class="action">
181                                 <input type="hidden" name="op" value="delete" />
182                                 <span id="delete"><input id="deletesu" type="button" id="delete" onclick="DeleteConfirm()" value="Delete image(s)" /></span>
183                                 <span id="delete_cancel"><a id="canceldel" href="/cgi-bin/koha/patroncards/home.pl" class="cancel">Cancel</a></span>
184                             </fieldset>
185                         </form>
186                         [% ELSE %]
187                         <fieldset class="brief">
188                             <div class="hint">
189                                 No images are currently available.
190                             </div>
191                         </fieldset>
192                         [% END %]
193                     </div>
194                 </div>
195             </div>
196         </div>
197         <div class="yui-b noprint">
198             [% INCLUDE 'patroncards-menu.inc' %]
199         </div>
200     </div>
201     [% INCLUDE 'intranet-bottom.inc' %]