Add option for host value in URLs
authorArt Rhyno <art632000@yahoo.ca>
Mon, 1 Oct 2012 02:50:09 +0000 (22:50 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 7 May 2013 19:58:00 +0000 (15:58 -0400)
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

index e4266a3..a53f7de 100644 (file)
@@ -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 @@ $$
 <div>
     <style> li { padding: 8px; margin 5px; }</style>
     <ol>
-    [% 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 @@ $$
 
         <li>
             Bib ID# [% bre_id %] [% IF isbn %]ISBN: [% isbn | html %]<br/>[% END -%] [% IF issn %]ISSN: [% issn | html %]<br/>[% END -%] <br />
+            [% IF tpac_host.length != 0 %]
+               URL: [% tpac_host %]/eg/opac/record/[% bre_id %]<br/>
+            [% END %]
             Title: [% title %]<br />
             Author: [% author %]<br />
             Publication Info: [% publisher %] [% pubdate %]<br/>
@@ -9019,7 +9032,7 @@ $$
                [% FOR uri IN uris %]
                   <li>URL: [% uri.href | html %]<br/>
                   [% IF uri.link.length > 0 %]
-                     Label: [% uri.href | html %]<br />
+                     Label: [% uri.link | html %]<br />
                   [% END %]
                   [% IF uri.note.length > 0 %]
                      Note: [% uri.note | html %]<br />