2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Tools › Patron card creator › Images</title>
4 [% INCLUDE 'doc-head-close.inc' %]
7 <body id="pcard_image-manage" class="tools pcard">
8 [% INCLUDE 'header.inc' %]
9 [% INCLUDE 'cat-search.inc' %]
10 <div id="breadcrumbs">
11 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
12 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
13 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
17 <div class="main container-fluid">
19 <div class="col-sm-10 col-sm-push-2">
22 [% INCLUDE 'patroncards-toolbar.inc' %]
23 [% INCLUDE 'patroncards-errors.inc' %]
25 <div class="col-sm-6">
26 <h1>Upload additional images for patron cards</h1>
27 <p>Manage additional images to use as logo, decoration or background on a patron card layout.</p>
28 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
29 <fieldset class="brief">
30 <div class="hint">Only PNG, GIF, JPEG, XPM formats are supported. Maximum image size is 500KB.</div>
33 <label for="uploadfile">Select the file to upload: </label>
34 <input type="file" id="uploadfile" name="uploadfile" />
35 <input type="hidden" id="image" name="filetype" value="image" />
38 <label for="image_name">Image name: </label>
40 This will be the name by which you will refer to this image in the patron card layout editor.
43 To replace an image, delete it, upload a new file and give it the same image name.
46 <input type="text" id="image_name" name="image_name" size="20" />
50 <input type="hidden" name="op" value="upload" />
51 <input class="btn btn-default btn-default" id="uploadsu" type="submit" value="Upload" />
53 [% IF ( IMPORT_SUCCESSFUL ) %]
54 <div class="dialog message">
55 <h3>Image successfully uploaded</h3>
56 <ul><li>File: [% SOURCE_FILE | html %]</li>
57 <li>Image name: [% IMAGE_NAME | html %]</li></ul>
64 <div class="col-sm-6">
65 <h1>Delete Images</h1>
67 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
68 <fieldset class="brief">
70 Select one or more images to delete.
73 [% FOREACH TABL IN TABLE %]
75 [% IF ( TABL.header_fields ) %]
78 [% FOREACH header_field IN TABL.header_fields %]
79 [% SWITCH header_field.field_label -%]
87 <th>[% header_field.field_label | html %]</th>
93 [% FOREACH text_field IN TABL.text_fields %]
94 [% IF ( text_field.select_field ) %]
96 <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 | html %]"><i class="fa fa-trash"></i> Delete</a>
98 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>
99 [% ELSIF ( text_field.field_value ) %]
100 <td>[% text_field.field_value | html %]</td>
110 <input type="hidden" name="op" value="delete" />
111 <input class="btn btn-default btn-default" type="button" id="delete" value="Delete selected" />
113 [% IF ( DELETE_SUCCESSFULL ) %]
114 <div id="dialog" class="dialog message">
115 <h3>Image(s) successfully deleted</h3>
121 <fieldset class="brief">
123 No images are currently available.
125 [% IF ( DELETE_SUCCESSFULL ) %]
126 <div id="dialog" class="dialog message">
127 <h3>Image(s) successfully deleted</h3>
136 </div> <!-- /.col-sm-10.col-sm-push-2 -->
138 <div class="col-sm-2 col-sm-pull-10">
140 [% INCLUDE 'tools-menu.inc' %]
142 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
143 </div> <!-- /.row -->
145 [% MACRO jsinclude BLOCK %]
147 function DeleteConfirm() {
148 var results = selected_images("delete");
149 if (results.images) {
150 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
151 var answer = confirm(msg);
153 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
155 return; // abort delete
158 alert(_("Please select image(s) to delete."));
162 function selected_images(op) {
163 var selected = new Array;
164 var image_ids = new Array;
165 if (document.delete_images.action.length) {
166 for (i=0;i<document.delete_images.action.length;i++){
167 if (document.delete_images.action[i].checked){
168 selected.push("image_id=" + document.delete_images.action[i].value);
169 image_ids.push(document.delete_images.action[i].value);
172 images = selected.join("&");
173 return {images:images, image_ids:image_ids};
175 else if (document.delete_images.action.checked){
176 return {images:"image_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
180 $(document).ready(function() {
181 $("#delete").click(function(){
182 return DeleteConfirm();
184 $(".delete_image").on("click", function(){
185 return confirmDelete( _("Are you sure you want to delete this image?") );
191 [% INCLUDE 'intranet-bottom.inc' %]