Merge branch 'master' of https://github.com/jgoodman/Freeside
[freeside.git] / rt / share / html / Elements / RT__Ticket / ColumnMap
index 7efc4b4..7309b5d 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -68,7 +68,7 @@ my $LinkCallback = sub {
             \'<a href="',
             $_->$mode_uri->Resolver->HREF,
             \'">',
-            ( $_->$mode_uri->IsLocal ? $_->$local_type : $_->$mode ),
+            ( $_->$mode_uri->IsLocal && $_->$local_type ? $_->$local_type : $_->$mode_uri->Resolver->AsString ),
             \'</a><br />',
         } @{ $_[0]->Links($other_mode,$type)->ItemsArrayRef }
     }
@@ -212,6 +212,11 @@ $COLUMN_MAP = {
             }
         }
     },
+    WillResolveRelative => {
+        title     => 'Will Resolve',
+        attribute => 'WillResolve',
+        value     => sub { return $_[0]->WillResolveObj->AgeAsString },
+    },
     ResolvedRelative => {
         title     => 'Resolved', # loc
         attribute => 'Resolved',
@@ -220,27 +225,32 @@ $COLUMN_MAP = {
     Starts => {
         title     => 'Starts', # loc
         attribute => 'Starts',
-        value     => sub { return $_[0]->StartsObj->AsString }
+        value     => sub { return $_[0]->StartsObj }
     },
     Started => {
         title     => 'Started', # loc
         attribute => 'Started',
-        value     => sub { return $_[0]->StartedObj->AsString }
+        value     => sub { return $_[0]->StartedObj },
     },
     Told => {
         title     => 'Told', # loc
         attribute => 'Told',
-        value     => sub { return $_[0]->ToldObj->AsString }
+        value     => sub { return $_[0]->ToldObj },
     },
     Due => {
         title     => 'Due', # loc
         attribute => 'Due',
-        value     => sub { return $_[0]->DueObj->AsString }
+        value     => sub { return $_[0]->DueObj },
+    },
+    WillResolve => {
+        title     => 'Will Resolve',
+        attribute => 'WillResolve',
+        value     => sub { return $_[0]->WillResolveObj },
     },
     Resolved => {
         title     => 'Resolved', # loc
         attribute => 'Resolved',
-        value     => sub { return $_[0]->ResolvedObj->AsString }
+        value     => sub { return $_[0]->ResolvedObj }
     },
     UpdateStatus => {
         title => 'New messages', # loc
@@ -261,10 +271,10 @@ $COLUMN_MAP = {
             {
                 my %key = RT::Crypt::GnuPG::GetKeyInfo($email);
                 if (!defined $key{'info'}) {
-                    $email .= loc(" (no pubkey!)");
+                    $email .= ' ' . loc("(no pubkey!)");
                 }
                 elsif ($key{'info'}{'TrustLevel'} == 0) {
-                    $email .= loc(" (untrusted!)");
+                    $email .= ' ' . loc("(untrusted!)");
                 }
             }
             return join ', ', @requestors;
@@ -313,25 +323,10 @@ $COLUMN_MAP = {
             return \$bookmark;
         },
     },
-
-    Customer => {
-        title     => 'Customer', #loc
-        attribute => 'Customer', #title/attribute/name... what does it all mean?
-        value     => sub {
-          my $Ticket = shift;
-          my @Customers = @{ $Ticket->Customers->ItemsArrayRef };
-          my @CustResolvers = map $_->TargetURI->Resolver, @Customers;
-          my @return = ();
-          for ( 0 .. $#CustResolvers ) {
-            my $c = @CustResolvers[$_];
-            push @return, \'<A HREF="', $c->HREF, \'">', $c->AsString, \'</A>';
-            push @return, \'<BR>' if scalar(@CustResolvers) > 1
-                                  && $_ != $#CustResolvers;
-          }
-          @return;
-        },
-    },
-
+    
+    #freeside
+    $m->comp('/Elements/CustomerFields', 'ColumnMap'),
+    $m->comp('/Elements/ServiceFields', 'ColumnMap'),
 };
 
 # if no GPG support, then KeyOwnerName and KeyRequestors fall back to the regular