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 btn-sm" 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 btn-sm" 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">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 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
127 [% INCLUDE 'calendar.inc' %]
128 [% INCLUDE 'datatables.inc' %]
130 $(document).ready(function(){
131 $("#notestable").dataTable($.extend(true, {}, dataTablesDefaults, {
132 "order": [[ 1, "asc" ]],
134 { "orderable": false, "searchable": false, 'targets': [ 'NoSort' ] },
135 { "type": "title-string", "targets" : [ "title-string" ] },
136 { "type": "anti-the", "targets": [ "anti-the" ] }
138 "pagingType": "four_button"
141 $(".SelectAll").on("click", function(){
142 $("input[name='issue_ids'][type='checkbox']").prop("checked", true);
143 $(".btn-sm").prop("disabled", false);
146 $(".ClearAll").on("click", function(){
147 $("input[name='issue_ids'][type='checkbox']").prop("checked", false);
148 $(".btn-sm").prop("disabled", true);
151 $(".HideSeen").on("click", function(){
152 $(".seen1").parent().hide();
155 $(".ShowAll").on("click", function(){
161 $("input[type='checkbox']").click(function(event){
162 if ( $("input[type='checkbox']").is(":checked") ) {
163 $(".btn-sm").prop("disabled", false);
165 $(".btn-sm").prop("disabled", true);
169 $("button.seen, button.notseen").click(function(event){
170 event.preventDefault(); // prevent form submission
171 var $action = $(this).attr("name");
172 var $issue_id = $(this).data('issue_id');
175 'issue_id': $issue_id,
179 url: '/cgi-bin/koha/svc/checkout_notes/',
185 .done(function(data){
186 if (data.status == 'success'){
187 if ( $action == 'notseen' ){
188 $("#status_" + $issue_id).text(_("Not seen"));
189 $(event.target).parent().siblings(".seen1").removeClass("seen1").addClass("seen0");
190 $(event.target).siblings(".seen").prop("disabled", false);
191 $(event.target).prop("disabled", true);
193 $("#status_" + $issue_id).text(_("Seen"));
194 $(event.target).parent().siblings(".seen0").removeClass("seen0").addClass("seen1");
195 $(event.target).siblings(".notseen").prop("disabled", false);
196 $(event.target).prop("disabled", true);
199 $("#error").text(_("Unable to change status of note."));
203 .error(function(data){
204 $("#error").text(_("Unable to change status of note."));
212 [% INCLUDE 'intranet-bottom.inc' %]