Displaying keywords on queue list --RT

Matt:

I read your post on rt-devel about displaying keywords on the queue
list, /Search/Listing.html, did you ever figure out a solution?

Thanks in advance,

Colleen

All,

Has anyone ever put a ShowKeywordSelects element or some such thing
to

show a keyword selection in a queue listing (similar to
Listing.html)?

I was hacking around the object model to try to find a way to do this, and
what I came up with was to put something like:

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

in config.pm.

The Header should be the name of the KeywordSelect retrieved by
Ticket->KeywordsObj(1) (i.e., SELECT * FROM KeywordSelects WHERE id=1’), or
whatever KeywordSelects.id you want.

This will output the relative path of the first keyword returned by the
numbered KeywordSelect associated with that ticket.

At least, that’s how it should work according to my reading of the object
docs. But, if you do this, Keyword::RelativePath() barfs because it tries
to call the ‘Path’ method on its shifted input which in this case seems to
be a bare string that is actually already the path we want. So, if you
comment out the ->Path call:

my $OtherPath = $OtherKey; # ->Path();

Line ~279

It will work in this instance. I don’t have RT in production so I can say
that this doesn’t break something else (seems like it should!). Any
developer care to comment on what is going on here? I haven’t had time to
trace the issue further.

Even this is really only useful if you have single keywords per ticket, and
they are assigned to all your queues. Making a truly useful keyword search
display would seem to be a good bit of work. It would be nice if the query
were LEFT JOINed in such a way to make them sortable as well…

–AdamFrom: “Colleen” colleen@darksideproductions.net
To: rgoonan@sunitafe.edu.au; rt-devel@lists.fsck.com
Sent: Tuesday, April 30, 2002 12:04 AM
Subject: [rt-devel] displaying keywords on queue list --RT

Matt:

I read your post on rt-devel about displaying keywords on the queue
list, /Search/Listing.html, did you ever figure out a solution?

Thanks in advance,

Colleen

All,

Has anyone ever put a ShowKeywordSelects element or some such thing
to

show a keyword selection in a queue listing (similar to
Listing.html)?

Thanks,
Matt

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

So, if you comment out the ->Path call:
what file are you in here?

It’s Keyword.pm. Change:

my $OtherPath = $OtherKey->Path();

  • to -

my $OtherPath = $OtherKey;

Just to retiterate, this might break a bunch of other stuff.

Here’s one thing that happens as a result of your modifications (which I
have implemented):

If you display that Keyword and it’s results on any of the Display
pages, etc, it shows the entire path.

In WebRT/html/Ticket/Elements/ShowKeywordSelects
There’s:

% my $Keywords = $Ticket->KeywordsObj($KeywordSelect->Id);
% while (my $Keyword = $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”

    Is there a workaround to fix this?

    Thanks!

    Colleen

    -----Original Message-----
    From: Adam Morton [mailto:lists@adammorton.com]
    Sent: Tuesday, April 30, 2002 10:40 AM
    To: rt-devel@lists.fsck.com
    Subject: Re: [rt-devel] displaying keywords on queue list --RT

    I was hacking around the object model to try to find a way to do this,
    and
    what I came up with was to put something like:

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

    in config.pm.

    The Header should be the name of the KeywordSelect retrieved by
    Ticket->KeywordsObj(1) (i.e., SELECT * FROM KeywordSelects WHERE
    id=1’),
    or
    whatever KeywordSelects.id you want.

    This will output the relative path of the first keyword returned by
    the
    numbered KeywordSelect associated with that ticket.

    At least, that’s how it should work according to my reading of the
    object
    docs. But, if you do this, Keyword::RelativePath() barfs because it
    tries
    to call the ‘Path’ method on its shifted input which in this case
    seems to
    be a bare string that is actually already the path we want. So, if
    you
    comment out the ->Path call:

    my $OtherPath = $OtherKey; # ->Path();

    Line ~279

    It will work in this instance. I don’t have RT in production so I can
    say
    that this doesn’t break something else (seems like it should!). Any
    developer care to comment on what is going on here? I haven’t had
    time to
    trace the issue further.

    Even this is really only useful if you have single keywords per
    ticket,

    Kludge:

    my $OtherPath = ref($OtherKey) ? $OtherKey->Path() : $OtherKey;From: “Colleen” colleen@darksideproductions.net
    To: “Adam Morton” lists@adammorton.com; rt-devel@lists.fsck.com
    Sent: Wednesday, May 01, 2002 11:10 PM
    Subject: RE: [rt-devel] displaying keywords on queue list --RT

    Here’s one thing that happens as a result of your modifications (which I
    have implemented):

    If you display that Keyword and it’s results on any of the Display
    pages, etc, it shows the entire path.

    In WebRT/html/Ticket/Elements/ShowKeywordSelects
    There’s:

    % my $Keywords = $Ticket->KeywordsObj($KeywordSelect->Id);
    % while (my $Keyword = $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”

    Is there a workaround to fix this?

    Thanks!

    Colleen

    -----Original Message-----
    From: Adam Morton [mailto:lists@adammorton.com]
    Sent: Tuesday, April 30, 2002 10:40 AM
    To: rt-devel@lists.fsck.com
    Subject: Re: [rt-devel] displaying keywords on queue list --RT

    I was hacking around the object model to try to find a way to do this,
    and
    what I came up with was to put something like:

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

    in config.pm.

    The Header should be the name of the KeywordSelect retrieved by
    Ticket->KeywordsObj(1) (i.e., SELECT * FROM KeywordSelects WHERE
    id=1’),
    or
    whatever KeywordSelects.id you want.

    This will output the relative path of the first keyword returned by
    the
    numbered KeywordSelect associated with that ticket.

    At least, that’s how it should work according to my reading of the
    object
    docs. But, if you do this, Keyword::RelativePath() barfs because it
    tries
    to call the ‘Path’ method on its shifted input which in this case
    seems to
    be a bare string that is actually already the path we want. So, if
    you
    comment out the ->Path call:

    my $OtherPath = $OtherKey; # ->Path();

    Line ~279

    It will work in this instance. I don’t have RT in production so I can
    say
    that this doesn’t break something else (seems like it should!). Any
    developer care to comment on what is going on here? I haven’t had
    time to
    trace the issue further.

    Even this is really only useful if you have single keywords per
    ticket,
    and
    they are assigned to all your queues. Making a truly useful keyword
    search
    display would seem to be a good bit of work. It would be nice if the
    query
    were LEFT JOINed in such a way to make them sortable as well…

    –Adam

    ----- Original Message -----
    From: “Colleen” colleen@darksideproductions.net
    To: rgoonan@sunitafe.edu.au; rt-devel@lists.fsck.com
    Sent: Tuesday, April 30, 2002 12:04 AM
    Subject: [rt-devel] displaying keywords on queue list --RT

    Matt:

    I read your post on rt-devel about displaying keywords on the queue
    list, /Search/Listing.html, did you ever figure out a solution?

    Thanks in advance,

    Colleen

    All,

    Has anyone ever put a ShowKeywordSelects element or some such thing
    to

    show a keyword selection in a queue listing (similar to
    Listing.html)?

    Thanks,
    Matt


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


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

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