Line 0
Link Here
|
|
|
1 |
[% USE raw %] |
2 |
[% USE Koha %] |
3 |
[% USE KohaDates %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › Your holds history</title> |
6 |
[% INCLUDE 'doc-head-close.inc' %] |
7 |
[% BLOCK cssinclude %] |
8 |
<style> |
9 |
.controls { |
10 |
font-size: 75%; |
11 |
} |
12 |
|
13 |
.controls .paginate_button { |
14 |
font-family: 'FontAwesome'; |
15 |
text-decoration: none; |
16 |
} |
17 |
|
18 |
.controls .paginate_button:not(.disabled) { |
19 |
cursor: pointer; |
20 |
} |
21 |
|
22 |
.controls .paginate_button.disabled { |
23 |
color: grey; |
24 |
} |
25 |
|
26 |
.controls .previous:before { |
27 |
content: "\f104"; |
28 |
padding-right: .5em; |
29 |
} |
30 |
|
31 |
.controls .next:after { |
32 |
content: "\f105"; |
33 |
padding-left: .5em; |
34 |
} |
35 |
</style> |
36 |
[% END %] |
37 |
</head> |
38 |
[% INCLUDE 'bodytag.inc' bodyid='opac-holdshistory' %] |
39 |
[% INCLUDE 'masthead.inc' %] |
40 |
|
41 |
<div class="main"> |
42 |
<ul class="breadcrumb"> |
43 |
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li> |
44 |
<li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">›</span></li> |
45 |
<li><a href="#">Your holds history</a></li> |
46 |
</ul> |
47 |
|
48 |
<div class="container-fluid"> |
49 |
<div class="row-fluid"> |
50 |
<div class="span2"> |
51 |
<div id="navigation"> |
52 |
[% INCLUDE 'navigation.inc' IsPatronPage=1 %] |
53 |
</div> |
54 |
</div> |
55 |
<div class="span10"> |
56 |
<div id="userholdshistory"> |
57 |
<h3>Holds history</h3> |
58 |
|
59 |
[% IF READING_RECORD.size == 0 %] |
60 |
You have never placed a hold from this library. |
61 |
[% ELSE %] |
62 |
<div id="opac-user-holdsrec"> |
63 |
<div id="tabs-container" style="overflow:auto"> |
64 |
<div class="controls"> |
65 |
<div class="span3 info"> |
66 |
|
67 |
</div> |
68 |
<div class="span2"> |
69 |
<input type="text" class="search" placeholder="search" autofocus/> |
70 |
</div> |
71 |
<div class="span1"> |
72 |
<a class="paginate_button previous disabled" aria-controls="holdsrec" data-dt-idx="1">Previous</a> |
73 |
</div> |
74 |
<div class="span1"> |
75 |
<a class="paginate_button next disabled" aria-controls="holdsrec" data-dt-idx="1">Next</a> |
76 |
</div> |
77 |
</div> |
78 |
<table id="holdsrec" class="table table-bordered table-striped"> |
79 |
<thead> |
80 |
<tr> |
81 |
<th class="anti-the">Title</th> |
82 |
<th class="">Author</th> |
83 |
<th class="">Barcode</th> |
84 |
<th class="">Library</th> |
85 |
<th class="title-string">Hold date</th> |
86 |
<th class="title-string">Expiration date</th> |
87 |
<th class="title-string">Waiting date</th> |
88 |
<th class="title-string">Cancellation date</th> |
89 |
<th>Status</th> |
90 |
</tr> |
91 |
</thead> |
92 |
<tbody> |
93 |
|
94 |
</tbody> |
95 |
</table> |
96 |
<div class="controls"> |
97 |
<div class="span3 info"> |
98 |
|
99 |
</div> |
100 |
<div class="span1"> |
101 |
<a class="paginate_button previous disabled" aria-controls="holdsrec" data-dt-idx="1">Previous</a> |
102 |
</div> |
103 |
<div class="span1"> |
104 |
<a class="paginate_button next disabled" aria-controls="holdsrec" data-dt-idx="1">Next</a> |
105 |
</div> |
106 |
</div> |
107 |
</div> <!-- / .tabs-container --> |
108 |
</div> <!-- / .opac-user-readingrec --> |
109 |
[% END # / IF READING_RECORD.size %] |
110 |
</div> <!-- / .userreadingrecord --> |
111 |
</div> <!-- / .span10 --> |
112 |
</div> <!-- / .row-fluid --> |
113 |
</div> <!-- / .container-fluid --> |
114 |
</div> <!-- / .main --> |
115 |
|
116 |
[% INCLUDE 'opac-bottom.inc' %] |
117 |
[% BLOCK jsinclude %] |
118 |
[% INCLUDE 'datatables.inc' %] |
119 |
[% INCLUDE 'js-date-format.inc' %] |
120 |
<script> |
121 |
$(document).ready(function(){ |
122 |
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] |
123 |
$('#order').change(function() { |
124 |
$('#sortform').submit(); |
125 |
}); |
126 |
|
127 |
var table = $("#holdsrec").api({ |
128 |
"ajax": { |
129 |
"url": "/api/v1/public/patrons/[% borrowernumber | html %]/holds?old=true" |
130 |
}, |
131 |
"embed": [ |
132 |
"item", |
133 |
"biblio", |
134 |
"branch" |
135 |
], |
136 |
'pageLength': 20, |
137 |
'order': [[ 4, "desc" ]], |
138 |
"columnDefs": [ |
139 |
{ "targets": [ "nosort" ],"sortable": false,"searchable": false }, |
140 |
{ "type": "anti-the", "targets" : [ "anti-the" ] }, |
141 |
{ "type": "title-string", "targets" : [ "title-string" ] } |
142 |
], |
143 |
"columns": [ |
144 |
{ |
145 |
"data": "biblio.title", |
146 |
"render": function(data, type, row, meta) { |
147 |
if (type != 'display') return data; |
148 |
return '<a href="opac-detail.pl?biblionumber='+row.biblio_id+'">'+data+'</a>'; |
149 |
} |
150 |
}, |
151 |
{"data": "biblio.author"}, |
152 |
{ |
153 |
"data": "item.external_id", |
154 |
"render": function(data, type, row, meta) { |
155 |
if(data) return data; |
156 |
return ''; |
157 |
} |
158 |
}, |
159 |
{"data": "branch.name"}, |
160 |
{ |
161 |
"data": "hold_date", |
162 |
"render": function(data, type, row, meta) { |
163 |
return (data&&$date(data))||''; |
164 |
} |
165 |
}, |
166 |
{ |
167 |
"data": "expiration_date", |
168 |
"render": function(data, type, row, meta) { |
169 |
return (data&&$date(data))||''; |
170 |
} |
171 |
}, |
172 |
{ |
173 |
"data": "waiting_date", |
174 |
"render": function(data, type, row, meta) { |
175 |
return (data&&$date(data))||''; |
176 |
} |
177 |
}, |
178 |
{ |
179 |
"data": "cancelation_date", |
180 |
"render": function(data, type, row, meta) { |
181 |
return (data&&$date(data))||''; |
182 |
} |
183 |
}, |
184 |
{ |
185 |
"data": "status", |
186 |
"render": function(data, type, row, meta) { |
187 |
if (type != 'display') return data; |
188 |
if(row.cancelation_date) return _('Canceled'); |
189 |
if (data == 'F') return _('Fulfilled'); |
190 |
if (data == 'W') return _('Waiting'); |
191 |
if (data == 'T') return _('In Transit'); |
192 |
return _('Pending'); |
193 |
} |
194 |
} |
195 |
] |
196 |
}).DataTable(); |
197 |
|
198 |
table.on('draw.dt', function(event, settings) { |
199 |
var page_info = table.page.info(); |
200 |
$(".controls .info").html(page_info.pages?_("Showing page %s of %s").format(page_info.page+1, page_info.pages):''); |
201 |
if(!page_info.page||!page_info.pages) { |
202 |
$('.controls .previous').addClass('disabled'); |
203 |
} else { |
204 |
$('.controls .previous').removeClass('disabled'); |
205 |
} |
206 |
if(page_info.pages-1===page_info.page||!page_info.pages) { |
207 |
$('.controls .next').addClass('disabled'); |
208 |
} else { |
209 |
$('.controls .next').removeClass('disabled'); |
210 |
} |
211 |
}) |
212 |
|
213 |
$('.controls .previous').click(function() { |
214 |
table.page('previous').draw('page'); |
215 |
}); |
216 |
|
217 |
$('.controls .next').click(function() { |
218 |
table.page('next').draw('page'); |
219 |
}); |
220 |
function debounce(func, wait, immediate) { |
221 |
var timeout; |
222 |
return function() { |
223 |
var context = this, args = arguments; |
224 |
var later = function() { |
225 |
timeout = null; |
226 |
if (!immediate) func.apply(context, args); |
227 |
}; |
228 |
var callNow = immediate && !timeout; |
229 |
clearTimeout(timeout); |
230 |
timeout = setTimeout(later, wait); |
231 |
if (callNow) func.apply(context, args); |
232 |
}; |
233 |
}; |
234 |
|
235 |
$(".controls .search").keyup(debounce(function(event) { |
236 |
table.search(this.value).draw(); |
237 |
}, 300)); |
238 |
}); |
239 |
</script> |
240 |
[% END %] |