2 [% PROCESS 'i18n.inc' %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% FILTER collapse %]
6 [% t("Image manager") | html %] ›
7 [% t("Patron card creator") | html %] ›
8 [% t("Tools") | html %] ›
11 [% INCLUDE 'doc-head-close.inc' %]
14 <body id="pcard_image-manage" class="tools pcard">
15 [% WRAPPER 'header.inc' %]
16 [% INCLUDE 'cat-search.inc' %]
20 [% WRAPPER 'sub-header.inc' %]
21 [% WRAPPER breadcrumbs %]
22 [% WRAPPER breadcrumb_item %]
23 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
25 [% WRAPPER breadcrumb_item %]
26 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a>
28 [% WRAPPER breadcrumb_item bc_active= 1 %]
29 <span>Image manager</span>
31 [% END #/ WRAPPER breadcrumbs %]
32 [% END #/ WRAPPER sub-header.inc %]
34 <div class="main container-fluid">
36 <div class="col-sm-10 col-sm-push-2">
39 [% INCLUDE 'patroncards-toolbar.inc' %]
40 <h1>Image manager</h1>
41 [% INCLUDE 'patroncards-errors.inc' %]
43 <div class="col-sm-6">
44 <h2>Upload additional images for patron cards</h2>
45 <p>Manage additional images to use as logo, decoration or background on a patron card layout.</p>
46 <form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
47 <fieldset class="brief">
48 <div class="hint">Only PNG, GIF, JPEG, XPM formats are supported. Maximum image size is 2MB.</div>
51 <label for="uploadfile">Select the file to upload: </label>
52 <input type="file" id="uploadfile" name="uploadfile" />
53 <input type="hidden" id="image" name="filetype" value="image" />
56 <label for="image_name">Image name: </label>
58 This will be the name by which you will refer to this image in the patron card layout editor.
61 To replace an image, delete it, upload a new file and give it the same image name.
64 <input type="text" id="image_name" name="image_name" size="20" />
67 [% IF ( IMPORT_SUCCESSFUL ) %]
68 <div class="dialog message">
69 <h3>Image successfully uploaded</h3>
70 <ul><li>File: [% SOURCE_FILE | html %]</li>
71 <li>Image name: [% IMAGE_NAME | html %]</li></ul>
75 <fieldset class="action">
76 <input type="hidden" name="op" value="upload" />
77 <input class="btn btn-primary" id="uploadsu" type="submit" value="Upload" />
81 <div class="col-sm-6">
82 <h2>Delete images</h2>
84 <form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
85 <fieldset class="brief">
87 Select one or more images to delete.
90 [% FOREACH TABL IN TABLE %]
92 [% IF ( TABL.header_fields ) %]
95 [% FOREACH header_field IN TABL.header_fields %]
96 [% SWITCH header_field.field_label -%]
104 <th>[% header_field.field_label | html %]</th>
110 [% FOREACH text_field IN TABL.text_fields %]
111 [% IF ( text_field.select_field ) %]
113 <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-can"></i> Delete</a>
115 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>
116 [% ELSIF ( text_field.field_value ) %]
117 <td>[% text_field.field_value | html %]</td>
126 [% IF ( DELETE_SUCCESSFULL ) %]
127 <div id="dialog" class="dialog message">
128 <h3>Image(s) successfully deleted</h3>
132 <fieldset class="action">
133 <input type="hidden" name="op" value="delete" />
134 <input class="btn btn-primary" type="button" id="delete" value="Delete selected" />
138 <fieldset class="brief">
140 No images are currently available.
142 [% IF ( DELETE_SUCCESSFULL ) %]
143 <div id="dialog" class="dialog message">
144 <h3>Image(s) successfully deleted</h3>
153 </div> <!-- /.col-sm-10.col-sm-push-2 -->
155 <div class="col-sm-2 col-sm-pull-10">
157 [% INCLUDE 'tools-menu.inc' %]
159 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
160 </div> <!-- /.row -->
162 [% MACRO jsinclude BLOCK %]
164 function DeleteConfirm() {
165 var results = selected_images("delete");
166 if (results.images) {
167 var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
168 var answer = confirm(msg);
170 window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
172 return; // abort delete
175 alert(_("Please select image(s) to delete."));
179 function selected_images(op) {
180 var selected = new Array;
181 var image_ids = new Array;
182 if (document.delete_images.action.length) {
183 for (i=0;i<document.delete_images.action.length;i++){
184 if (document.delete_images.action[i].checked){
185 selected.push("image_id=" + document.delete_images.action[i].value);
186 image_ids.push(document.delete_images.action[i].value);
189 images = selected.join("&");
190 return {images:images, image_ids:image_ids};
192 else if (document.delete_images.action.checked){
193 return {images:"image_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
197 $(document).ready(function() {
198 $("#delete").click(function(){
199 return DeleteConfirm();
201 $(".delete_image").on("click", function(){
202 return confirmDelete( _("Are you sure you want to delete this image?") );
208 [% INCLUDE 'intranet-bottom.inc' %]