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