7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Circulation › Checkout notes</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="circ_checkout-notes" class="circ">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'circ-search.inc' %]
16 <div id="breadcrumbs">
17 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
18 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> ›
22 <div class="main container-fluid">
24 <div class="col-sm-12">
28 [% IF Koha.Preference('CircSidebar') %]
29 <div class="col-sm-10 col-sm-push-2">
31 <div class="col-md-12 col-lg-10 col-lg-offset-1">
34 <h1>Checkout notes</h1>
36 <div class="dialog alert" id="error" style="display:none;"></div>
38 [% IF ( selected_count ) %]
39 <div class="dialog message">
40 [% IF ( action == 'seen' ) %]
41 <span>[% selected_count | html %] note(s) marked as seen.</span>
42 [% ELSIF ( action == 'notseen' ) %]
43 <span>[% selected_count | html %] note(s) marked as not seen.</span>
45 <span>Failed to change the status of [% selected_count | html %] item(s).</span>
50 [% IF ( notes.count ) %]
51 <form id="mark_selected" method="post" action="/cgi-bin/koha/circ/checkout-notes.pl">
52 <div id="toolbar" class="btn-toolbar">
53 <button type="submit" class="btn btn-default markseen" name="mark_selected-seen" value="seen" disabled="disabled"><i class="fa fa-eye"></i> Mark seen</button>
54 <button type="submit" class="btn btn-default markseen" name="mark_selected-notseen" value="notseen" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button>
57 <fieldset class="action" style="cursor:pointer;">
58 <a class="SelectAll"><i class="fa fa-check"></i> Select all</a>
59 | <a class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
60 | <a class="HideSeen"><i class="fa fa-minus-square"></i> Hide seen</a>
61 | <a class="ShowAll"><i class="fa fa-bars"></i> Show all</a>
64 <table id="notestable">
67 <th class="NoSort"> </th>
68 <th class="anti-the">Title</th>
70 <th class="title-string">Date</th>
73 <th class="NoSort noExport">Actions</th>
77 [% FOREACH note IN notes %]
79 <td><input type="checkbox" name="issue_ids" value="[% note.issue_id | html %]"></td>
80 <td>[% note.item.biblio.title | html %] - [% note.item.biblio.author | html %] (<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% note.item.biblionumber | uri %]">[% note.item.barcode | html %]</a>)</td>
81 <td>[% note.note | html %]</td>
82 <td><span title="[% note.notedate | html %]">[% note.notedate | $KohaDates %]</span></td>
83 <td>[% INCLUDE 'patron-title.inc' patron => note.patron hide_patron_infos_if_needed=1 %]</td>
84 <td class="seen[% note.noteseen | html %]">
85 [% IF ( note.noteseen == 0 ) %]
86 <span id="status_[% note.issue_id | html %]">Not seen</span>
87 [% ELSIF ( note.noteseen == 1 ) %]
88 <span id="status_[% note.issue_id | html %]">Seen</span>
92 [% IF ( note.noteseen == 1 ) %]
93 <button name="seen" data-issue_id="[% note.issue_id | html %]" 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 | html %]" class="notseen btn btn-default btn-xs"><i class="fa fa-eye-slash"></i> Mark not seen</button>
94 [% ELSIF ( note.noteseen == 0 ) %]
95 <button name="seen" data-issue_id="[% note.issue_id | html %]" 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 | html %]" class="notseen btn btn-default btn-xs" disabled="disabled"><i class="fa fa-eye-slash"></i> Mark not seen</button>
106 <div class="dialog message">There are currently no checkout notes.</div>
107 [% END %] <!-- notes -->
109 [% IF Koha.Preference('CircSidebar') %]
110 </div> <!-- /.col-sm-10.col-sm-push-2 -->
111 <div class="col-sm-2 col-sm-pull-10">
113 [% INCLUDE 'circ-nav.inc' %]
115 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
117 </div> <!-- .col-md-12.col-lg-10.col-lg-offset-1 -->
120 </div> <!-- /.row -->
122 </div> <!-- /.col-sm-12 -->
123 </div> <!-- /.row -->
125 [% MACRO jsinclude BLOCK %]
126 [% INCLUDE 'calendar.inc' %]
127 [% INCLUDE 'datatables.inc' %]
129 $(document).ready(function(){
130 $("#notestable").dataTable($.extend(true, {}, dataTablesDefaults, {
131 "order": [[ 1, "asc" ]],
133 { "orderable": false, "searchable": false, 'targets': [ 'NoSort' ] },
134 { "type": "title-string", "targets" : [ "title-string" ] },
135 { "type": "anti-the", "targets": [ "anti-the" ] }
140 $(".SelectAll").on("click", function(){
141 $("input[name='issue_ids'][type='checkbox']").prop("checked", true);
142 $(".markseen").prop("disabled", false);
145 $(".ClearAll").on("click", function(){
146 $("input[name='issue_ids'][type='checkbox']").prop("checked", false);
147 $(".markseen").prop("disabled", true);
150 $(".HideSeen").on("click", function(){
151 $(".seen1").parent().hide();
154 $(".ShowAll").on("click", function(){
160 $("#notestable").on("change", "input[type='checkbox']", function(){
161 if ( $("input[type='checkbox']").is(":checked") ) {
162 $(".markseen").prop("disabled", false);
164 $(".markseen").prop("disabled", true);
168 $("#notestable").on("click", "button.seen, button.notseen", function(event){
169 event.preventDefault(); // prevent form submission
170 var $action = $(this).attr("name");
171 var $issue_id = $(this).data('issue_id');
174 'issue_id': $issue_id,
178 url: '/cgi-bin/koha/svc/checkout_notes/',
184 .done(function(data){
185 if (data.status == 'success'){
186 if ( $action == 'notseen' ){
187 $("#status_" + $issue_id).text(_("Not seen"));
188 $(event.target).parent().siblings(".seen1").removeClass("seen1").addClass("seen0");
189 $(event.target).siblings(".seen").prop("disabled", false);
190 $(event.target).prop("disabled", true);
192 $("#status_" + $issue_id).text(_("Seen"));
193 $(event.target).parent().siblings(".seen0").removeClass("seen0").addClass("seen1");
194 $(event.target).siblings(".notseen").prop("disabled", false);
195 $(event.target).prop("disabled", true);
198 $("#error").text(_("Unable to change status of note."));
202 .error(function(data){
203 $("#error").text(_("Unable to change status of note."));
211 [% INCLUDE 'intranet-bottom.inc' %]