Remove extraneous spaces from bib email template feature/callno_tpac_template_2_4
authorDan Scott <dscott@laurentian.ca>
Tue, 9 Oct 2012 16:21:10 +0000 (12:21 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 7 May 2013 19:58:10 +0000 (15:58 -0400)
Various email servers refuse to send email that begins with blank lines,
so use TT's [%- and -%] to eat up whitespace. Also, remove the extra
linefeeds (_ "\n") as the linefeed is already generated by virtue of
being on its own line.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/sql/Pg/950.data.seed-values.sql

index 6e482ad..05d5aae 100644 (file)
@@ -8791,15 +8791,15 @@ INSERT INTO action_trigger.event_definition (
         NULL,
         '00:00:00',
 $$
-[%  SET user = target.0.owner; 
+[%-  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 %]
+    SET tpac_host = 'http://www.concat.ca'; # tpac_host can be specfied directly -%]
 To: [%- params.recipient_email || user.email %]
 From: [%- params.sender_email || default_sender %]
 Subject: Bibliographic Records
 
 [% FOR cbreb IN target %]
-[% FOR item IN cbreb.items;
+[%- FOR item IN cbreb.items;
     bre_id = item.target_biblio_record_entry;
 
     bibxml = helpers.unapi_bre(bre_id, {flesh => '{mra}'});
@@ -8871,42 +8871,41 @@ Subject: Bibliographic Records
         END;
     END;
 
-%]
+-%]
 
 [% loop.count %]/[% loop.size %]. Bib ID# [% bre_id %]
-[% IF tpac_host.length != 0 %]URL: [% tpac_host %]/eg/opac/record/[% bre_id _ "\n" %][% END %]
-[% IF isbn %]ISBN: [% isbn _ "\n" %][% END %]
-[% IF issn %]ISSN: [% issn _ "\n" %][% END %]
-[% IF upc  %]UPC:  [% upc _ "\n" %] [% END %]
+[%- IF tpac_host.length != 0 %]URL: [% tpac_host %]/eg/opac/record/[% bre_id _ "\n" %][% END %]
+[%- IF isbn %]ISBN: [% isbn %][% END %]
+[%- IF issn %]ISSN: [% issn %][% END %]
+[%- IF upc  %]UPC:  [% upc %] [% END %]
 Title: [% title %]
 Author: [% author %]
 Publication Info: [% publisher %] [% pubdate %]
 Item Type: [% item_type %]
 
-[% IF holdings.size > 0 %]
-   [% IF holdings.size > print_limit AND print_limit > 0 %]
+[%- IF holdings.size > 0 %]
+   [%- IF holdings.size > print_limit AND print_limit > 0 %]
       Showing [% print_limit %] of [% holdings.size %], use URL for full list of copies...
-   [% 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 %]
-      Status: [% holding.status _ "\n" %]
-   [% END %]
-[% END %]
-[% IF uris.size > 0 %]
-   [% 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 %]
+   [%- FOR holding IN holdings %]
+      Location: [% holding.library %] - [% holding.location %]
+      Call Number: [% holding.label %][% IF holding.part_label %][% holding.part_label %][% END %]
+      Status: [% holding.status %]
    [% END %]
 [% END %]
-
-[% END %]
-[% END %]
+[%- IF uris.size > 0 %]
+   [%- FOR uri IN uris %]
+      URL: [% uri.href %]
+   [%- END %]
+   [%- IF uri.link.length > 0 %]
+         Label: [% uri.link %]
+   [%- END %]
+   [%- IF uri.note.length > 0 %]
+         Note: [% uri.note %]
+   [%- END %]
+[%- END %]
+[%- END %]
+[%- END %]
 $$
     )
     ,(