[Rt-commit] r8745 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: .
sartak at bestpractical.com
sartak at bestpractical.com
Mon Aug 27 12:28:17 EDT 2007
Author: sartak
Date: Mon Aug 27 12:28:15 2007
New Revision: 8745
Modified:
rt/branches/3.7-EXPERIMENTAL-TUNIS/ (props changed)
rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/RT__Ticket/ColumnMap
Log:
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-TUNIS/html/Elements/RT__Ticket/ColumnMap
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/RT__Ticket/ColumnMap (original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/RT__Ticket/ColumnMap Mon Aug 27 12:28:15 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