[Rt-commit] r13480 - in rt/3.8/branches/3.8.0-releng: . lib/RT

jesse at bestpractical.com jesse at bestpractical.com
Fri Jun 20 18:07:57 EDT 2008


Author: jesse
Date: Fri Jun 20 18:07:53 2008
New Revision: 13480

Modified:
   rt/3.8/branches/3.8.0-releng/   (props changed)
   rt/3.8/branches/3.8.0-releng/lib/RT/Record.pm
   rt/3.8/branches/3.8.0-releng/lib/RT/SharedSetting.pm
   rt/3.8/branches/3.8.0-releng/sbin/rt-test-dependencies.in

Log:
 r33219 at 68-246-70-236 (orig r13476):  ruz | 2008-06-20 17:27:59 -0400
 * pod changes, minors
 r33220 at 68-246-70-236 (orig r13477):  falcone | 2008-06-20 17:32:05 -0400
  r34680 at ketch:  falcone | 2008-06-20 17:31:49 -0400
  * make dashboards default
  * add it to the command line args
 
 r33221 at 68-246-70-236 (orig r13478):  falcone | 2008-06-20 17:44:42 -0400
  r34683 at ketch:  falcone | 2008-06-20 17:44:29 -0400
  * add missing comma
 
 r33222 at 68-246-70-236 (orig r13479):  kyoki | 2008-06-20 18:01:51 -0400
  r23238 at nyx:  kyoki | 2008-06-20 18:01:36 -0400
  RT-Ticket: 9599
  RT-Status: Resolved
  RT-Update: Correspond
  Message is now more human readable.
 


Modified: rt/3.8/branches/3.8.0-releng/lib/RT/Record.pm
==============================================================================
--- rt/3.8/branches/3.8.0-releng/lib/RT/Record.pm	(original)
+++ rt/3.8/branches/3.8.0-releng/lib/RT/Record.pm	Fri Jun 20 18:07:53 2008
@@ -1179,6 +1179,29 @@
 
 # }}}
 
+# {{{ sub FormatLink
+
+=head2 FormatLink
+
+Takes either a Target or a Base and returns a string of human friendly text.
+
+=cut
+
+sub FormatLink {
+    my $self = shift;
+    my %args = ( Object => undef,
+		 FallBack => '',
+		 @_
+	       );
+    my $text = "URI " . $args{FallBack};
+    if ($args{Object} && $args{Object}->isa("RT::Ticket")) {
+	$text = "Ticket " . $args{Object}->id;
+    }
+    return $text;
+}
+
+# }}}
+
 # {{{ sub _AddLink
 
 =head2 _AddLink
@@ -1190,7 +1213,6 @@
 
 =cut
 
-
 sub _AddLink {
     my $self = shift;
     my %args = ( Target => '',
@@ -1247,10 +1269,13 @@
         return ( 0, $self->loc("Link could not be created") );
     }
 
+    my $basetext = $self->FormatLink(Object => $link->BaseObj,
+				     FallBack => $args{Base});
+    my $targettext = $self->FormatLink(Object => $link->TargetObj,
+				       FallBack => $args{Target});
     my $TransString =
-      "Record $args{'Base'} $args{Type} record $args{'Target'}.";
-
-    return ( $linkid, $self->loc( "Link created ([_1])", $TransString ) );
+      "$basetext $args{Type} $targettext.";
+    return ( $linkid, $TransString ) ;
 }
 
 # }}}
@@ -1305,13 +1330,16 @@
 
     $link->LoadByParams( Base=> $args{'Base'}, Type=> $args{'Type'}, Target=>  $args{'Target'} );
     #it's a real link. 
-    if ( $link->id ) {
 
+    if ( $link->id ) {
+	my $basetext = $self->FormatLink(Object => $link->BaseObj,
+				     FallBack => $args{Base});
+	my $targettext = $self->FormatLink(Object => $link->TargetObj,
+				       FallBack => $args{Target});
         my $linkid = $link->id;
         $link->Delete();
-
-        my $TransString = "Record $args{'Base'} no longer $args{Type} record $args{'Target'}.";
-        return ( 1, $self->loc("Link deleted ([_1])", $TransString));
+        my $TransString = "$basetext no longer $args{Type} $targettext.";
+        return ( 1, $TransString);
     }
 
     #if it's not a link we can find

Modified: rt/3.8/branches/3.8.0-releng/lib/RT/SharedSetting.pm
==============================================================================
--- rt/3.8/branches/3.8.0-releng/lib/RT/SharedSetting.pm	(original)
+++ rt/3.8/branches/3.8.0-releng/lib/RT/SharedSetting.pm	Fri Jun 20 18:07:53 2008
@@ -48,19 +48,16 @@
 
 =head1 NAME
 
-  RT::SharedSetting - an API for settings that belong to an RT::User or RT::Group
+RT::SharedSetting - an API for settings that belong to an RT::User or RT::Group
 
 =head1 SYNOPSIS
 
-  use RT::SharedSetting
+  use RT::SharedSetting;
 
 =head1 DESCRIPTION
 
-  A SharedSetting is an object that can belong to an RT::User or an RT::Group.
-  It consists of an ID, a name, and some arbitrary data.
-
-=head1 METHODS
-
+A RT::SharedSetting is an object that can belong to an L<RT::User> or an <RT::Group>.
+It consists of an ID, a name, and some arbitrary data.
 
 =cut
 
@@ -70,6 +67,15 @@
 use RT::Attribute;
 use base qw/RT::Base/;
 
+=head1 METHODS
+
+=head2 new
+
+Returns a new L<RT::SharedSetting> object.
+Takes the current user, see also L<RT::Base>.
+
+=cut
+
 sub new  {
     my $proto = shift;
     my $class = ref($proto) || $proto;
@@ -112,8 +118,6 @@
     }
 }
 
-sub PostLoad { }
-
 =head2 LoadById
 
 First loads up the L<RT::Attribute> for this shared setting by ID, then calls
@@ -138,12 +142,21 @@
     return $self->Load($privacy, $id);
 }
 
+=head2 PostLoad
+
+Called after after successful L</Load>.
+
+=cut
+
+sub PostLoad { }
+
 =head2 Save
 
 Takes a privacy, a name, and any other arguments. Saves the given parameters to
 the appropriate user/group object, and loads the resulting object. Arguments
 are passed to the SaveAttribute method, which does the actual update. Returns a
 tuple of status and message, where status is true on success. Defaults are:
+
   Privacy:  CurrentUser only
   Name:     "new (ObjectName)"
 
@@ -253,8 +266,8 @@
 =cut
 
 sub Id {
-     my $self = shift;
-     return $self->{'Id'};
+    my $self = shift;
+    return $self->{'Id'};
 }
 
 =head2 Privacy
@@ -369,4 +382,3 @@
 die $@ if ($@ && $@ !~ qr{^Can't locate RT/SharedSetting_Local.pm});
 
 1;
-

Modified: rt/3.8/branches/3.8.0-releng/sbin/rt-test-dependencies.in
==============================================================================
--- rt/3.8/branches/3.8.0-releng/sbin/rt-test-dependencies.in	(original)
+++ rt/3.8/branches/3.8.0-releng/sbin/rt-test-dependencies.in	Fri Jun 20 18:07:53 2008
@@ -70,6 +70,7 @@
     'with-SMTP',
     'with-GRAPHVIZ',
     'with-GD',
+    'with-DASHBOARDS',
 
     'download=s',
     'repository=s',
@@ -94,6 +95,7 @@
     'with-SMTP' => 1,
     'with-GRAPHVIZ' => @RT_GRAPHVIZ@,
     'with-GD' => @RT_GD@,
+    'with-DASHBOARDS' => 1
 );
 $args{$_} = $default{$_} foreach grep !exists $args{$_}, keys %default;
 


More information about the Rt-commit mailing list