From: Ben Shum Date: Wed, 21 Nov 2012 15:20:56 +0000 (-0500) Subject: TinyPAC by GRPL X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7480f84cd68ecbe1f4635afe20d080f446e65225;p=working%2FEvergreen.git TinyPAC by GRPL Based originally off "beanstalk" by Bill Erickson, ESI. These files created by Bill Ott, GRPL. Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/TinyPAC.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TinyPAC.pm new file mode 100644 index 0000000000..a25447d0ed --- /dev/null +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/TinyPAC.pm @@ -0,0 +1,55 @@ +package OpenILS::WWW::TinyPAC; +use base q/OpenILS::WWW::EGCatLoader/; +use strict; use warnings; +use Apache2::Const -compile => qw(OK); + +sub load { + my $self = shift; + + $self->init_ro_object_cache; + my $stat = $self->load_common; + return $stat unless $stat == Apache2::Const::OK; + + $self->ctx->{opac_root} =~ s/opac/tinypac/g; + + my $path = $self->apache->path_info; + + return $self->load_simple("home") if $path =~ m|tinypac/home|; + return $self->load_rresults if $path =~ m|tinypac/results|; + return $self->load_record if $path =~ m|tinypac/record|; + + return $self->load_logout if $path =~ m|tinypac/logout|; + + if($path =~ m|tinypac/login|) { + return $self->load_login unless $self->editor->requestor; # already logged in? + + # This will be less confusing to users than to be shown a login form + # when they're already logged in. + return $self->generic_redirect( + sprintf( + "https://%s%s/myopac/main", + $self->apache->hostname, $self->ctx->{opac_root} + ) + ); + } + + return $self->redirect_auth unless $self->editor->requestor; + + return $self->load_logout if $path =~ m|tinypac/logout|; + + # Don't cache anything requiring auth for security reasons + $self->apache->headers_out->add("cache-control" => "no-store, no-cache, must-revalidate"); + $self->apache->headers_out->add("expires" => "-1"); + + return $self->load_email_record if $path =~ m|tinypac/record/email|; + + return $self->load_place_hold if $path =~ m|tinypac/place_hold|; + return $self->load_myopac_holds if $path =~ m|tinypac/myopac/holds|; + return $self->load_myopac_circs if $path =~ m|tinypac/myopac/circs|; + return $self->load_myopac_main if $path =~ m|tinypac/myopac/main|; + + + return Apache2::Const::OK; +} + +1; diff --git a/Open-ILS/src/templates/tinypac/base.tt2 b/Open-ILS/src/templates/tinypac/base.tt2 new file mode 100644 index 0000000000..2107449ed4 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/base.tt2 @@ -0,0 +1,21 @@ + + + + [% ctx.page_title %] + + + + +
+
+
+
+
+
+
+ [% content %] +
+
+
+ + diff --git a/Open-ILS/src/templates/tinypac/home.tt2 b/Open-ILS/src/templates/tinypac/home.tt2 new file mode 100644 index 0000000000..31604fe5ba --- /dev/null +++ b/Open-ILS/src/templates/tinypac/home.tt2 @@ -0,0 +1,18 @@ +[% PROCESS "tinypac/parts/header.tt2"; + WRAPPER "tinypac/base.tt2"; + INCLUDE "tinypac/parts/misc_util.tt2"; + ctx.page_title = l("Home") %] +
+ [% INCLUDE "tinypac/parts/searchbar.tt2" %] +
+
+
+
+
+
+ +


+
+


+ Standard Catalog +[% END %] diff --git a/Open-ILS/src/templates/tinypac/login.tt2 b/Open-ILS/src/templates/tinypac/login.tt2 new file mode 100644 index 0000000000..aa61bada3e --- /dev/null +++ b/Open-ILS/src/templates/tinypac/login.tt2 @@ -0,0 +1,23 @@ +[% PROCESS "tinypac/parts/header.tt2"; + WRAPPER "tinypac/base.tt2"; + INCLUDE "tinypac/parts/misc_util.tt2"; + ctx.page_title = l("Account Login") %] +
+
+ [% INCLUDE "tinypac/parts/login/form.tt2" %] +
+ +
+
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/circ_history.tt2 b/Open-ILS/src/templates/tinypac/myopac/circ_history.tt2 new file mode 100644 index 0000000000..4e8c861325 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/circ_history.tt2 @@ -0,0 +1,109 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "circs" + limit = ctx.circ_history_limit; + offset = ctx.circ_history_offset; +%] + +
+ + + +
+ [% l('Previously Checked Out Items') %] + + limit, offset => (offset - limit)}) %]' + [% IF offset == 0 %] class='invisible' [% END %]>[% l('Previous') %] + [%# TODO: get total to prevent paging off then end of the list.. %] + limit, offset => (offset + limit)}) %]' + [% IF ctx.circs.size < limit %] class='invisible' [% END %] >[% l('Next') %] + + +
+
+ [%- INCLUDE "opac/parts/preserve_params.tt2" %] + + +
+
+
+
+
+ + [% IF ctx.circs.size < 1 %] +
+ [% l('There are no items in your circulation history.') %] +
+ [% ELSE %] + +
+ + + + + + + + + + + + + [% FOR circ IN ctx.circs; + attrs = {marc_xml => circ.marc_xml}; + PROCESS get_marc_attrs args=attrs; %] + + + + + + + + + [% END %] + +
+ [% l('Title') %] / + [% l('Author') %] + + [% l('Checkout Date') %] + + [% l('Due Date') %] + + [% l('Date Returned') %] + + [% l('Barcode') %] + + [% l('Call Number') %] +
+ [% attrs.title | html %] + [% IF attrs.author %] / + [% attrs.author | html %] + [% END %] + + [% date.format(ctx.parse_datetime(circ.circ.xact_start),DATE_FORMAT); %] + + [% date.format(ctx.parse_datetime(circ.circ.due_date),DATE_FORMAT); %] + + [% + IF circ.circ.checkin_time; + date.format(ctx.parse_datetime(circ.circ.checkin_time),DATE_FORMAT); + ELSE; %] + * + [% END; %] + [% circ.circ.target_copy.barcode | html %][% circ.circ.target_copy.call_number.label | html %]
+
+ [% END %] +
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/circ_history/export.tt2 b/Open-ILS/src/templates/tinypac/myopac/circ_history/export.tt2 new file mode 100644 index 0000000000..fa3988f7f0 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/circ_history/export.tt2 @@ -0,0 +1 @@ +[%- ctx.csv.template_output.data -%] diff --git a/Open-ILS/src/templates/tinypac/myopac/circs.tt2 b/Open-ILS/src/templates/tinypac/myopac/circs.tt2 new file mode 100644 index 0000000000..ccecc05f7f --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/circs.tt2 @@ -0,0 +1,93 @@ +[% PROCESS "tinypac/parts/header.tt2"; + PROCESS "tinypac/parts/misc_util.tt2"; + WRAPPER "tinypac/parts/myopac/base.tt2"; + myopac_page = "circs" %] +
+ +
+ [% IF ctx.circs.size < 1 %] +
+ [% l('You have no items checked out.') %] +
+ [% ELSE %] + [% IF ctx.success_renewals %] +
+ [% l("Successfully renewed [_1] item(s)", ctx.success_renewals) %] +
+ [% END %] + [% IF ctx.failed_renewals %] +
+ [% l("Failed to renew [_1] item(s)", ctx.failed_renewals) %] +
+ [% END %] +
+
+
+ + + + + +
+ + + +
+
+
+
+ + [% FOR circ IN ctx.circs; + attrs = {marc_xml => circ.marc_xml}; + PROCESS get_marc_attrs args=attrs; %] + + + + [% IF circ.renewal_response AND + circ.renewal_response.textcode != 'SUCCESS' %] + + + + [% END; + END %] +
+ + + [% attrs.title | html %] + [% IF attrs.author %] / + [% attrs.author | html %] + [% END %] +
+ Renewals Remaining: [% circ.circ.renewal_remaining %] +
+ Due Date: [% date.format(due_date, DATE_FORMAT) %] +
+ Barcode: + [% circ.circ.target_copy.barcode | html %] +
+
[%# XXX colspan="0" does not work in IE %] + + [% (circ.renewal_response.desc || circ.renewal_response.payload.fail_part || circ.renewal_response.textcode) | html %] + +
+
+
+
+
+ [% END %] + +
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/hold_history.tt2 b/Open-ILS/src/templates/tinypac/myopac/hold_history.tt2 new file mode 100644 index 0000000000..bc3cc6cfc0 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/hold_history.tt2 @@ -0,0 +1,110 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + PROCESS "opac/parts/hold_status.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "holds"; + limit = ctx.hold_history_limit; + offset = ctx.hold_history_offset; +%] + +
+ + + +
+ [% l("Previously Held Items") %] + + + [%# TODO: get total to prevent paging off then end of the list.. %] + + + + Export List + +
+
+ +
+ [% IF ctx.holds.size < 1 %] +
+ [% l('No holds found.') %] +
+ [% ELSE %] + + + + + + + + + + + + + + + [% FOR hold IN ctx.holds; + attrs = {marc_xml => hold.marc_xml}; + PROCESS get_marc_attrs args=attrs; + ahr = hold.hold.hold %] + + + + + + + + + + + + + [% END %] + +
[% l('Title') %][% l('Author') %] [% l('Format') %][% l('Pickup Location') %] [% l('Active On') %][% l('Active') %][% l('Date Fulfilled') %][% l('Status') %]
+ + + + +
+ [% IF attrs.format_icon %] + [% attrs.format_label | html %] + [% END %] +
+
+ [% ctx.get_aou(ahr.pickup_lib).name | html %] + + [% IF ahr.frozen == 't' AND ahr.thaw_date; + date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT); + END %] + + [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %] + + [% IF ahr.fulfillment_time; + date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT); + END %] + +
+ [% PROCESS get_hold_status hold=hold; %] +
+
+ [% END %] +
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/holds.tt2 b/Open-ILS/src/templates/tinypac/myopac/holds.tt2 new file mode 100644 index 0000000000..29404230a7 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/holds.tt2 @@ -0,0 +1,109 @@ +[% PROCESS "tinypac/parts/header.tt2"; + PROCESS "tinypac/parts/misc_util.tt2"; + PROCESS "tinypac/parts/hold_status.tt2"; + WRAPPER "tinypac/parts/myopac/base.tt2"; + myopac_page = "holds" %] +
+ +
+
+ + [% IF CGI.param("available"); + l("Items Ready for Pickup"); + ELSE; + l("Current Items on Hold"); + 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 ctx.holds.size < 1 %] +
+ [% l('No holds found.') %] +
+ [% ELSE %] +
+ + + [% FOR hold IN ctx.holds; + attrs = {marc_xml => hold.marc_xml}; + PROCESS get_marc_attrs args=attrs; + ahr = hold.hold.hold %] + + + + + + + [% END %] + +
+ + + [% + title = attrs.title; + IF ahr.hold_type == 'P'; + title = l('[_1] ([_2])', title, hold.hold.part.label); + END; + %] + [% title | html %] + / [% attrs.author | html %] +
+ Pickup at: [% ctx.get_aou(ahr.pickup_lib).name | html %] +
+ [% IF ahr.frozen == 't' AND + ahr.thaw_date; + date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT); + END %] +
+ Expires: [% IF ahr.expire_time; + date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT); + END %] +
+ Status: [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %] +
+
+ [% PROCESS get_hold_status hold=hold; %] +
+
+

+
+ [% END %] +
+
+ + +
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/holds/edit.tt2 b/Open-ILS/src/templates/tinypac/myopac/holds/edit.tt2 new file mode 100644 index 0000000000..293199f53a --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/holds/edit.tt2 @@ -0,0 +1,115 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + PROCESS "opac/parts/hold_status.tt2"; + PROCESS "opac/parts/org_selector.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "holds"; # in this case, just for tab coloring. + + hold = ctx.holds.0; + ahr = hold.hold.hold; + attrs = {marc_xml => hold.marc_xml}; + PROCESS get_marc_attrs args=attrs; + hold.human_status = PROCESS get_hold_status hold=hold; + + # Do this up front to avoid verbosity later + expire_time = ahr.expire_time ? date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT) : ''; + thaw_date = ahr.thaw_date ? date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT) : ''; +%] +
+
+ [% l('Editing Hold') %] +         + [% l('List all holds') %] +
+
+ [% IF hold; + title = attrs.title; + IF ahr.hold_type == 'P'; + title = l('[_1] ([_2])', title, hold.hold.part.label); + END + %] +

[% title | html %]

+

[% attrs.author | html %]

+ [% IF attrs.format_icon %]

+ [% l('Format:') %] + [% attrs.format_label | html %] +

[% END %] +

+ [% l('Status') %]: [% hold.human_status %] +

+
+ + + + + + [% IF hold.hold.status < 3 %] + [%# The following actions cannot be performed on holds that + have already been captured... %] + + + + + + + + + + + + + + + [% END %] + + + +
+ + + [% l('Pickup library') %] + + [% INCLUDE build_org_selector + name='pickup_lib' value=ahr.pickup_lib %] +
+ [% l('Cancel unless filled by') %] + + + + [% l('Enter date in MM/DD/YYYY format') %] + +
+ [% l('Active?') %] + + +
+ [% l('If suspended, activate on') %] + + + + [% l('Enter date in MM/DD/YYYY format') %] +
+ + +
+
+ [% ELSE; + l('Hold not found'); + END %] +
+
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/list/print.tt2 b/Open-ILS/src/templates/tinypac/myopac/list/print.tt2 new file mode 100644 index 0000000000..fa3988f7f0 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/list/print.tt2 @@ -0,0 +1 @@ +[%- ctx.csv.template_output.data -%] diff --git a/Open-ILS/src/templates/tinypac/myopac/lists.tt2 b/Open-ILS/src/templates/tinypac/myopac/lists.tt2 new file mode 100644 index 0000000000..88972c6c22 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/lists.tt2 @@ -0,0 +1,281 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "lists" + limit = ctx.bookbags_limit; + offset = ctx.bookbags_offset; +%] +
+ + +
+

[% l('Create new list') %]

+ + + + + + + + + + +
+ + + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + + + + + + [% l('Sharing Help') %] + + +       + +
+ + + +
+
+ +

[% l("Your existing lists") %]

+ [% INCLUDE "opac/parts/anon_list.tt2" %] + [% IF ctx.bookbags.size %] + +
+ +
+ [% FOR bbag IN ctx.bookbags %] +
+
+ [% baseurl = ctx.opac_root _ '/myopac/lists'; + IF bbag.id != CGI.param("bbid"); + url = mkurl(baseurl,{bbid => bbag.id},['edit_notes','sort']); + ltitle = l("Show items in list"); + ELSE; + url = mkurl(baseurl, {}, ['bbid', 'edit_notes', 'sort']); + ltitle = l("Hide items in list"); + END %] +

[% bbag.name | html %]

+ [% IF bbag.description %]
[% bbag.description | html %]
[% END %] +
+
+
+ + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + [% IF bbag.pub != 't' %] + + + [% ELSE %] + + + [% END %] +
+
+
+
+ + + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + +
+
+
+
+ + + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + +
+
+
+ [% IF bbag.pub == 't'; %] + [% l('RSS Feed') %] + [% END %] +
+ +
+
+ [% IF CGI.param("bbid") == bbag.id %] +
+
+
+ + [%- INCLUDE "opac/parts/preserve_params.tt2" params=['loc', 'query', 'qtype']; %] + [% INCLUDE "opac/parts/filtersort.tt2" + value=CGI.param('sort') mode='bookbag' %] + + +
+
+
+
+ + + + + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + + + + + + + + + + +
+ + + + + [% l("Save changes to name or description?") %]
+ +
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + [% UNLESS bbag.items.size %] + + [% END %] + [% FOR item IN bbag.items; + rec_id = item.target_biblio_record_entry.id; + attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id}; + PROCESS get_marc_attrs args=attrs %] + + + + + [% ELSE %] + + [% END %] + + [% END %] + [% IF CGI.param("edit_notes") == bbag.id %] + + + + + [% END %] + +
+ + + + [% l('Title') %] + + [% l('Author(s)') %] + + [% l('Notes') %] + [% IF CGI.param("edit_notes") != bbag.id %] + | [% l('Edit') %] + [% END %] + + + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + +
+ [% l("This list contains no items.") %] +
+ + + [% attrs.title | html %] + + [% attrs.author | html %] + [% IF CGI.param("edit_notes") == bbag.id %] + + [% FOR note IN item.notes %] + + [% END %] + + + [% FOR note IN item.notes %] +
[% note.note | html %]
+ [% END %] +
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + + +
+
+ [% END %] + [% END %] +
+ [% END %] + + +[% |l %]Sharing a Bookbag means that the contents +of the Bookbag will be visible to others. +To see the public view of a shared Bookbag, +click on the Bookbag's name in the Bookbag list.[% END %] + +
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/main.tt2 b/Open-ILS/src/templates/tinypac/myopac/main.tt2 new file mode 100644 index 0000000000..de7d13be50 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/main.tt2 @@ -0,0 +1,186 @@ +[% PROCESS "tinypac/parts/header.tt2"; + PROCESS "tinypac/parts/misc_util.tt2"; + WRAPPER "tinypac/parts/myopac/main_base.tt2"; + myopac_page = "main"; + myopac_main_page = "main"; + myopac_cc_allowed = 0; + IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1; + myopac_cc_allowed = 1; + END +%] +
+ [% IF ctx.fines.circulation.size > 0 %] +
+ + + + + + + + + + + + + [% IF myopac_cc_allowed %] + + [% END %] + + + + [% FOR f IN ctx.fines.circulation; + attrs = {marc_xml => f.marc_xml}; + IF f.marc_xml; + PROCESS get_marc_attrs args=attrs; + ELSIF f.xact.reservation; + attrs.title = f.xact.reservation.target_resource_type.name; + END %] + + + + + + + + [% IF myopac_cc_allowed %] + + [% END %] + + [% END %] + +
+ [% l("Fines") %] +
[% l("Title") %][% l("Author") %][% l("Checkout Date") %][% l("Due Date") %][% l("Date Returned") %][% l("Balance Owed") %] + + +
+ [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id; + IF recid; %] + [% attrs.title | html %] + [% ELSE %] + [% attrs.title | html %] + [% END %] + [%- author_query = attrs.author.replace('[,\.:;]', ''); %] + [% attrs.author | html %] + + [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0; + IF ts; + date.format(ctx.parse_datetime(ts), DATE_FORMAT); + END %] + + [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0; + IF ts; + date.format(ctx.parse_datetime(ts), DATE_FORMAT); + END %] + + [% ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0; + IF ts; + date.format(ctx.parse_datetime(ts), DATE_FORMAT); + ELSE %] + + [% l('(fines accruing)') %] + [% END %] + + + [% money(f.xact.balance_owed) %] + + + +
+
+ [% END %] + + [% IF ctx.fines.grocery.size > 0 %] + +
+
+
+
+ + + + + + + + + + + + + [% IF myopac_cc_allowed %] + + [% END %] + + + + [% FOR f IN ctx.fines.grocery %] + + + + + + + + [% IF myopac_cc_allowed %] + + [% END %] + + [% END %] + +
+ [% l("Other Fees") %] +
[% l("Transaction Start Time") %][% l("Last Payment Time") %][% l("Initial Amount Owed") %][% l("Total Amount Paid") %][% l("Balance Owed") %][% l("Billing Type") %] + + +
[% date.format( + ctx.parse_datetime(f.xact.xact_start), + DATE_FORMAT + ) %] + [% IF f.xact.last_payment_ts; + date.format( + ctx.parse_datetime( + f.xact.last_payment_ts + ), DATE_FORMAT + ); + END %] + [% money(f.xact.total_owed) %][% money(f.xact.total_paid) %] + + [% money(f.xact.balance_owed) %] + + [% f.xact.last_billing_type %] + +
+
+ [% END %] + [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %] +
[% l('You have no current fines.') %]
+ [% ELSIF myopac_cc_allowed %] +
+ +
+ [% END %] +
+[% END %] + +
New Search diff --git a/Open-ILS/src/templates/tinypac/myopac/main_pay.tt2 b/Open-ILS/src/templates/tinypac/myopac/main_pay.tt2 new file mode 100644 index 0000000000..9352b45e9e --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/main_pay.tt2 @@ -0,0 +1,58 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "main"; + myopac_main_page = "pay" %] +
+ + [% IF ctx.payment_response.textcode %] +
+ + [% ctx.payment_response.desc || ctx.payment_response.textcode %] +
+ [% ctx.payment_response.note %] + [% ctx.payment_response.payload.error_message %] +
+

+ [% + url_args = {xact => [], xact_misc => []}; + FOR k IN ['xact', 'xact_misc']; + FOR val IN CGI.param(k); + url_args.$k.push(val); + END; + END; + retry_url = mkurl(ctx.opac_root _ '/myopac/main_payment_form', url_args, 1); + %] +
+ [% + l('Go back to try again or to cancel this payment attempt.') + %] +

+ [% ELSE %] +

[% l('Your payment has been approved.') %]

+ [% IF ctx.printable_receipt.template_output; + print_args = []; + FOR p IN ctx.payment_response.payments; + print_args.push('payment=' _ p); + END %] +

[ [% l('Print receipt') %] ]

+ + [% ctx.printable_receipt.template_output.data %] + + [% ELSE %] +
+ [% l( + 'Error creating receipt: [_1]', + (ctx.printable_receipt.textcode ? ctx.printable_receipt.textcode _ ' / ' _ ctx.printable_receipt.desc : 0) || + ctx.printable_receipt.error_output.data || + l('No receipt data returned from server') + ) | html %] +
+ [% END %] +

[ [% + l("Back to Account Summary") %] ]

+ [% END %] +
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/main_pay_init.tt2 b/Open-ILS/src/templates/tinypac/myopac/main_pay_init.tt2 new file mode 100644 index 0000000000..835571070f --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/main_pay_init.tt2 @@ -0,0 +1,15 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "main"; + myopac_main_page = "pay" %] +
+ +
+ [% l('Processing...') %]

+ [% l('Processing your payment may take some time.') %]
+ [% l("Please do not Refresh or use your browser's Back button or your credit card may be charged more than once.") %]
+
+ +
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/main_payment_form.tt2 b/Open-ILS/src/templates/tinypac/myopac/main_payment_form.tt2 new file mode 100644 index 0000000000..e91838a1de --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/main_payment_form.tt2 @@ -0,0 +1,186 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/main_base.tt2"; + myopac_page = "main"; + myopac_main_page = "payment_form"; + + last_chance = CGI.param("last_chance"); + +%] +[% IF ctx.fines.balance_owed <= 0 %] +
+ [% l("You either have no fines to pay or you have selected fines whose " _ + "total is non-positive. We cannot process non-positive amounts.") %] +
+[% ELSE %] +
+ [% IF last_chance %] +

[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]

+
+ [% FOR k IN CGI.Vars; + NEXT UNLESS k; + FOR val IN CGI.param(k) %] + + [% END; END %] + + [% l('Cancel') %] + [% ELSE %] + + + [% FOR xact IN CGI.param('xact') %] + + [% END %] + [% FOR xact IN CGI.param('xact_misc') %] + + [% END %] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %] + +
[% l('Billing Information') %] +

[% l('Selected fines you are paying for:') %]

+ + + + + + + + + [% + FOR f IN ctx.fines.circulation; + NEXT IF CGI.param('xact').size && + !CGI.param('xact').grep(f.xact.id).size; + attrs = {marc_xml => f.marc_xml}; + IF f.marc_xml; + PROCESS get_marc_attrs args=attrs; + ELSIF f.xact.reservation; + attrs.title = f.xact.reservation.target_resource_type.name; + END %] + + + + + [% + END; + FOR f IN ctx.fines.grocery; + NEXT IF CGI.param('xact_misc').size && + !CGI.param('xact_misc').grep(f.xact.id).size %] + + + + + [% END %] + +
[% l('Name') %][% l('Amount') %]
[% attrs.title | html %][% money(f.xact.balance_owed) %]
[% f.xact.last_billing_type | html %][% money(f.xact.balance_owed) %]
+
+
+ [% l('Total amount to pay:') %] + [% money(ctx.fines.balance_owed) %] +
+
+ [% | l('', '') %]Click [_1]Cancel[_2] to go back and (un)select other fines.[% END %] +
[% l('First Name') %]
[% l('Last Name') %]
[% l('Email Address') %] + + [% l("Update") %] +
[% l('Street Address') %]
[% l('City' )%]
[% l('State or Province') %]
[% l('ZIP or Postal Code') %]
[% l('Credit Card Information') %]
[% l('Credit Card #') %]
[% l('Security Code') %] + +
[% l('Expiration Month') %] + +
[% l('Expiration Year') %] + +
+ + [% l('Cancel') %] +
+ [% END %] +
+
+[% END %] +[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/main_payments.tt2 b/Open-ILS/src/templates/tinypac/myopac/main_payments.tt2 new file mode 100644 index 0000000000..a30edebc55 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/main_payments.tt2 @@ -0,0 +1,59 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/main_base.tt2"; + myopac_page = "main"; + myopac_main_page = "payments"; + limit = ctx.payment_history_limit; + offset = ctx.payment_history_offset; +%] + +
+
+ [% l('Payments History') %] + + + [%# TODO: get total to prevent paging off then end of the list.. %] + + +
+
+ + [% IF ctx.payments.size %] + + + + + + + + + [% FOR payment IN ctx.payments %] + + + + + + + [% END %] + +
[% l('Payment Date') %][% l('Payment For') %][% l('Amount') %][% l('Receipt') %]
[% date.format(ctx.parse_datetime(payment.mp.payment_ts), DATE_FORMAT) %][% + btype = payment.last_billing_type | html; + ptitle = payment.title | html; + (payment.xact_type == 'grocery') ? btype : ptitle + %][% money(payment.mp.amount) %] +
+ + +
+
+ + +
+
+ [% ELSE %] +
[% l('You have no historical payments to display.') %]
+ [% END %] +
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/prefs.tt2 b/Open-ILS/src/templates/tinypac/myopac/prefs.tt2 new file mode 100644 index 0000000000..418c7ac467 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/prefs.tt2 @@ -0,0 +1,252 @@ +[% PROCESS "opac/parts/header.tt2"; + WRAPPER "opac/parts/myopac/prefs_base.tt2"; + myopac_page = "prefs"; + prefs_page = 'personal' %] + +
+
+ + + + + + +
+ [% l("Your account expired on") %] + ! + [% l("Please see a librarian to renew your account.") %]
+
+ +
+ + + + + + + + + + + + +
+ [% l("* Staff Notes *") %]
:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [% IF ctx.username_change_disallowed %] + + [% ELSE %] + + [% END %] + + + + + + + + + + + + + [% IF ctx.user.ident_value %] + + + + + [% END %] + + + + + + + + + + + + + + + + + + +
[% l("Name") %][% l( + HUMAN_NAME_FORMAT, + ctx.user.prefix, ctx.user.first_given_name, + ctx.user.second_given_name, ctx.user.family_name, + ctx.user.suffix + ) | html %]
[% l("Day Phone") %][% ctx.user.day_phone | html %]
[% l("Evening Phone") %][% ctx.user.evening_phone | html %]
[% l("Other Phone") %][% ctx.user.other_phone | html %]
+
+
+ Username Help +
+
[% l("Username") %] +
[% ctx.user.usrname | html %][% l("Change") %]
[% l("Password") %][% l("(not shown)") %][% l("Change") %]
[% l("Email Address") %][% ctx.user.email | html %][% l('Change') %]
+ [% l("Primary Identification") %] + [% + # l('[_1] ([_2])', ctx.user.ident_value, ctx.user.ident_type.name) | html + # XXX uncomment the above line to show primary + # identification. With a minor tweak it could + # alternatively be shown but partially obscured. + %] +
[% l("Active Barcode") %][% ctx.user.card.barcode %]
[% l("Home Library") %][% ctx.user.home_ou.name | html %]
[% l("Account Creation Date") %][% date.format(ctx.parse_datetime(ctx.user.create_date), DATE_FORMAT) %]

+
+
+ + + + + + + + + + [% + # cycle through the non-pending address. For each non-pending addr + # that has a corresponding pending addr, render the pending addr + # along the right inside it's own edit form + pending = {}; + regular = []; + edit_addr_id = CGI.param('edit_address'); + FOR addr IN ctx.user.addresses; + IF addr.pending == 't'; + replaces = addr.replaces; + pending.$replaces = addr; + ELSE; + regular.push(addr); + END; + END; + FOR addr IN regular; + cur_id = addr.id; + pending_addr = pending.$cur_id; + %] + + + + + [% IF pending_addr OR edit_addr_id == cur_id; + update_addr = pending_addr || addr %] + + [% END %] + + [% END %] + +
[% l("Addresses") %][% l("Pending Addresses") %]
+ + + + + + + + + + + [% IF ctx.get_org_setting(ctx.user.home_ou.id, 'opac.allow_pending_address') + AND !pending_addr AND edit_addr_id != cur_id %] + + + + [% END %] +
[% l("Address Type") %][% addr.address_type | html %]
[% l("Street") %][% addr.street1 | html %]
[% l("Street") %][% addr.street2 | html %]
[% l("City") %][% addr.city | html %]
[% l("County") %][% addr.county| html %]
[% l("State") %][% addr.state | html %]
[% l("Country") %][% addr.country | html %]
[% l("Zip") %][% addr.post_code | html %]
+ [% l('Edit Address') %] +
+
+
+ [% IF pending_addr %] + + [% ELSE %] + + [% END %] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[% l("Address Type") %]
[% l("Street") %]
[% l("Street") %]
[% l("City") %]
[% l("County") %]
[% l("State") %] +
[% l("Country") %]
[% l("Zip") %]
+ [% params = (pending_addr) ? {delete_pending => pending_addr.id} : {} %] + [% l('Discard Pending Address') %] +
[% l('Address changes will be verified by staff') %]
+
+
+
+ +[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/prefs_notify.tt2 b/Open-ILS/src/templates/tinypac/myopac/prefs_notify.tt2 new file mode 100644 index 0000000000..fcd9f47823 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/prefs_notify.tt2 @@ -0,0 +1,97 @@ +[% PROCESS "opac/parts/header.tt2"; + WRAPPER "opac/parts/myopac/prefs_base.tt2"; + myopac_page = "prefs"; + prefs_page = 'notify' %] + +
+ [% setting = 'opac.hold_notify' %] + + + + + + [% IF ctx.updated_user_settings %] + + [% END %] + + + + + + + + + + + + + + [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %] + + + + + + + + + + + + + [% END %] + +
+
+ [% l('Account Successfully Updated') %] +
+
[% l('Notify by Email by default when a hold is ready for pickup?') %] + [% setting = 'opac.hold_notify' %] + +
[% l('Notify by Phone by default when a hold is ready for pickup?') %] + [% setting = 'opac.hold_notify' %] + +
[% l('Default Phone Number') %] + [% setting = 'opac.default_phone' %] + +
[% l('Notify by Text by default when a hold is ready for pickup?') %] + [% setting = 'opac.hold_notify' %] + +
[% l('Default Mobile Carrier') %][% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_label="true" %]
[% l('Default Mobile Number') %] + [% setting = 'opac.default_sms_notify' %] + + [% l('Hint: use the full 10 digits of your phone #, no spaces, no dashes'); %] +
+ + + + + + + + [% IF optin.size == 0 %] + [% l('No notification preferences are configured') %] + [% END %] + [% FOR optin IN ctx.opt_in_settings %] + + + + + [% END %] + +
[% l('Notification Type') %][% l('Enabled') %]
[% optin.cust.label | html %] + +
+ +
+[% END %] + + diff --git a/Open-ILS/src/templates/tinypac/myopac/prefs_settings.tt2 b/Open-ILS/src/templates/tinypac/myopac/prefs_settings.tt2 new file mode 100644 index 0000000000..b5d1f70765 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/prefs_settings.tt2 @@ -0,0 +1,98 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/org_selector.tt2"; + WRAPPER "opac/parts/myopac/prefs_base.tt2"; + myopac_page = "prefs"; + prefs_page = 'settings' %] + + +
+ + + + + [% IF ctx.updated_user_settings %] + + [% END %] + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ [% l('Account Successfully Updated') %] +
+
[% l("Search hits per page") %] + [% setting = 'opac.hits_per_page' %] + + [% l('Search Hits Help') %] +
[% l("Preferred search location") %] + [%- setting = 'opac.default_search_location'; + thang = ctx.user.home_ou.id; + IF ctx.user_setting_map.$setting; + thang = ctx.user_setting_map.$setting; + END; + INCLUDE build_org_selector name=setting value=thang; + %] +
[% l("Preferred pickup location") %] + [%- setting = 'opac.default_pickup_location'; + thang = ctx.user.home_ou.id; + IF ctx.user_setting_map.$setting; + thang = ctx.user_setting_map.$setting; + END; + INCLUDE build_org_selector name=setting value=thang can_have_vols_only=1; + %] +
[% l('Keep history of checked out items?') %] + [% setting = 'history.circ.retention_start' %] + +
[% l('Keep history of holds?') %] + [% setting = 'history.hold.retention_start' %] + +
+ +
+ [% INCLUDE "opac/parts/myopac/prefs_hints.tt2" %] +[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/receipt_email.tt2 b/Open-ILS/src/templates/tinypac/myopac/receipt_email.tt2 new file mode 100644 index 0000000000..15b744f8cf --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/receipt_email.tt2 @@ -0,0 +1,21 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "prefs" %] + [% IF ctx.email_receipt_result; # result should be undef on success %] +
+ [% l('Error preparing receipt:') %] + + [% ctx.email_receipt_result.desc | html %] + +
+ [% ELSE %] +
+ [% l('Your receipt will be emailed to [_1]', ctx.user.email) | html %] +
+ [% END %] +

+ [ [% + l("Back to Payments History") %] ] +

+[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/receipt_print.tt2 b/Open-ILS/src/templates/tinypac/myopac/receipt_print.tt2 new file mode 100644 index 0000000000..fe6849502b --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/receipt_print.tt2 @@ -0,0 +1,25 @@ +[%# sic! no wrapper %] + + + [% l('Receipt') %] + + + [% IF ctx.printable_receipt.template_output %] + + [% ctx.printable_receipt.template_output.data %] + + [% ELSE %] +
+ [% l( + 'Error preparing receipt: [_1]', + (ctx.printable_receipt.textcode ? ctx.printable_receipt.textcode _ ' / ' _ ctx.printable_receipt.desc : 0) || + ctx.printable_receipt.error_output.data || + l('No receipt data returned from server') + ) | html %] +
+ [% END %] +
+

[ [% + l("Back to Payments History") %] ]

+ + diff --git a/Open-ILS/src/templates/tinypac/myopac/update_email.tt2 b/Open-ILS/src/templates/tinypac/myopac/update_email.tt2 new file mode 100644 index 0000000000..6b662bd67c --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/update_email.tt2 @@ -0,0 +1,32 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "prefs" %] +
+ +[% IF ctx.invalid_email %] +
+ [% bad_email = ctx.invalid_email | html %] + [% l('The email address "[_1]" is invalid. Please try a different email address.', bad_email) %] +
+ +[% ELSIF ctx.password_incorrect %] +
+ [% |l %] Your current password was not correct. [% END %] +
+ +[% END %] + +
+ [% IF CGI.param("return_to_referer") %] + + [% END %] + + + + + +
[% l('Current Email') %][% ctx.user.email | html %]
[% l('Current Password') %]
[% l('New Email') %]
+
+ +[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/update_password.tt2 b/Open-ILS/src/templates/tinypac/myopac/update_password.tt2 new file mode 100644 index 0000000000..c87fc5d71f --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/update_password.tt2 @@ -0,0 +1,33 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "prefs" %] + +
+ +[% IF ctx.password_invalid %] +
+ [% |l %] New password is invalid. Please try a different password. [% END %] +
+ +[% ELSIF ctx.password_nomatch %] +
+ [% |l %] Passwords do not match. [% END %] +
+ +[% ELSIF ctx.password_incorrect %] +
+ [% |l %] Your current password was not correct. [% END %] +
+[% END %] + +
+ + + + + +
[% l('Current Password') %]
[% l('New Password') %]
[% l('New Password Again') %]
+
+ +[% END %] diff --git a/Open-ILS/src/templates/tinypac/myopac/update_username.tt2 b/Open-ILS/src/templates/tinypac/myopac/update_username.tt2 new file mode 100644 index 0000000000..a3a0bd2654 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/myopac/update_username.tt2 @@ -0,0 +1,37 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; + myopac_page = "prefs" %] +
+ +[% IF ctx.invalid_username %] +
+ [% bad_user = ctx.invalid_username | html %] + [% l('"[_1]" is not a valid username. Usernames cannot have any spaces or look like a barcode, and may be restricted by policy. Please try a different username.', bad_user) %] +
+ +[% ELSIF ctx.username_exists %] +
+ [% bad_user = ctx.username_exists | html %] + [% | l(bad_user) %] + The username "[_1]" is taken. Please try a different username. + [% END %] +
+ +[% ELSIF ctx.password_incorrect %] +
+ [% |l %] Your current password was not correct. [% END %] +
+ +[% END %] + +
+ + + + + +
[% l('Current Username') %][% ctx.user.usrname | html %]
[% l('Current Password') %]
[% l('New Username') %]
+
+ +[% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/acjs.tt2 b/Open-ILS/src/templates/tinypac/parts/acjs.tt2 new file mode 100644 index 0000000000..fe15569e22 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/acjs.tt2 @@ -0,0 +1,55 @@ + + + diff --git a/Open-ILS/src/templates/tinypac/parts/anon_list.tt2 b/Open-ILS/src/templates/tinypac/parts/anon_list.tt2 new file mode 100644 index 0000000000..00a898dc48 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/anon_list.tt2 @@ -0,0 +1,70 @@ + [% IF ctx.mylist.size %] +
+
+ + [% INCLUDE "opac/parts/filtersort.tt2" mode='bookbag' + id="anonsort" name="anonsort" value=CGI.param("anonsort") %] + + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + +
+
+ +
+
+

[% l('Temporary List') %]

+ + + + + + + + + + [% FOR item IN ctx.mylist; + attrs = {marc_xml => ctx.mylist_marc_xml.$item}; + PROCESS get_marc_attrs args=attrs %] + + + + + + [% END %] + +
+ + [% l('Title') %][% l('Author(s)') %] + + + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + +
+ + [% attrs.title | html %][% attrs.author | html %]
+

+
+
+ [% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/chilifresh.tt2 b/Open-ILS/src/templates/tinypac/parts/chilifresh.tt2 new file mode 100644 index 0000000000..937e20f3f7 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/chilifresh.tt2 @@ -0,0 +1,17 @@ +[%- IF ENV.OILS_CHILIFRESH_URL AND ENV.OILS_CHILIFRESH_ACCOUNT + AND (ctx.page == 'rresult' OR ctx.page == 'record'); + chili_url = ENV.OILS_CHILIFRESH_URL; + IF CGI.https AND ENV.OILS_CHILIFRESH_HTTPS_URL; + chili_url = ENV.OILS_CHILIFRESH_HTTPS_URL; + END; +%] + + + + + + + +[%- END %] diff --git a/Open-ILS/src/templates/tinypac/parts/coded_value_selector.tt2 b/Open-ILS/src/templates/tinypac/parts/coded_value_selector.tt2 new file mode 100644 index 0000000000..18bb4a4166 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/coded_value_selector.tt2 @@ -0,0 +1,45 @@ + +[%- + # If caller passes a list of possible attribute types, + # search all until we find some values + + IF !attr.size; attr = [attr]; END; + all_values = []; + attr_class = ''; + FOR attr_class IN attr; + all_values = ctx.search_ccvm('ctype', attr_class, 'opac_visible', 't'); + IF all_values.size > 0; LAST; END; + END; + name = name || "fi:" _ attr_class; + id = id || attr_class _ "_selector"; + values = values || CGI.param(name); +-%] + + + diff --git a/Open-ILS/src/templates/tinypac/parts/config.tt2 b/Open-ILS/src/templates/tinypac/parts/config.tt2 new file mode 100644 index 0000000000..bfe6427c08 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/config.tt2 @@ -0,0 +1,67 @@ +[% + +############################################################################## +# This file contains skin-level configuration settings. +# Many of these settings will probably migrate into actor.org_unit_settings. +############################################################################## + +############################################################################## +# RefWorks configuration +############################################################################## +# RefWorks is a Web-based citation manager +ctx.refworks.enabled = 'false'; + +# Base URL for RefWorks +ctx.refworks.url = 'http://www.refworks.com'; + +# Some sites have a hosted RefWorks instance at a different URL; +# in addition, you might want to proxy access to RefWorks - for example: +# ctx.refworks.url = 'http://librweb.laurentian.ca/login?url=http://refworks.scholarsportal.info'; + +############################################################################## +# OpenURL resolution +############################################################################## +# Evergreen provides the ability to point at an OpenURL resolver to find +# electronic resources for a given ISSN or ISBN. Currently, only the SFX +# resolver is supported. +# +# You must enable the open-ils.resolver instance in opensrf.xml to use +# this feature. +############################################################################## + +openurl.enabled = 'false'; +openurl.baseurl = 'http://sfx.example.com/instance'; + +############################################################################## +# Google Analytics support +############################################################################## +# You can enable Google Analytics support in Evergreen by entering a +# valid Google Analytics code and changing 'false' to 'true' +############################################################################## +google_analytics.enabled = 'false'; +google_analytics.code = 'UA-9999999-99'; + +############################################################################## +# Enable "Forgot your password?" prompt at login +############################################################################## +reset_password = 'true'; + +############################################################################## +# Misc. UI Settings +############################################################################## + +############################################################################## +# Size of the jacket image to display on the record detail summary. +# Sizes vary depending on added content provider. +# Options are "small", "medium", and "large" +record.summary.jacket_size = 'medium'; + + +############################################################################## +# Define the order in which facets are displayed. Only facets listed here +# will be displayed. To show all facets sorted by name, comment out this +# setting. +# facet.display = [] # show no facets +facet.display = []; + +%] diff --git a/Open-ILS/src/templates/tinypac/parts/filter_group_selector.tt2 b/Open-ILS/src/templates/tinypac/parts/filter_group_selector.tt2 new file mode 100644 index 0000000000..3b8f730b6e --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/filter_group_selector.tt2 @@ -0,0 +1,31 @@ +[%- + # If caller passes a list of possible filter_groups + # search all until we find some values + IF !filter_group.size; filter_group = [filter_group]; END; + group = ''; + FOR code IN filter_group; + group = ctx.search_filter_groups.$code; + LAST IF group AND group.entries.size; + END; + name = name || "fg:" _ group.code; + id = id || group.code _ "_selector"; + values = values || CGI.param(name); +-%] + + + diff --git a/Open-ILS/src/templates/tinypac/parts/filtersort.tt2 b/Open-ILS/src/templates/tinypac/parts/filtersort.tt2 new file mode 100644 index 0000000000..8d47979711 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/filtersort.tt2 @@ -0,0 +1,15 @@ + diff --git a/Open-ILS/src/templates/tinypac/parts/footer.tt2 b/Open-ILS/src/templates/tinypac/parts/footer.tt2 new file mode 100644 index 0000000000..76c6b7a56d --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/footer.tt2 @@ -0,0 +1,33 @@ +[%- + USE CGI = CGI_utf8; + hostname = CGI.url({'-base' => 1}); +-%] + diff --git a/Open-ILS/src/templates/tinypac/parts/header.tt2 b/Open-ILS/src/templates/tinypac/parts/header.tt2 new file mode 100644 index 0000000000..ba754129cc --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/header.tt2 @@ -0,0 +1,99 @@ +[%- USE money = format(l('$%.2f')); + USE date; + USE CGI = CGI_utf8; + USE POSIX; + USE HTML; + SET DATE_FORMAT = l('%m/%d/%Y'); + PROCESS "opac/parts/config.tt2"; + + # Don't wrap in l() here; do that where this format string is actually used. + SET HUMAN_NAME_FORMAT = '[_1] [_2] [_3] [_4] [_5]'; + + is_advanced = CGI.param("_adv").size; + is_special = CGI.param("_special").size; + + # ----------------------------------------------------------------------------- + # mkurl( destination_page, params_to_set, params_to_clear ) + # + # Current page, updated params: + # mkurl('', {foo => 'bar', boo => 'baz'}); + # + # New page, one param is a list: + # mkurl('http://flarg.baz/squz', {foo => 'bar', boo => ['baz', 'faz']}); + # + # New page, clear all existing params before applying new ones: + # mkurl('/fuz/buster', {foo => 'bar', boo => 'baz'}, 1); + # + # Current page, clear 'some_param' from the existing params: + # mkurl('', {foo => 'bar', boo => 'baz'}, ['some_param']); + # + # Current page to a named anchor 'copies' + # mkurl('', {}, [], 'copies'); + MACRO mkurl(page, params, clear_params, named_anchor) BLOCK; + + # clone the query string to avoid clobberation + cgi = CGI.new(CGI.query_string); + + # remove requested params + IF clear_params.0; # array + FOR p IN clear_params; cgi.delete(p); END; + ELSIF clear_params; + cgi.delete_all(); + END; + + # x and y are artifacts of using tags + # instead of true submit buttons, and their values are never used. + cgi.delete('x', 'y'); + + # apply user params + FOR k IN params.keys; + encoded = []; + max = params.$k.max; + + # The following commented-out line can be fooled. Its replacement + # below is what you really mean. + # list = (params.$k.0 OR max == -1) ? params.$k : [params.$k]; + list = params.$k.list; + + IF list.size == 0; NEXT; END; + # CGI croaks on already-decoded strings. force-encode to be safe. + FOR p IN list; encoded.push(ctx.encode_utf8(p)); END; + foo = cgi.param("-name", k, "-values", encoded); + END; + + # for url brevity, remove any params that have no value + FOR p IN cgi.param; + val = cgi.param(p); + IF val == ''; cgi.delete(p); END; + + # Delete POST vars unless we asked for them + UNLESS CGI.url_param(p).defined OR params.defined(p); + cgi.delete(p); + END; + END; + + final = named_anchor ? '#' _ named_anchor : ''; + + IF page; + IF cgi.query_string; + page _ '?' _ cgi.query_string _ final; + ELSE; + page _ final; + END; + ELSE; + # staying on the current page + cgi.url("-path" => 1, "-query" => 1) _ final; + END; + END; + + # Whether we want Dojo or not may one day be a wholly distinct + # concern from whether we want autosuggest, so let's get used to + # defining that separately. + want_dojo = 0; + + use_autosuggest = ctx.get_cgf("opac.use_autosuggest"); + + IF use_autosuggest.enabled == "t"; + want_dojo = 1; + END; +%] diff --git a/Open-ILS/src/templates/tinypac/parts/hold_error_messages.tt2 b/Open-ILS/src/templates/tinypac/parts/hold_error_messages.tt2 new file mode 100644 index 0000000000..50a0ebff94 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/hold_error_messages.tt2 @@ -0,0 +1,42 @@ +[% + # XXX It might be cleaner to move this into its own file or something. + # + # The following hash should have fail_parts as keys and user/patron-friendly + # strings as values. If the system returns an event with a fail_part when + # you attempt to place a hold and the fail part matches something in this + # hash, this is the message that will be displayed to the user. Wait until + # these are used to pass them through l() for i18n. + + FAIL_PART_MSG_MAP = { + "actor.usr.barred" => l("The patron is barred"), + "asset.copy.circulate" => l("The item does not circulate"), + "asset.copy_location.circulate" => l("Items from this shelving location do not circulate"), + "asset.copy.status" => l("The item cannot circulate at this time"), + "circ.holds.target_skip_me" => l("The item's circulation library does not fulfill holds"), + "config.circ_matrix_circ_mod_test" => l("The patron has too many items of this type checked out"), + "config.circ_matrix_test.available_copy_hold_ratio" => l("The available item-to-hold ratio is too low"), + "config.circ_matrix_test.circulate" => l("Circulation rules reject this item as non-circulatable"), + "config.circ_matrix_test.total_copy_hold_ratio" => l("The total item-to-hold ratio is too low"), + "config.hold_matrix_test.holdable" => l("Hold rules reject this item as unholdable"), + "config.hold_matrix_test.max_holds" => l("The patron has reached the maximum number of holds"), + "config.rule_age_hold_protect.prox" => l("The item is too new to transit this far"), + "item.holdable" => l("The item is not holdable"), + "location.holdable" => l("The item's location is not holdable"), + "status.holdable" => l("The item is not in a holdable status"), + "no_item" => l("The system could not find this item"), + "no_ultimate_items" => l("The system could not find any items to match this hold request"), + "no_matchpoint" => l("System rules do not define how to handle this item"), + "no_user" => l("The system could not find this patron"), + "transit_range" => l("The item cannot transit this far") + }; + + + # This works like the above has, but instead of fail_parts for keys, use + # the textcode of the event. This will only be consulted for events + # that do not have a fail_part matching something in the above hash. + # Wait until these are used to pass them through l() for i18n. + + EVENT_MSG_MAP = { + "PATRON_EXCEEDS_FINES" => l("Patron has reached the maximum fine amount") + }; +%] diff --git a/Open-ILS/src/templates/tinypac/parts/hold_status.tt2 b/Open-ILS/src/templates/tinypac/parts/hold_status.tt2 new file mode 100644 index 0000000000..16499c9ac1 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/hold_status.tt2 @@ -0,0 +1,29 @@ +[% BLOCK get_hold_status %] +
+ [% + IF hold.hold.status == 4; + l("Available") | html; + IF ahr.shelf_expire_time; + '
'; + l('Expires [_1]', + date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT)) | html; + END; + + ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0; + # estimated wait is delivered as seconds. + SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400); + l("Estimated wait: [quant,_1,day,days]", hwait) | html; + + ELSIF hold.hold.status == 3 OR hold.hold.status == 8; + l("In Transit") | html; + + ELSIF hold.hold.status < 3; + l("Waiting for copy") | html; + END + %] +
+ +[% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/js.tt2 b/Open-ILS/src/templates/tinypac/parts/js.tt2 new file mode 100644 index 0000000000..7029554d02 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/js.tt2 @@ -0,0 +1,82 @@ + + + +[%- IF ctx.is_staff %] + + [% IF ctx.page == 'record' %] + [% IF ctx.search_result_index >= 0 %] + + [% END %] + [% IF ctx.mfhd_summaries.size %] + + [% END %] + [% END %] +[%- END %] + +[%- IF ENV.OILS_NOVELIST_URL AND ctx.page == 'record'; + url = ENV.OILS_NOVELIST_URL; + IF CGI.https; url = url.replace('^http:', 'https:'); END; %] + +[%- END %] +[%- IF want_dojo; -%] + + + + +[%- # So the following works in Mozilla and Chrome, but not in IE8. + # Seems like it /should/ work anywhere, though, and obviate the + # next three script tags: %] + + + + + + +[% IF use_autosuggest.enabled == "t"; %] + +[% END; # use_autosuggest %] + +[% INCLUDE "opac/parts/acjs.tt2" IF ctx.page == 'record' %] + +[%- END; # want_dojo -%] diff --git a/Open-ILS/src/templates/tinypac/parts/login/form.tt2 b/Open-ILS/src/templates/tinypac/parts/login/form.tt2 new file mode 100644 index 0000000000..c98235e458 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/login/form.tt2 @@ -0,0 +1,135 @@ + + +[% IF ctx.login_failed_event %] +
+[% + IF ctx.login_failed_event.textcode == 'PATRON_CARD_INACTIVE'; + l("The barcode used to login is marked as inactive. Please contact your local library."); + ELSIF ctx.login_failed_event.textcode == 'PATRON_INACTIVE'; + l("This account has been deactivated. Please contact your local library."); + ELSE; + l("Login failed. The username or password provided was not valid. + Ensure Caps-Lock is off and try again or contact your local library."); + END; +%] +
+[% END %] + +
+
+
+ + + + + +
+
+
+
diff --git a/Open-ILS/src/templates/tinypac/parts/login/help.tt2 b/Open-ILS/src/templates/tinypac/parts/login/help.tt2 new file mode 100644 index 0000000000..16db31fe7e --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/login/help.tt2 @@ -0,0 +1,12 @@ + + + [% l('Questions?') %] + +
+ [% l('Visit our FAQs section for answers to common questions about how to use your account.') %] +
+ + [% l('FAQs') %] + diff --git a/Open-ILS/src/templates/tinypac/parts/misc_util.tt2 b/Open-ILS/src/templates/tinypac/parts/misc_util.tt2 new file mode 100644 index 0000000000..fe4d97fe02 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/misc_util.tt2 @@ -0,0 +1,270 @@ +[% + # Extract MARC fields from XML + # get_marc_attrs( { marc_xml => doc } ) + BLOCK get_marc_attrs; + xml = args.marc_xml; + + # Map item types to schema.org types; impedance mismatch :( + args.schema.itemtype = {}; + schema_typemap = {}; + schema_typemap.a = 'http://schema.org/Book'; + schema_typemap.j = 'http://schema.org/MusicRecording'; + + args.isbns = []; + FOR isbn IN xml.findnodes('//*[@tag="020"]/*[@code="a"]'); + args.isbns.push(isbn.textContent); + END; + + args.upcs = []; + FOR upc IN xml.findnodes('//*[@tag="024"]/*[@code="a"]'); + args.upcs.push(upc.textContent); + END; + args.upc = args.upcs.0; # use first UPC as the default + + args.issns = []; + FOR sub IN xml.findnodes('//*[@tag="022"]/*[@code="a"]'); + args.issns.push(sub.textContent); + END; + args.issn = (args.issns.size) ? args.issn.0 : ''; + + args.authors = []; + FOR sub IN xml.findnodes('//*[@tag="100"]/*[@code="a"]'); + args.authors.push(sub.textContent); + END; + args.author = (args.authors.size) ? args.authors.0 : ''; + + # Include subfields 'abnp' to generate a more comprehensive title display in search results + titresults = xml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b" or @code="n" or @code="p"]'); + titresults_content = []; + FOR sub IN titresults; titresults_content.push(sub.textContent); END; + args.title = titresults_content.join(" "); + # Avoid ugly trailing syntax on brief titles + args.title = args.title | replace('[:;/]$', ''); + + # Provide correct spacing between the subfields + titsubs = xml.findnodes('//*[@tag="245"]/*[@code]'); + titsubs_content = []; + FOR sub IN titsubs; titsubs_content.push(sub.textContent); END; + args.title_extended = titsubs_content.join(" "); + + args.publishers = []; + FOR sub IN xml.findnodes('//*[@tag="260"]/*[@code="b"]'); + args.publishers.push(sub.textContent); + END; + args.publisher = (args.publishers.size) ? args.publishers.0 : ''; + + args.pubdates = []; + FOR sub IN xml.findnodes('//*[@tag="260"]/*[@code="c"]'); + args.pubdates.push(sub.textContent); + END; + args.pubdate = (args.pubdates.size) ? args.pubdates.0 : ''; + + args.summaries = []; + FOR sub IN xml.findnodes('//*[@tag="520"]/*[@code="a"]'); + args.summaries.push(sub.textContent); + END; + args.summary = (args.summary.size) ? args.summary.0 : ''; + + args.editions = []; + ed_hunt = xml.findnodes('//*[@tag="250"]/*[@code="a"]') && + xml.findnodes('//*[@tag="534"]/*[@code="b"]') && + xml.findnodes('//*[@tag="775"]/*[@code="b"]'); + FOR sub IN ed_hunt; + args.editions.push(sub.textContent); + END; + args.edition = (args.editions.size) ? args.editions.0 : ''; + + phys_content = []; + FOR sub IN xml.findnodes( + '//*[@tag="300"]/*[@code="a" or @code="b" or @code="c" or @code="e"]' + ); + phys_content.push(sub.textContent); + END; + args.phys_desc = phys_content.join(" "); + + args.contents_list = []; + FOR sub IN xml.findnodes('//*[@tag="505"]'); + args.contents_list.push(sub.textContent); + END; + args.contents = args.contents_list.join(" "); + args.content = (args.contents.size) ? args.contents.0 : ''; + + # MARC Callnumber + args.marc_cns = []; + FOR sub IN xml.findnodes('//*[@tag="092" or @tag="099"]/*'); + args.marc_cns.push(sub.textContent); + END; + args.marc_cn = (args.marc_cns.size ) ? args.marc_cns.0 : ''; + + + # clean up the ISBN + args.isbn_clean = args.isbns.0.replace('\ .*', ''); + + # Extract the 856 URLs that are not otherwise represented by asset.uri's + args.online_res = []; + FOR node IN xml.findnodes('//*[@tag="856" and @ind1="4" and (@ind2="0" or @ind2="1")]'); + IF node.findnodes('./*[@code="9" or @code="w" or @code="n"]'); NEXT; END; # asset.uri's + label = node.findnodes('./*[@code="y"]'); + notes = node.findnodes('./*[@code="z" or @code="3"]'); + FOR href IN node.findnodes('./*[@code="u"]'); + NEXT UNLESS href; + # it's possible for multiple $u's to exist within 1 856 tag. + # in that case, honor the label/notes data for the first $u, but + # leave any subsequent $u's as unadorned href's. + # use href/link/note keys to be consistent with args.uri's + args.online_res.push({ + href => href.textContent, + link => (loop.first AND label) ? label.textContent : href.textContent, + note => (loop.first) ? notes.textContent : '' + }); + END; + END; + + args.holdings = []; + args.uris = []; + args.issns = []; + args.resolver_isbns = []; + args.resolver_issns = []; + + # we use $9 of ISBN and ISSN as a flag for e-version + FOR resolver_isbn IN xml.findnodes('//*[@tag="020"]/*[@code="9"]'); + IF resolver_isbn.textContent == "SFX" || resolver_isbn.textContent == "CUFTS"; + my_parent = resolver_isbn.parentNode(); + FOR resolver_isbn_val IN my_parent.findnodes('./*[@code="a"]'); + args.resolver_isbns.push( + resolver_isbn_val.textContent.replace('-', '').replace('\ .*', '') + ); + END; + END; + END; + + FOR resolver_issn IN xml.findnodes('//*[@tag="022"]/*[@code="9"]'); + IF resolver_issn.textContent == "SFX" || resolver_issn.textContent == "CUFTS"; + my_parent = resolver_issn.parentNode(); + FOR resolver_issn_val IN my_parent.findnodes('./*[@code="a"]'); + args.resolver_issns.push( + resolver_issn_val.textContent.replace('[^\d\-X]', '') + ); + END; + END; + END; + + # now snag all issns + FOR rawissn IN xml.findnodes('//*[@tag="022"]/*[@code="a"]'); + args.issns.push( + rawissn.textContent.replace('[^\d\-X]', '') + ); + END; + + FOR volume IN xml.findnodes('//*[local-name()="volumes"]/*[local-name()="volume"]'); + + # Check volume visibility - could push this into XPath + vol.label = volume.getAttribute('label'); + + # Prepend prefix, if any + prefix = volume.findnodes('./*[local-name()="call_number_prefix"][@ident!="-1"]'); + IF prefix.getAttribute('label') != ''; + vol.label = prefix.getAttribute('label') _ " " _ vol.label; + END; + + # Append prefix, if any + suffix = volume.findnodes('./*[local-name()="call_number_suffix"][@ident!="-1"]'); + IF suffix.getAttribute('label') != ''; + vol.label = vol.label _ " " _ suffix.getAttribute('label'); + END; + + vol.id = volume.getAttribute('id'); + NEXT IF volume.getAttribute('opac_visible') == 'false'; + NEXT IF volume.getAttribute('deleted') == 'true'; + + IF vol.label == '##URI##'; + FOR uri IN volume.findnodes('./*[local-name()="uris"]/*[local-name()="uri"]'); + res = {}; + res.href = uri.getAttribute('href'); + res.link = uri.getAttribute('label'); + res.note = uri.getAttribute('use_restriction'); + args.uris.push(res); + END; + NEXT; + ELSE; + copies = volume.findnodes('./*[local-name()="copies"]/*[local-name()="copy"]'); + FOR copy IN copies; + parts = copy.findnodes('./*[local-name()="monograph_parts"]/*[local-name()="monograph_part"]'); + FOREACH part IN parts; + part_label = part.getAttribute('label'); + LAST IF part_label != ''; + END; + # Check copy visibility + cp.deleted = copy.getAttribute('deleted'); + cp.visible = copy.getAttribute('opac_visible'); + NEXT IF (cp.deleted == 'true' OR cp.visible == 'false'); + + # Iterate through all of the children to determine visibility + FOR node IN cp.childNodes; + NEXT IF cp.visible == 'false'; + vis = node.getAttribute('opac_visible'); + del = node.getAttribute('deleted'); + IF vis == 'false' or del == 'true'; + cp.visible = 'false'; + END; + END; + + NEXT IF cp.visible == 'false'; + + loc = copy.findnodes('./*[local-name()="location"]'); + circlib = copy.findnodes('./*[local-name()="circlib"]'); + status = copy.findnodes('./*[local-name()="status"]'); + + holding = { + label => vol.label, + part_label => part_label, + location => loc.textContent, + library => circlib.textContent, + status => status.textContent + barcode => copy.getAttribute('barcode') + }; + args.holdings.push(holding); + part_label = ''; + END; + END; + END; + + # Extract the copy count summary + count_type = (ctx.is_staff) ? 'staff' : 'public'; + + # Consortial copy count summary first + xpath = '//*[local-name()="counts"]/*[local-name()="count"][@type="' _ count_type _ '"]'; + args.copy_counts = {}; + FOR node IN xml.findnodes(xpath); + FOR attr IN ['count', 'available', 'unshadow', 'transcendant', 'org_unit']; + depth = node.getAttribute('depth'); + args.copy_counts.$depth.$attr = node.getAttribute(attr); + END; + END; + + # Get preferred library copy count + args.plib_copy_counts = {}; + count_type = 'pref_lib'; + xpath = '//*[local-name()="counts"]/*[local-name()="count"][@type="' _ count_type _ '"]'; + FOR node IN xml.findnodes(xpath); + FOR attr IN ['count', 'available', 'unshadow', 'transcendant', 'org_unit']; + depth = node.getAttribute('depth'); + args.plib_copy_counts.$depth.$attr = node.getAttribute(attr); + END; + END; + + # "mattype" == "custom marc format specifier" + FOR icon_style IN ['mattype', 'item_type']; + node = xml.findnodes( + '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]'); + IF node AND node.textContent; + type = node.textContent; + args.format_label = node.getAttribute('coded-value') + args.schema.itemtype = schema_typemap.$type; + args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ type _ '.png'; + LAST; + END; + END; + + END; +%] diff --git a/Open-ILS/src/templates/tinypac/parts/myopac/base.tt2 b/Open-ILS/src/templates/tinypac/parts/myopac/base.tt2 new file mode 100644 index 0000000000..63b01b30e5 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/myopac/base.tt2 @@ -0,0 +1,30 @@ +[% WRAPPER "tinypac/base.tt2" %] + +[% myopac_pages = [ + {url => "main", name => l("Account Summary")}, + {url => "circs", name => l("Items Out")}, + {url => "holds", name => l("Holds")}, + ]; + skin_root = "../" +%] +
+
+
+ [%- FOREACH page IN myopac_pages; + IF page.url == myopac_page; + cls_which = "acct-tab-on"; + ctx.page_title = "Your Account - " _ page.name; + ELSE; + cls_which = "acct-tab-off"; + END -%] + [% page.name; %] + [% END %] +
+
+
+ [% content %] +
+
+
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/myopac/main_base.tt2 b/Open-ILS/src/templates/tinypac/parts/myopac/main_base.tt2 new file mode 100644 index 0000000000..4a5040aba4 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/myopac/main_base.tt2 @@ -0,0 +1,104 @@ +[% PROCESS "tinypac/parts/header.tt2"; + PROCESS "tinypac/parts/misc_util.tt2"; + WRAPPER "tinypac/parts/myopac/base.tt2"; +%] + +
+ + + + + + + + + +
+
+
+
+
+
+ + + + + +
[% l("Items Currently Checked out ([_1])", ctx.user_stats.checkouts.total_out) %] + [% l("View All") %] +
+
+
+ + + + + +
[% l('Items Currently on Hold ([_1])', ctx.user_stats.holds.total) %] + [% l('View All') %] +
+
+
+ + + + + +
[% l('Items ready for pickup ([_1])', ctx.user_stats.holds.ready) %] + [% l('View All') %] +
+
+ +
+
+
+
+ + [% IF myopac_main_page == "payment_form" OR ( + !ctx.fines.circulation.size AND !ctx.fines.grocery.size + ) %] +
+ [% ELSE %] +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ [% l('Fines:') %] + + [% money(ctx.user_stats.fines.balance_owed) %] +
+ [% IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1 %] +
+ [% END %] + + [% END %] + +
+
+
+
+ [% content %] +
+
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/myopac/main_refund_policy.tt2 b/Open-ILS/src/templates/tinypac/parts/myopac/main_refund_policy.tt2 new file mode 100644 index 0000000000..0a41658892 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/myopac/main_refund_policy.tt2 @@ -0,0 +1,18 @@ + + +
+ [% l('Important! You must have a printed receipt + to be eligible for a refund on lost items + (regulations allow for no exceptions).') + %] +
+ + [% l('To ensure your necessary receipt information + is not lost, enter your email address above + and a receipt will be emailed to you. Otherwise, + make certain you have a printed receipt in hand + before closing the payment receipt screen.') + %] + + + diff --git a/Open-ILS/src/templates/tinypac/parts/myopac/prefs_base.tt2 b/Open-ILS/src/templates/tinypac/parts/myopac/prefs_base.tt2 new file mode 100644 index 0000000000..b6a1194245 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/myopac/prefs_base.tt2 @@ -0,0 +1,56 @@ +[% PROCESS "opac/parts/header.tt2"; + WRAPPER "opac/parts/myopac/base.tt2"; %] + +
+ + +

+ +
+ [% l('Account Information and Preferences') %] + + [% l('Export List') %] + +
+ +
+ +[% content; %] + +
+[% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/myopac/prefs_hints.tt2 b/Open-ILS/src/templates/tinypac/parts/myopac/prefs_hints.tt2 new file mode 100644 index 0000000000..e2fbc6b76e --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/myopac/prefs_hints.tt2 @@ -0,0 +1,5 @@ +

+ [% l('Ensure your account has a valid email address so that we can notify + you about available holds, items that are about to be overdue, and + overdue items!') %] +

diff --git a/Open-ILS/src/templates/tinypac/parts/org_selector.tt2 b/Open-ILS/src/templates/tinypac/parts/org_selector.tt2 new file mode 100644 index 0000000000..31ba30d7e8 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/org_selector.tt2 @@ -0,0 +1,105 @@ +[% +# Org Unit Selector Widget : +# INCLUDE build_org_selector id='selector-id' name='selector-name' +# value=org_id show_loc_groups=1/0 can_have_vols_only=1/0 +# +# NOTE: DO NOT USE PROCESS +# Use of PROCESS results in internal variables, such as value or org_unit, to "leak" out + +BLOCK build_org_selector; + node_stack = [{org => org_unit || ctx.aouct_tree || ctx.aou_tree}]; + inherited_vis = ctx.get_cgf('opac.org_unit.non_inherited_visibility').enabled == 'f'; + + IF !name; + name = 'loc'; + IF show_loc_groups; name = 'locg'; END; + END; + IF !value; + value = ctx.search_ou; + IF show_loc_groups; + value = CGI.param('locg') || ctx.search_ou; + END; + END; + %] + + +[% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/place_hold.tt2 b/Open-ILS/src/templates/tinypac/parts/place_hold.tt2 new file mode 100644 index 0000000000..ec979e311b --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/place_hold.tt2 @@ -0,0 +1,106 @@ +[% PROCESS "opac/parts/misc_util.tt2"; + PROCESS "opac/parts/hold_error_messages.tt2"; +%] + +
+

[% l('Place Hold') %]

+
+ + [% + redirect = CGI.param('hold_source_page') || CGI.param('redirect_to') || CGI.referer; + # since we have to be logged in to get this far, return to a secure page + redirect = redirect.replace('^http:', 'https:') + %] + + + [% IF ctx.is_staff %] +

+ + +
+ + + + + +

+ [% END %] + + + + [% FOR hdata IN ctx.hold_data; + attrs = {marc_xml => hdata.marc_xml}; + PROCESS get_marc_attrs args=attrs %] + + + + [% END %] +
+ +
[% attrs.title_extended | html %]
+ [% IF hdata.parts %] + [% IF hdata.parts.size > 0 %] +
+ [% hdata.part_required ? l('Select a Part:') : l('Select a Part (optional):') %] + +
+ [% ELSE %] + + [% END %] + [% END %] +
+ +

+ [% l('Pickup location:') %] + [% PROCESS "opac/parts/org_selector.tt2"; + INCLUDE build_org_selector name='pickup_lib' value=ctx.default_pickup_lib id='pickup_lib' can_have_vols_only=1 %] +

+

+ [% l('Notify when hold is ready for pickup?') %] +

+ + [% l('Yes, by Email') %]
+ + [% l('Yes, by Phone') %]
+
+ [% l('Phone Number:') %] +
+ [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %] + + [% l('Yes, by Text Messaging') %]
+
+ [% INCLUDE "opac/parts/sms_carrier_selector.tt2" %]
+ [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]
+
+ [% END %] +
+

+ +        + +
+
+ diff --git a/Open-ILS/src/templates/tinypac/parts/place_hold_result.tt2 b/Open-ILS/src/templates/tinypac/parts/place_hold_result.tt2 new file mode 100644 index 0000000000..b933d6a8d5 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/place_hold_result.tt2 @@ -0,0 +1,136 @@ +[% PROCESS "opac/parts/misc_util.tt2"; + PROCESS "opac/parts/hold_error_messages.tt2"; + override_possible = 0; + any_failures = 0; +%] + + + +
+

[% l('Place Hold') %]

+ +
+ + [% FOR k IN ctx.orig_params.keys %] + + [% END %] + + + + [% FOR hdata IN ctx.hold_data; + attrs = {marc_xml => hdata.marc_xml}; + PROCESS get_marc_attrs args=attrs %] + + + + + [% END %] +
+ [% + override = 0; + IF hdata.could_override || hdata.hold_local_alert; + override_possible = 1; + override = 1; + END; + %] + + + [% + title = attrs.title_extended; + IF hdata.selected_part AND hdata.parts AND hdata.parts.size > 0; + FOREACH part IN hdata.parts; + IF hdata.selected_part == part.id; + title = l('[_1] ([_2])', title, part.label); + END; + END; + END; + %] + +
[% title | html %]
+ [% IF hdata.parts %] + + [% END %] +
+ [% IF hdata.hold_success %] + +
[% l("Hold was successfully placed"); %]
+ + [% IF ctx.is_staff %] + + [% END %] + + [% ELSIF hdata.hold_failed; any_failures = 1 %] + +
[% l("Hold was not successfully placed"); %]
+ [% IF hdata.hold_local_block %] +
[% l("There is already a copy available at your local library.") %]
+ [% ELSIF hdata.hold_failed_event || hdata.hold_local_alert %] +
+ [% l('Problem:') %] + + [% + fail_part_key = hdata.hold_failed_event.payload.fail_part; + event_key = hdata.hold_failed_event.textcode; + + # display: + (hdata.age_protect ? + l("All available copies are temporarily unavailable at your pickup library. Placing this hold could result in longer wait times.") : + FAIL_PART_MSG_MAP.$fail_part_key || + EVENT_MSG_MAP.$event_key || + l(hdata.hold_failed_event.desc) || + hdata.hold_failed_event.payload.fail_part || + hdata.hold_failed_event.textcode || + (hdata.hold_local_alert ? + l("There is already a copy available at your local library.") : + l("Unknown problem"))) | html + %] + [% IF event_key == 'PERM_FAILURE' %] +
[% l('Permission: "[_1]"', hdata.hold_failed_event.ilsperm) | html %]
+ [% END %] +
+ [% IF hdata.hold_copy_available %] +

[% l('Find a copy in the shelving location, "[_1]."', locname) | html %]

+ [% END %] +
+ [% END; + END %] +
+
+ [% IF override_possible %] +
+
+
+ [% |l %]You have permission to override some of the failed holds.
Click Submit to override and place your hold on the selected items.[% END %] +
+ + + + [% END %] + + [% IF any_failures OR ctx.general_hold_error %] + [% l('Cancel') %] + [% ELSE %] + [% l('Continue') %] + [% END %] + +
+
+ diff --git a/Open-ILS/src/templates/tinypac/parts/pref_lib_display.tt2 b/Open-ILS/src/templates/tinypac/parts/pref_lib_display.tt2 new file mode 100644 index 0000000000..635c766658 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/pref_lib_display.tt2 @@ -0,0 +1,7 @@ +[%- IF ctx.pref_ou && ctx.pref_ou != ctx.search_ou; %] +[% + l('Preferred library: [_1][_2][_3]', '', ctx.get_aou(ctx.pref_ou).name, ''); + %][% l('?') %] + +[%- END; %] diff --git a/Open-ILS/src/templates/tinypac/parts/preserve_params.tt2 b/Open-ILS/src/templates/tinypac/parts/preserve_params.tt2 new file mode 100644 index 0000000000..3517f58e31 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/preserve_params.tt2 @@ -0,0 +1,9 @@ +[%- +UNLESS params; + params = ['locg', 'loc', 'query', 'qtype', 'sort']; +END; +FOR param IN params; + IF CGI.param(param); %] + + [%- END; +END; %] diff --git a/Open-ILS/src/templates/tinypac/parts/qtype_selector.tt2 b/Open-ILS/src/templates/tinypac/parts/qtype_selector.tt2 new file mode 100644 index 0000000000..98567d4ce6 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/qtype_selector.tt2 @@ -0,0 +1,16 @@ +[% query_types = [ + {value => "keyword", label => l("Keyword")}, + {value => "title", label => l("Title")}, + {value => "author", label => l("Author")}, + {value => "subject", label => l("Subject")}, + {value => "series", label => l("Series")}, + {value => "id|bibcn", label => l("Bib Call Number")} +] %] + diff --git a/Open-ILS/src/templates/tinypac/parts/record/authors.tt2 b/Open-ILS/src/templates/tinypac/parts/record/authors.tt2 new file mode 100644 index 0000000000..4a0419cfdf --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/authors.tt2 @@ -0,0 +1,67 @@ +[%- + +authors = [ + { + type => 'author', + label => l('Author'), + xpath => '//*[@tag="100"]|//*[@tag="110"]|//*[@tag="111"]' + }, { + type => 'added', + label => l('Added Author'), + xpath => '//*[@tag="700"]|//*[@tag="710"]|//*[@tag="711"]' + }, { + type => 'credits', + label => l('Credited'), + xpath => '//*[@tag="100"]|//*[@tag="110"]|//*[@tag="111"]' + }, { + type => 'cast', + label => l('Cast'), + xpath => '//*[@tag="508"]' + }, { + type => 'notes', + label => l('Author Notes: '), + xpath => '' # Comes from added content... + } +]; + +BLOCK build_author_links; + FOR node IN ctx.marc_xml.findnodes(xpath); + term = ''; + qterm = ''; + iprop = ''; + FOR subfield IN node.childNodes; + NEXT UNLESS subfield.nodeName == "subfield"; + code = subfield.getAttribute('code'); + NEXT UNLESS code.match('[a-z]'); + sf_raw = subfield.textContent; + sf = subfield.textContent | html; + term = term _ ' ' _ sf; + qterm = qterm _ ' ' _ sf_raw; + END; + url = mkurl(ctx.opac_root _ '/results', {query => qterm, qtype => 'author'}, ['page', 'expand']); + author_type = label | html; + + # schema.org changes + IF type == 'author'; + iprop = ' itemprop="accountablePerson"'; + ELSIF type == 'added'; + iprop = ' itemprop="contributor"'; + END; + '' _ term.replace('^\s+', '') _ ' (' _ author_type _ '). '; + END; +END; +%] + +
+[%- FOREACH author IN authors; + NEXT UNLESS author.xpath; + links = PROCESS build_author_links( + xpath=author.xpath, label=author.label, type=author.type + ); + IF links.match('\S') %] + [% links %] + [%- END %] +[%- END %] +
+ + diff --git a/Open-ILS/src/templates/tinypac/parts/record/body.tt2 b/Open-ILS/src/templates/tinypac/parts/record/body.tt2 new file mode 100644 index 0000000000..77dad5e735 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/body.tt2 @@ -0,0 +1,17 @@ +[%- attrs = {marc_xml => ctx.marc_xml}; + PROCESS "tinypac/parts/misc_util.tt2"; + PROCESS get_marc_attrs args=attrs; + stop_parms = ['expand','cnoffset']; + ctx.record_attrs = attrs; # capture for JS +%] +
+ New Search

+ [%- INCLUDE "tinypac/parts/record/navigation.tt2" %] + [%- IF ctx.bib_is_dead %] +
+ [% l("This record has been deleted from the database. We recommend that you remove this title from any bookbags it may have been added to.") %] +
+ [%- END %] + [% INCLUDE "tinypac/parts/record/summary.tt2" %] + [%- INCLUDE "tinypac/parts/record/navigation.tt2" %] +
diff --git a/Open-ILS/src/templates/tinypac/parts/record/cnbrowse.tt2 b/Open-ILS/src/templates/tinypac/parts/record/cnbrowse.tt2 new file mode 100644 index 0000000000..b9498bbea1 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/cnbrowse.tt2 @@ -0,0 +1,61 @@ +[% + cnoffset = CGI.param('cnoffset'); + cnoffset = cnoffset.match('^\d+$') ? cnoffset : 0; # verify cnoffset is a sane value +%] + +
+
+
+ [% l("You are now browsing") %] + [% ctx.browsing_ou.name | html %] +
+ + + + + + + + + + [% tr_open = 0; FOR cn IN ctx.browsed_call_numbers %] + [%- IF loop.index % 3 == 0; tr_open = 1 %] + + [% END -%] + + [% IF loop.index % 3 == 2; tr_open = 0 %] + + [% END %] + [% END; IF tr_open %][% END %] + +
+ [% l("<< Previous Page") %] + [% l("Shelf Browser") %] + [% l("Next Page >>") %] +
+ [% rec_attrs = {marc_xml => cn.record.marc}; + PROCESS get_marc_attrs args=rec_attrs; + ident = rec_attrs.isbn_clean || rec_attrs.upc; + IF ident %] + + [% END %] +
[% cn.label | html %]
+ + [% IF rec_attrs.author %][% END %] +
[% cn.owning_lib.name | html %]
+
+
+
diff --git a/Open-ILS/src/templates/tinypac/parts/record/copy_counts.tt2 b/Open-ILS/src/templates/tinypac/parts/record/copy_counts.tt2 new file mode 100644 index 0000000000..e9c815a1aa --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/copy_counts.tt2 @@ -0,0 +1,46 @@ + + [% l('Available copies') %] : + [%- depths = ctx.copy_summary.size; + depth = 0; + displayed_ous = {}; + WHILE depth < depths; + ou_avail = ctx.copy_summary.$depth.available; + ou_id = ctx.copy_summary.$depth.org_unit; + cp_org_unit = ctx.get_aou(ou_id); + IF cp_org_unit.opac_visible == 'f' AND !ctx.is_staff; + depth = depth + 1; + NEXT; + END; + ou_name = cp_org_unit.name; + displayed_ous.$ou_name = 1; + %] + [% l('[quant,_1,copy,copies] at [_2].', ou_avail, ou_name) | html %] + [%- this_depth = ctx.get_aou(ou_id).ou_type.depth; + IF ou_avail > 0 && this_depth != ctx.copy_depth %] + + [%- l('(Show)'); %] + [%- END; %] + [%- depth = depth + 1; + END; + + depth = attrs.plib_copy_counts.size - 1; + ou_name = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit).name; + ou_id = attrs.plib_copy_counts.$depth.org_unit; + UNLESS depth < 0 || displayed_ous.exists(ou_name); + %] + [%- IF attrs.plib_copy_counts.$depth.count > 0; %] +
  • [% + l('[_1] of [quant,_2,copy,copies] available at [_3].', + attrs.plib_copy_counts.$depth.available, + attrs.plib_copy_counts.$depth.count, + ou_name) | html + %] [% + l('(Show preferred library)'); + %]
  • + [%- END %] + [%- END %] +
    +
    +
    diff --git a/Open-ILS/src/templates/tinypac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/tinypac/parts/record/copy_table.tt2 new file mode 100644 index 0000000000..973292a5b2 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/copy_table.tt2 @@ -0,0 +1,73 @@ +[%- + +# If being used in serial mode, flatten list of units so that they can be +# used like one long list of copies without changing so much code below. +IF serial_holdings; + copies = []; + FOREACH h IN serial_holdings; + units = h.units.slice(0); # copy + FOREACH unit IN units; + unit.holding_label = h.label; + END; + copies = copies.merge(units); + END; +END; + +FOREACH copy_info IN copies; + IF copy_info.call_number_label != '##URI##'; + has_copies = 'true'; + END; + IF copy_info.part_label != ''; + has_parts = 'true'; + END; + IF has_parts && has_copies; + LAST; + END; +END; +-%] +
    +[%- IF has_copies; %] + [%- last_cn = 0; + FOR copy_info IN copies; + callnum = copy_info.call_number_label; + NEXT IF callnum == '##URI##'; + + callnum_prefix = copy_info.call_number_prefix_label; + IF callnum_prefix != ""; + callnum = callnum_prefix _ " " _ callnum; + END; + + callnum_suffix = copy_info.call_number_suffix_label; + IF callnum_suffix != ""; + callnum = callnum _ " " _ callnum_suffix; + END; + -%] + + [%- + org_name = ctx.get_aou(copy_info.circ_lib).name; + org_name | html + -%] + +
  • + [% callnum | html %] [% IF ctx.get_org_setting(CGI.param('loc') OR ctx.aou_tree.id, 'sms.enable') == 1 %](Text)[% END %] +
  • +
  • + [% copy_info.copy_location | html %] +
  • +
  • + [% copy_info.copy_status | html %] +
  • +
  • + [% + IF copy_info.due_date; + date.format( + ctx.parse_datetime(copy_info.due_date), + DATE_FORMAT + ); + ELSE; + '-'; + END %] +
  • + [%- END %] +[% END; %] +
    diff --git a/Open-ILS/src/templates/tinypac/parts/record/issues-db.tt2 b/Open-ILS/src/templates/tinypac/parts/record/issues-db.tt2 new file mode 100644 index 0000000000..2864161ddf --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/issues-db.tt2 @@ -0,0 +1,199 @@ +[%- +expand_path = CGI.param('sepath') || []; +expand_path = expand_path.list; # sic + +seoffset_list = CGI.param('seoffset') || []; +seoffset_list = seoffset_list.list; # sic + +IF expand_path.size == 0 AND seoffset_list.size == 0; + seoffset_list = [0,0]; # compensate for $auto_expand_first; see ML +END; + +selimit = CGI.param('selimit') || 10; +ght_sepath = []; +ght_depth = 0; + +VIEW grouped_holding_tree; + BLOCK list; + level_description = item.shift; + level_description.caption = + level_description.caption.replace('[\(\)]', ''); + + '
    '; + prev_seoffset_list = seoffset_list.slice(0, ght_depth); + next_seoffset_list = seoffset_list.slice(0, ght_depth); + + prev_seoffset_list.$ght_depth = prev_seoffset_list.$ght_depth - selimit; + IF prev_seoffset_list.$ght_depth < 0; + prev_seoffset_list.$ght_depth = 0; + END; + + has_more = 0; + at_deepest_level = 0; + + next_seoffset_list.$ght_depth = next_seoffset_list.$ght_depth + selimit; + IF item.0.units; + INCLUDE "opac/parts/record/copy_table.tt2" serial_holdings=item; + "
    "; + + at_deepest_level = 1; + IF NOT item.last.label; + has_more = 1; + END; + ELSE; + FOREACH node IN item; + IF NOT node.label; + has_more = 1; + LAST; + END; + + IF node.value; + ght_sepath.push(node.value); + new_seoffsets = seoffset_list.slice(0, ght_depth); + new_seoffsets.push(0); + + expand_link = mkurl( + '', {'sepath' => ght_sepath, 'seoffset' => new_seoffsets}, + 0, 'issues' + ); + + collapse_sepath = ght_sepath.slice(0, -2); + IF collapse_sepath.size == 0; + collapse_clear_params = ['sepath']; + ELSE; + collapse_clear_params = 0; + END; + + collapse_link = mkurl( + '', { + 'sepath' => collapse_sepath, + 'seoffset' => new_seoffsets.slice(0, -2) + }, collapse_clear_params, 'issues' + ); + + "
    "; + IF node.children.size; + # TODO: make images or figure out a CSS trick or + # something. I doubt we can count on all OPAC clients + # having adequate fonts to cover these Unicode glyphs. + "▼ "; node.label; "
    "; + + IF node.children.size; + ght_depth = ght_depth + 1; + view.print(node.children); + ght_depth = ght_depth - 1; + END; + + waste = ght_sepath.pop; + ELSE; + "
    "; node.label; "
    "; + at_deepest_level = 1; + END; + END; + END; + + to_clear = 0; + new_sepath_end = ght_depth - 1; + IF new_sepath_end < 0; + to_clear = ['sepath']; + new_sepath = []; + ELSE; + new_sepath = expand_path.slice(0, ght_depth - 1); + END; + + # So the "holdings" level of the tree is sorted ascending, while all + # the higher levels are sorted descending. This seems weird until you + # look at it. I dunno. I think it feels right. It could be changed I + # guess. Anyway, this means we have to be careful about which + # paging link we label "earlier" and which one we label "later." + + next_link = ''; prev_link = ''; + IF has_more; + next_link = 'LABEL_HERE  '; + END; + IF seoffset_list.$ght_depth > 0; + prev_link = 'LABEL_HERE  '; + END; + + IF at_deepest_level; + prev_link.replace('LABEL_HERE', '« ' _ l('Earlier issues')); + next_link.replace('LABEL_HERE', l('Later issues') _ ' »'); + ELSE; + # XXX this is really bad for i18n (notice the sloppy pluralization), + # but then the middle layer for serials only knows English names + # for things like "month". There's a bigger problem to solve + # here... + caption = level_description.caption; + IF level_description.display_grouping == 'chron'; + caption = caption _ 's'; + END; + next_link.replace( + 'LABEL_HERE', + '« ' _ l('Earlier') _ ' ' _ caption + ); + prev_link.replace( + 'LABEL_HERE', + l('Later') _ ' ' _ caption _ ' »' + ); + END; + '
    '; + END; +END; + +VIEW holding_summary_tree; + BLOCK hash; + '
    '; + ctx.get_aou(item.org_unit).name; "
    "; + FOREACH summary IN item.holding_summaries; + IF summary.holdings; + twisty = '▼ '; + link = mkurl( + '', {}, + ['sid','stype','selimit','sepath','seoffset'], 'issues' + ); + link_title = l('Collapse'); + ELSE; + twisty = '► '; + link = mkurl( + '', {sid => summary.id, stype => summary.summary_type}, + ['selimit','sepath','seoffset'], 'issues' + ); + link_title = l('Expand'); + END; + ''; twisty; + ''; + summary.generated_coverage.join(", "); + '
    '; + IF summary.holdings; + grouped_holding_tree.print(summary.holdings); + END; + END; + FOREACH child IN item.children; + view.print(child); + END; + '
    '; + END; +END %] +
    + [% holding_summary_tree.print(ctx.holding_summary_tree) %] +
    +
    + [% slimit = CGI.param('slimit') || 10; + soffset = CGI.param('soffset') || 0; + soffset_prev = soffset - slimit; + IF soffset_prev < 0; soffset_prev = 0; END; + soffset_next = soffset + slimit; + %] + [% IF soffset > 0 %] + soffset_next}, ['sid','stype','sepath','selimit','seoffset'], 'issues') %]">[% l('Next') %] + [% END %] +
    diff --git a/Open-ILS/src/templates/tinypac/parts/record/issues-mfhd.tt2 b/Open-ILS/src/templates/tinypac/parts/record/issues-mfhd.tt2 new file mode 100644 index 0000000000..15b9ab9d3c --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/issues-mfhd.tt2 @@ -0,0 +1,40 @@ +[% IF ctx.mfhd_summaries.size; %] +
    + +[% + mfhd = { + basic_holdings = l('Volumes'), + basic_holdings_add = l('Additional Volume Information'), + supplement_holdings = l('Supplements'), + supplement_holdings_add = l('Additional Supplement Information'), + index_holdings = l('Indexes'), + index_holdings_add = l('Additional Index Information'), + online = l('Online'), + missing = l('Missing'), + incomplete = l('Incomplete'), + }; + + FOREACH serial IN ctx.mfhd_summaries; +%] + + + +[% + FOREACH type IN mfhd.keys; + NEXT UNLESS serial.$type.size; +%] + + + + + [% END %] + + + + [% END %] +
    [% l('Holdings summary ([_1])', serial.location) %]
    [% mfhd.$type %][% + FOR thing IN serial.$type; + thing.join(", "); + END %]
    +
    +[% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/record/issues.tt2 b/Open-ILS/src/templates/tinypac/parts/record/issues.tt2 new file mode 100644 index 0000000000..998e2d64d9 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/issues.tt2 @@ -0,0 +1,8 @@ +
    + [% + IF ctx.holding_summary_tree; + INCLUDE 'opac/parts/record/issues-db.tt2'; # "new" serials holdings + END; + %] + [% INCLUDE 'opac/parts/record/issues-mfhd.tt2' # mfhd-based "classic" serials %] +
    diff --git a/Open-ILS/src/templates/tinypac/parts/record/navigation.tt2 b/Open-ILS/src/templates/tinypac/parts/record/navigation.tt2 new file mode 100644 index 0000000000..29b1106a68 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/navigation.tt2 @@ -0,0 +1,38 @@ +[% IF ctx.search_result_index >= 0 %] +
    + + [% l('◄ Search Results') %] + + [% l('Showing Item [_1] of [_2]', ctx.search_result_index + 1, ctx.hit_count) %] + + + [%- INCLUDE "opac/parts/pref_lib_display.tt2" %] +
    + [% + IF ctx.prev_search_record; + prev_args = {}; + IF ctx.search_page > 0 AND + ctx.search_result_index % ((ctx.page_size * ctx.search_page)) == 0; # first record in the page + prev_args.page = ctx.search_page - 1; + END; + ctx.prev_rec_url = mkurl(ctx.prev_search_record, prev_args, stop_parms); + %] + ◄ [% l('Previous') %] + [% END %] + + [% + IF ctx.next_search_record; + next_args = {}; + IF (ctx.page_size * (ctx.search_page + 1)) == ctx.search_result_index + 1; + next_args.page = ctx.search_page + 1; + END; + ctx.next_rec_url = mkurl(ctx.next_search_record, next_args, stop_parms); + %] + [% l('Next') %] ► + [% END %] + +
    +
    +[% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/record/series.tt2 b/Open-ILS/src/templates/tinypac/parts/record/series.tt2 new file mode 100644 index 0000000000..4695768a6d --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/series.tt2 @@ -0,0 +1,32 @@ +[% + series_tags = ['440', '490', '800', '810', '811', '830', '694']; + loc = ctx.search_ou; +%] + +[% BLOCK render_series; + results = []; + FOR tag IN series_tags; + FOR node IN ctx.marc_xml.findnodes('//*[@tag="' _ tag _ '"]/*'); + node_uri = node.textContent | uri; + node_html = node.textContent | html; + IF !loop.first; + results.last = result.last _ ''; + END; + results.push('' _ node_html _ '' + ); + END; + END; +END; +%] + +[%- series_anchors = PROCESS render_series; + IF series_anchors.length > 0; %] + +
      + [%- FOR entry IN series_anchors %] +
    • [% entry %]
    • + [% END %] +
    +[%- END %] diff --git a/Open-ILS/src/templates/tinypac/parts/record/subjects.tt2 b/Open-ILS/src/templates/tinypac/parts/record/subjects.tt2 new file mode 100644 index 0000000000..52d9ac86cd --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/subjects.tt2 @@ -0,0 +1,73 @@ +[% + subjects = [ + { + label => l('Subject: '), + xpath => '//*[@tag="600" or @tag="610" or @tag="611" or @tag="630" or @tag="650" or @tag="651"]' + }, { + label => l('Genre: '), + xpath => '//*[@tag="655"]|//*[@tag="659"]' + }, { + label => l('Topic Heading: '), + xpath => '//*[@tag="690"]' + }, { + label => l('Geographic Setting: '), + xpath => '//*[@tag="691"]' + }, { + label => l('Biographical Subject: '), + xpath => '//*[@tag="692"]' + }, { + label => l('Character Attributes: '), + xpath => '//*[@tag="693"]' + }, { + label => l('Setting: '), + xpath => '//*[@tag="698"]' + }, { + label => l('Time Period: '), + xpath => '//*[@tag="699"]' + } + ]; + + BLOCK render_subject; + xpath = xpath || '//*[starts-with(@tag,"6")]'; + FOR node IN ctx.marc_xml.findnodes(xpath); + all_terms = []; + FOR subfield IN node.childNodes; + NEXT UNLESS subfield.nodeName == "subfield"; + code = subfield.getAttribute('code'); + NEXT UNLESS code.match('[a-z]'); + IF code.match('[vxyz]'); " > "; END; + # at this point, we actually have a partial term to use. + single_term = subfield.textContent | html; + all_terms.push(subfield.textContent); + total_term = all_terms.join(" ").replace('\s+$', ''); + %] +[% single_term %] + [%- END; + IF all_terms.size; "
    "; END; + END; + END +%] + +[% BLOCK render_all_subjects; + FOREACH subj IN subjects; + content = PROCESS render_subject(xpath=subj.xpath); + IF content.match('\S'); +%] + + + + + + + +
    [% subj.label %][% content %]
    + [%- END; %] + [%- END; %] +[%- END %] + +[%- subject_html = PROCESS render_all_subjects; + IF subject_html.length > 0; +%] + +[%- subject_html %] +[%- END %] diff --git a/Open-ILS/src/templates/tinypac/parts/record/summary.tt2 b/Open-ILS/src/templates/tinypac/parts/record/summary.tt2 new file mode 100644 index 0000000000..509401d71d --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/summary.tt2 @@ -0,0 +1,110 @@ +[% PROCESS "tinypac/parts/misc_util.tt2"; + USE ResolverResolver; + ctx.page_title = attrs.title | html +%] + + + + +
    + +[%-# This holds the record summary information %] +
    + + + + +
    + [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] + [% l('Image of item') %] + [% END %] + +

    [% attrs.title_extended | html %]

    +
    + [%- INCLUDE "tinypac/parts/record/authors.tt2" %] +
    + +
    + [%- IF attrs.format_icon %] +
    + [% attrs.format_label %] +
    + [%- END %] +
    +
    + +
    + [%- IF num_uris > 1 %]
      [% END %] + [%- FOR uri IN merged_uris %] + [%- IF num_uris == 1 %]

      [% ELSE %]

    • [% END %] + [% uri.link %][% ' - ' _ uri.note IF uri.note %] + [%- IF num_uris == 1 %]

      [% ELSE %]
    • [% END %] + [%- END %] + [%- IF num_uris > 1 %]
    [% END %] +
    +[%- # Hold/copy summary + IF ctx.copy_summary.0.count +%] +
    +[%- INCLUDE "tinypac/parts/record/copy_counts.tt2" %] + + [% l('Current holds') %] : + [%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", + ctx.record_hold_count, ctx.copy_summary.0.count) %] +

    +
    +[%- INCLUDE "tinypac/parts/record/copy_table.tt2" copies=ctx.copies %] +
    +[%- END %] + +

    [% l("Record details") %]

    +
      + [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %] +
    • + [% l('ISBN:'); %] + [% isbn | html %] +
    • + [%- END %] + [%- END %] + [%- IF attrs.issns.0; FOR issn IN attrs.issns %] +
    • + [% l('ISSN:'); %] + [% issn | html %] +
    • + [%- END %] + [%- END %] + [%- IF attrs.phys_desc %] +
    • + [% l("Physical Description:") %] + [% attrs.phys_desc | html %] +
    • + [%- END %] + [%- IF attrs.edition %] +
    • + [% l("Edition:") %] + [% attrs.edition | html %] +
    • + [%- END %] + [%- IF attrs.publisher %] +
    • + [% l("Publisher:") %] + [% + attrs.publisher | html; + %] + [% IF attrs.pubdate; %] + + [% END; %] +
    • + [%- END %] +
    + diff --git a/Open-ILS/src/templates/tinypac/parts/record/summaryplus.tt2 b/Open-ILS/src/templates/tinypac/parts/record/summaryplus.tt2 new file mode 100644 index 0000000000..7796213fa8 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/record/summaryplus.tt2 @@ -0,0 +1,19 @@ +
    + [% IF attrs.summary %] +
    + [% l('Summary: ') %] + [% FOR sum IN attrs.summary %] + [% IF !loop.first; '
    '; END %] + [% sum | html %] + [% END %] +
    + [% END %] + + + [% ident = attrs.isbn_clean || attrs.upc %] + +
    + diff --git a/Open-ILS/src/templates/tinypac/parts/result/copy_counts.tt2 b/Open-ILS/src/templates/tinypac/parts/result/copy_counts.tt2 new file mode 100644 index 0000000000..1bbc357efc --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/result/copy_counts.tt2 @@ -0,0 +1,36 @@ +[%- depths = attrs.copy_counts.size; + depth = 0; + displayed_ous = {}; + WHILE depth < depths; + ou_name = ctx.get_aou(attrs.copy_counts.$depth.org_unit).name; + displayed_ous.$ou_name = 1; + IF attrs.copy_counts.$depth.count > 0; +%] +
    +[% IF ctx.get_aou(attrs.copy_counts.$depth.org_unit).opac_visible == 't' %] + [% l('[_1] of [quant,_2,copy,copies] available at [_3].', + attrs.copy_counts.$depth.available, + attrs.copy_counts.$depth.count, + ou_name) | html + %] +[% END %] +
    +[%- END; + depth = depth + 1; + END; + + depth = attrs.plib_copy_counts.size - 1; + ou_name = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit).name; + UNLESS displayed_ous.exists(ou_name); + +%] +[%- IF attrs.plib_copy_counts.$depth.count > 0; %] +
    [% + l('[_1] of [quant,_2,copy,copies] available at [_3].', + attrs.plib_copy_counts.$depth.available, + attrs.plib_copy_counts.$depth.count, + ou_name) | html + %] +
    +[%- END %] +[%- END %] diff --git a/Open-ILS/src/templates/tinypac/parts/result/paginate.tt2 b/Open-ILS/src/templates/tinypac/parts/result/paginate.tt2 new file mode 100644 index 0000000000..6df47b02aa --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/result/paginate.tt2 @@ -0,0 +1,47 @@ +[% BLOCK results_count_header %] +
    + [%- INCLUDE "opac/parts/pref_lib_display.tt2" %] + + + + [% class = 'search_page_nav_link'; + href = '#'; + IF page > 0; + href = mkurl('', {page => page - 1}); + ELSE; class = class _ ' invisible'; END; + %] + [% l('Prev') %] + + + [% # show links to 4 previous pages, the current page, and 3 more pages. + added = 0; + pageitr = page - 5; + IF page_count > 1; # no need to paginate 1 page + WHILE (pageitr = pageitr + 1) < page_count; + IF pageitr < 0; NEXT; END; + IF pageitr == page; %] + [% pageitr + 1%] + [% ELSE %] + [% pageitr + 1%] + [% END; + added = added + 1; + IF added == 5; LAST; END; + END; + END; + %] + + + [% class = 'search_page_nav_link'; + href = '#'; + IF (page + 1) < page_count; + href = mkurl('', {page => page + 1}); + ELSE; class = class _ ' invisible'; END; + %] + [% l('Next') %] + + +
    +[% END %] + diff --git a/Open-ILS/src/templates/tinypac/parts/result/table.tt2 b/Open-ILS/src/templates/tinypac/parts/result/table.tt2 new file mode 100644 index 0000000000..95a5ac09be --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/result/table.tt2 @@ -0,0 +1,120 @@ +[% PROCESS "tinypac/parts/misc_util.tt2"; + + USE ResolverResolver; + + ctx.result_start = 1 + ctx.page_size * page; + ctx.result_stop = ctx.page_size * (page + 1); + IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END; + + result_count = ctx.result_start; + +%] +New Search

    +[% PROCESS "tinypac/parts/result/paginate.tt2" %] +[% ctx.results_count_header = PROCESS results_count_header; + ctx.results_count_header %] + +
    +
    + + + [% FOR rec IN ctx.records; + attrs = {marc_xml => rec.marc_xml}; + PROCESS get_marc_attrs args=attrs; + IF CGI.param('detail_record_view'); + attrs.title = attrs.title_extended; + END; + -%] + + + + + + + [% END %] + +

    [% + result_count; result_count = result_count + 1 + %]. + [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] + [% l('Image of item') %]
    + [% END %] +
    + +
    +
    + [% attrs.author | html %] +    + [% attrs.pubdate | html %] +
    + + + [% IF attrs.phys_desc %] + + + + + [% END %] + [% FOR uri IN args.uris %] + + + + + [% END %] +
    + + [% args.phys_desc | html %] +
    + [% l('Electronic resource') %] + [% uri.link | html %][% ' - ' _ uri.note | html IF uri.note %]
    + [% IF ctx.bookbag; + rec_id = rec.id; + FOR note IN ctx.bookbag_items_by_bre_id.$rec_id.notes %] +
    + [% note.note | html %] +
    + [% END %] + [% END %] +
    +
    + [% IF attrs.format_icon %] + [% attrs.format_label | html %] + [% END %] + + + +
    + +
    +
    +
    +
    + [% ctx.results_count_header %] +
    New Search

    +

    +Standard Catalog +
    diff --git a/Open-ILS/src/templates/tinypac/parts/searchbar.tt2 b/Open-ILS/src/templates/tinypac/parts/searchbar.tt2 new file mode 100644 index 0000000000..6aedaf16b1 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/searchbar.tt2 @@ -0,0 +1,32 @@ +[% PROCESS "tinypac/parts/org_selector.tt2" %] + diff --git a/Open-ILS/src/templates/tinypac/parts/sms_carrier_selector.tt2 b/Open-ILS/src/templates/tinypac/parts/sms_carrier_selector.tt2 new file mode 100644 index 0000000000..919ba074d1 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/sms_carrier_selector.tt2 @@ -0,0 +1,28 @@ +[% + setting = 'opac.default_sms_carrier'; + IF ctx.user_setting_map.$setting; + default_carrier = ctx.user_setting_map.$setting; + END; + + temp = ctx.search_csc('active','t'); + + # turn the list of objects into a list of hashes to + # leverage TT's array.sort('') behavior + carriers = []; + FOR o IN temp; + carriers.push({ + id => o.id, + region => o.region, + name => o.name + }); + END; +%] +[% IF NOT sms_carrier_hide_label; l('Mobile carrier:'); END; %] + +[% IF NOT sms_carrier_hide_warning; l('Note: carrier charges may apply'); END; %] diff --git a/Open-ILS/src/templates/tinypac/parts/sms_number_textbox.tt2 b/Open-ILS/src/templates/tinypac/parts/sms_number_textbox.tt2 new file mode 100644 index 0000000000..dc107b721d --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/sms_number_textbox.tt2 @@ -0,0 +1,4 @@ +[% IF NOT sms_number_hide_label; l('Mobile number:'); END; %] + +[% IF NOT sms_number_hide_hint; l('Hint: use the full 10 digits of your phone #, no spaces, no dashes'); END; %] diff --git a/Open-ILS/src/templates/tinypac/parts/staff_saved_searches.tt2 b/Open-ILS/src/templates/tinypac/parts/staff_saved_searches.tt2 new file mode 100644 index 0000000000..0250651caa --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/staff_saved_searches.tt2 @@ -0,0 +1,26 @@ +[% IF ctx.saved_searches.size %] + +
    +
    + [% l("Recent searches") %] +
    +
    + [% IF ctx.saved_searches_expanded %] + [% l('Collapse') %] + [% ELSE %] + [% l('Expand') %] + [% END %] +
    +
     
    +
    +
     
    +
    + [% IF ctx.saved_searches_expanded %] + [% FOR s IN ctx.saved_searches %] + + [% END %] + [% END %] +
    +[% END %] diff --git a/Open-ILS/src/templates/tinypac/parts/tips.tt2 b/Open-ILS/src/templates/tinypac/parts/tips.tt2 new file mode 100644 index 0000000000..f4e73ed08b --- /dev/null +++ b/Open-ILS/src/templates/tinypac/parts/tips.tt2 @@ -0,0 +1,11 @@ + +
    +
    +
    + [% l("Click on a folder icon in the sidebar to access related quick searches") %] + [% l("If you don't find what you want try expanding your search using the range selector at the right of the search bar") %] +
    + [% l("Tip:") %] +
    +
    + diff --git a/Open-ILS/src/templates/tinypac/place_hold.tt2 b/Open-ILS/src/templates/tinypac/place_hold.tt2 new file mode 100644 index 0000000000..e8a81c3ca7 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/place_hold.tt2 @@ -0,0 +1,15 @@ +[% PROCESS "tinypac/parts/header.tt2"; + WRAPPER "tinypac/base.tt2"; + ctx.page_title = l("Place Hold") %] +
    +
    +
    + [% IF ctx.hold_attempt_made %] + [% INCLUDE "tinypac/parts/place_hold_result.tt2" %] + [% ELSE %] + [% INCLUDE "tinypac/parts/place_hold.tt2" %] + [% END %] +
    +
    +
    +[% END %] diff --git a/Open-ILS/src/templates/tinypac/record.tt2 b/Open-ILS/src/templates/tinypac/record.tt2 new file mode 100644 index 0000000000..872d23dafa --- /dev/null +++ b/Open-ILS/src/templates/tinypac/record.tt2 @@ -0,0 +1,12 @@ +[% PROCESS "tinypac/parts/header.tt2"; + WRAPPER "tinypac/base.tt2"; + ctx.page_title = l("Record Detail") %] +
    +
    +
    + [% INCLUDE "tinypac/parts/record/body.tt2" %] +
    +
    +
    +
    +[% END %] diff --git a/Open-ILS/src/templates/tinypac/record/email.tt2 b/Open-ILS/src/templates/tinypac/record/email.tt2 new file mode 100644 index 0000000000..bafd20aa98 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/record/email.tt2 @@ -0,0 +1,21 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/config.tt2"; + WRAPPER "opac/parts/base.tt2"; + INCLUDE "opac/parts/topnav.tt2"; + ctx.page_title = l("Record Detail") %] +
    + [% INCLUDE "opac/parts/searchbar.tt2" %] +
    +
    +
    +
    +
    +

    [% l('Your email has been queued for Delivery.') %]

    +
    +

    [ [% l("Back to Record") %] ]

    +
    +
    +
    +
    +[% END %] + diff --git a/Open-ILS/src/templates/tinypac/record/print.tt2 b/Open-ILS/src/templates/tinypac/record/print.tt2 new file mode 100644 index 0000000000..d5d94e615b --- /dev/null +++ b/Open-ILS/src/templates/tinypac/record/print.tt2 @@ -0,0 +1,27 @@ +[% PROCESS 'opac/parts/header.tt2' %] + + + [% l('Print Record') %] + + + + [% IF ctx.printable_record.template_output %] + + [% ctx.printable_record.template_output.data %] + + [% ELSE %] + + [% END %] + + + diff --git a/Open-ILS/src/templates/tinypac/results.tt2 b/Open-ILS/src/templates/tinypac/results.tt2 new file mode 100644 index 0000000000..10c3173eb3 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/results.tt2 @@ -0,0 +1,41 @@ +[% PROCESS "tinypac/parts/header.tt2"; + WRAPPER "tinypac/base.tt2"; + + ctx.page_title = l("Search Results: ") _ CGI.param('query') | html; + + page = CGI.param('page'); + page = page.match('^\d+$') ? page : 0; # verify page is a sane value + + page_count = ctx.page_size == 0 ? 1 : POSIX.ceil(ctx.hit_count / ctx.page_size); +%] + +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    + [% INCLUDE "tinypac/parts/result/table.tt2" %] +
    +
    +
    +
    +
    +[% END %] diff --git a/Open-ILS/src/templates/tinypac/sms_cn.tt2 b/Open-ILS/src/templates/tinypac/sms_cn.tt2 new file mode 100644 index 0000000000..6a1dc16db5 --- /dev/null +++ b/Open-ILS/src/templates/tinypac/sms_cn.tt2 @@ -0,0 +1,49 @@ +[% PROCESS "opac/parts/header.tt2"; + WRAPPER "opac/parts/base.tt2"; + INCLUDE "opac/parts/topnav.tt2"; + ctx.page_title = l("Send Call Number via Text/SMS") %] +
    + [% INCLUDE "opac/parts/searchbar.tt2" %] +
    +
    +
    +
    +
    +

    + [% IF ctx.event != -1 %] +
    + [% IF ctx.sms_notify %] +

    Your message has been sent!

    + Return to record +
    [% ctx.event.template_output.data %]
    + [% ELSE %] +

    Text call number

    + Return to record +
    [% ctx.event.template_output.data %]
    +
    +
    +
    + + + [% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_warning="true" %]
    + [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]
    + +
    [% l('Note: carrier charges may apply'); %] +
    +
    +
    + [% END %] + [% ELSE %] + SMS not enabled for this site. + [% END %] +

    +
    +
    +
    +
    +[% END %]