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");
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;
14 return; // abort delete
17 alert(_("Please select image(s) to delete."));
21 function selected_images(op) {
22 var selected = new Array;
23 var image_ids = new Array;
24 if (document.delete_images.action.length) {
25 for (i=0;i<document.delete_images.action.length;i++){
26 if (document.delete_images.action[i].checked){
27 selected.push("image_id=" + document.delete_images.action[i].value);
28 image_ids.push(document.delete_images.action[i].value);
31 images = selected.join("&");
32 return {images:images, image_ids:image_ids};
34 else if (document.delete_images.action.checked){
35 return {images:"image_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
39 $(document).ready(function() {
40 $("#delete").click(function(){
41 return DeleteConfirm();
43 $(".delete_image").on("click", function(){
44 return confirmDelete( _("Are you sure you want to delete this image?") );
50 <body id="pcard_image-manage" class="tools pcard">
51 [% INCLUDE 'header.inc' %]
52 [% INCLUDE 'cat-search.inc' %]
53 <div id="breadcrumbs">
54 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
55 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
56 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
59 <div id="doc3" class="yui-t2">
64 [% INCLUDE 'patroncards-toolbar.inc' %]
65 <div class="yui-u first">
69 [% INCLUDE 'patroncards-errors.inc' %]
71 <div class="yui-u first">
72 <h1>Upload images</h1>
73 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
74 <fieldset class="brief">
76 <b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported. Images <b>must</b> be less than 500KB.
80 <label for="uploadfile">Select the file to upload: </label>
81 <input type="file" id="uploadfile" name="uploadfile" />
82 <input type="hidden" id="image" name="filetype" value="image" />
85 <label for="image_name">Image name: </label>
87 This will be the name by which you will refer to this image in the patron card layout editor.
89 <input type="text" id="image_name" name="image_name" size="20" />
93 <input type="hidden" name="op" value="upload" />
94 <input class="btn btn-default btn-default" id="uploadsu" type="submit" value="Upload" />
96 [% IF ( IMPORT_SUCCESSFUL ) %]
97 <div class="dialog message">
98 <h3>Image successfully uploaded</h3>
99 <ul><li>File: [% SOURCE_FILE %]</li>
100 <li>Image name: [% IMAGE_NAME %]</li></ul>
108 <h1>Delete Images</h1>
110 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
111 <fieldset class="brief">
113 Select one or more images to delete.
116 [% FOREACH TABL IN TABLE %]
118 [% IF ( TABL.header_fields ) %]
121 [% FOREACH header_field IN TABL.header_fields %]
122 [% SWITCH header_field.field_label -%]
130 <th>[% header_field.field_label %]</th>
136 [% FOREACH text_field IN TABL.text_fields %]
137 [% IF ( text_field.select_field ) %]
139 <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 %]"><i class="fa fa-trash"></i> Delete</a>
141 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
142 [% ELSIF ( text_field.field_value ) %]
143 <td>[% text_field.field_value %]</td>
153 <input type="hidden" name="op" value="delete" />
154 <input class="btn btn-default btn-default" type="button" id="delete" value="Delete selected" />
156 [% IF ( DELETE_SUCCESSFULL ) %]
157 <div id="dialog" class="dialog message">
158 <h3>Image(s) successfully deleted</h3>
164 <fieldset class="brief">
166 No images are currently available.
168 [% IF ( DELETE_SUCCESSFULL ) %]
169 <div id="dialog" class="dialog message">
170 <h3>Image(s) successfully deleted</h3>
180 [% INCLUDE 'tools-menu.inc' %]
183 [% INCLUDE 'intranet-bottom.inc' %]