[Rt-commit] rt branch, html-templates, updated. rt-3.9.4-485-ga28720b

Thomas Sibley trs at bestpractical.com
Thu Nov 18 10:37:20 EST 2010


The branch, html-templates has been updated
       via  a28720b02996ba87aba1b53cd3fd067353ad3784 (commit)
       via  135a95b710a7a82e76658ddf12c36fe3a3c8d0c5 (commit)
      from  edc6d0a99a46a86d717ceed03f805864fcada7f1 (commit)

Summary of changes:
 etc/initialdata |  237 +++++++++++++++++++++++-------------------------------
 1 files changed, 101 insertions(+), 136 deletions(-)

- Log -----------------------------------------------------------------
commit 135a95b710a7a82e76658ddf12c36fe3a3c8d0c5
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Nov 17 16:31:40 2010 -0500

    Cleanup template descriptions

diff --git a/etc/initialdata b/etc/initialdata
index 95bf4a1..4e56f4c 100755
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -194,7 +194,7 @@
       Content     => '', },
     {  Queue       => '0',
        Name        => 'Autoreply',                                         # loc
-       Description => 'Default Autoresponse template',                     # loc
+       Description => 'Plain text Autoresponse template',                     # loc
        Content     => 'Subject: AutoReply: {$Ticket->Subject}
 
 
@@ -225,7 +225,7 @@ you may reply to this message.
 
     {  Queue       => '0',
        Name        => 'Transaction',                     # loc
-       Description => 'Default transaction template',    # loc
+       Description => 'Plain text transaction template',    # loc
        Content     => 'RT-Attach-Message: yes
 
 
@@ -247,7 +247,7 @@ you may reply to this message.
 
       Queue       => '0',
       Name        => 'Admin Correspondence',                     # loc
-      Description => 'Default admin correspondence template',    # loc
+      Description => 'Plain text admin correspondence template',    # loc
       Content     => 'RT-Attach-Message: yes
 
 
@@ -259,7 +259,7 @@ you may reply to this message.
 
     {  Queue       => '0',
        Name        => 'Correspondence',                          # loc
-       Description => 'Default correspondence template',         # loc
+       Description => 'Plain text correspondence template',         # loc
        Content     => 'RT-Attach-Message: yes
 
 {$Transaction->Content()}
@@ -268,7 +268,7 @@ you may reply to this message.
 
     {  Queue       => '0',
        Name        => 'Admin Comment',                           # loc
-       Description => 'Default admin comment template',          # loc
+       Description => 'Plain text admin comment template',          # loc
        Content     =>
 'Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject); $s =~ s/\\[Comment\\]\\s*//g; $s =~ s/^Re:\\s*//i; $s;}
 RT-Attach-Message: yes
@@ -486,13 +486,6 @@ Hour:         { $SubscriptionObj->SubValue('Hour') }
 }
 }
 },
-# HTML version of the templates
-# TODO
-# needs the approval templates to be converted
-# possibly the error templates
-# probably not the Forward templates
-# needs an upgrade step
-# needs docs on how to swap your scrips to use the new templates
     {
      Name        => 'Correspondence in HTML',                            # loc
      Description => 'HTML correspondence template',         # loc
@@ -566,7 +559,7 @@ Content-Type: text/html
 ],
    },
    {  Queue       => '0',
-      Name        => 'Autoreply in HTML',                                         # loc
+      Name        => 'Autoreply in HTML',                              # loc
       Description => 'HTML Autoresponse template',                     # loc
       Content     => q[Subject: AutoReply: {$Ticket->Subject}
 Content-Type: text/html
@@ -596,7 +589,7 @@ you may reply to this message.</p>
    {  
       Queue       => '0',
       Name        => 'Transaction in HTML',                     # loc
-      Description => 'Default transaction template',    # loc
+      Description => 'HTML transaction template',    # loc
       Content     => q[RT-Attach-Message: yes
 Content-Type: text/html
 

commit a28720b02996ba87aba1b53cd3fd067353ad3784
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Nov 18 10:34:04 2010 -0500

    Interleave plain text and HTML templates for easier maintenance
    
    In the process I've cleaned up the HTML versions and brought them up to
    date with their plain text counterparts in 3.9.

diff --git a/etc/initialdata b/etc/initialdata
index 4e56f4c..922ad1e 100755
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -222,10 +222,35 @@ you may reply to this message.
 {$Transaction->Content()}
 '
     },
+    {  Queue       => '0',
+       Name        => 'Autoreply in HTML',                              # loc
+       Description => 'HTML Autoresponse template',                     # loc
+       Content     => q[Subject: AutoReply: {$Ticket->Subject}
+Content-Type: text/html
 
+<p>Greetings,</p>
+
+<p>This message has been automatically generated in response to the
+creation of a trouble ticket regarding <b>{$Ticket->Subject()}</b>,
+a summary of which appears below.</p>
+
+<p>There is no need to reply to this message right now.  Your ticket has been
+assigned an ID of <b>{$Ticket->SubjectTag}</b>.</p>
+
+<p>Please include the string <b>{$Ticket->SubjectTag}</b>
+in the subject line of all future correspondence about this issue. To do so,
+you may reply to this message.</p>
+
+<p>Thank you,<br/>
+{$Ticket->QueueObj->CorrespondAddress()}</p>
+
+<hr/>
+{$Transaction->Content(Type => 'text/html')}
+],
+    },
     {  Queue       => '0',
        Name        => 'Transaction',                     # loc
-       Description => 'Plain text transaction template',    # loc
+       Description => 'Plain text transaction template', # loc
        Content     => 'RT-Attach-Message: yes
 
 
@@ -242,7 +267,28 @@ you may reply to this message.
 {$Transaction->Content()}
 '
     },
+    {  Queue       => '0',
+       Name        => 'Transaction in HTML',          # loc
+       Description => 'HTML transaction template',    # loc
+       Content     => 'RT-Attach-Message: yes
+Content-Type: text/html
 
+<b>{$Transaction->CreatedAsString}: {$Transaction->CreatorObj->Name} updated ticket <a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">{$Ticket->id}</a>.</b>
+<br>
+<table border="0">
+<tr><td align="right"><b>Transaction:</b></td><td>{$Transaction->Description}</td></tr>
+<tr><td align="right"><b>Queue:</b></td><td>{$Ticket->QueueObj->Name}</td></tr>
+<tr><td align="right"><b>Subject:</b></td><td>{$Transaction->Subject || $Ticket->Subject || "(No subject given)"} </td></tr>
+<tr><td align="right"><b>Owner:</b></td><td>{$Ticket->OwnerObj->Name}</td></tr>
+<tr><td align="right"><b>Requestors:</b></td><td>{$Ticket->RequestorAddresses}</td></tr>
+<tr><td align="right"><b>Status:</b></td><td>{$Ticket->Status}</td></tr>
+<tr><td align="right"><b>Ticket URL:</b></td><td><a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}</a></td></tr>
+</table>
+<br/>
+<br/>
+{$Transaction->Content( Type => "text/html")}
+'
+    },
     {
 
       Queue       => '0',
@@ -256,7 +302,18 @@ you may reply to this message.
 {$Transaction->Content()}
 '
     },
+    {  Queue       => '0',
+       Name        => 'Admin Correspondence in HTML',                     # loc
+       Description => 'HTML admin correspondence template',    # loc
+       Content     => 'RT-Attach-Message: yes
+Content-Type: text/html
 
+Ticket URL: <a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}</a>
+<br />
+<br />
+{$Transaction->Content(Type => "text/html");}
+'
+    },
     {  Queue       => '0',
        Name        => 'Correspondence',                          # loc
        Description => 'Plain text correspondence template',         # loc
@@ -265,7 +322,15 @@ you may reply to this message.
 {$Transaction->Content()}
 '
     },
+    {  Queue       => '0',
+       Name        => 'Correspondence in HTML',                 # loc
+       Description => 'HTML correspondence template',           # loc
+       Content     => 'RT-Attach-Message: yes
+Content-Type: text/html
 
+{$Transaction->Content( Type => "text/html")}
+'
+    },
     {  Queue       => '0',
        Name        => 'Admin Comment',                           # loc
        Description => 'Plain text admin comment template',          # loc
@@ -280,7 +345,18 @@ This is a comment.  It is not sent to the Requestor(s):
 {$Transaction->Content()}
 '
     },
+    {  Queue       => '0',
+       Name        => 'Admin Comment in HTML',                  # loc
+       Description => 'HTML admin comment template',            # loc
+       Content     => 'Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject); $s =~ s/\[Comment\]//g; $comment =~ s/^Re//i; $s;}
+RT-Attach-Message: yes
+Content-Type: text/html
 
+<p>This is a comment about <a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">ticket {$Ticket->id}</a>. It is not sent to the Requestor(s):</p>
+
+{$Transaction->Content(Type => "text/html")}
+'
+    },
     {  Queue       => '0',
        Name        => 'Status Change',                                     # loc
        Description => 'Ticket status changed',                             # loc
@@ -292,7 +368,18 @@ This is a comment.  It is not sent to the Requestor(s):
 {$Transaction->Content()}
 '
     },
+    {  Queue       => '0',
+       Name        => 'Status Change in HTML',              # loc
+       Description => 'Ticket status changed',              # loc
+       Content     => 'Subject: Status Changed to: {$Transaction->NewValue}
+Content-Type: text/html
 
+<a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}</a>
+<br/>
+<br/>
+{$Transaction->Content(Type => "text/html")}
+'
+    },
     {
 
       Queue       => '0',
@@ -304,6 +391,15 @@ According to our records, your request has been resolved. If you have any
 further questions or concerns, please respond to this message.
 '
     },
+    {  Queue       => '0',
+       Name        => 'Resolved in HTML',               # loc
+       Description => 'HTML Ticket Resolved',           # loc
+       Content     => 'Subject: Resolved: {$Ticket->Subject}
+Content-Type: text/html
+
+<p>According to our records, your request has been resolved.  If you have any further questions or concerns, please respond to this message.</p>
+'
+    },
     {  Queue       => '___Approvals',
        Name        => "New Pending Approval",    # loc
        Description =>
@@ -486,130 +582,6 @@ Hour:         { $SubscriptionObj->SubValue('Hour') }
 }
 }
 },
-    {
-     Name        => 'Correspondence in HTML',                            # loc
-     Description => 'HTML correspondence template',         # loc
-     Content     => q[RT-Attach-Message: yes
-Content-Type: text/html
-
-{$Transaction->Content( Type => 'text/html')}
-],
-   },
-
-   {
-     Queue       => '0',
-     Name        => 'Admin Correspondence in HTML',                     # loc
-     Description => 'HTML admin correspondence template',    # loc
-     Content     => q[RT-Attach-Message: yes
-Content-Type: text/html
-
-{ my $c = $Transaction->Content(Type => 'text/html');
-  my $url = RT->Config->Get('WebURL')."Ticket/Display.html?id=".$Ticket->id;
-  if (substr($c,0,500) =~ qr/\Q$url\E/) {
-     $OUT = $c;
-  } else {
-    $OUT = <<EOF;
-Ticket URL: <a href="$url">$url</a>
-<br/>
-<br/>
-<br/>
-$c
-EOF
-
-  }
-}
-],
-   },
-   {  
-      Queue       => '0',
-      Name        => 'Admin Comment in HTML',                           # loc
-      Description => 'HTML admin comment template',          # loc
-      Content     => q[Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject); $s =~ s/\[Comment\]//g; $comment =~ s/^Re//i; $s;}
-RT-Attach-Message: yes
-Content-Type: text/html
-
-<p>This is a comment about <a href="{RT->Config->Get('WebURL')}Ticket/Display.html?id={$Ticket->id}">ticket {$Ticket->id}</a>. It is not sent to the Requestor(s):</p>
-<br/>
-{$Transaction->Content(Type => 'text/html')}
-],
-   },
-   {  Queue       => '0',
-      Name        => 'Status Change in HTML',                                     # loc
-      Description => 'Ticket status changed',                             # loc
-      Content     => q[Subject: Status Changed to: {$Transaction->NewValue}
-RT-Attach-Message: yes
-Content-Type: text/html
-
-<a href="{RT->Config->Get('WebURL')}Ticket/Display.html?id={$Ticket->id}">{RT->Config->Get('WebURL')}Ticket/Display.html?id={$Ticket->id}</a>
-<br/>
-<br/>
-{$Transaction->Content(Type => 'text/html')}
-],
-   },
-   {
-     Queue       => '0',
-     Name        => 'Resolved in HTML',                 # loc
-     Description => 'HTML Ticket Resolved',          # loc
-     Content     => q[Subject: Resolved: {$Ticket->Subject}
-Content-Type: text/html
-
-<p>According to our records, your request has been resolved.</p>
-
-<p>If you have any further questions or concerns, please respond to this message.</p>
-],
-   },
-   {  Queue       => '0',
-      Name        => 'Autoreply in HTML',                              # loc
-      Description => 'HTML Autoresponse template',                     # loc
-      Content     => q[Subject: AutoReply: {$Ticket->Subject}
-Content-Type: text/html
-
-
-<p>Greetings,</p>
-
-<p>This message has been automatically generated in response to the
-creation of a trouble ticket regarding <b>{$Ticket->Subject()}</b>,
-a summary of which appears below.</p>
-
-<p>There is no need to reply to this message right now.  Your ticket has been
-assigned an ID of [{$rtname} #{$Ticket->id()}].</p>
-
-<p>Please include the string <b>[{$rtname} #{$Ticket->id}]</b>
-in the subject line of all future correspondence about this issue. To do so,
-you may reply to this message.</p>
-
-
-<p>Thank you,<br/>
-{$Ticket->QueueObj->CorrespondAddress()}</p>
-
-<hr/>
-{$Transaction->Content(Type => 'text/html')}
-],
-   },
-   {  
-      Queue       => '0',
-      Name        => 'Transaction in HTML',                     # loc
-      Description => 'HTML transaction template',    # loc
-      Content     => q[RT-Attach-Message: yes
-Content-Type: text/html
-
-<b>{$Transaction->CreatedAsString}: {$Transaction->CreatorObj->Name} updated ticket {$Ticket->id}.</b>
-<br>
-<table border="0">
-<tr><td align="right"><b>Transaction:</b></td><td>{$Transaction->Description}</td></tr>
-<tr><td align="right"><b>Queue:</b></td><td>{$Ticket->QueueObj->Name}</td></tr>
-<tr><td align="right"><b>Subject:</b></td><td>{$Transaction->Subject || $Ticket->Subject || "(No subject given)"} </td></tr>
-<tr><td align="right"><b>Owner:</b></td><td>{$Ticket->OwnerObj->Name}</td></tr>
-<tr><td align="right"><b>Requestors:</b></td><td>{$Ticket->RequestorAddresses}</td></tr>
-<tr><td align="right"><b>Status:</b></td><td>{$Ticket->Status}</td></tr>
-<tr><td align="right"><b>Ticket URL:</b></td><td><a href="{RT->Config->Get('WebURL')}Ticket/Display.html?id={$Ticket->id}">{RT->Config->Get('WebURL')}Ticket/Display.html?id={$Ticket->id}</a></td></tr>
-</table>
-
-<br/>
-<br/>
-{$Transaction->Content( Type => 'text/html')}
-],
-   },
 );
 
 @Scrips = (

-----------------------------------------------------------------------


More information about the Rt-commit mailing list