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