Keywords in queue listings again

References:
http://lists.fsck.com/pipermail/rt-devel/2002-May/002225.html
http://lists.fsck.com/pipermail/rt-devel/2002-May/002227.html
http://lists.fsck.com/pipermail/rt-devel/2002-May/002228.html

Ok, so combing through the archives (and some help from others on
the list), I found the following method to display my keywords in
my queue listings:

In etc/config.pm, WebOptions, I added:

    { Header => 'State',
     TicketAttribute => 'KeywordsObj(1)->RelativePaths()->[0];'
     },

In Keyword.pm (line 279) Changed:

from: my $OtherPath = $OtherKey->Path();
to: my $OtherPath = $OtherKey;

Problems:

  1. If I do not change Keyword.pm, it breaks the queue listing and
    rt2 comes back with “cannot display page.” Completely breaks
    the listing.

  2. If I do the Keyword.pm change – the listing of keywords INSIDE
    the ticket show up as:
    “State o State/Whatever” (instead of “State o Whatever”)

Is anyone doing this successfully, so keywords appear correctly
in both the queue listing and the keyword section inside the
ticket? If so, how?

thanks
bill

Try this, in that same subroutine in Keyword.pm

sub RelativePath {
my $self = shift;
my $OtherKey = shift;

my $OtherPath = ref($OtherKey) ? $OtherKey->Path() : $OtherKey;

my $OtherPath = $OtherKey;

my $MyPath = $self->Path;
$MyPath =~ s/^$OtherPath\///g;
return ($MyPath);

}

-----Original Message-----
From: billp [mailto:billp@wjp.net]
Sent: Wednesday, August 21, 2002 5:30 PM
To: rt-users@lists.fsck.com
Subject: [rt-users] Keywords in queue listings again

References:
http://lists.fsck.com/pipermail/rt-devel/2002-May/002225.html
http://lists.fsck.com/pipermail/rt-devel/2002-May/002227.html
http://lists.fsck.com/pipermail/rt-devel/2002-May/002228.html

Ok, so combing through the archives (and some help from others on
the list), I found the following method to display my keywords in
my queue listings:

In etc/config.pm, WebOptions, I added:

    { Header => 'State',
     TicketAttribute => 'KeywordsObj(1)->RelativePaths()->[0];'
     },

In Keyword.pm (line 279) Changed:

from: my $OtherPath = $OtherKey->Path();
to: my $OtherPath = $OtherKey;

Problems:

  1. If I do not change Keyword.pm, it breaks the queue listing and
    rt2 comes back with “cannot display page.” Completely breaks
    the listing.

  2. If I do the Keyword.pm change – the listing of keywords INSIDE
    the ticket show up as:
    “State o State/Whatever” (instead of “State o Whatever”)

Is anyone doing this successfully, so keywords appear correctly
in both the queue listing and the keyword section inside the
ticket? If so, how?

thanks
bill


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at
http://fsck.com/rtfm

Yup, that was the additional mod I was looking for. Looks great.

Only caveat: If your keyword can have multiple selections, it will
only display one of them in the queue listing. Fortunately, all
KeywordSelects I want to display are single select only.

thanks!!
billOn Wed, Aug 21, 2002 at 05:30:29PM -0700, Colleen wrote:

Try this, in that same subroutine in Keyword.pm

sub RelativePath {
my $self = shift;
my $OtherKey = shift;

my $OtherPath = ref($OtherKey) ? $OtherKey->Path() : $OtherKey;

my $OtherPath = $OtherKey;

my $MyPath = $self->Path;
$MyPath =~ s/^$OtherPath\///g;
return ($MyPath);

}

Yup, that was the additional mod I was looking for. Looks great.

Only caveat: If your keyword can have multiple selections, it will
only display one of them in the queue listing. Fortunately, all
KeywordSelects I want to display are single select only.

Second caveat: It works for any number of KeywordSelects, however,
it only is useful for GLOBAL Keywords. Meaning if you have the
same KeywordSelect name in multiple queues, you can only specify
a single one of them in the queue listing. (So if you have a
“customer” keyword in two different queues, you can really only
specify one of them in the queue listing – that column for the
tickets that are in the 2nd queue will still show as blank.)

bill

In the second link below (ending in 2227) is written:
In WebRT/html/Ticket/Elements/ShowKeywordSelects
There’s:

% my $Keywords =3D $Ticket->KeywordsObj($KeywordSelect->Id);
% while (my $Keyword =3D $Keywords->Next) {


  • <% $Keyword->KeywordObj->RelativePath($KeywordSelect->KeywordObj) |n
    %>
  • % }

    and the output of this will show the entire path.

    In my case, ShowKeywordSelects displays:
    “Action City: City/Atlanta” instead of just “Action City: Atlanta”

    I changed the
    $Keyword->KeywordObj->RelativePath($KeywordSelect->KeywordObj) to
    $Keyword-KeywordObj->Name, and that fixed the problem. This is in the
    display code, rather than the back-end, so it won’t break anything
    else…

    O- ~ARK