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 of cancellation</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="exampleModalLabel" 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="exampleModalLabel">Confirm deletion</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_dicharge_alert" class="alert alert-danger" style="display:none;"></div> |
137 |
<fieldset class="action"> |
138 |
<p>Are you sure you want to cancel this discharge ? Borrower will again have right to check out books after this.</p> |
139 |
[% SET discharge_cancellation = AuthorisedValues.GetAuthValueDropbox('DISCHARGE_CANCELLATION') %] |
140 |
[% IF discharge_cancellation.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 %] |
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 |
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> |
156 |
<button type="button" class="btn btn-primary">Save changes</button> --> |
157 |
</div> |
158 |
</form> |
159 |
</div> |
160 |
</div> |
161 |
</div> |
162 |
|
104 |
[% MACRO jsinclude BLOCK %] |
163 |
[% MACRO jsinclude BLOCK %] |
105 |
[% INCLUDE 'str/members-menu.inc' %] |
164 |
[% INCLUDE 'str/members-menu.inc' %] |
106 |
[% Asset.js("js/members-menu.js") | $raw %] |
165 |
[% Asset.js("js/members-menu.js") | $raw %] |
|
|
166 |
<script> |
167 |
$(".cancel-discharge").on("click", function (e) { |
168 |
e.preventDefault; |
169 |
cancel_link = $(this); |
170 |
let discharge_id = cancel_link.data("discharge_id"); |
171 |
let borrowernumber = cancel_link.data("borrowernumber"); |
172 |
$("#cancel_modal_form").append('<input type="hidden" name="discharge_id" value="' + discharge_id + '">'); |
173 |
$("#cancel_modal_form").append('<input type="hidden" name="borrowernumber" value="' + borrowernumber + '">'); |
174 |
return false; |
175 |
}); |
176 |
</script> |
107 |
[% END %] |
177 |
[% END %] |
108 |
|
178 |
|
109 |
[% INCLUDE 'intranet-bottom.inc' %] |
179 |
[% INCLUDE 'intranet-bottom.inc' %] |