[rt-users] Quick Search in 3.8.1 doesn't include Resolved Status

Jesse Vincent jesse at bestpractical.com
Tue Sep 9 15:32:01 EDT 2008




On Fri, Sep 05, 2008 at 10:49:35AM +0200, Espen Wiborg wrote:
> Jesse Vincent <jesse at bestpractical.com> writes:
> > On Sep 4, 2008, at 8:42 PM, gordon at cryologic.com wrote:
> >> We are the same, much prefer searching for all unresolved and
> >> resolved tickets in the quick search. The change has caused quite a
> >> bit of abuse at the sysadmin (me).
> > As I sad before, I'd love to take a patch :)
> 
> Something like this, perhaps?

Given the sorts of customizability people want, it might make sense to
let the admin specify "SimpleSearchStatuses" (so that someone could,
say, force it to "only resolved").

You're actually only a couple lines away from making this a user
preference.

If you look at lib/RT/Config.pm, you can see the data structire you need
to fill in.

To get your RT->Config->Get invocation to notice user preferences, you
just need to pass in the currentuser object as an extra argument.

Best,
Jesse

> Index: lib/RT/Search/Googleish.pm
> ===================================================================
> --- lib/RT/Search/Googleish.pm	(revision 15777)
> +++ lib/RT/Search/Googleish.pm	(working copy)
> @@ -162,7 +162,7 @@
>      push @tql_clauses, join( " OR ", sort @id_clauses );
>      push @tql_clauses, join( " OR ", sort @owner_clauses );
>      if ( ! @status_clauses ) {
> -        push @tql_clauses, join( " OR ", map "Status = '$_'", RT::Queue->ActiveStatusArray());
> +        push @tql_clauses, join( " OR ", map "Status = '$_'", RT::Queue->ActiveStatusArray(), RT->Config->Get('ExtraStatesInSimpleSearch'));
>      } else {
>          push @tql_clauses, join( " OR ", sort @status_clauses );
>      }
> Index: etc/RT_Config.pm.in
> ===================================================================
> --- etc/RT_Config.pm.in	(revision 15777)
> +++ etc/RT_Config.pm.in	(working copy)
> @@ -1117,6 +1117,15 @@
>  
>  Set($DontSearchFileAttachments, undef);
>  
> +=item C<$ExtraStatesInSimpleSearch>
> +
> +Tickets in these states are included in the results of a simple
> +search, along with any active tickets.
> +
> +=cut
> +
> +Set(@ExtraStatesInSimpleSearch, qw());
> +
>  =item C<$ChartFont>
>  
>  The L<GD> module (which RT uses for graphs) uses a builtin font that doesn't

> 
> -- 
> Espen Wiborg <espen.wiborg at telio.no> - Veritas vos liberabit
> Coincidences are spiritual puns.
> 		-- G.K. Chesterton


-- 



More information about the rt-users mailing list