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-holdsrecord' %] |
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="userholdsrecord"> |
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 |
'order': [[ 4, "desc" ]], |
137 |
"columnDefs": [ |
138 |
{ "targets": [ "nosort" ],"sortable": false,"searchable": false }, |
139 |
{ "type": "anti-the", "targets" : [ "anti-the" ] }, |
140 |
{ "type": "title-string", "targets" : [ "title-string" ] } |
141 |
], |
142 |
"columns": [ |
143 |
{ |
144 |
"data": "biblio.title", |
145 |
"render": function(data, type, row, meta) { |
146 |
if (type != 'display') return data; |
147 |
return '<a href="opac-detail.pl?biblionumber='+row.biblio_id+'">'+data+'</a>'; |
148 |
} |
149 |
}, |
150 |
{"data": "biblio.author"}, |
151 |
{ |
152 |
"data": "item.external_id", |
153 |
"render": function(data, type, row, meta) { |
154 |
if(data) return data; |
155 |
return ''; |
156 |
} |
157 |
}, |
158 |
{"data": "branch.name"}, |
159 |
{ |
160 |
"data": "hold_date", |
161 |
"render": function(data, type, row, meta) { |
162 |
return (data&&$date(data))||''; |
163 |
} |
164 |
}, |
165 |
{ |
166 |
"data": "expiration_date", |
167 |
"render": function(data, type, row, meta) { |
168 |
return (data&&$date(data))||''; |
169 |
} |
170 |
}, |
171 |
{ |
172 |
"data": "waiting_date", |
173 |
"render": function(data, type, row, meta) { |
174 |
return (data&&$date(data))||''; |
175 |
} |
176 |
}, |
177 |
{ |
178 |
"data": "cancelation_date", |
179 |
"render": function(data, type, row, meta) { |
180 |
return (data&&$date(data))||''; |
181 |
} |
182 |
}, |
183 |
{ |
184 |
"data": "status", |
185 |
"render": function(data, type, row, meta) { |
186 |
if (type != 'display') return data; |
187 |
if(row.cancelation_date) return 'Canceled'; |
188 |
if (data == 'F') return 'Fulfilled'; |
189 |
if (data == 'W') return 'Waiting'; |
190 |
if (data == 'T') return 'In Transit'; |
191 |
return 'Pending'; |
192 |
} |
193 |
} |
194 |
] |
195 |
}).DataTable(); |
196 |
|
197 |
table.on('draw.dt', function(event, settings) { |
198 |
var page_info = table.page.info(); |
199 |
$(".controls .info").html(_("Showing page %s of %s").format(page_info.page+1, page_info.pages)); |
200 |
if(!page_info.page) { |
201 |
$('.controls .previous').addClass('disabled'); |
202 |
} else { |
203 |
$('.controls .previous').removeClass('disabled'); |
204 |
} |
205 |
if(page_info.pages-1===page_info.page) { |
206 |
$('.controls .next').addClass('disabled'); |
207 |
} else { |
208 |
$('.controls .next').removeClass('disabled'); |
209 |
} |
210 |
}) |
211 |
|
212 |
$('.controls .previous').click(function() { |
213 |
table.page('previous').draw('page'); |
214 |
}); |
215 |
|
216 |
$('.controls .next').click(function() { |
217 |
table.page('next').draw('page'); |
218 |
}); |
219 |
function debounce(func, wait, immediate) { |
220 |
var timeout; |
221 |
return function() { |
222 |
var context = this, args = arguments; |
223 |
var later = function() { |
224 |
timeout = null; |
225 |
if (!immediate) func.apply(context, args); |
226 |
}; |
227 |
var callNow = immediate && !timeout; |
228 |
clearTimeout(timeout); |
229 |
timeout = setTimeout(later, wait); |
230 |
if (callNow) func.apply(context, args); |
231 |
}; |
232 |
}; |
233 |
|
234 |
$(".controls .search").keypress(debounce(function(event) { |
235 |
table.search(this.value).draw(); |
236 |
}, 300)); |
237 |
}); |
238 |
</script> |
239 |
[% END %] |