[rt-users] CONTRIB: Quickpicks Element for WebRT

Jim Meyer purp at wildbrain.com
Mon Jan 28 21:00:31 EST 2002


Howdy!

Using Bruce Campbell's JumpBar as a starter (thanks, Bruce!) I've put
together an Element for the WebRT interface called "Quickpicks". It's an
element in a titlebox (much like the Quicksearch element) which does
essentially what Bruce described -- pop open a new browser window in
response to a menu selection -- with a couple of twists:

* Does a simple indexOf to see if the URL is within RT; if so, changes
this window's location instead of popping a new one.

* Resets the menu to the top choice after a choice is made.

* If you're a privileged user, you'll get three predefined searches: 
"Unresolved Tickets I Own", "Unresolved & Unowned Tickets", and "All
Unresolved Tickets"

* There's a broken search for "Unresolved Tickets I Requested" in there
that I'm working on; it doesn't work yet because I don't understand
something or another. =\

To add this to our RT Start Page, I did:

* Put the file in RTHOME/WebRT/html/Elements
* chmod a+x Quickpicks
* Add these two lines to RTHOME/WebRT/html/index.html

  <& /Elements/Quickpicks &>
  <BR>

... above or below these two lines:

  <& /Elements/Quicksearch &>
  <BR>

You may also want to add it to your Search/Listing.html and other places
as well.

Enjoy!

--j
-- 
Jim Meyer, Geek At Large                              purp at wildbrain.com
-------------- next part --------------
<!-- $Id: JumpBar,v 1.8 2002/01/28 11:33:42 rt2 Exp $ -->
<!-- With great thanks to Bruce Campbell of RIPE      -->
<!-- Blame the bugs on Jim Meyer (purp at wildbrain.com) -->

<& /Elements/TitleBoxStart, title => "QuickPicks" &>

<form name="qpjavaredir" style="margin-left: 2px; margin-top: 2px; margin-bottom: 2px;">
<select class="qpnullclass" name="site" size="1" onchange="if (this.options[selectedIndex].value != '') { if (this.options[selectedIndex].value.indexOf('http://YOUR_SITE_SHORT_NAME') == 0) {location.href = this.options[selectedIndex].value} else {window.open(this.options[selectedIndex].value)} ; this.selectedIndex = 0 }" style="width: 110px;">
<option value="">Choose one ...</option>
<option value="">---------</option>
% if ($session{'CurrentUser'}->Privileged()) {
<option value="http://YOUR_SITE_SHORT_NAME/Search/Listing.html?Bookmark=FrT%3B%402%7C%254%7C%242%7C22%242%7C23%258%7C%2411%7CDESCRIPTION%245%7CFIELD%248%7COPERATOR%245%7CVALUE%2412%7COwner%20%3D%20<%$session{'CurrentUser'}->Name%>%245%7COwner%241%7C%3D%241%7C<%$session{'CurrentUser'}->Id%>%258%7C%2411%7CDESCRIPTION%245%7CFIELD%248%7COPERATOR%245%7CVALUE%2418%7CStatus%20%21%3D%20resolved%246%7CStatus%242%7C%21%3D%248%7Cresolved%242%7C24&TicketsSortBy=Queue&TicketsSortOrder=ASC&RowsPerPage=50">  Unresolved Tickets I Own</option>
<option value="http://YOUR_SITE_SHORT_NAME/Search/Listing.html?Bookmark=FrT%3B%402%7C%254%7C%242%7C19%242%7C21%258%7C%2411%7CDESCRIPTION%245%7CFIELD%248%7COPERATOR%245%7CVALUE%2414%7COwner%20%3D%20Nobody%245%7COwner%241%7C%3D%241%7C2%258%7C%2411%7CDESCRIPTION%245%7CFIELD%248%7COPERATOR%245%7CVALUE%2418%7CStatus%20%21%3D%20resolved%246%7CStatus%242%7C%21%3D%248%7Cresolved%242%7C22&TicketsSortBy=id&TicketsSortOrder=ASC&RowsPerPage=50">  Unresolved & Unowned Tickets</option>
<option value="http://YOUR_SITE_SHORT_NAME/Search/Listing.html?Bookmark=FrT%3B%402%7C%254%7C%241%7C2%241%7C3%258%7C%2411%7CDESCRIPTION%245%7CFIELD%248%7COPERATOR%245%7CVALUE%2418%7CStatus%20%21%3D%20resolved%246%7CStatus%242%7C%21%3D%248%7Cresolved%258%7C%2411%7CDESCRIPTION%245%7CFIELD%248%7COPERATOR%245%7CVALUE%2414%7CStatus%20%21%3D%20dead%246%7CStatus%242%7C%21%3D%244%7Cdead%241%7C5&TicketsSortBy=id&TicketsSortOrder=ASC&RowsPerPage=50">  All Unresolved Tickets</option>
% }
<!-- I know I'm doing something wrong here, but I can't figure out what. -->
<!-- <option value="http://YOUR_SITE_SHORT_NAME/Search/Listing.html?Bookmark=FrT%3B%402%7C%256%7C%241%7C6%241%7C7%241%7C8%258%7C%2411%7CDESCRIPTION%245%7CFIELD%248%7COPERATOR%245%7CVALUE%2418%7CStatus%20%21%3D%20resolved%246%7CStatus%242%7C%21%3D%248%7Cresolved%258%7C%2411%7CDESCRIPTION%245%7CFIELD%248%7COPERATOR%245%7CVALUE%2414%7CStatus%20%21%3D%20dead%246%7CStatus%242%7C%21%3D%244%7Cdead%2510%7C%2411%7CDESCRIPTION%245%7CFIELD%248%7COPERATOR%244%7CTYPE%245%7CVALUE%2430%7CRequestor%20%3D%20<%$session{'CurrentUser'}->EmailAddress%>%24<%$session{'CurrentUser'}->Id%>%7CWatcher%241%7C%3D%249%7CRequestor%2418%7C<%$session{'CurrentUser'}->EmailAddress%>%241%7C9&TicketsSortBy=id&TicketsSortOrder=ASC&RowsPerPage=50">  Unresolved Tickets I Requested</option> -->
<option value="">---------</option>
<option value="http://YOUR.INTRANET.SITE/">  Intranet</option>
<option value="http://YOUR.SUPPORT.SITE/">  Support</option>
<option value="">---------</option>
<option value="http://www.bestpractical.com/rt/">  RT Home Page</option>
<option value="http://fsck.com/rt2/NoAuth/Buglist.html">  RT Bug List</option>
<option value="http://lists.fsck.com/search.html">  Search the RT Mailing Lists</option>
<option value="http://www.bestpractical.com/pricelist.html">  RT Support Plans</option>
<option value="">---------</option>
<option value="http://www.google.com/">  Search Google</option>
<option value="https://bugzilla.redhat.com/bugzilla/query.cgi">  Search Redhat's Bugzilla</option>
<option value="http://bugzilla.ximian.com/query.cgi">  Search Ximian's Bugzilla</option>
<option value="http://www.rpmfind.net/">  Search RPMFind</option>
</select>
</form>

<& /Elements/TitleBoxEnd &>



More information about the rt-users mailing list