show/hide this revision's text 2 Updated

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

function linkifyProjectArea() {
    

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);
    }
}
show/hide this revision's text 1

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

function linkifyProjectArea() {
    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);
    }
}