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 [% WRAPPER 'header.inc' %]
9 [% INCLUDE 'cat-search.inc' %]
11 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
14 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
17 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
20 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a>
23 <a href="#" aria-current="page">
30 <div class="main container-fluid">
32 <div class="col-sm-10 col-sm-push-2">
35 [% INCLUDE 'patroncards-toolbar.inc' %]
36 <h1>Image manager</h1>
37 [% INCLUDE 'patroncards-errors.inc' %]
39 <div class="col-sm-6">
40 <h2>Upload additional images for patron cards</h2>
41 <p>Manage additional images to use as logo, decoration or background on a patron card layout.</p>
42 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
43 <fieldset class="brief">
44 <div class="hint">Only PNG, GIF, JPEG, XPM formats are supported. Maximum image size is 2MB.</div>
47 <label for="uploadfile">Select the file to upload: </label>
48 <input type="file" id="uploadfile" name="uploadfile" />
49 <input type="hidden" id="image" name="filetype" value="image" />
52 <label for="image_name">Image name: </label>
54 This will be the name by which you will refer to this image in the patron card layout editor.
57 To replace an image, delete it, upload a new file and give it the same image name.
60 <input type="text" id="image_name" name="image_name" size="20" />
64 <input type="hidden" name="op" value="upload" />
65 <input class="btn btn-default btn-default" id="uploadsu" type="submit" value="Upload" />
67 [% IF ( IMPORT_SUCCESSFUL ) %]
68 <div class="dialog message">
69 <h3>Image successfully uploaded</h3>
70 <ul><li>File: [% SOURCE_FILE | html %]</li>
71 <li>Image name: [% IMAGE_NAME | html %]</li></ul>
78 <div class="col-sm-6">
79 <h2>Delete images</h2>
81 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
82 <fieldset class="brief">
84 Select one or more images to delete.
87 [% FOREACH TABL IN TABLE %]
89 [% IF ( TABL.header_fields ) %]
92 [% FOREACH header_field IN TABL.header_fields %]
93 [% SWITCH header_field.field_label -%]
101 <th>[% header_field.field_label | html %]</th>
107 [% FOREACH text_field IN TABL.text_fields %]
108 [% IF ( text_field.select_field ) %]
110 <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>
112 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>
113 [% ELSIF ( text_field.field_value ) %]
114 <td>[% text_field.field_value | html %]</td>
124 <input type="hidden" name="op" value="delete" />
125 <input class="btn btn-default btn-default" type="button" id="delete" value="Delete selected" />
127 [% IF ( DELETE_SUCCESSFULL ) %]
128 <div id="dialog" class="dialog message">
129 <h3>Image(s) successfully deleted</h3>
135 <fieldset class="brief">
137 No images are currently available.
139 [% IF ( DELETE_SUCCESSFULL ) %]
140 <div id="dialog" class="dialog message">
141 <h3>Image(s) successfully deleted</h3>
150 </div> <!-- /.col-sm-10.col-sm-push-2 -->
152 <div class="col-sm-2 col-sm-pull-10">
154 [% INCLUDE 'tools-menu.inc' %]
156 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
157 </div> <!-- /.row -->
159 [% MACRO jsinclude BLOCK %]
161 function DeleteConfirm() {
162 var results = selected_images("delete");
163 if (results.images) {
164 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
165 var answer = confirm(msg);
167 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
169 return; // abort delete
172 alert(_("Please select image(s) to delete."));
176 function selected_images(op) {
177 var selected = new Array;
178 var image_ids = new Array;
179 if (document.delete_images.action.length) {
180 for (i=0;i<document.delete_images.action.length;i++){
181 if (document.delete_images.action[i].checked){
182 selected.push("image_id=" + document.delete_images.action[i].value);
183 image_ids.push(document.delete_images.action[i].value);
186 images = selected.join("&");
187 return {images:images, image_ids:image_ids};
189 else if (document.delete_images.action.checked){
190 return {images:"image_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
194 $(document).ready(function() {
195 $("#delete").click(function(){
196 return DeleteConfirm();
198 $(".delete_image").on("click", function(){
199 return confirmDelete( _("Are you sure you want to delete this image?") );
205 [% INCLUDE 'intranet-bottom.inc' %]