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