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 <nav 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 [% INCLUDE 'patroncards-errors.inc' %]
37 <div class="col-sm-6">
38 <h1>Upload additional images for patron cards</h1>
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 500KB.</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" />
62 <input type="hidden" name="op" value="upload" />
63 <input class="btn btn-default btn-default" id="uploadsu" type="submit" value="Upload" />
65 [% IF ( IMPORT_SUCCESSFUL ) %]
66 <div class="dialog message">
67 <h3>Image successfully uploaded</h3>
68 <ul><li>File: [% SOURCE_FILE | html %]</li>
69 <li>Image name: [% IMAGE_NAME | html %]</li></ul>
76 <div class="col-sm-6">
77 <h1>Delete Images</h1>
79 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
80 <fieldset class="brief">
82 Select one or more images to delete.
85 [% FOREACH TABL IN TABLE %]
87 [% IF ( TABL.header_fields ) %]
90 [% FOREACH header_field IN TABL.header_fields %]
91 [% SWITCH header_field.field_label -%]
99 <th>[% header_field.field_label | html %]</th>
105 [% FOREACH text_field IN TABL.text_fields %]
106 [% IF ( text_field.select_field ) %]
108 <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>
110 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>
111 [% ELSIF ( text_field.field_value ) %]
112 <td>[% text_field.field_value | html %]</td>
122 <input type="hidden" name="op" value="delete" />
123 <input class="btn btn-default btn-default" type="button" id="delete" value="Delete selected" />
125 [% IF ( DELETE_SUCCESSFULL ) %]
126 <div id="dialog" class="dialog message">
127 <h3>Image(s) successfully deleted</h3>
133 <fieldset class="brief">
135 No images are currently available.
137 [% IF ( DELETE_SUCCESSFULL ) %]
138 <div id="dialog" class="dialog message">
139 <h3>Image(s) successfully deleted</h3>
148 </div> <!-- /.col-sm-10.col-sm-push-2 -->
150 <div class="col-sm-2 col-sm-pull-10">
152 [% INCLUDE 'tools-menu.inc' %]
154 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
155 </div> <!-- /.row -->
157 [% MACRO jsinclude BLOCK %]
159 function DeleteConfirm() {
160 var results = selected_images("delete");
161 if (results.images) {
162 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
163 var answer = confirm(msg);
165 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
167 return; // abort delete
170 alert(_("Please select image(s) to delete."));
174 function selected_images(op) {
175 var selected = new Array;
176 var image_ids = new Array;
177 if (document.delete_images.action.length) {
178 for (i=0;i<document.delete_images.action.length;i++){
179 if (document.delete_images.action[i].checked){
180 selected.push("image_id=" + document.delete_images.action[i].value);
181 image_ids.push(document.delete_images.action[i].value);
184 images = selected.join("&");
185 return {images:images, image_ids:image_ids};
187 else if (document.delete_images.action.checked){
188 return {images:"image_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
192 $(document).ready(function() {
193 $("#delete").click(function(){
194 return DeleteConfirm();
196 $(".delete_image").on("click", function(){
197 return confirmDelete( _("Are you sure you want to delete this image?") );
203 [% INCLUDE 'intranet-bottom.inc' %]