[% INCLUDE 'doc-head-open.inc' %]
- <title>Koha › Patron Card Creator › Manage Images</title>
+ <title>Koha › Tools › Patron card creator › Images</title>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">
//<![CDATA[
+ var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this image?");
function DeleteConfirm() {
var results = selected_images("delete");
if (results.images != -1) {
- var msg = "Are you sure you want to delete image(s): " + results.image_ids + "?";
+ var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
var answer = confirm(msg);
if (answer) {
window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
else if (document.delete_images.action.checked){
return {images:"batch_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
};
- alert(_("Please select image(s) to ") + op + ".");
+ alert(_("Please select image(s) to %s.").format(op));
return (-1);
};
- function showHideLayers(element, time, action) {
- setTimeout("changeVisibility('" + element + "','" + action + "')", time)
- }
- function changeVisibility(element, action) {
- document.getElementById(element).style.display=action;
- }
- </script>
- <script type="text/javascript">
- //<![CDATA[
$(document).ready(function() {
- $("#upload_cancel").empty();
- $("#delete_cancel").empty();
- $("#upload").empty();
- $("#delete").empty();
- buildButtons();
- showHideLayers('dialog', 5000, 'none')
- });
-
- function buildButtons() {
- new YAHOO.widget.Button({
- type: "link",
- label: _("Cancel"),
- id: "cancelul",
- href: "/cgi-bin/koha/patroncards/home.pl",
- container: "upload_cancel"
- });
-
- new YAHOO.widget.Button({
- type: "link",
- label: _("Cancel"),
- id: "canceldel",
- href: "/cgi-bin/koha/patroncards/home.pl",
- container: "delete_cancel"
+ $("#delete").click(function(){
+ return DeleteConfirm();
});
-
- new YAHOO.widget.Button({
- type: "submit",
- label: _("Upload"),
- id: "uploadsb",
- value: "upload",
- container: "upload"
- });
-
- var deleteButton = new YAHOO.widget.Button({
- type: "link",
- onclick: {fn: DeleteConfirm},
- label: _("Delete"),
- id: "deletesb",
- value: "delete",
- container: "delete",
- });
- }
+ });
+ //]]>
</script>
</head>
-<body>
+<body id="pcard_image-manage" class="tools pcard">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
- <a href="/cgi-bin/koha/patroncards/home.pl">Patron Card Creator</a> ›
- Manage Images
+ <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
+ Images
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
- [% INCLUDE 'error-messages.inc' %]
+ <div class="yui-g">
+ [% INCLUDE 'patroncards-toolbar.inc' %]
+ <div class="yui-u first">
+
+ </div>
+ </div>
+ [% INCLUDE 'patroncards-errors.inc' %]
<div class="yui-g">
<div class="yui-u first">
- <h1>Upload Images</h1>
- [% IF ( IMPORT_SUCCESSFUL ) %]
- <div id="dialog" class="dialog message">
- <li><h3>Image successfully uploaded.</h3></li>
- <li>File: [% SOURCE_FILE %]</li>
- <li>Image name: [% IMAGE_NAME %]</li>
- </div>
- [% END %]
+ <h1>Upload images</h1>
<form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
<fieldset class="brief">
<div class="hint">
<b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported. Images <b>must</b> be less than 500KB.
</div>
+ <ol>
<li>
<label for="uploadfile">Select the file to upload: </label>
<input type="file" id="uploadfile" name="uploadfile" />
</div>
<input type="text" id="image_name" name="image_name" size="20" />
</li>
+ </ol>
+ <div class="action">
+ <input type="hidden" name="op" value="upload" />
+ <input class="btn btn-default" id="uploadsu" type="submit" value="Upload" />
+ </div>
+ [% IF ( IMPORT_SUCCESSFUL ) %]
+ <div class="dialog message">
+ <h3>Image successfully uploaded</h3>
+ <ul><li>File: [% SOURCE_FILE %]</li>
+ <li>Image name: [% IMAGE_NAME %]</li></ul>
+ </div>
+ [% END %]
</fieldset>
- <fieldset class="action">
- <input type="hidden" name="op" value="upload" />
- <span id="upload"><input id="uploadsu" type="submit" value="upload" class="submit" /></span>
- <span id="upload_cancel"><a id="cancelul" href="/cgi-bin/koha/patroncards/home.pl" class="cancel">Cancel</a></span>
- </fieldset>
+
</form>
</div>
<div class="yui-u">
<h1>Delete Images</h1>
- [% IF ( DELETE_SUCCESSFULL ) %]
- <div id="dialog" class="dialog message">
- <li><h3>Image(s) successfully deleted.</h3></li>
- </div>
- [% END %]
[% IF ( TABLE ) %]
<form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
<fieldset class="brief">
<div class="hint">
Select one or more images to delete.
</div>
- <li>
<table>
[% FOREACH TABL IN TABLE %]
+
[% IF ( TABL.header_fields ) %]
+
<tr>
[% FOREACH header_field IN TABL.header_fields %]
- <th>[% header_field.field_label %]</th>
+ [% SWITCH header_field.field_label -%]
+ [% CASE "ID" %]
+ <th>Image ID</th>
+ [% CASE "Name" %]
+ <th>Name</th>
+ [% CASE " " %]
+ <th>Delete</th>
+ [% CASE %]
+ <th>[% header_field.field_label %]</th>
+ [% END %]
[% END %]
</tr>
[% ELSE %]
<tr>
[% FOREACH text_field IN TABL.text_fields %]
[% IF ( text_field.select_field ) %]
+ <td>
+ <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>
+ </td>
<td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
[% ELSIF ( text_field.field_value ) %]
<td>[% text_field.field_value %]</td>
[% END %]
[% END %]
</table>
- </li>
- </fieldset>
- <fieldset class="action">
- <input type="hidden" name="op" value="delete" />
- <span id="delete"><input id="deletesu" type="button" id="delete" onclick="DeleteConfirm()" value="Delete Image(s)" /></span>
- <span id="delete_cancel"><a id="canceldel" href="/cgi-bin/koha/patroncards/home.pl" class="cancel">Cancel</a></span>
+ <div class="action">
+ <input type="hidden" name="op" value="delete" />
+ <input class="btn btn-default" type="button" id="delete" value="Delete selected" />
+ </div>
+ [% IF ( DELETE_SUCCESSFULL ) %]
+ <div id="dialog" class="dialog message">
+ <h3>Image(s) successfully deleted</h3>
+ </div>
+ [% END %]
</fieldset>
</form>
[% ELSE %]
<div class="hint">
No images are currently available.
</div>
+ [% IF ( DELETE_SUCCESSFULL ) %]
+ <div id="dialog" class="dialog message">
+ <h3>Image(s) successfully deleted</h3>
+ </div>
+ [% END %]
</fieldset>
[% END %]
</div>
</div>
</div>
</div>
- <div class="yui-b noprint">
- [% INCLUDE 'patroncards-menu.inc' %]
+ <div class="yui-b">
+ [% INCLUDE 'tools-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]