9

2

Under the case title, I see this text:

Project: Area | Milestone: Undecided

I'd like to make as much of that text clickable as possible to speed navigation. I want to click "Project" and be taken to a list of open cases for that project.

Can I do this?

flag

4 Answers

9

First, get the BugMonkey plugin, and put this code in for all users. (It won't do anything unless you're on a bug view page, so it's safe to put on all pages.)

String.prototype.htmlEntities = function () {
   // returns text that renders as readable HTML code for the browser
   return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
};


if(window.goBug) {
  var sProjectArea = $("div.idTitleProjectAndArea .subtitle").html();
  sProjectArea = sProjectArea.replace(goBug.sProject.htmlEntities(),"<a href='default.asp?pre=preSaveFilter&fOpenBugs=ON&ixProject="+goBug.ixProject+"&sort1=4&sort2=0&sort3=0&fGridView=1'>"+goBug.sProject.htmlEntities()+"</a>");
  sProjectArea = sProjectArea.replace(": " + goBug.sArea.htmlEntities(),": <a href='default.asp?pre=preSaveFilter&fOpenBugs=ON&ixProject="+goBug.ixProject+"&ixArea="+goBug.ixArea+"&sort1=8&sort2=0&sort3=0&fGridView=1'>"+goBug.sArea.htmlEntities()+"</a>");
  $("div.idTitleProjectAndArea .subtitle").html(sProjectArea);
}
link|flag
3

(should be a comment): maybe this script should be added to this wiki: http://fogbugz.stackexchange.com/questions/59/bugmonkey-scripts-post-them-here

Or to whatever is considered to be the repo for BugMonkey scripts...

link|flag
Thanks for pointing that out. I've posted a link to this post on that question, and voted you up. – Rich Armstrong Nov 25 2009 at 14:44
2

Here's an updated version that does the milestone as well:

name:        Linkify project, area, and Milestone
description: Turns the Project, Area, and Milestone on the case detail page into links to filters on those bits of information
author:      cdeszaq
version:     1.0.0.0
minApi:      1.0

js: 
    String.prototype.htmlEntities = function () {
       // returns text that renders as readable HTML code for the browser
       return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
    };


    if(window.goBug) { 
      var sProjectArea = $("div.idTitleProjectAndArea .subtitle").html();
      sProjectArea = sProjectArea.replace(goBug.sProject.htmlEntities(),"<a href='default.asp?pre=preSaveFilter&fOpenBugs=ON&ixProject="+goBug.ixProject+"&sort1=4&sort2=0&sort3=0&fGridView=1'>"+goBug.sProject.htmlEntities()+"</a>");
      sProjectArea = sProjectArea.replace(": " + goBug.sArea.htmlEntities(),": <a href='default.asp?pre=preSaveFilter&fOpenBugs=ON&ixProject="+goBug.ixProject+"&ixArea="+goBug.ixArea+"&sort1=8&sort2=0&sort3=0&fGridView=1'>"+goBug.sArea.htmlEntities()+"</a>");
      sProjectArea = sProjectArea.replace("| Milestone","| <a href='default.asp?pre=preSaveFilter&fOpenBugs=ON&ixProject="+goBug.ixProject+"&sort1=111&sort2=0&sort3=0&fGridView=1'>Milestone</a>");
      sProjectArea = sProjectArea.replace(": " + goBug.sFixFor.htmlEntities(),": <a href='default.asp?pre=preSaveFilter&fOpenBugs=ON&ixProject="+goBug.ixProject+"&ixFixFor="+goBug.ixFixFor+"&sort1=3&sort2=0&sort3=0&fGridView=1'>"+goBug.sFixFor.htmlEntities()+"</a>");

      $("div.idTitleProjectAndArea .subtitle").html(sProjectArea);
    }
link|flag
1

Version 8.3 just has this by default!

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.