[Rt-devel] Re: [rt-users] Search criteria UpdatedBy a little help please

Ruslan Zakirov ruslan.zakirov at gmail.com
Wed Sep 27 15:59:17 EDT 2006


You need something like:
     $self->_OpenParen;
     $self->SUPER::Limit(
         ALIAS           => $self->{_sql_transalias},
         FIELD           => 'Type',
         VALUE         => 'Comment',
         ENTRYAGGREGATOR => 'AND'
     );
     $self->SUPER::Limit(
         ALIAS           => $self->{_sql_transalias},
         FIELD           => 'Type',
         VALUE         => 'Correspond',
         ENTRYAGGREGATOR => 'OR'
     );
     $self->_CloseParen;



On 9/12/06, Roy El-Hames <rfh at pipex.net> wrote:
> Hi there;
> (rt-3.6.1 , mysql, apache2 mod_perl)
> I have a search criteria where it looks for any tickets updated by a
> particular user, I got it working for all kind of transactions and I
> wonder if anyone can help me put the final tweak to get it to return
> ticket where the User just Commented/Corresponded ..I have the following
> function in Tickets_Overlay.pm:
>
> sub _TransUser {
>     my ($self, $field, $op, $value, @rest ) = @_;
>     $RT::Logger->error("the field = $field and op is $op and value is
> $value and rest is @rest");
>     $self->{_sql_transalias} = $self->NewAlias('Transactions')
>     unless defined $self->{_sql_transalias};
>     $self->{_sql_Usersalias} = $self->NewAlias('Users')
>         unless defined $self->{_sql_Usersalias};
>     $self->_OpenParen;
>     #Search for the right field
>     $self->_SQLLimit(
>         ALIAS         => $self->{_sql_Usersalias},
>         FIELD         => 'Name',  ### for the Updated by in particular
> may change later
>         OPERATOR      => $op,
>         VALUE         => $value,
>         CASESENSITIVE => 0,
>         @rest
>     );
>     $self->_SQLJoin(
>         ALIAS1 => $self->{_sql_Usersalias},
>         FIELD1 => 'Id',
>         ALIAS2 => $self->{_sql_transalias},
>         FIELD2 => 'Creator'
>     );
>     $self->_SQLJoin(
>         ALIAS1 => 'main',
>         FIELD1 => 'Id',
>         ALIAS2 => $self->{_sql_transalias},
>         FIELD2 => 'ObjectId'
>     );
>     $self->SUPER::Limit(
>         ALIAS           => $self->{_sql_transalias},
>         FIELD           => 'ObjectType',
>         VALUE           => 'RT::Ticket',
>         ENTRYAGGREGATOR => 'AND'
>     );
>     $self->_CloseParen;
> }
>
>
> Any help will be appreciated,
> Regards;
> Roy
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>


-- 
Best regards, Ruslan.


More information about the Rt-devel mailing list