[rt-users] Example of HasMember? and NewWindow stuff

Seth Cohn, EFN General Manager gm at efn.org
Thu Jan 16 19:34:37 EST 2003


In request to a user wanting opening new windows (or new tabs, thanks to
Multizilla on Mozilla), I implemented a simple tweak to TicketCell.

I found the existing NewWindowOption stuff useless and poorly documented
(I finally found the pref setting in Admin/Users/Prefs, but no links to
that, unless I manually went to that page), and it didn't seem to work on
a per user basis (see below) removing:

 if ($session{NewWindowOption}) {
		$link .= "TARGET=\"TicketDisplay".$session{AlwaysNewWindowOption} &&
(time() . rand(1024))."\" ";
				}
Which didn't work anyway... and caused problems.

I put:

if ($session{NewWindowOption}) {
                $link .= "\" TARGET=\"_blank\"";
        }

Which did work fine.

Initially, I had it without the NewWindowOption condition, so that it
worked for everyone, but i got complaints that some people disliked the
opening in a new window behavior.  What some wanted (and if someone can
code either of these, please do) was "Ok, but close the window when we
resolve the ticket" or "Don't open new windows, but do return to Home when
we resolve a ticket."  I tried use the NewWindowOption stuff, but it
doesn't seem to work beyond a session... or else I just didn't understand
how it works.

What I want:

Pseudocode:

if (Current User is a member of NewWindow group) {
                $link .= "\" TARGET=\"_blank\"";
        }

And I see RT:Group has a HasMember function but no idea how to form
such a code fragment to do that.  Googling in the archive didn't find it
either, nor did reading the code.

Help?


-- 
## Seth Cohn, General Manager of Eugene Free Community Network gm at efn.org
## Businesses planned for service are apt to succeed;  Phone 541-484-9637
## Businesses planned for profit are apt to fail. - N. Butler





More information about the rt-users mailing list