|
Lines 86-91
Link Here
|
| 86 |
<tr> |
86 |
<tr> |
| 87 |
<th>Requested</th> |
87 |
<th>Requested</th> |
| 88 |
<th>Validated</th> |
88 |
<th>Validated</th> |
|
|
89 |
<th>Cancelled</th> |
| 90 |
<th>Reason cancelled</th> |
| 91 |
<th>Cancel</th> |
| 89 |
</tr> |
92 |
</tr> |
| 90 |
</thead> |
93 |
</thead> |
| 91 |
<tbody> |
94 |
<tbody> |
|
Lines 93-99
Link Here
|
| 93 |
<tr> |
96 |
<tr> |
| 94 |
<td>[% d.needed | $KohaDates with_hours = 1 %]</td> |
97 |
<td>[% d.needed | $KohaDates with_hours = 1 %]</td> |
| 95 |
<td>[% d.validated | $KohaDates with_hours = 1 %]</td> |
98 |
<td>[% d.validated | $KohaDates with_hours = 1 %]</td> |
| 96 |
</tr> |
99 |
<td>[% d.cancelled | $KohaDates with_hours = 1 %]</td> |
|
|
100 |
<td>[% d.cancellation_reason | html %]</td> |
| 101 |
<td> |
| 102 |
[% IF d.cancelled %] |
| 103 |
<i> Cancelled </i> |
| 104 |
[% ELSE %] |
| 105 |
<a |
| 106 |
class="cancel-discharge delete btn btn-default btn-xs" |
| 107 |
data-borrowernumber="[% patron.borrowernumber | html %]" |
| 108 |
data-bs-target="#cancelDischargeModal" |
| 109 |
data-bs-toggle="modal" |
| 110 |
data-discharge_id="[% d.discharge_id | html %]" |
| 111 |
> |
| 112 |
<i class="fa fa-trash-can"></i> |
| 113 |
Cancel |
| 114 |
</a> |
| 115 |
[% END %] |
| 116 |
</td></tr |
| 117 |
> |
| 97 |
[% END %] |
118 |
[% END %] |
| 98 |
</tbody> |
119 |
</tbody> |
| 99 |
</table> |
120 |
</table> |
|
Lines 101-109
Link Here
|
| 101 |
[% END %] |
122 |
[% END %] |
| 102 |
[% END %] |
123 |
[% END %] |
| 103 |
|
124 |
|
|
|
125 |
<div class="modal fade" id="cancelDischargeModal" tabindex="-1" aria-labelledby="cancelDischargeModal" aria-hidden="true"> |
| 126 |
<div class="modal-dialog modal-lg"> |
| 127 |
<div class="modal-content"> |
| 128 |
<div class="modal-header"> |
| 129 |
<h1 class="modal-title" id="cancelModalLabel">Confirm cancellation</h1> |
| 130 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
| 131 |
</div> |
| 132 |
<form id="cancel_modal_form" method="post" action="discharge.pl"> |
| 133 |
<div class="modal-body"> |
| 134 |
[% INCLUDE 'csrf-token.inc' %] |
| 135 |
<input name="op" type="hidden" value="cud-cancel-discharge" /> |
| 136 |
<div id="cancel_discharge_alert" class="alert alert-danger" style="display:none;"></div> |
| 137 |
<fieldset class="action"> |
| 138 |
<p>Are you sure you want to cancel this discharge? The patron will be able to check out items again.</p> |
| 139 |
[% SET discharge_cancellation_reasons = AuthorisedValues.GetAuthValueDropbox('DISCHARGE_CANCELLATION') %] |
| 140 |
[% IF discharge_cancellation_reasons.count %] |
| 141 |
<label for="cancellation-reason">Cancellation reason: </label> |
| 142 |
<select class="cancellation-reason" name="cancellation-reason" id="modal-cancellation-reason"> |
| 143 |
[% FOREACH reason IN discharge_cancellation_reasons %] |
| 144 |
<option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option> |
| 145 |
[% END %] |
| 146 |
</select> |
| 147 |
[% ELSE %] |
| 148 |
<div class="alert alert-warning audio-alert-warning"> You must define at least one authorized value for the category DISCHARGE_CANCELLATION </div> |
| 149 |
[% END %] |
| 150 |
</fieldset> |
| 151 |
</div> |
| 152 |
<div class="modal-footer"> |
| 153 |
<input id="cancelModalConfirmBtn" type="submit" class="btn btn-danger" value="Confirm cancellation" /> |
| 154 |
<button type="button" class="btn btn-default" data-bs-dismiss="modal">Cancel</button> |
| 155 |
</div> |
| 156 |
</form> |
| 157 |
</div> |
| 158 |
</div> |
| 159 |
</div> |
| 160 |
|
| 104 |
[% MACRO jsinclude BLOCK %] |
161 |
[% MACRO jsinclude BLOCK %] |
| 105 |
[% INCLUDE 'str/members-menu.inc' %] |
162 |
[% INCLUDE 'str/members-menu.inc' %] |
| 106 |
[% Asset.js("js/members-menu.js") | $raw %] |
163 |
[% Asset.js("js/members-menu.js") | $raw %] |
|
|
164 |
<script> |
| 165 |
$(".cancel-discharge").on("click", function (e) { |
| 166 |
e.preventDefault; |
| 167 |
cancel_link = $(this); |
| 168 |
let discharge_id = cancel_link.data("discharge_id"); |
| 169 |
let borrowernumber = cancel_link.data("borrowernumber"); |
| 170 |
$("#cancel_modal_form").append('<input type="hidden" name="discharge_id" value="' + discharge_id + '">'); |
| 171 |
$("#cancel_modal_form").append('<input type="hidden" name="borrowernumber" value="' + borrowernumber + '">'); |
| 172 |
return false; |
| 173 |
}); |
| 174 |
</script> |
| 107 |
[% END %] |
175 |
[% END %] |
| 108 |
|
176 |
|
| 109 |
[% INCLUDE 'intranet-bottom.inc' %] |
177 |
[% INCLUDE 'intranet-bottom.inc' %] |