From: Jason Boyer Date: Wed, 10 Mar 2021 23:48:12 +0000 (-0500) Subject: LP1895737: Add Curbside Appointments to Bootstrap OPAC X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5cd1d5224799c3ad9d85b21a13bb1d641a7012a7;p=Evergreen.git LP1895737: Add Curbside Appointments to Bootstrap OPAC Add support for requesting / editing / canceling curbside appointments to the bootstrap opac. Signed-off-by: Jason Boyer Signed-off-by: Terran McCanna Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 b/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 index 3bf6f2b72f..0317abd440 100755 --- a/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 @@ -135,6 +135,12 @@ only screen and (max-width: 650px) { .holdHistoryTable td:nth-of-type(4):before { content: "Pickup Location"; display: flex; } .holdHistoryTable td:nth-of-type(5):before { content: "Status"; display: flex; } + .curbsideApptTable td:nth-of-type(1):before { content: "Pickup Location"; display: flex; } + .curbsideApptTable td:nth-of-type(2):before { content: "Date"; display: flex; } + .curbsideApptTable td:nth-of-type(3):before { content: "Time"; display: flex;} + .curbsideApptTable td:nth-of-type(4):before { content: "Arrival Notes"; display: flex;} + .curbsideApptTable td:nth-of-type(5):before { content: "Action"; display: flex;} + .paymentTable td:nth-of-type(1):before { content: "Payment Date"; display: flex; } .paymentTable td:nth-of-type(2):before { content: "Payment For"; display: flex; } .paymentTable td:nth-of-type(3):before { content: "Amount"; display: flex; } diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/holds_curbside.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/holds_curbside.tt2 new file mode 100755 index 0000000000..e464b6cb9c --- /dev/null +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/holds_curbside.tt2 @@ -0,0 +1,191 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + PROCESS "opac/parts/hold_status.tt2"; + PROCESS "opac/parts/hold_notify.tt2"; + PROCESS "opac/parts/myopac/column_sort_support.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + + myopac_page = "holds_curbside"; + parent="holds"; + limit = (ctx.holds_limit.defined) ? ctx.holds_limit : 0; + offset = (ctx.holds_offset.defined) ? ctx.holds_offset : 0; + count = (ctx.holds_ids.size.defined) ? ctx.holds_ids.size : 0; +%] +

[% l("Curbside Pickup Appointments") %]

+
+
+
+
+ [% IF offset != 0 %] limit,offset => (offset - limit)}) %]' + >◄[% l('Previous') %] [% END %] + + [% IF offset > 0 || count > limit; curpage = 0; WHILE curpage * limit < count; IF curpage * limit == offset; %] + [% curpage + 1 %] + + [%- ELSE %] + limit, offset => (curpage * limit)}) %]' class="np_nav_link classic_link btn btn-action">[% curpage + 1 %] + [%- END; curpage = curpage + 1; END; END %] + + [% IF ctx.hold_suspend_post_capture; l('One or more holds could not be suspended because the item is at (or en route to) the pickup library.'); END; %] + + + [% IF count > limit + offset %] limit, offset => (offset + limit)}) %]' + >[% l('Next') %]►[% END %] +
+
+ + [% IF ctx.holds.size && ctx.holds.size < 1 %] +
[% l('No holds found.') %]
+ [% ELSE %] +
+ [% FOR lib IN ctx.curbside_pickup_libs; + + cs_slot = ''; + cs_slot_id = ''; + cs_date = ''; + cs_time = ''; + cs_notes = ''; + + cs_org = ctx.cs_org; + IF cs_org == lib; + cs_slot = ctx.cs_slot; + cs_slot_id = ctx.cs_slot_id; + cs_date = ctx.cs_date; + cs_time = ctx.cs_time; + cs_notes = ctx.cs_notes; + END; + + appointment = ctx.curbside_appointments.$lib; + IF appointment; + cs_slot = appointment; + cs_slot_id = appointment.id; + IF appointment.slot; cs_date = date.format(ctx.parse_datetime(appointment.slot),'%F'); END; + IF appointment.slot; cs_time = date.format(ctx.parse_datetime(appointment.slot),'%T'); END; + cs_notes = appointment.notes; + END %] +
+ + + + + + + + + + + + [% disable_me = 0 %] + [% no_patron_input = 0 %] + [% date_started_null = 0 %] + [% IF appointment && appointment.arrival; disable_me = 1; END %] + [% IF ctx.get_org_setting(lib, 'circ.curbside.disable_patron_input'); no_patron_input = 1; END %] + + + + + +
[% l('Pickup Location') %][% l('Date') %][% l('Time') %][% l('Arrival Notes') %] + + + + [% l('Action') %]
+ [% ctx.get_aou(lib).name | html %]
+ [% l('Phone:')%] [% ctx.get_aou(lib).phone | html %] + +
+ [% IF !cs_date || ( date.format(cs_date _ ' 12:00:00', '%Y%m%d') < date.format(date.now, '%Y%m%d') ); cs_date = ''; tmp_cs_date = date.format(date.now, '%F'); date_started_null = 1; %] + [% ELSE; tmp_cs_date = cs_date; END %] + [% IF cs_date %][% END %] + [% IF no_patron_input && date_started_null; %]  + [% ELSE; %][% END %] + + [% IF appointment || cs_date; # checking times %] + [% current_date = cs_date %] + [% IF date_started_null && no_patron_input %]  + [% ELSIF appointment || ctx.cs_times.$lib.$current_date.size; # show a select %] + + [% ELSE %] + [% l('No times available for selected date') %] + [% END %] + [% ELSE %] + [% IF !no_patron_input; %][% l('Select a date') %][% END %] + [% END %] + + [% IF cs_date; # show the notes box %] + + [% ELSE %]   + [% END %] + [% + disable_arrival_button = 1; # assume arrival is not yet allowed + IF appointment && appointment.slot; + stime = date.format(ctx.parse_datetime(appointment.slot), '%s'); + now_time = date.format(date.now, '%s'); + IF now_time >= stime; + disable_arrival_button = 0; # if 'now' is after the slot time, allow arrival + END; + END %] + [% IF no_patron_input %] + [% l('Please contact the library to schedule, change, or cancel your appointment.') %] + [% ELSIF appointment.staged && !appointment.arrival; # relevant submit action %] +
+ + [% ELSIF appointment.arrival %] + [% l('Staff have been notified of your arrival.') %]
+ + + [% ELSIF appointment.slot %] +
+
+ + [% ELSIF cs_date %] + +
+ [% ELSE %] + + [% END %] +
+
+ [% END %] +
+ + [% END %] +
+
+[% END %] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/myopac/base.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/myopac/base.tt2 index 14e425a95e..646440dd96 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/myopac/base.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/myopac/base.tt2 @@ -14,7 +14,7 @@ {children => 0, parent => "circs", url => "ebook_circs", text => l(" E-Items Currently Checked Out"), name => l("E-Items Currently Checked Out")}, {children => 0, parent => "circs", url => "circ_history", text => l(" Check Out History"), name => l("Check Out History")}, - {children => 4, parent => "parent",url => "holds", text => l(" [_1]Holds / [_2] Ready", ctx.user_stats.holds.total, ctx.user_stats.holds.ready), name => l("Holds")}, + {children => 5, parent => "parent",url => "holds", text => l(" [_1]Holds / [_2] Ready", ctx.user_stats.holds.total, ctx.user_stats.holds.ready), name => l("Holds")}, {children => 0, parent => "holds", url => "holds", text => l(" Items on Hold"), name => l("Holds")}, {children => 0, parent => "holds", url => "ebook_holds", text => l(" E-Items on Hold"), name => l("E-Items on Hold")}, {children => 0, parent => "holds", url => "ebook_holds_ready", text => l(" E-Items Ready for Checkout"), name => l("E-Items Ready for Checkout")}, @@ -29,9 +29,15 @@ {children => 0, parent => "parent", url => "lists", text => l(" My Lists"), name => l("My Lists")} ]; - IF (ctx.show_reservations_tab == 'true'); + IF (ctx.curbside_pickup_libs.size > 0 ); + myopac_pages.push({children => 0, parent => "parent", url => "holds_curbside", text => l(" Curbside Pickup"), name => l("Curbside Pickup")}); + myopac_pages.push({children => 0, parent => "holds", url => "holds_curbside", text => l(" Curbside Pickup"), name => l("Curbside Pickup")}); + END; + + IF (ctx.show_reservations_tab == 'true'); myopac_pages.push({children => 0, parent => "parent", url => "reservations", text => l(" Reservations"), name => l("Reservations")}); END; + IF ctx.my_hold_subscriptions.size > 0; myopac_pages.push({children => 0, parent => "holds", url => "hold_subscriptions", text => l(" Hold Groups"), name => l("Hold Groups")}); END;