Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt
Aleisha Amohia ac4014d21b Bug 17698: (follow-up) Fixing some small issues
Fixing the comments in Comment 42

Ready to test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-07-23 15:23:42 +00:00

182 lines
8.6 KiB
Text

[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Home &rsaquo; Circulation &rsaquo; Checkout notes</title>
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
</head>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
<a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo;
Checkout notes
</div>
[% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc" class="yui-t7">[% END %]
<div id="bd">
<div id="yui-main">
[% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %]
<h1>Checkout notes</h1>
<div class="dialog alert" id="error"></div>
[% IF ( selected_count ) %]
<div class="dialog message">
[% IF ( action == 'seen' ) %]
[% selected_count %] note(s) marked as seen.
[% ELSIF ( action == 'notseen' ) %]
[% selected_count %] note(s) marked as not seen.
[% ELSE %]
Failed to change the status of [% selected_count %] item(s).
[% END %]
</div>
<a href="/cgi-bin/koha/circ/checkout-notes.pl" class="btn btn-default btn-sm"><i class="fa fa-left"></i> Return to checkout notes</a>
[% ELSE %]
[% IF ( notes ) %]
<fieldset class="action">
<a class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
</fieldset>
<form id="mark_selected" method="post" action="/cgi-bin/koha/circ/checkout-notes.pl">
<table id="notestable">
<thead>
<tr>
<th>&nbsp;</th>
<th>Title</th>
<th>Note</th>
<th>Date</th>
<th>Set by</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
[% FOREACH note IN notes %]
<tr>
<td><input type="checkbox" name="issue_ids" value="[% note.issue_id %]"></td>
<td>[% note.item.biblio.title %] - [% note.item.biblio.author %] (<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% note.item.biblionumber %]">[% note.item.barcode %]</a>)</td>
<td>[% note.note %]</td>
<td>[% note.notedate | $KohaDates %]</td>
<td>[% IF note.patron.title %][% note.patron.title %][% END %][% note.patron.firstname %] [% note.patron.surname %] (<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% note.patron.borrowernumber %]">[% note.patron.cardnumber %]</a>)</td>
<td>
[% IF ( note.noteseen == 0 ) %]
<span id="status_[% note.issue_id %]">Not seen</span>
[% ELSIF ( note.noteseen == 1 ) %]
<span id="status_[% note.issue_id %]">Seen</span>
[% END %]
</td>
<td class="actions">
[% IF ( note.noteseen == 1 ) %]
<button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs"><i class="fa fa-eye-slash"></i> Mark not seen</button>
[% ELSIF ( note.noteseen == 0 ) %]
<button name="seen" data-issue_id="[% note.issue_id %]" class="seen btn btn-default btn-xs"><i class="fa fa-eye"></i> Mark seen</button> <button name="notseen" data-issue_id="[% note.issue_id %]" class="notseen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button>
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
<fieldset class="action">
<button type="submit" class="btn btn-default btn-sm" name="mark_selected-seen" value="seen" disabled="disabled"><i class="fa fa-eye"></i> Mark seen</button>
<button type="submit" class="btn btn-default btn-sm" name="mark_selected-notseen" value="notseen" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button>
</fieldset>
</form>
[% END %] <!-- notes -->
[% END %] <!-- selected_count -->
</div> <!-- yui-main -->
[% IF Koha.Preference('CircSidebar') %]
</div>
<div class="yui-b noprint">
[% INCLUDE 'circ-nav.inc' %]
</div>
[% END %]
</div> <!-- bd -->
</div> <!-- doc3 -->
[% MACRO jsinclude BLOCK %]
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min_[% KOHA_VERSION %].js"></script>
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$("#notestable").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ 0, -1 ], "bSearchable": false, "bSortable": false },
],
"sPaginationType": "four_button"
}));
$(".SelectAll").on("click", function(){
$("input[name='issue_ids'][type='checkbox']").prop("checked", true);
$(".btn-sm").prop("disabled", false);
});
$(".ClearAll").on("click", function(){
$("input[name='issue_ids'][type='checkbox']").prop("checked", false);
$(".btn-sm").prop("disabled", true);
});
$("#error").hide();
$("input[type='checkbox']").click(function(event){
if ( $("input[type='checkbox']").is(":checked") ) {
$(".btn-sm").prop("disabled", false);
} else {
$(".btn-sm").prop("disabled", true);
}
});
$(".btn-xs").click(function(event){
event.preventDefault(); // prevent form submission
var $action = $(this).attr("name");
var $issue_id = $(this).data('issue_id');
var ajaxData = {
'action': $action,
'issue_id': $issue_id,
};
$.ajax({
url: '/cgi-bin/koha/svc/checkout_notes/',
type: 'POST',
dataType: 'json',
data: ajaxData,
})
.done(function(data){
if (data.status == 'success'){
if ( $action == 'notseen' ){
$("#status_" + $issue_id).text(_("Not seen"));
$(event.target).siblings(".seen").prop("disabled", false);
$(event.target).prop("disabled", true);
} else {
$("#status_" + $issue_id).text(_("Seen"));
$(event.target).siblings(".notseen").prop("disabled", false);
$(event.target).prop("disabled", true);
}
} else {
$("#error").text(_("Unable to change status of note."));
$("#error").show();
}
});
});
});
//]]>
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]