[Rt-commit] r8801 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Tue Aug 28 14:45:48 EDT 2007
Author: ruz
Date: Tue Aug 28 14:45:48 2007
New Revision: 8801
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Ticket/ColumnMap
Log:
r8746 at cubic-pc (orig r8745): sartak | 2007-08-27 20:28:15 +0400
r37456 at onn: sartak | 2007-08-27 12:27:55 -0400
Add OwnerNameKey and RequestorsKey to display "(no pubkey!)" on each applicable name
Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Ticket/ColumnMap
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Ticket/ColumnMap (original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Ticket/ColumnMap Tue Aug 28 14:45:48 2007
@@ -225,6 +225,37 @@
$_[0]->loc('New'), \'</a>';
},
},
+ RequestorsKey => {
+ title => 'Requestors',
+ attribute => 'Requestor.EmailAddress',
+ value => sub {
+ my $t = shift;
+ my @requestors = $t->Requestors->MemberEmailAddresses;
+ for my $email (@requestors)
+ {
+ my %key = RT::Crypt::GnuPG::GetKeyInfo($email);
+ if (!defined $key{'info'}) {
+ $email .= " (no pubkey!)";
+ }
+ }
+ return join ', ', @requestors;
+ }
+ },
+ OwnerNameKey => {
+ title => 'Owner',
+ attribute => 'Owner',
+ value => sub {
+ my $t = shift;
+ my $email = $t->OwnerObj->EmailAddress;
+ return $email if $email eq '';
+
+ my %key = RT::Crypt::GnuPG::GetKeyInfo($email);
+ if (!defined $key{'info'}) {
+ $email .= " (no pubkey!)";
+ }
+ return $email;
+ }
+ },
# Everything from LINKTYPEMAP
(map {
@@ -271,6 +302,16 @@
$TICKET_COLUMN_MAP->{'CF'} = $TICKET_COLUMN_MAP->{'CustomField'};
+# if no GPG support, then OwnerNameKey and RequestorsKey fall back to the regular
+# versions
+if ("GPG support") {
+ require RT::Crypt::GnuPG;
+}
+else {
+ $TICKET_COLUMN_MAP->{OwnerNameKey} = $TICKET_COLUMN_MAP->{OwnerName};
+ $TICKET_COLUMN_MAP->{RequestorsKey} = $TICKET_COLUMN_MAP->{Requestors};
+}
+
</%ONCE>
<%init>
$m->callback( COLUMN_MAP => $TICKET_COLUMN_MAP, CallbackName => 'Once', CallbackOnce => 1 );
More information about the Rt-commit
mailing list