3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Images › Patron card creator › Tools › Koha</title>
5 [% INCLUDE 'doc-head-close.inc' %]
8 <body id="pcard_image-manage" class="tools pcard">
9 [% WRAPPER 'header.inc' %]
10 [% INCLUDE 'cat-search.inc' %]
14 [% WRAPPER 'sub-header.inc' %]
15 [% WRAPPER breadcrumbs %]
16 [% WRAPPER breadcrumb_item %]
17 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
19 [% WRAPPER breadcrumb_item %]
20 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a>
22 [% WRAPPER breadcrumb_item bc_active= 1 %]
25 [% END #/ WRAPPER breadcrumbs %]
26 [% END #/ WRAPPER sub-header.inc %]
28 <div class="main container-fluid">
30 <div class="col-sm-10 col-sm-push-2">
33 [% INCLUDE 'patroncards-toolbar.inc' %]
34 <h1>Image manager</h1>
35 [% INCLUDE 'patroncards-errors.inc' %]
37 <div class="col-sm-6">
38 <h2>Upload additional images for patron cards</h2>
39 <p>Manage additional images to use as logo, decoration or background on a patron card layout.</p>
40 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
41 <fieldset class="brief">
42 <div class="hint">Only PNG, GIF, JPEG, XPM formats are supported. Maximum image size is 2MB.</div>
45 <label for="uploadfile">Select the file to upload: </label>
46 <input type="file" id="uploadfile" name="uploadfile" />
47 <input type="hidden" id="image" name="filetype" value="image" />
50 <label for="image_name">Image name: </label>
52 This will be the name by which you will refer to this image in the patron card layout editor.
55 To replace an image, delete it, upload a new file and give it the same image name.
58 <input type="text" id="image_name" name="image_name" size="20" />
61 [% IF ( IMPORT_SUCCESSFUL ) %]
62 <div class="dialog message">
63 <h3>Image successfully uploaded</h3>
64 <ul><li>File: [% SOURCE_FILE | html %]</li>
65 <li>Image name: [% IMAGE_NAME | html %]</li></ul>
69 <fieldset class="action">
70 <input type="hidden" name="op" value="upload" />
71 <input class="btn btn-primary" id="uploadsu" type="submit" value="Upload" />
75 <div class="col-sm-6">
76 <h2>Delete images</h2>
78 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
79 <fieldset class="brief">
81 Select one or more images to delete.
84 [% FOREACH TABL IN TABLE %]
86 [% IF ( TABL.header_fields ) %]
89 [% FOREACH header_field IN TABL.header_fields %]
90 [% SWITCH header_field.field_label -%]
98 <th>[% header_field.field_label | html %]</th>
104 [% FOREACH text_field IN TABL.text_fields %]
105 [% IF ( text_field.select_field ) %]
107 <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>
109 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>
110 [% ELSIF ( text_field.field_value ) %]
111 <td>[% text_field.field_value | html %]</td>
120 [% IF ( DELETE_SUCCESSFULL ) %]
121 <div id="dialog" class="dialog message">
122 <h3>Image(s) successfully deleted</h3>
126 <fieldset class="action">
127 <input type="hidden" name="op" value="delete" />
128 <input class="btn btn-primary" type="button" id="delete" value="Delete selected" />
132 <fieldset class="brief">
134 No images are currently available.
136 [% IF ( DELETE_SUCCESSFULL ) %]
137 <div id="dialog" class="dialog message">
138 <h3>Image(s) successfully deleted</h3>
147 </div> <!-- /.col-sm-10.col-sm-push-2 -->
149 <div class="col-sm-2 col-sm-pull-10">
151 [% INCLUDE 'tools-menu.inc' %]
153 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
154 </div> <!-- /.row -->
156 [% MACRO jsinclude BLOCK %]
158 function DeleteConfirm() {
159 var results = selected_images("delete");
160 if (results.images) {
161 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
162 var answer = confirm(msg);
164 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
166 return; // abort delete
169 alert(_("Please select image(s) to delete."));
173 function selected_images(op) {
174 var selected = new Array;
175 var image_ids = new Array;
176 if (document.delete_images.action.length) {
177 for (i=0;i<document.delete_images.action.length;i++){
178 if (document.delete_images.action[i].checked){
179 selected.push("image_id=" + document.delete_images.action[i].value);
180 image_ids.push(document.delete_images.action[i].value);
183 images = selected.join("&");
184 return {images:images, image_ids:image_ids};
186 else if (document.delete_images.action.checked){
187 return {images:"image_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
191 $(document).ready(function() {
192 $("#delete").click(function(){
193 return DeleteConfirm();
195 $(".delete_image").on("click", function(){
196 return confirmDelete( _("Are you sure you want to delete this image?") );
202 [% INCLUDE 'intranet-bottom.inc' %]