[Rt-commit] r10323 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Sun Jan 13 17:53:51 EST 2008


Author: ruz
Date: Sun Jan 13 17:53:51 2008
New Revision: 10323

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm

Log:
 r10147 at cubic-pc:  cubic | 2008-01-09 16:43:19 +0300
 * add GenMessageId() function in RT::Interface::Email


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm	Sun Jan 13 17:53:51 2008
@@ -985,6 +985,21 @@
     }
 }
 
+sub GenMessageId {
+    my %args = (
+        Ticket => undef,
+        Scrip  => undef,
+        @_
+    );
+    my $org = RT->Config->Get('Organization');
+    my $res =
+        "<rt-". $RT::VERSION ."-". $$ ."-". CORE::time() ."-". int(rand(2000)) .'.'
+        . (ref($args{'Ticket'})? $args{'Ticket'}->id : $args{'Ticket'} || 0) . "-" # ticket
+        . (ref($args{'Scrip'})?  $args{'Scrip'}->id  : $args{'Scrip'}  || 0) . "-" # scrip
+        . "0" # Email sent
+        . "@". $org . ">" ;
+    return $res;
+}
 
 
 sub ParseTicketId {


More information about the Rt-commit mailing list