|
Lines 49-57
Link Here
|
| 49 |
[% ELSIF patron.is_anonymous %] |
49 |
[% ELSIF patron.is_anonymous %] |
| 50 |
<div class="alert alert-warning">This is the anonymous patron, so no holds history is displayed.</div> |
50 |
<div class="alert alert-warning">This is the anonymous patron, so no holds history is displayed.</div> |
| 51 |
[% ELSE %] |
51 |
[% ELSE %] |
| 52 |
|
|
|
| 53 |
[% SET show_itemtype_column = Koha.Preference('AllowHoldItemTypeSelection') %] |
| 54 |
|
| 55 |
<div id="holdshistory" class="page-section"> |
52 |
<div id="holdshistory" class="page-section"> |
| 56 |
<h2 id="current_holds_heading">Current holds</h2> |
53 |
<h2 id="current_holds_heading">Current holds</h2> |
| 57 |
<p |
54 |
<p |
|
Lines 85-104
Link Here
|
| 85 |
<table id="table_holdshistory"> |
82 |
<table id="table_holdshistory"> |
| 86 |
<thead> |
83 |
<thead> |
| 87 |
<tr> |
84 |
<tr> |
| 88 |
<th class="anti-the">Title</th> |
85 |
<th data-colname="title" class="anti-the">Title</th> |
| 89 |
<th>Author</th> |
86 |
<th data-colname="author">Author</th> |
| 90 |
<th>Barcode</th> |
87 |
<th data-colname="barcode">Barcode</th> |
| 91 |
<th>Call number</th> |
88 |
<th data-colname="itemcallnumber">Call number</th> |
| 92 |
<th>Library</th> |
89 |
<th data-colname="branch">Library</th> |
| 93 |
<th>Hold date</th> |
90 |
<th data-colname="reservedate">Hold date</th> |
| 94 |
<th>Expiration date</th> |
91 |
<th data-colname="expirationdate">Expiration date</th> |
| 95 |
<th>Waiting date</th> |
92 |
<th data-colname="waitingdate">Waiting date</th> |
| 96 |
<th>Cancellation date</th> |
93 |
<th data-colname="cancellationdate">Cancellation date</th> |
| 97 |
[% IF show_itemtype_column %] |
94 |
<th data-colname="itemtype">Requested item type</th> |
| 98 |
<th>Requested item type</th> |
95 |
<th data-colname="status">Status</th> |
| 99 |
[% END %] |
96 |
<th data-colname="notes">Notes</th> |
| 100 |
<th>Status</th> |
|
|
| 101 |
<th>Notes</th> |
| 102 |
</tr> |
97 |
</tr> |
| 103 |
</thead> |
98 |
</thead> |
| 104 |
</table> |
99 |
</table> |
|
Lines 130-149
Link Here
|
| 130 |
<table id="table_oldholdshistory"> |
125 |
<table id="table_oldholdshistory"> |
| 131 |
<thead> |
126 |
<thead> |
| 132 |
<tr> |
127 |
<tr> |
| 133 |
<th class="anti-the">Title</th> |
128 |
<th data-colname="title" class="anti-the">Title</th> |
| 134 |
<th>Author</th> |
129 |
<th data-colname="author">Author</th> |
| 135 |
<th>Barcode</th> |
130 |
<th data-colname="barcode">Barcode</th> |
| 136 |
<th>Call number</th> |
131 |
<th data-colname="itemcallnumber">Call number</th> |
| 137 |
<th>Library</th> |
132 |
<th data-colname="branch">Library</th> |
| 138 |
<th>Hold date</th> |
133 |
<th data-colname="reservedate">Hold date</th> |
| 139 |
<th>Expiration date</th> |
134 |
<th data-colname="expirationdate">Expiration date</th> |
| 140 |
<th>Waiting date</th> |
135 |
<th data-colname="waitingdate">Waiting date</th> |
| 141 |
<th>Cancellation date</th> |
136 |
<th data-colname="cancellationdate">Cancellation date</th> |
| 142 |
[% IF show_itemtype_column %] |
137 |
<th data-colname="itemtype">Requested item type</th> |
| 143 |
<th>Requested item type</th> |
138 |
<th data-colname="status">Status</th> |
| 144 |
[% END %] |
139 |
<th data-colname="notes">Notes</th> |
| 145 |
<th>Status</th> |
|
|
| 146 |
<th>Notes</th> |
| 147 |
</tr> |
140 |
</tr> |
| 148 |
</thead> |
141 |
</thead> |
| 149 |
</table> |
142 |
</table> |
|
Lines 181-194
Link Here
|
| 181 |
item_types: all_item_types, |
174 |
item_types: all_item_types, |
| 182 |
libraries: all_libraries, |
175 |
libraries: all_libraries, |
| 183 |
}; |
176 |
}; |
|
|
177 |
|
| 178 |
const show_itemtype_column = [% Koha.Preference('AllowHoldItemTypeSelection') ? 1 : 0 %]; |
| 184 |
</script> |
179 |
</script> |
| 185 |
<script> |
180 |
<script> |
| 186 |
$(document).ready(function() { |
181 |
$(document).ready(function() { |
| 187 |
var table_settings = [% TablesSettings.GetTableSettings('members', 'holdshistory', 'holdshistory-table', 'json') | $raw %]; |
182 |
var table_settings = [% TablesSettings.GetTableSettings('members', 'holdshistory', 'holdshistory-table', 'json') | $raw %]; |
| 188 |
[% UNLESS show_itemtype_column %] |
183 |
|
| 189 |
//Remove item type column settings |
184 |
let item_type_column = table_settings.columns.find(c => c.columnname == 'itemtype'); |
| 190 |
table_settings['columns'] = table_settings['columns'].filter(function(c){return c['columnname'] != 'itemtype';}); |
185 |
if ( !show_itemtype_column ) { |
| 191 |
[% END %] |
186 |
item_type_column.is_hidden = 1; |
|
|
187 |
item_type_column.cannot_be_toggled = 1; |
| 188 |
} else { |
| 189 |
item_type_column.is_hidden = 0; |
| 190 |
} |
| 191 |
item_type_column.force_visibility = 1; |
| 192 |
|
192 |
|
| 193 |
let current_holds_table = build_holds_table("#table_holdshistory"); |
193 |
let current_holds_table = build_holds_table("#table_holdshistory"); |
| 194 |
let old_holds_table = build_holds_table("#table_oldholdshistory", 1); |
194 |
let old_holds_table = build_holds_table("#table_oldholdshistory", 1); |
|
Lines 323-329
Link Here
|
| 323 |
return $date(row.cancellation_date) |
323 |
return $date(row.cancellation_date) |
| 324 |
} |
324 |
} |
| 325 |
}, |
325 |
}, |
| 326 |
[% IF show_itemtype_column %] |
|
|
| 327 |
{ |
326 |
{ |
| 328 |
data: "item_type_id", |
327 |
data: "item_type_id", |
| 329 |
datatype: "coded_value:item_type", |
328 |
datatype: "coded_value:item_type", |
|
Lines 331-344
Link Here
|
| 331 |
searchable: true, |
330 |
searchable: true, |
| 332 |
orderable: true, |
331 |
orderable: true, |
| 333 |
render: function (data, type, row, meta) { |
332 |
render: function (data, type, row, meta) { |
| 334 |
if ( row.item_type_id ) { |
333 |
[% IF Koha.Preference('AllowHoldItemTypeSelection') %] |
| 335 |
return row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id; |
334 |
return ""; |
| 336 |
} else { |
335 |
[% ELSE %] |
| 337 |
return _("Any item type"); |
336 |
if ( row.item_type_id ) { |
| 338 |
} |
337 |
return row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id; |
|
|
338 |
} else { |
| 339 |
return _("Any item type"); |
| 340 |
} |
| 341 |
[% END %] |
| 339 |
} |
342 |
} |
| 340 |
}, |
343 |
}, |
| 341 |
[% END %] |
|
|
| 342 |
{ |
344 |
{ |
| 343 |
data: "status", |
345 |
data: "status", |
| 344 |
searchable: false, |
346 |
searchable: false, |
|
Lines 372-377
Link Here
|
| 372 |
} |
374 |
} |
| 373 |
}, |
375 |
}, |
| 374 |
], |
376 |
], |
|
|
377 |
bKohaColumnsUseNames: true, |
| 375 |
}, |
378 |
}, |
| 376 |
table_settings, |
379 |
table_settings, |
| 377 |
true, |
380 |
true, |
| 378 |
- |
|
|