|
Lines 4-9
Link Here
|
| 4 |
[% USE KohaDates %] |
4 |
[% USE KohaDates %] |
| 5 |
[% USE Branches %] |
5 |
[% USE Branches %] |
| 6 |
[% USE TablesSettings %] |
6 |
[% USE TablesSettings %] |
|
|
7 |
[% USE AuthorisedValues %] |
| 7 |
[% SET footerjs = 1 %] |
8 |
[% SET footerjs = 1 %] |
| 8 |
[% INCLUDE 'doc-head-open.inc' %] |
9 |
[% INCLUDE 'doc-head-open.inc' %] |
| 9 |
<title>Koha › Circulation › Holds awaiting pickup</title> |
10 |
<title>Koha › Circulation › Holds awaiting pickup</title> |
|
Lines 63-68
Link Here
|
| 63 |
[% END %] |
64 |
[% END %] |
| 64 |
[% END %] |
65 |
[% END %] |
| 65 |
[% ELSE %] |
66 |
[% ELSE %] |
|
|
67 |
[% IF enqueued %] |
| 68 |
<div class="dialog message"> |
| 69 |
<p>The job has been enqueued! It will be processed as soon as possible.</p> |
| 70 |
<p><a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a></p> |
| 71 |
</div> |
| 72 |
[% END %] |
| 66 |
<div id="resultlist" class="toptabs"> |
73 |
<div id="resultlist" class="toptabs"> |
| 67 |
<ul> |
74 |
<ul> |
| 68 |
<li><a href="#holdswaiting">Holds waiting: [% reservecount | html %]</a></li> |
75 |
<li><a href="#holdswaiting">Holds waiting: [% reservecount | html %]</a></li> |
|
Lines 74-80
Link Here
|
| 74 |
</ul> |
81 |
</ul> |
| 75 |
<div id="holdswaiting"> |
82 |
<div id="holdswaiting"> |
| 76 |
[% IF ( reserveloop ) %] |
83 |
[% IF ( reserveloop ) %] |
| 77 |
[% INCLUDE waiting_holds.inc table_name='holdst' reserveloop=reserveloop tab='holdwaiting' %] |
84 |
<div id="toolbar" class="btn-toolbar"> |
|
|
85 |
<button class="cancel_selected_holds" data-bulk="true"></button> |
| 86 |
</div> |
| 87 |
[% INCLUDE waiting_holds.inc select_column='1' table_name='holdst' reserveloop=reserveloop tab='holdwaiting' %] |
| 78 |
[% ELSE %] |
88 |
[% ELSE %] |
| 79 |
<div class="dialog message">No holds found.</div> |
89 |
<div class="dialog message">No holds found.</div> |
| 80 |
[% END %] |
90 |
[% END %] |
|
Lines 83-88
Link Here
|
| 83 |
[% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.</p>[% END %] |
93 |
[% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.</p>[% END %] |
| 84 |
[% IF ( overloop ) %] |
94 |
[% IF ( overloop ) %] |
| 85 |
<span id="holdsover-cancel-all"> |
95 |
<span id="holdsover-cancel-all"> |
|
|
96 |
<button class="cancel_selected_holds" data-bulk="true"></button> |
| 86 |
<form name="cancelAllReserve" action="waitingreserves.pl" method="post"> |
97 |
<form name="cancelAllReserve" action="waitingreserves.pl" method="post"> |
| 87 |
<input type="hidden" name="cancelall" value="1" /> |
98 |
<input type="hidden" name="cancelall" value="1" /> |
| 88 |
<input type="hidden" name="allbranches" value="[% allbranches | html %]" /> |
99 |
<input type="hidden" name="allbranches" value="[% allbranches | html %]" /> |
|
Lines 96-103
Link Here
|
| 96 |
[% UNLESS TransferWhenCancelAllWaitingHolds %] |
107 |
[% UNLESS TransferWhenCancelAllWaitingHolds %] |
| 97 |
Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds syspref) |
108 |
Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds syspref) |
| 98 |
[% END %] |
109 |
[% END %] |
|
|
110 |
|
| 99 |
</span> |
111 |
</span> |
| 100 |
[% INCLUDE waiting_holds.inc table_name='holdso' reserveloop=overloop tab='holdsover' %] |
112 |
[% INCLUDE waiting_holds.inc select_column='1' table_name='holdso' reserveloop=overloop tab='holdsover' %] |
| 101 |
[% ELSE %] |
113 |
[% ELSE %] |
| 102 |
<div class="dialog message">No holds found.</div> |
114 |
<div class="dialog message">No holds found.</div> |
| 103 |
[% END %] |
115 |
[% END %] |
|
Lines 119-143
Link Here
|
| 119 |
</div> <!-- /.col-sm-12 --> |
131 |
</div> <!-- /.col-sm-12 --> |
| 120 |
</div> <!-- /.row --> |
132 |
</div> <!-- /.row --> |
| 121 |
|
133 |
|
|
|
134 |
<div id="cancelModal" class="modal" tabindex="-1" role="dialog" aria-hidden="true"> |
| 135 |
<div class="modal-dialog" role="document"> |
| 136 |
<div class="modal-content"> |
| 137 |
<div class="modal-header"> |
| 138 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
| 139 |
<h3>Confirm deletion</h3> |
| 140 |
</div> |
| 141 |
|
| 142 |
<div class="modal-body"> |
| 143 |
<p>Are you sure you want to cancel this hold?</p> |
| 144 |
|
| 145 |
<fieldset class="action"> |
| 146 |
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] |
| 147 |
[% IF hold_cancellation %] |
| 148 |
<label for="cancellation-reason">Cancellation reason: </label> |
| 149 |
<select class="cancellation-reason" name="modal-cancellation-reason" id="modal-cancellation-reason"> |
| 150 |
<option value="">No reason given</option> |
| 151 |
[% FOREACH reason IN hold_cancellation %] |
| 152 |
<option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> |
| 153 |
[% END %] |
| 154 |
</select> |
| 155 |
[% END %] |
| 156 |
</fieldset> |
| 157 |
</div> |
| 158 |
|
| 159 |
<div class="modal-footer"> |
| 160 |
<button id="cancelModalConfirmBtn" type="button" class="btn btn-danger">Confirm cancellation</button> |
| 161 |
<a href="#" data-dismiss="modal">Cancel</a> |
| 162 |
</div> |
| 163 |
</div> |
| 164 |
</div> |
| 165 |
</div> |
| 166 |
|
| 122 |
[% MACRO jsinclude BLOCK %] |
167 |
[% MACRO jsinclude BLOCK %] |
| 123 |
[% INCLUDE 'datatables.inc' %] |
168 |
[% INCLUDE 'datatables.inc' %] |
| 124 |
[% INCLUDE 'columns_settings.inc' %] |
169 |
[% INCLUDE 'columns_settings.inc' %] |
| 125 |
<script> |
170 |
<script> |
|
|
171 |
var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); |
| 126 |
var holdst_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdst', 'json' ) | $raw %]; |
172 |
var holdst_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdst', 'json' ) | $raw %]; |
| 127 |
var holdso_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdso', 'json' ) | $raw %]; |
173 |
var holdso_columns_settings = [% TablesSettings.GetColumns( 'circ', 'holds_awaiting_pickup', 'holdso', 'json' ) | $raw %]; |
| 128 |
|
174 |
|
| 129 |
$(document).ready(function() { |
175 |
$(document).ready(function() { |
| 130 |
|
176 |
|
| 131 |
KohaTable("holdst", { |
177 |
KohaTable("holdst", { |
| 132 |
"sPaginationType": "full" |
178 |
"sPaginationType": "full", |
|
|
179 |
"order": [[1, 'asc']] |
| 133 |
}, holdst_columns_settings); |
180 |
}, holdst_columns_settings); |
| 134 |
|
181 |
|
| 135 |
KohaTable("holdso", { |
182 |
KohaTable("holdso", { |
| 136 |
"sPaginationType": "full" |
183 |
"sPaginationType": "full", |
|
|
184 |
"order": [[1, 'asc']] |
| 137 |
}, holdso_columns_settings); |
185 |
}, holdso_columns_settings); |
| 138 |
|
186 |
|
| 139 |
$('#resultlist').tabs(); |
187 |
$('#resultlist').tabs(); |
| 140 |
|
188 |
|
|
|
189 |
let cancel_link; |
| 190 |
|
| 191 |
$("#cancelModalConfirmBtn").on("click",function(e) { |
| 192 |
var ids = cancel_link.data('ids'); |
| 193 |
localStorage.selectedWaitingHolds = JSON.stringify(JSON.parse(localStorage.selectedWaitingHolds).filter(id => !ids.includes(id))); |
| 194 |
let link = `waitingreserves.pl?cancelBulk=1&ids=${ids.join(',')}`; |
| 195 |
let reason = $("#modal-cancellation-reason").val(); |
| 196 |
if ( reason ) { |
| 197 |
link += "&cancellation-reason=" + reason |
| 198 |
} |
| 199 |
window.location.href = link; |
| 200 |
return false; |
| 201 |
}); |
| 202 |
|
| 203 |
if(!localStorage.selectedWaitingHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) { |
| 204 |
localStorage.selectedWaitingHolds = '[]'; |
| 205 |
} |
| 206 |
|
| 207 |
try { |
| 208 |
JSON.parse(localStorage.selectedWaitingHolds); |
| 209 |
} catch(e) { |
| 210 |
localStorage.selectedWaitingHolds = '[]'; |
| 211 |
} |
| 212 |
|
| 213 |
$('.holds_table .select_hold').each(function() { |
| 214 |
if(JSON.parse(localStorage.selectedWaitingHolds).includes($(this).data('id'))) { |
| 215 |
$(this).prop('checked', true); |
| 216 |
} |
| 217 |
}); |
| 218 |
|
| 219 |
$('.holds_table').each(function() { |
| 220 |
var table = $(this); |
| 221 |
var parent = table.parents('.ui-tabs-panel'); |
| 222 |
|
| 223 |
$('.holds_table .select_hold_all', parent).each(function() { |
| 224 |
var count = $('.select_hold:not(:checked)', table).length; |
| 225 |
$('.select_hold_all', table).prop('checked', !count); |
| 226 |
}); |
| 227 |
|
| 228 |
$('.cancel_selected_holds', parent).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length)); |
| 229 |
|
| 230 |
$('.holds_table .select_hold_all', parent).click(function() { |
| 231 |
var count = $('.select_hold:checked', table).length; |
| 232 |
$('.select_hold', table).prop('checked', !count); |
| 233 |
$(this).prop('checked', !count); |
| 234 |
$('.cancel_selected_holds', parent).data('ids', $('.holds_table .select_hold:checked', parent).toArray().map(el => $(el).data('id'))).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length)); |
| 235 |
localStorage.selectedWaitingHolds = JSON.stringify($('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'))); |
| 236 |
}); |
| 237 |
|
| 238 |
$('.holds_table .select_hold', parent).click(function() { |
| 239 |
var count = $('.select_hold:not(:checked)', table).length; |
| 240 |
$('.select_hold_all', table).prop('checked', !count); |
| 241 |
$('.cancel_selected_holds', parent).data('ids', $('.holds_table .select_hold:checked', parent).toArray().map(el => $(el).data('id'))).html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked', parent).length)); |
| 242 |
localStorage.selectedWaitingHolds = JSON.stringify($('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id'))); |
| 243 |
}); |
| 244 |
|
| 245 |
$('.cancel_selected_holds', parent).click(function(e) { |
| 246 |
e.preventDefault(); |
| 247 |
if($('.select_hold:checked', table).length) { |
| 248 |
cancel_link = $(this); |
| 249 |
$('#cancelModal').modal(); |
| 250 |
} |
| 251 |
return false; |
| 252 |
}); |
| 253 |
}); |
| 254 |
|
| 255 |
|
| 141 |
}); |
256 |
}); |
| 142 |
</script> |
257 |
</script> |
| 143 |
[% END %] |
258 |
[% END %] |