1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Tools › Patron card creator › Images</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
6 function DeleteConfirm() {
7 var results = selected_images("delete");
8 if (results.images != -1) {
9 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
10 var answer = confirm(msg);
12 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
15 return; // abort delete
19 function selected_images(op) {
20 var selected = new Array;
21 var image_ids = new Array;
22 if (document.delete_images.action.length) {
23 for (i=0;i<document.delete_images.action.length;i++){
24 if (document.delete_images.action[i].checked){
25 selected.push("image_id=" + document.delete_images.action[i].value);
26 image_ids.push(document.delete_images.action[i].value);
29 images = selected.join("&");
30 return {images:images, image_ids:image_ids};
32 else if (document.delete_images.action.checked){
33 return {images:"batch_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
35 alert(_("Please select image(s) to %s.").format(op));
38 $(document).ready(function() {
39 $("#delete").click(function(){
40 return DeleteConfirm();
42 $(".delete_image").on("click", function(){
43 return confirmDelete( _("Are you sure you want to delete this image?") );
49 <body id="pcard_image-manage" class="tools pcard">
50 [% INCLUDE 'header.inc' %]
51 [% INCLUDE 'cat-search.inc' %]
52 <div id="breadcrumbs">
53 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
54 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
55 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
58 <div id="doc3" class="yui-t2">
63 [% INCLUDE 'patroncards-toolbar.inc' %]
64 <div class="yui-u first">
68 [% INCLUDE 'patroncards-errors.inc' %]
70 <div class="yui-u first">
71 <h1>Upload images</h1>
72 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
73 <fieldset class="brief">
75 <b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported. Images <b>must</b> be less than 500KB.
79 <label for="uploadfile">Select the file to upload: </label>
80 <input type="file" id="uploadfile" name="uploadfile" />
81 <input type="hidden" id="image" name="filetype" value="image" />
84 <label for="image_name">Image name: </label>
86 This will be the name by which you will refer to this image in the patron card layout editor.
88 <input type="text" id="image_name" name="image_name" size="20" />
92 <input type="hidden" name="op" value="upload" />
93 <input class="btn btn-default" id="uploadsu" type="submit" value="Upload" />
95 [% IF ( IMPORT_SUCCESSFUL ) %]
96 <div class="dialog message">
97 <h3>Image successfully uploaded</h3>
98 <ul><li>File: [% SOURCE_FILE %]</li>
99 <li>Image name: [% IMAGE_NAME %]</li></ul>
107 <h1>Delete Images</h1>
109 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
110 <fieldset class="brief">
112 Select one or more images to delete.
115 [% FOREACH TABL IN TABLE %]
117 [% IF ( TABL.header_fields ) %]
120 [% FOREACH header_field IN TABL.header_fields %]
121 [% SWITCH header_field.field_label -%]
129 <th>[% header_field.field_label %]</th>
135 [% FOREACH text_field IN TABL.text_fields %]
136 [% IF ( text_field.select_field ) %]
138 <a class="delete_image btn btn-mini" href="/cgi-bin/koha/patroncards/image-manage.pl?op=delete&image_id=[% text_field.field_value %]"><i class="fa fa-trash"></i> Delete</a>
140 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
141 [% ELSIF ( text_field.field_value ) %]
142 <td>[% text_field.field_value %]</td>
152 <input type="hidden" name="op" value="delete" />
153 <input class="btn btn-default" type="button" id="delete" value="Delete selected" />
155 [% IF ( DELETE_SUCCESSFULL ) %]
156 <div id="dialog" class="dialog message">
157 <h3>Image(s) successfully deleted</h3>
163 <fieldset class="brief">
165 No images are currently available.
167 [% IF ( DELETE_SUCCESSFULL ) %]
168 <div id="dialog" class="dialog message">
169 <h3>Image(s) successfully deleted</h3>
179 [% INCLUDE 'tools-menu.inc' %]
182 [% INCLUDE 'intranet-bottom.inc' %]