From 309e8bc3f9e27ca068169ac192b8c75431a320e9 Mon Sep 17 00:00:00 2001 From: Art Rhyno Date: Sun, 30 Sep 2012 22:50:09 -0400 Subject: [PATCH] Add option for host value in URLs The ability to link back to a bib record for print and e-mail displays from tpac is very useful, esp. for e-mail where there is a good chance that the mail system will make it an active link. It looks possible to wire in environmental variables with the template toolkit but that's probably as complicated as it is to modify the template directly. --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 33 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index e4266a3eb8..a53f7de5dd 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -8791,8 +8791,9 @@ INSERT INTO action_trigger.event_definition ( NULL, '00:00:00', $$ -[%- SET user = target.0.owner; - SET print_limit = 500; #this is to limit the no. of copies, set to 0 for unlimited %] +[% SET user = target.0.owner; + SET print_limit = 500; #this is to limit the no. of copies, set to 0 for unlimited + SET tpac_host = ''; # tpac_host can be specfied directly %] To: [%- params.recipient_email || user.email %] From: [%- params.sender_email || default_sender %] Subject: Bibliographic Records @@ -8872,11 +8873,11 @@ Subject: Bibliographic Records %] -[% loop.count %]/[% loop.size %]. Bib ID# [% bre_id %] -URL: [% params.hostname %]/eg/opac/record/[% bre_id %] -[% IF isbn %]ISBN: [% isbn _ "\n" %][% END -%] -[% IF issn %]ISSN: [% issn _ "\n" %][% END -%] -[% IF upc %]UPC: [% upc _ "\n" %] [% END -%] +[% loop.count %]/[% loop.size %]. Bib ID# [% bre_id %] +[% IF tpac_host.length != 0 %]URL: [% tpac_host %]/eg/opac/record/[% bre_id %][% END %] +[% IF isbn %]ISBN: [% isbn _ "\n" %][% END %] +[% IF issn %]ISSN: [% issn _ "\n" %][% END %] +[% IF upc %]UPC: [% upc _ "\n" %] [% END %] Title: [% title %] Author: [% author %] Publication Info: [% publisher %] [% pubdate %] @@ -8888,7 +8889,7 @@ Item Type: [% item_type %] [% END %] [% FOR holding IN holdings %] Location: [% holding.library %] - [% holding.location _ "\n" %] - Call Number: [% holding.label _ "\n" %][% IF holding.part_label %][% holding.part_label _ "\n" %][% END -%] + Call Number: [% holding.label _ "\n" %][% IF holding.part_label %][% holding.part_label _ "\n" %][% END %] Status: [% holding.status _ "\n" %] [% END %] [% END %] @@ -8896,6 +8897,12 @@ Item Type: [% item_type %] [% FOR uri IN uris %] URL: [% uri.href _ "\n" %] [% END %] + [% IF uri.link.length > 0 %] + Label: [% uri.link _ "\n" %] + [% END %] + [% IF uri.note.length > 0 %] + Note: [% uri.note _ "\n" %] + [% END %] [% END %] [% END %] @@ -8919,7 +8926,10 @@ $$
    - [% SET print_limit = 500; #this is to limit the no. of copies, set to 0 for unlimited %] + + [% SET tpac_host = ''; # tpac_host can be specfied directly + SET print_limit = 500; #this is to limit the no. of copies, set to 0 for unlimited %] + [% FOR cbreb IN target %] [% FOR item IN cbreb.items; bre_id = item.target_biblio_record_entry; @@ -8993,6 +9003,9 @@ $$
  1. Bib ID# [% bre_id %] [% IF isbn %]ISBN: [% isbn | html %]
    [% END -%] [% IF issn %]ISSN: [% issn | html %]
    [% END -%]
    + [% IF tpac_host.length != 0 %] + URL: [% tpac_host %]/eg/opac/record/[% bre_id %]
    + [% END %] Title: [% title %]
    Author: [% author %]
    Publication Info: [% publisher %] [% pubdate %]
    @@ -9019,7 +9032,7 @@ $$ [% FOR uri IN uris %]
  2. URL: [% uri.href | html %]
    [% IF uri.link.length > 0 %] - Label: [% uri.href | html %]
    + Label: [% uri.link | html %]
    [% END %] [% IF uri.note.length > 0 %] Note: [% uri.note | html %]
    -- 2.11.0