Line 0
Link Here
|
|
|
1 |
[% USE Koha %] |
2 |
[% USE KohaDates %] |
3 |
[% USE Branches %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
<title>Home › Circulation › Issue Notes</title> |
6 |
[% INCLUDE 'doc-head-close.inc' %] |
7 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
8 |
[% INCLUDE 'datatables.inc' %] |
9 |
<script type="text/javascript"> |
10 |
//<![CDATA[ |
11 |
$(document).ready(function(){ |
12 |
$("#notestable").dataTable($.extend(true, {}, dataTablesDefaults, { |
13 |
"aoColumnDefs": [ |
14 |
{ "aTargets": [ 0, -1 ], "bSearchable": false, "bSortable": false }, |
15 |
], |
16 |
"sPaginationType": "four_button" |
17 |
})); |
18 |
|
19 |
$(".SelectAll").on("click", function(){ |
20 |
$("input[name='issue_ids'][type='checkbox']").prop("checked", true); |
21 |
$(".btn-sm").prop("disabled", false); |
22 |
}); |
23 |
|
24 |
$(".ClearAll").on("click", function(){ |
25 |
$("input[name='issue_ids'][type='checkbox']").prop("checked", false); |
26 |
$(".btn-sm").prop("disabled", true); |
27 |
}); |
28 |
|
29 |
$("#error").hide(); |
30 |
|
31 |
$("input[type='checkbox']").click(function(event){ |
32 |
if ( $("input[type='checkbox']").is(":checked") ) { |
33 |
$(".btn-sm").prop("disabled", false); |
34 |
} else { |
35 |
$(".btn-sm").prop("disabled", true); |
36 |
} |
37 |
}); |
38 |
|
39 |
$(".btn-xs").click(function(event){ |
40 |
event.preventDefault(); // prevent form submission |
41 |
var $action = $(this).attr("name"); |
42 |
var $issue_id = $(this).data('issue_id'); |
43 |
var ajaxData = { |
44 |
'action': $action, |
45 |
'issue_id': $issue_id, |
46 |
}; |
47 |
|
48 |
$.ajax({ |
49 |
url: '/cgi-bin/koha/svc/checkout_notes/', |
50 |
type: 'POST', |
51 |
dataType: 'json', |
52 |
data: ajaxData, |
53 |
}) |
54 |
|
55 |
.done(function(data){ |
56 |
if (data.status == 'success'){ |
57 |
if ( $action == 'notseen' ){ |
58 |
$("#status_" + $issue_id).text("Not seen"); |
59 |
$(event.target).siblings(".seen").prop("disabled", false); |
60 |
$(event.target).prop("disabled", true); |
61 |
} else { |
62 |
$("#status_" + $issue_id).text("Seen"); |
63 |
$(event.target).siblings(".notseen").prop("disabled", false); |
64 |
$(event.target).prop("disabled", true); |
65 |
} |
66 |
} else { |
67 |
$("#error").text(_("Unable to change status of note.")); |
68 |
$("#error").show(); |
69 |
} |
70 |
}); |
71 |
}); |
72 |
}); |
73 |
//]]> |
74 |
</script> |
75 |
[% INCLUDE 'calendar.inc' %] |
76 |
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> |
77 |
</head> |
78 |
[% INCLUDE 'header.inc' %] |
79 |
[% INCLUDE 'circ-search.inc' %] |
80 |
<div id="breadcrumbs"> |
81 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> › |
82 |
<a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › |
83 |
Checkout notes |
84 |
</div> |
85 |
|
86 |
<div id="doc" class="yui-t7"> <!-- <div id="doc3" class="yui-t2" --> |
87 |
<div id="bd"> |
88 |
<div id="yui-main"> |
89 |
|
90 |
<h1>Checkout notes</h1> |
91 |
|
92 |
<div class="dialog alert" id="error"></div> |
93 |
|
94 |
[% IF ( selected_count ) %] |
95 |
<div class="dialog message"> |
96 |
[% IF ( action == 'seen' ) %] |
97 |
[% selected_count %] note(s) marked as seen. |
98 |
[% ELSIF ( action == 'notseen' ) %] |
99 |
[% selected_count %] note(s) marked as not seen. |
100 |
[% ELSE %] |
101 |
Failed to change the status of [% selected_count %] item(s). |
102 |
[% END %] |
103 |
</div> |
104 |
<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> |
105 |
[% ELSE %] |
106 |
|
107 |
[% IF ( notes ) %] |
108 |
|
109 |
<fieldset class="action"> |
110 |
<a class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a class="ClearAll"><i class="fa fa-remove"></i> Clear all</a> |
111 |
</fieldset> |
112 |
|
113 |
<form id="mark_selected" method="post" action="/cgi-bin/koha/circ/checkout-notes.pl"> |
114 |
|
115 |
<table id="notestable"> |
116 |
<thead> |
117 |
<tr> |
118 |
<th> </th> |
119 |
<th>Title</th> |
120 |
<th>Note</th> |
121 |
<th>Date</th> |
122 |
<th>Set by</th> |
123 |
<th>Status</th> |
124 |
<th>Actions</th> |
125 |
</tr> |
126 |
</thead> |
127 |
<tbody> |
128 |
[% FOREACH note IN notes %] |
129 |
<tr> |
130 |
<td><input type="checkbox" name="issue_ids" value="[% note.issue_id %]"></td> |
131 |
<td>[% note.item.biblionumber.title %] - [% note.item.biblionumber.author %] (<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% note.item.biblionumber.biblionumber %]">[% note.item.barcode %]</a>)</td> |
132 |
<td>[% note.note %]</td> |
133 |
<td>[% note.notedate | $KohaDates %]</td> |
134 |
<td>[% note.borrower.firstname %] [% note.borrower.surname %] (<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% note.borrower.borrowernumber %]">[% note.borrower.cardnumber %]</a>)</td> |
135 |
<td>[% IF ( note.noteseen == 0 ) %] |
136 |
<span id="status_[% note.issue_id %]">Not seen</span> |
137 |
[% ELSIF ( note.noteseen == 1 ) %] |
138 |
<span id="status_[% note.issue_id %]">Seen</span> |
139 |
[% END %]</td> |
140 |
<td class="actions">[% IF ( note.noteseen == 1 ) %] |
141 |
<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> |
142 |
[% ELSIF ( note.noteseen == 0 ) %] |
143 |
<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> |
144 |
[% END %]</td> |
145 |
</tr> |
146 |
[% END %] |
147 |
</tbody> |
148 |
</table> |
149 |
|
150 |
<fieldset class="action"> |
151 |
<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> |
152 |
<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> |
153 |
</fieldset> |
154 |
|
155 |
</form> |
156 |
|
157 |
[% END %] <!-- notes --> |
158 |
|
159 |
[% END %] <!-- selected_count --> |
160 |
|
161 |
</div> <!-- yui-main --> |
162 |
</div> <!-- bd --> |
163 |
</div> <!-- doc3 --> |
164 |
|
165 |
[% INCLUDE 'intranet-bottom.inc' %] |