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 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this image?");
7 function DeleteConfirm() {
8 var results = selected_images("delete");
9 if (results.images != -1) {
10 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
11 var answer = confirm(msg);
13 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
16 return; // abort delete
20 function selected_images(op) {
21 var selected = new Array;
22 var image_ids = new Array;
23 if (document.delete_images.action.length) {
24 for (i=0;i<document.delete_images.action.length;i++){
25 if (document.delete_images.action[i].checked){
26 selected.push("image_id=" + document.delete_images.action[i].value);
27 image_ids.push(document.delete_images.action[i].value);
30 images = selected.join("&");
31 return {images:images, image_ids:image_ids};
33 else if (document.delete_images.action.checked){
34 return {images:"batch_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
36 alert(_("Please select image(s) to %s.").format(op));
39 $(document).ready(function() {
40 $("#delete").click(function(){
41 return DeleteConfirm();
47 <body id="pcard_image-manage" class="tools pcard">
48 [% INCLUDE 'header.inc' %]
49 [% INCLUDE 'cat-search.inc' %]
50 <div id="breadcrumbs">
51 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
52 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
53 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
56 <div id="doc3" class="yui-t2">
61 [% INCLUDE 'patroncards-toolbar.inc' %]
62 <div class="yui-u first">
66 [% INCLUDE 'patroncards-errors.inc' %]
68 <div class="yui-u first">
69 <h1>Upload images</h1>
70 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
71 <fieldset class="brief">
73 <b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported. Images <b>must</b> be less than 500KB.
77 <label for="uploadfile">Select the file to upload: </label>
78 <input type="file" id="uploadfile" name="uploadfile" />
79 <input type="hidden" id="image" name="filetype" value="image" />
82 <label for="image_name">Image name: </label>
84 This will be the name by which you will refer to this image in the patron card layout editor.
86 <input type="text" id="image_name" name="image_name" size="20" />
90 <input type="hidden" name="op" value="upload" />
91 <input class="btn btn-default" id="uploadsu" type="submit" value="Upload" />
93 [% IF ( IMPORT_SUCCESSFUL ) %]
94 <div class="dialog message">
95 <h3>Image successfully uploaded</h3>
96 <ul><li>File: [% SOURCE_FILE %]</li>
97 <li>Image name: [% IMAGE_NAME %]</li></ul>
105 <h1>Delete Images</h1>
107 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
108 <fieldset class="brief">
110 Select one or more images to delete.
113 [% FOREACH TABL IN TABLE %]
115 [% IF ( TABL.header_fields ) %]
118 [% FOREACH header_field IN TABL.header_fields %]
119 [% SWITCH header_field.field_label -%]
127 <th>[% header_field.field_label %]</th>
133 [% FOREACH text_field IN TABL.text_fields %]
134 [% IF ( text_field.select_field ) %]
136 <a class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);" href="/cgi-bin/koha/patroncards/image-manage.pl?op=delete&image_id=[% text_field.field_value %]"><icon class="fa fa-trash"></icon> Delete</a>
138 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
139 [% ELSIF ( text_field.field_value ) %]
140 <td>[% text_field.field_value %]</td>
150 <input type="hidden" name="op" value="delete" />
151 <input class="btn btn-default" type="button" id="delete" value="Delete selected" />
153 [% IF ( DELETE_SUCCESSFULL ) %]
154 <div id="dialog" class="dialog message">
155 <h3>Image(s) successfully deleted</h3>
161 <fieldset class="brief">
163 No images are currently available.
165 [% IF ( DELETE_SUCCESSFULL ) %]
166 <div id="dialog" class="dialog message">
167 <h3>Image(s) successfully deleted</h3>
177 [% INCLUDE 'tools-menu.inc' %]
180 [% INCLUDE 'intranet-bottom.inc' %]