1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Tools › Patron card creator › Images</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
6 function DeleteConfirm() {
7 var results = selected_images("delete");
9 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
10 var answer = confirm(msg);
12 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
14 return; // abort delete
17 alert(_("Please select image(s) to delete."));
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);
31 images = selected.join("&");
32 return {images:images, image_ids:image_ids};
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};
39 $(document).ready(function() {
40 $("#delete").click(function(){
41 return DeleteConfirm();
43 $(".delete_image").on("click", function(){
44 return confirmDelete( _("Are you sure you want to delete this image?") );
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> ›
55 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
56 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
59 <div id="doc3" class="yui-t2">
64 [% INCLUDE 'patroncards-toolbar.inc' %]
65 <div class="yui-u first">
69 [% INCLUDE 'patroncards-errors.inc' %]
71 <div class="yui-u first">
72 <h1>Upload additional images for patron cards</h1>
73 <p>Manage additional images to use as logo, decoration or background on a patron card layout.</p>
74 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
75 <fieldset class="brief">
76 <div class="hint">Only PNG, GIF, JPEG, XPM formats are supported. Maximum image size is 500KB.</div>
79 <label for="uploadfile">Select the file to upload: </label>
80 <input type="file" id="uploadfile" name="uploadfile" />
81 <input type="hidden" id="image" name="filetype" value="image" />
84 <label for="image_name">Image name: </label>
86 This will be the name by which you will refer to this image in the patron card layout editor.
89 To replace an image, delete it, upload a new file and give it the same image name.
92 <input type="text" id="image_name" name="image_name" size="20" />
96 <input type="hidden" name="op" value="upload" />
97 <input class="btn btn-default btn-default" id="uploadsu" type="submit" value="Upload" />
99 [% IF ( IMPORT_SUCCESSFUL ) %]
100 <div class="dialog message">
101 <h3>Image successfully uploaded</h3>
102 <ul><li>File: [% SOURCE_FILE %]</li>
103 <li>Image name: [% IMAGE_NAME %]</li></ul>
111 <h1>Delete Images</h1>
113 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
114 <fieldset class="brief">
116 Select one or more images to delete.
119 [% FOREACH TABL IN TABLE %]
121 [% IF ( TABL.header_fields ) %]
124 [% FOREACH header_field IN TABL.header_fields %]
125 [% SWITCH header_field.field_label -%]
133 <th>[% header_field.field_label %]</th>
139 [% FOREACH text_field IN TABL.text_fields %]
140 [% IF ( text_field.select_field ) %]
142 <a class="delete_image btn btn-default btn-xs" href="/cgi-bin/koha/patroncards/image-manage.pl?op=delete&image_id=[% text_field.field_value %]"><i class="fa fa-trash"></i> Delete</a>
144 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
145 [% ELSIF ( text_field.field_value ) %]
146 <td>[% text_field.field_value %]</td>
156 <input type="hidden" name="op" value="delete" />
157 <input class="btn btn-default btn-default" type="button" id="delete" value="Delete selected" />
159 [% IF ( DELETE_SUCCESSFULL ) %]
160 <div id="dialog" class="dialog message">
161 <h3>Image(s) successfully deleted</h3>
167 <fieldset class="brief">
169 No images are currently available.
171 [% IF ( DELETE_SUCCESSFULL ) %]
172 <div id="dialog" class="dialog message">
173 <h3>Image(s) successfully deleted</h3>
183 [% INCLUDE 'tools-menu.inc' %]
186 [% INCLUDE 'intranet-bottom.inc' %]