2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Images › Patron card creator › Tools › Koha</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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
13 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
16 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
19 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a>
22 <a href="#" aria-current="page">
29 <div class="main container-fluid">
31 <div class="col-sm-10 col-sm-push-2">
34 [% INCLUDE 'patroncards-toolbar.inc' %]
35 <h1>Image manager</h1>
36 [% INCLUDE 'patroncards-errors.inc' %]
38 <div class="col-sm-6">
39 <h2>Upload additional images for patron cards</h2>
40 <p>Manage additional images to use as logo, decoration or background on a patron card layout.</p>
41 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
42 <fieldset class="brief">
43 <div class="hint">Only PNG, GIF, JPEG, XPM formats are supported. Maximum image size is 2MB.</div>
46 <label for="uploadfile">Select the file to upload: </label>
47 <input type="file" id="uploadfile" name="uploadfile" />
48 <input type="hidden" id="image" name="filetype" value="image" />
51 <label for="image_name">Image name: </label>
53 This will be the name by which you will refer to this image in the patron card layout editor.
56 To replace an image, delete it, upload a new file and give it the same image name.
59 <input type="text" id="image_name" name="image_name" size="20" />
63 <input type="hidden" name="op" value="upload" />
64 <input class="btn btn-default btn-default" id="uploadsu" type="submit" value="Upload" />
66 [% IF ( IMPORT_SUCCESSFUL ) %]
67 <div class="dialog message">
68 <h3>Image successfully uploaded</h3>
69 <ul><li>File: [% SOURCE_FILE | html %]</li>
70 <li>Image name: [% IMAGE_NAME | html %]</li></ul>
77 <div class="col-sm-6">
78 <h2>Delete images</h2>
80 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
81 <fieldset class="brief">
83 Select one or more images to delete.
86 [% FOREACH TABL IN TABLE %]
88 [% IF ( TABL.header_fields ) %]
91 [% FOREACH header_field IN TABL.header_fields %]
92 [% SWITCH header_field.field_label -%]
100 <th>[% header_field.field_label | html %]</th>
106 [% FOREACH text_field IN TABL.text_fields %]
107 [% IF ( text_field.select_field ) %]
109 <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>
111 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>
112 [% ELSIF ( text_field.field_value ) %]
113 <td>[% text_field.field_value | html %]</td>
123 <input type="hidden" name="op" value="delete" />
124 <input class="btn btn-default btn-default" type="button" id="delete" value="Delete selected" />
126 [% IF ( DELETE_SUCCESSFULL ) %]
127 <div id="dialog" class="dialog message">
128 <h3>Image(s) successfully deleted</h3>
134 <fieldset class="brief">
136 No images are currently available.
138 [% IF ( DELETE_SUCCESSFULL ) %]
139 <div id="dialog" class="dialog message">
140 <h3>Image(s) successfully deleted</h3>
149 </div> <!-- /.col-sm-10.col-sm-push-2 -->
151 <div class="col-sm-2 col-sm-pull-10">
153 [% INCLUDE 'tools-menu.inc' %]
155 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
156 </div> <!-- /.row -->
158 [% MACRO jsinclude BLOCK %]
160 function DeleteConfirm() {
161 var results = selected_images("delete");
162 if (results.images) {
163 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
164 var answer = confirm(msg);
166 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
168 return; // abort delete
171 alert(_("Please select image(s) to delete."));
175 function selected_images(op) {
176 var selected = new Array;
177 var image_ids = new Array;
178 if (document.delete_images.action.length) {
179 for (i=0;i<document.delete_images.action.length;i++){
180 if (document.delete_images.action[i].checked){
181 selected.push("image_id=" + document.delete_images.action[i].value);
182 image_ids.push(document.delete_images.action[i].value);
185 images = selected.join("&");
186 return {images:images, image_ids:image_ids};
188 else if (document.delete_images.action.checked){
189 return {images:"image_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
193 $(document).ready(function() {
194 $("#delete").click(function(){
195 return DeleteConfirm();
197 $(".delete_image").on("click", function(){
198 return confirmDelete( _("Are you sure you want to delete this image?") );
204 [% INCLUDE 'intranet-bottom.inc' %]