5 [% USE AuthorisedValues %]
7 [% PROCESS 'i18n.inc' %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>[% FILTER collapse %]
11 [% t("Details for") | html %] [% INCLUDE 'patron-title.inc' no_html = 1 %] ›
12 [% t("Housebound") | html %] ›
13 [% t("Koha") | html %]
15 [% INCLUDE 'doc-head-close.inc' %]
18 <body id="housebound-home" class="housebound">
19 [% WRAPPER 'header.inc' %]
20 [% INCLUDE 'patron-search-header.inc' %]
23 [% BLOCK 'homebound-details' %]
27 <span class="label" class="required"> Delivery day:</span>
28 [% hpd = housebound_profile.day %]
29 [% IF hpd == 'any' %]<span>Any</span>
30 [% ELSIF hpd == 'monday' %]<span>Monday</span>
31 [% ELSIF hpd == 'tuesday' %]<span>Tuesday</span>
32 [% ELSIF hpd == 'wednesday' %]<span>Wednesday</span>
33 [% ELSIF hpd == 'thursday' %]<span>Thursday</span>
34 [% ELSIF hpd == 'friday' %]<span>Friday</span>
35 [% ELSIF hpd == 'saturday' %]<span>Saturday</span>
36 [% ELSIF hpd == 'sunday' %]<span>Sunday</span>
40 <span class="label" class="required">Frequency:</span>
41 [% AuthorisedValues.GetByCode( 'HSBND_FREQ', housebound_profile.frequency, 0 ) || housebound_profile.frequency | html %]
44 <span class="label">Material:</span><br />
45 [% housebound_profile.fav_itemtypes | html | html_line_break %]
48 <span class="label">Subjects:</span><br />
49 [% housebound_profile.fav_subjects | html | html_line_break %]
52 <span class="label">Authors:</span><br />
53 [% housebound_profile.fav_authors | html | html_line_break %]
56 <span class="label">Referral:</span><br />
57 [% housebound_profile.referral | html | html_line_break %]
60 <span class="label">Notes:</span><br />
61 [% housebound_profile.notes | html | html_line_break %]
67 [% WRAPPER 'sub-header.inc' %]
68 [% WRAPPER breadcrumbs %]
69 [% WRAPPER breadcrumb_item %]
70 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
72 [% WRAPPER breadcrumb_item %]
73 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% INCLUDE 'patron-title.inc' %]</a>
75 [% WRAPPER breadcrumb_item bc_active= 1 %]
76 <span>Housebound details</span>
78 [% END #/ WRAPPER breadcrumbs %]
79 [% END #/ WRAPPER sub-header.inc %]
81 <div class="main container-fluid">
83 <div class="col-sm-10 col-sm-push-2">
85 [% INCLUDE 'messages.inc' %]
87 [% INCLUDE 'members-toolbar.inc' %]
89 <h1>Housebound details for [% INCLUDE 'patron-title.inc' %]</h1>
91 [% FOR m IN messages %]
92 <div class="dialog [% m.type | html %]">
94 [% CASE 'error_on_profile_store' %]
95 <span>An error occurred whilst updating this housebound profile</span>
96 [% CASE 'error_on_profile_create' %]
97 <span>An error occurred whilst creating this housebound profile</span>
98 [% CASE 'error_on_visit_load' %]
99 <span>An error occurred whilst loading the housebound visit</span>
100 [% CASE 'error_on_visit_delete' %]
101 <span>An error occurred whilst deleting a housebound visit</span>
102 [% CASE 'error_on_visit_store' %]
103 <span>An error occurred whilst updating a housebound visit</span>
104 [% CASE 'error_on_visit_create' %]
105 <span>An error occurred whilst creating a new housebound visit</span>
107 <span>[% m.code | html %]</span>
109 <span>Please try again later</span>
113 <!-- Create or edit housebound_profile -->
114 [% IF ( op == 'update_or_create' ) %]
115 <form id="editform" method="post" name="editform" action="/cgi-bin/koha/members/housebound.pl">
116 [% INCLUDE 'csrf-token.inc' %]
117 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
118 [% IF ( housebound_profile ) %]
119 <input type="hidden" name="op" value="cud-updateconfirm" />
121 <input type="hidden" name="op" value="cud-createconfirm" />
123 <fieldset id="houseboundentry" class="rows">
124 <legend>Manage housebound profile</legend>
127 <label for="day" class="required">Delivery day:</label>
128 <select id="day" name="day" class="required" required="required">
129 <option value="">Select a day</option>
130 [% IF ( housebound_profile ) %]
131 [% IF ( housebound_profile.day == 'any' ) %]
132 <option value="any" selected='selected'>Any</option>
134 <option value="any">Any</option>
136 [% IF ( housebound_profile.day == 'monday' ) %]
137 <option value="monday" selected='selected'>Monday</option>
139 <option value="monday">Monday</option>
141 [% IF ( housebound_profile.day == 'tuesday' ) %]
142 <option value="tuesday" selected='selected'>Tuesday</option>
144 <option value="tuesday">Tuesday</option>
146 [% IF ( housebound_profile.day == 'wednesday' ) %]
147 <option value="wednesday" selected='selected'>Wednesday</option>
149 <option value="wednesday">Wednesday</option>
151 [% IF ( housebound_profile.day == 'thursday' ) %]
152 <option value="thursday" selected='selected'>Thursday</option>
154 <option value="thursday">Thursday</option>
156 [% IF ( housebound_profile.day == 'friday' ) %]
157 <option value="friday" selected='selected'>Friday</option>
159 <option value="friday">Friday</option>
161 [% IF ( housebound_profile.day == 'saturday' ) %]
162 <option value="saturday" selected='selected'>Saturday</option>
164 <option value="saturday">Saturday</option>
166 [% IF ( housebound_profile.day == 'sunday' ) %]
167 <option value="sunday" selected='selected'>Sunday</option>
169 <option value="sunday">Sunday</option>
172 <option value="any">Any</option>
173 <option value="monday">Monday</option>
174 <option value="tuesday">Tuesday</option>
175 <option value="wednesday">Wednesday</option>
176 <option value="thursday">Thursday</option>
177 <option value="friday">Friday</option>
178 <option value="saturday">Saturday</option>
179 <option value="sunday">Sunday</option>
182 <span class="required">Required</span>
185 <label for="frequency" class="required">Frequency:</label>
186 <select id="frequency" name="frequency" class="required" required="required">
187 <option value="">Select a frequency</option>
188 [% FOREACH frequency IN AuthorisedValues.GetAuthValueDropbox('HSBND_FREQ') %]
189 [% IF housebound_profile.frequency == frequency.authorised_value %]
190 <option value="[% frequency.authorised_value | html %]" selected="selected">[% frequency.lib | html %]</option>
192 <option value="[% frequency.authorised_value | html %]">[% frequency.lib | html %]</option>
196 <span class="required">Required</span>
199 <label for="fav_itemtypes">Preferred materials:</label>
200 [% IF ( housebound_profile ) %]
201 <textarea id="fav_itemtypes" name="fav_itemtypes" cols="110" rows="10">[% housebound_profile.fav_itemtypes | html %]</textarea>
203 <textarea id="fav_itemtypes" name="fav_itemtypes" cols="110" rows="10"></textarea>
207 <label for="fav_subjects">Subjects:</label>
208 [% IF ( housebound_profile ) %]
209 <textarea id="fav_subjects" name="fav_subjects" cols="110" rows="10">[% housebound_profile.fav_subjects | html %]</textarea>
211 <textarea id="fav_subjects" name="fav_subjects" cols="110" rows="10"></textarea>
215 <label for="fav_authors">Authors:</label>
216 [% IF ( housebound_profile ) %]
217 <textarea id="fav_authors" name="fav_authors" cols="110" rows="10">[% housebound_profile.fav_authors | html %]</textarea>
219 <textarea id="fav_authors" name="fav_authors" cols="110" rows="10"></textarea>
223 <label for="referral">Referral:</label>
224 [% IF ( housebound_profile ) %]
225 <textarea id="referral" name="referral" cols="110" rows="10">[% housebound_profile.referral | html %]</textarea>
227 <textarea id="referral" name="referral" cols="110" rows="10"></textarea>
231 <label for="notes">Notes:</label>
232 [% IF ( housebound_profile ) %]
233 <textarea id="notes" name="notes" cols="110" rows="10">[% housebound_profile.notes | html %]</textarea>
235 <textarea id="notes" name="notes" cols="110" rows="10"></textarea>
240 <fieldset class="action">
241 <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Save changes</button>
242 <a class="cancel btn btn-link"
243 href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber | html %]">
249 <!-- Create or edit housebound_visit -->
250 [% ELSIF ( op == 'visit_update_or_create' ) %]
251 <h4>Manage housebound deliveries</h4>
252 <form name="form" id="instance_form" method="post" action="/cgi-bin/koha/members/housebound.pl">
253 [% INCLUDE 'csrf-token.inc' %]
255 <input type="hidden" name="op" value="cud-editvisitconfirm" />
256 <input type="hidden" name="visit_id" value="[% visit.id | html %]" />
258 <input type="hidden" name="op" value="cud-addvisitconfirm" />
260 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
261 <fieldset class="rows" id="instance">
262 <legend>Delivery details</legend>
265 <label for="date" class="required">Date: </label>
267 <input type="text" id="date" class="flatpickr required"
268 value="[% visit.appointment_date | $KohaDates %]"
269 name="date" size="20" required="required"/>
271 <input type="text" id="date" class="flatpickr required"
272 value="" name="date" size="20" required="required"/>
274 <span class="required">Required</span>
275 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
278 <label for="segment" class="required">Time:</label>
279 <select id="segment" name="segment" required="required"
281 <option value="">Select a time</option>
283 [% IF ( visit.day_segment == 'morning' ) %]
284 <option value="morning" selected="selected">
288 <option value="morning">Morning</option>
290 [% IF ( visit.day_segment == 'afternoon' ) %]
291 <option value="afternoon" selected="selected">
295 <option value="afternoon">Afternoon</option>
297 [% IF ( visit.day_segment == 'evening' ) %]
298 <option value="evening" selected="selected">
302 <option value="evening">Evening</option>
305 <option value="morning">Morning</option>
306 <option value="afternoon">Afternoon</option>
307 <option value="evening">Evening</option>
310 <span class="required">Required</span>
313 <label for="chooser" class="required"> Chooser:</label>
314 <select id="chooser" name="chooser" class="required" required="required">
315 <option value="">Select a chooser</option>
317 [% FOREACH chooser IN choosers %]
318 [% IF ( visit.chooser_brwnumber == chooser.borrowernumber ) %]
319 <option value="[% chooser.borrowernumber | html %]" selected="selected">
320 [% INCLUDE 'patron-title.inc' patron = chooser invert_name = 0 %]
323 <option value="[% chooser.borrowernumber | html %]">
324 [% INCLUDE 'patron-title.inc' patron = chooser invert_name = 0 %]
329 [% FOREACH chooser IN choosers %]
330 <option value="[% chooser.borrowernumber | html %]">
331 [% INCLUDE 'patron-title.inc' patron = chooser invert_name = 0 %]
336 <span class="required">Required</span>
339 <label for="deliverer" class="required">Deliverer:</label>
340 <select id="deliverer" name="deliverer" class="required" required="required">
341 <option value="">Select a deliverer</option>
343 [% FOREACH deliverer IN deliverers %]
344 [% IF ( visit.deliverer_brwnumber == deliverer.borrowernumber ) %]
345 <option value="[% deliverer.borrowernumber | html %]" selected="selected">
346 [% INCLUDE 'patron-title.inc' patron = deliverer invert_name = 0 %]
349 <option value="[% deliverer.borrowernumber | html %]">
350 [% INCLUDE 'patron-title.inc' patron = deliverer invert_name = 0 %]
355 [% FOREACH deliverer IN deliverers %]
356 <option value="[% deliverer.borrowernumber | html %]">
357 [% INCLUDE 'patron-title.inc' patron = deliverer invert_name = 0 %]
362 <span class="required">Required</span>
366 <fieldset class="action">
367 <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> Save</button>
369 href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber | html %]">
374 <div class="page-section">
375 <h3>Housebound details</h3>
376 [% PROCESS 'homebound-details' %]
377 <!-- Display a housebound_profile -->
378 </div> <!-- /.page-section -->
379 [% ELSIF ( housebound_profile ) %]
380 <div class="page-section">
381 [% PROCESS 'homebound-details' %]
383 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber | html %]&op=update_or_create"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
385 </div> <!-- /.page-section -->
387 <div class="page-section">
389 [% housebound_visits = housebound_profile.housebound_visits %]
390 [% IF housebound_visits.count > 0 %]
391 <table id="deliveries">
398 <th class="noExport">Actions</th>
402 [% FOREACH entry IN housebound_visits %]
404 <td>[% entry.id | html %]</td>
405 <td>[% entry.appointment_date | $KohaDates %] ([% entry.day_segment | html %])</td>
407 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% entry.chooser.borrowernumber | uri %]">
408 [% INCLUDE 'patron-title.inc' patron = entry.chooser invert_name = 0 %]
412 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% entry.deliverer.borrowernumber | uri %]">
413 [% INCLUDE 'patron-title.inc' patron = entry.deliverer invert_name = 0 %]
417 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/members/housebound.pl?op=visit_update_or_create&visit_id=[% entry.id | html %]&borrowernumber=[% patron.borrowernumber | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
418 <form action="/cgi-bin/koha/members/housebound.pl" method="post">
419 [% INCLUDE 'csrf-token.inc' %]
420 <input type="hidden" name="op" value="cud-visit_delete" />
421 <input type="hidden" name="visit_id" value="[% entry.id | html %]" />
422 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
423 <button class="delete btn btn-default btn-xs"><i class="fa fa-trash-can"></i> Delete</button>
432 <a href="/cgi-bin/koha/members/housebound.pl?op=visit_update_or_create&borrowernumber=[% patron.borrowernumber | uri %]"
433 class="btn btn-default btn-sm">
434 <i class="fa fa-plus"></i> Add a new delivery
437 </div> <!-- /.page-section -->
442 </div> <!-- /.col-sm-10.col-sm-push-2 -->
444 <div class="col-sm-2 col-sm-pull-10">
446 [% INCLUDE 'circ-menu.inc' %]
448 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
449 </div> <!-- /.row -->
451 [% MACRO jsinclude BLOCK %]
452 [% INCLUDE 'calendar.inc' %]
453 [% INCLUDE 'datatables.inc' %]
454 [% INCLUDE 'columns_settings.inc' %]
456 $(document).ready(function() {
457 $(".delete").click(function(){
458 return confirm(_("Are you sure you want to delete this delivery?"));
461 KohaTable("deliveries", {
462 "pagingType": "full",
466 [% INCLUDE 'str/members-menu.inc' %]
467 [% Asset.js("js/members-menu.js") | $raw %]
470 [% INCLUDE 'intranet-bottom.inc' %]