[rt-users] Feature Request: List of Saved Searches on RT at a Glance

Torsten Brumm torsten.brumm at googlemail.com
Wed Dec 20 06:59:54 EST 2006


Hi,

I'm not sure who has wrote this, but i found it several months ago at the
list:

--

<& /Elements/TitleBoxStart, title => loc('My Saved Searches') &>
<table border="0" cellspacing="0" cellpadding="1" width="100%">

% my $i=0;
% foreach my $srch (@user_attrs) {
% $m->out( '<TR class="' . ( $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
<td>
% if ($srch->Id == $user_attrs[0]->Id) {
My saved searches:
% } else {
 
% }
</td>
<td>

% $format = $srch->SubValue('Format');
% $format =~ s/%23/#/g;
% $format =~ s/%26/&/g;

<A HREF="Search/Results.html<% "?".$m->comp('/Elements/QueryString',
                                Query => $srch->SubValue('Query'),
                                Format => $format,
                                Rows => 50,
                                Page => 1) %>"><% $srch->Description
%></A><br>
</td>
</tr>
% $i++
% }
% for my $grp (@grouparr) {
%    my @gattrs = $grp->Attributes->Named('SavedSearch');
%    foreach my $srch (@gattrs) {
% $m->out( '<TR class="' . ( $i % 2 ? 'oddline' : 'evenline' ) . '" >' );
<td>
% if ($srch->Id == $gattrs[0]->Id) {
Group <% $grp->Name %> saved searches:
% } else {
 
% }
</td>
<td>
% $format = $srch->SubValue('Format');
% $format =~ s/%23/#/g;
% $format =~ s/%26/&/g;
<A HREF="Search/Results.html<% "?".$m->comp('/Elements/QueryString',
                                Query => $srch->SubValue('Query'),
                                Format => $format,
                                Rows => 50,
                                Page => 1) %>"><% $srch->Description
%></A><br>
</td>
</tr>
% $i++
%    }
% }

</table>
<& /Elements/TitleBoxEnd &>
<%init>

my $format;

my @user_attrs =
$session{'CurrentUser'}->UserObj->Attributes->Named('SavedSearch');

# Get any group saved searches: (Steve Turner 7/23/04)
my @attrs;
my $groups = RT::Groups->new($session{'CurrentUser'});
$groups->LimitToUserDefinedGroups;
$groups->WithMember(PrincipalId => $session{'CurrentUser'}->Id,
                    Recursively => 1);
my $ref = $groups->ItemsArrayRef();
my @grouparr = @$ref;

</%init>
<%ARGS>
$user_attrs => undef
</%ARGS>

--

Put it into local/html/Elements my one is called SavedSearchList and add
this ooption to RT_SiteConfig.pm as Option for MyRT

Torsten


2006/12/19, Jay Lee <jlee at pbu.edu>:
>
> My boss likes to be able to quickly view any of his employees open
> tickets at any given time.  To do this now from the At a Glance page, he
> adds them to his RT at a glance: body list.  This generates a very long
> page for him and also hammers the server everytime he refreshes.
>
> What I'd like to be able to do is add links to the Query itself to his
> At a Glance page without actually running the query every time he
> refreshes.  Any way to do this?  Something similar to Quick Search but
> using Saved Searches instead of a list of queues.
>
> Jay
> _______________________________________________
> 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
>



-- 
MFG

Torsten Brumm

http://www.torsten-brumm.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20061220/2ba55d85/attachment.htm>


More information about the rt-users mailing list