[Rt-devel] a fancy ShowUser - not quite possible

Olly Stephens Olly.Stephens at arm.com
Tue Jul 1 09:54:12 EDT 2008


Hi,

I've implemented a local fancier version of "Elements/ShowUserVerbose" -
one that shows the username but then has a tooltip attached to it that
shows more info about the user when you hover over it.

This worked fine initially but then I noticed a problem - the "ShowUser"
element is used in multiple contexts.  For example, it's also used in
Elements/SelectUsers to generate the options in a multiple select.  In
this situation I just want a simple name and my override mucks things
up.


I can think of two solutions to this so I thought I'd canvas people as
to which would be the more likely to be adopted upstream if I provided a
patch:

A) Introduce a "ShowUserFancy" element which is used in cases where
there is opportunity to enhance the HTML produced but who's default
action is just to drop through to ShowUser  (ie gives me a more specific
hook to override)

B) Add a "Context" parameter to the ShowUser calls so that I can tell if
it's in the plain page or in a form element etc.  (ie gives me the
necessary info in my override to make a formatting decision)

C) Abandon my attempt to do fancy things :-)


Which would people prefer? 


Any whilst I'm on the subject, I noticed a few places where a username
was rendered directly rather than through ShowUser; the most obvious of
these is in the title part of each transaction of a ticket;  is there
any reason why this shouldn't go through the component too?  It's one of
the places I'd like to hook my fancy popup into.


Thanks,

Olly

-- 
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.




More information about the Rt-devel mailing list