[Rt-devel] Making the NotifyActor config option a user preference.

Kevin Falcone falcone at bestpractical.com
Thu Dec 3 10:02:34 EST 2009


On Wed, Dec 02, 2009 at 02:52:20PM -0500, Jason A. Smith wrote:
> I tried adding the following code to my RT_SiteConfig.pm to see if I can
> make the NotifyActor config option a user preference:

Coincidentally, you may be interested in
59b5f56d348983efb5c6ec40fc1e2148d7fd004d

The issue you are running into is that you need to pass the current
user context to RT->Config->Get, otherwise it just uses the system
setting.

-kevin

> package RT::Config;
> { $META{'NotifyActor'} = {
>         Section         => 'Mail',                                     #loc
>         Overridable     => 1,
>         Widget          => '/Widgets/Form/Boolean',
>         WidgetArguments => {
>             Description => 'Receive own posts', # loc
>             Hints       => "Toggles whether you want to receive copies of your own messages" #loc
>         }
>     };
> }
> 
> This did successfully add the option to the "Mail" preference box, but
> it does not seem to have an effect when RT sends email.  Is there
> something wrong with this?
> 
> Also, while trying to figure out what was wrong, I think I found a small
> bug, but fixing it did not seem to help.  See attached patch.
> 
> ~Jason
> 
> 
> -- 
> /------------------------------------------------------------------\
> |  Jason A. Smith                          Email:  smithj4 at bnl.gov |
> |  Atlas Computing Facility, Bldg. 510M    Phone: +1-631-344-4226  |
> |  Brookhaven National Lab, P.O. Box 5000  Fax:   +1-631-344-7616  |
> |  Upton, NY 11973-5000,  U.S.A.                                   |
> \------------------------------------------------------------------/
> 

> diff -u /usr/lib/perl5/vendor_perl/5.8.8/RT/Action/NotifyGroup.pm /usr/local/lib/rt3/lib/RT/Action/NotifyGroup.pm
> --- /usr/lib/perl5/vendor_perl/5.8.8/RT/Action/NotifyGroup.pm	2009-10-23 11:10:18.000000000 -0400
> +++ /usr/local/lib/rt3/lib/RT/Action/NotifyGroup.pm	2009-12-02 14:02:03.000000000 -0500
> @@ -85,7 +85,7 @@
>      }
>  
>      my $creator = $self->TransactionObj->CreatorObj->EmailAddress();
> -    unless( $RT::NotifyActor ) {
> +    unless( RT->Config->Get('NotifyActor') ) {
>          @{ $self->{'To'} } = grep ( !/^\Q$creator\E$/, @{ $self->{'To'} } );
>      }
>  




> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20091203/1bfe3f56/attachment.pgp 


More information about the Rt-devel mailing list