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 |
{"data": "hold_date"}, |
160 |
{ |
161 |
"data": "expiration_date", |
162 |
"render": function(data, type, row, meta) { |
163 |
return (data&&$date(data))||''; |
164 |
} |
165 |
}, |
166 |
{ |
167 |
"data": "waiting_date", |
168 |
"render": function(data, type, row, meta) { |
169 |
return (data&&$date(data))||''; |
170 |
} |
171 |
}, |
172 |
{ |
173 |
"data": "cancelation_date", |
174 |
"render": function(data, type, row, meta) { |
175 |
return (data&&$date(data))||''; |
176 |
} |
177 |
}, |
178 |
{ |
179 |
"data": "status", |
180 |
"render": function(data, type, row, meta) { |
181 |
if (type != 'display') return data; |
182 |
if(row.cancelation_date) return 'Canceled'; |
183 |
if (data == 'F') return 'Fulfilled'; |
184 |
if (data == 'W') return 'Waiting'; |
185 |
if (data == 'T') return 'In Transit'; |
186 |
return 'Pending'; |
187 |
} |
188 |
} |
189 |
] |
190 |
}).DataTable(); |
191 |
|
192 |
table.on('draw.dt', function(event, settings) { |
193 |
var page_info = table.page.info(); |
194 |
$(".controls .info").html(_("Showing page %s of %s").format(page_info.page+1, page_info.pages)); |
195 |
if(!page_info.page) { |
196 |
$('.controls .previous').addClass('disabled'); |
197 |
} else { |
198 |
$('.controls .previous').removeClass('disabled'); |
199 |
} |
200 |
if(page_info.pages-1===page_info.page) { |
201 |
$('.controls .next').addClass('disabled'); |
202 |
} else { |
203 |
$('.controls .next').removeClass('disabled'); |
204 |
} |
205 |
}) |
206 |
|
207 |
$('.controls .previous').click(function() { |
208 |
table.page('previous').draw('page'); |
209 |
}); |
210 |
|
211 |
$('.controls .next').click(function() { |
212 |
table.page('next').draw('page'); |
213 |
}); |
214 |
function debounce(func, wait, immediate) { |
215 |
var timeout; |
216 |
return function() { |
217 |
var context = this, args = arguments; |
218 |
var later = function() { |
219 |
timeout = null; |
220 |
if (!immediate) func.apply(context, args); |
221 |
}; |
222 |
var callNow = immediate && !timeout; |
223 |
clearTimeout(timeout); |
224 |
timeout = setTimeout(later, wait); |
225 |
if (callNow) func.apply(context, args); |
226 |
}; |
227 |
}; |
228 |
|
229 |
$(".controls .search").keypress(debounce(function(event) { |
230 |
table.search(this.value).draw(); |
231 |
}, 300)); |
232 |
}); |
233 |
</script> |
234 |
[% END %] |