Fix for Bug 3659, Add place hold option from patron checkout tab
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patroncards / image-manage.tmpl
1     <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2     <title>Koha &rsaquo; Patron Card Creator &rsaquo; Manage Images</title>
3     <!-- TMPL_INCLUDE NAME="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>
93 <!-- TMPL_INCLUDE NAME="header.inc" -->
94 <!-- TMPL_INCLUDE NAME="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                 <!-- TMPL_INCLUDE NAME="error-messages.inc" -->
106                 <div class="yui-g">
107                     <div class="yui-u first">
108                         <h1>Upload Images</h1>
109                         <!-- TMPL_IF name="IMPORT_SUCCESSFUL" -->
110                         <div id="dialog" class="dialog message">
111                             <li><h3>Image successfully uploaded.</h3></li>
112                             <li>File: <!-- TMPL_VAR name="SOURCE_FILE" --></li>
113                             <li>Image name: <!-- TMPL_VAR name="IMAGE_NAME" --></li>
114                         </div>
115                         <!-- /TMPL_IF -->
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                         <!-- TMPL_IF name="DELETE_SUCCESSFULL" -->
144                         <div id="dialog" class="dialog message">
145                             <li><h3>Image(s) successfully deleted.</h3></li>
146                         </div>
147                         <!-- /TMPL_IF -->
148                         <!-- TMPL_IF NAME="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                                     <!-- TMPL_LOOP NAME="TABLE" -->
157                                     <!-- TMPL_IF NAME="header_fields" -->
158                                     <tr>
159                                     <!-- TMPL_LOOP NAME="header_fields" -->
160                                         <th><!-- TMPL_VAR NAME="field_label" --></th>
161                                     <!-- /TMPL_LOOP -->
162                                     </tr>
163                                     <!-- TMPL_ELSE -->
164                                     <tr>
165                                     <!-- TMPL_LOOP NAME="text_fields" -->
166                                     <!-- TMPL_IF NAME="select_field" -->
167                                         <td align="center"><input type="checkbox" name="action" value="<!-- TMPL_VAR NAME="field_value" -->" /></td>
168                                     <!-- TMPL_ELSIF NAME="field_value" -->
169                                         <td><!-- TMPL_VAR NAME="field_value" --></td>
170                                     <!-- TMPL_ELSE -->
171                                         <td>&nbsp;</td>
172                                     <!-- /TMPL_IF -->
173                                     <!-- /TMPL_LOOP -->
174                                     </tr>
175                                     <!-- /TMPL_IF -->
176                                     <!-- /TMPL_LOOP -->
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                         <!-- TMPL_ELSE -->
187                         <fieldset class="brief">
188                             <div class="hint">
189                                 No images are currently available.
190                             </div>
191                         </fieldset>
192                         <!-- /TMPL_IF -->
193                     </div>
194                 </div>
195             </div>
196         </div>
197         <div class="yui-b noprint">
198             <!-- TMPL_INCLUDE NAME="patroncards-menu.inc" -->
199         </div>
200     </div>
201     <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->