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> ›
16 <div id="doc3" class="yui-t2">
21 [% INCLUDE 'patroncards-toolbar.inc' %]
22 <div class="yui-u first">
26 [% INCLUDE 'patroncards-errors.inc' %]
28 <div class="yui-u first">
29 <h1>Upload additional images for patron cards</h1>
30 <p>Manage additional images to use as logo, decoration or background on a patron card layout.</p>
31 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
32 <fieldset class="brief">
33 <div class="hint">Only PNG, GIF, JPEG, XPM formats are supported. Maximum image size is 500KB.</div>
36 <label for="uploadfile">Select the file to upload: </label>
37 <input type="file" id="uploadfile" name="uploadfile" />
38 <input type="hidden" id="image" name="filetype" value="image" />
41 <label for="image_name">Image name: </label>
43 This will be the name by which you will refer to this image in the patron card layout editor.
46 To replace an image, delete it, upload a new file and give it the same image name.
49 <input type="text" id="image_name" name="image_name" size="20" />
53 <input type="hidden" name="op" value="upload" />
54 <input class="btn btn-default btn-default" id="uploadsu" type="submit" value="Upload" />
56 [% IF ( IMPORT_SUCCESSFUL ) %]
57 <div class="dialog message">
58 <h3>Image successfully uploaded</h3>
59 <ul><li>File: [% SOURCE_FILE %]</li>
60 <li>Image name: [% IMAGE_NAME %]</li></ul>
68 <h1>Delete Images</h1>
70 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
71 <fieldset class="brief">
73 Select one or more images to delete.
76 [% FOREACH TABL IN TABLE %]
78 [% IF ( TABL.header_fields ) %]
81 [% FOREACH header_field IN TABL.header_fields %]
82 [% SWITCH header_field.field_label -%]
90 <th>[% header_field.field_label %]</th>
96 [% FOREACH text_field IN TABL.text_fields %]
97 [% IF ( text_field.select_field ) %]
99 <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>
101 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
102 [% ELSIF ( text_field.field_value ) %]
103 <td>[% text_field.field_value %]</td>
113 <input type="hidden" name="op" value="delete" />
114 <input class="btn btn-default btn-default" type="button" id="delete" value="Delete selected" />
116 [% IF ( DELETE_SUCCESSFULL ) %]
117 <div id="dialog" class="dialog message">
118 <h3>Image(s) successfully deleted</h3>
124 <fieldset class="brief">
126 No images are currently available.
128 [% IF ( DELETE_SUCCESSFULL ) %]
129 <div id="dialog" class="dialog message">
130 <h3>Image(s) successfully deleted</h3>
140 [% INCLUDE 'tools-menu.inc' %]
144 [% MACRO jsinclude BLOCK %]
146 function DeleteConfirm() {
147 var results = selected_images("delete");
148 if (results.images) {
149 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
150 var answer = confirm(msg);
152 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
154 return; // abort delete
157 alert(_("Please select image(s) to delete."));
161 function selected_images(op) {
162 var selected = new Array;
163 var image_ids = new Array;
164 if (document.delete_images.action.length) {
165 for (i=0;i<document.delete_images.action.length;i++){
166 if (document.delete_images.action[i].checked){
167 selected.push("image_id=" + document.delete_images.action[i].value);
168 image_ids.push(document.delete_images.action[i].value);
171 images = selected.join("&");
172 return {images:images, image_ids:image_ids};
174 else if (document.delete_images.action.checked){
175 return {images:"image_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
179 $(document).ready(function() {
180 $("#delete").click(function(){
181 return DeleteConfirm();
183 $(".delete_image").on("click", function(){
184 return confirmDelete( _("Are you sure you want to delete this image?") );
190 [% INCLUDE 'intranet-bottom.inc' %]