RSS

trunk : 1225

jake%acutex.net
2001-12-13 00:41:04
Revision ID: cvs-1:jakeacutex.net-20011213064104-hjwx5licn1mi96f3
Bug 37339 and Bug 80183 - Adding a sidebar.cgi and index.cgi.  The sidebar.cgi can currently be used in Mozilla/Netscape 6 and uses XUL that was originally written by Scott Collins <scc@mozilla.org>.  The index.cgi displays both the proper header and footer in the appropriate places.  It also changes the links accoding to if you are logged in or not. r= ddk, kiko

collapse all collapse all

added added

removed removed

2
graphs
2
graphs
3
data
3
data
4
localconfig
4
localconfig
5
shadow
5
index.html
282
# Set up the defaults for the --LOCAL-- variables below:
282
# Set up the defaults for the --LOCAL-- variables below:
283
#
283
#
284
 
284
 
 
 
285
LocalVar('index_html', <<'END');
 
 
286
#
 
 
287
# With the introduction of a configurable index page using the
 
 
288
# template toolkit, Bugzilla's main index page is now index.cgi.
 
 
289
# Most web servers will allow you to use index.cgi as a directory
 
 
290
# index and many come preconfigured that way, however if yours
 
 
291
# doesn't you'll need an index.html file that provides redirection
 
 
292
# to index.cgi. Setting $index_html to 1 below will allow
 
 
293
# checksetup.pl to create one for you if it doesn't exist.
 
 
294
# NOTE: checksetup.pl will not replace an existing file, so if you
 
 
295
#       wish to have checksetup.pl create one for you, you must
 
 
296
#       make sure that there isn't already an index.html
 
 
297
$index_html = 0;
 
 
298
END
 
 
299
 
285
my $mysql_binaries = `which mysql`;
300
my $mysql_binaries = `which mysql`;
286
if ($mysql_binaries =~ /no mysql/) {
301
if ($mysql_binaries =~ /no mysql/) {
287
    # If which didn't find it, just provide a reasonable default
302
    # If which didn't find it, just provide a reasonable default
473
my $my_db_name = ${*{$main::{'db_name'}}{SCALAR}};
488
my $my_db_name = ${*{$main::{'db_name'}}{SCALAR}};
474
my $my_db_user = ${*{$main::{'db_user'}}{SCALAR}};
489
my $my_db_user = ${*{$main::{'db_user'}}{SCALAR}};
475
my $my_db_pass = ${*{$main::{'db_pass'}}{SCALAR}};
490
my $my_db_pass = ${*{$main::{'db_pass'}}{SCALAR}};
 
 
491
my $my_index_html = ${*{$main::{'index_html'}}{SCALAR}};
476
my $my_create_htaccess = ${*{$main::{'create_htaccess'}}{SCALAR}};
492
my $my_create_htaccess = ${*{$main::{'create_htaccess'}}{SCALAR}};
477
my $my_webservergroup = ${*{$main::{'webservergroup'}}{SCALAR}};
493
my $my_webservergroup = ${*{$main::{'webservergroup'}}{SCALAR}};
478
my @my_severities = @{*{$main::{'severities'}}{ARRAY}};
494
my @my_severities = @{*{$main::{'severities'}}{ARRAY}};
637
 
653
 
638
}
654
}
639
 
655
 
 
 
656
if ($my_index_html) {
 
 
657
    if (!-e "index.html") {
 
 
658
        print "Creating index.html...\n";
 
 
659
        open HTML, ">index.html";
 
 
660
        print HTML <<'END';
 
 
661
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
 
662
<HTML>
 
 
663
<HEAD>
 
 
664
<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=index.cgi">
 
 
665
</HEAD>
 
 
666
<BODY>
 
 
667
<H1>I think you are looking for <a href="index.cgi">index.cgi</a></H1>
 
 
668
</BODY>
 
 
669
</HTML>
 
 
670
END
 
 
671
        close HTML;
 
 
672
    }
 
 
673
    else {
 
 
674
        open HTML, "index.html";
 
 
675
        if (! grep /index\.cgi/, <HTML>) {
 
 
676
            print "\n\n";
 
 
677
            print "*** It appears that you still have an old index.html hanging\n";
 
 
678
            print "    around.  The contents of this file should be moved into a\n";
 
 
679
            print "    template and placed in the 'template/custom' directory.\n\n";
 
 
680
        }
 
 
681
        close HTML;
 
 
682
    }
 
 
683
}
 
 
684
 
640
 
685
 
641
# Just to be sure ...
686
# Just to be sure ...
642
unlink "data/versioncache";
687
unlink "data/versioncache";
18
 
18
 
19
Type in one or more words (or word fragments) to search for:
19
Type in one or more words (or word fragments) to search for:
20
 
20
 
21
<!-- The name of the form must be "f" (used in "quicksearch.js"). -->
 
 
22
 
 
 
23
<form name="f" action="show_bug.cgi" method="get"
21
<form name="f" action="show_bug.cgi" method="get"
24
      onsubmit="QuickSearch(); return false;">
22
      onsubmit="QuickSearch(f.id.value); return false;">
25
  <table>
23
  <table>
26
    <tr>
24
    <tr>
27
      <td><input type="text" size="40" name="id"/></td>
25
      <td><input type="text" size="40" name="id"/></td>
46
}
46
}
47
 
47
 
48
function go_to (url) {
48
function go_to (url) {
49
  document.location.href = url;
49
    if (sidebar == 1) {
50
  //window.open(url, "other" );
50
        load_relative_url(url);
 
 
51
    } else {
 
 
52
        document.location.href = url;
 
 
53
    }
51
}
54
}
52
 
55
 
53
function map(l, f) {
56
function map(l, f) {
600
    return (new Date()).getTime();
603
    return (new Date()).getTime();
601
}
604
}
602
 
605
 
603
function ShowURL(mode) {
606
function ShowURL(mode,input) {
604
    var input = document.f.id.value;
 
 
605
    var searchURL = make_query_URL(bugzilla+"buglist.cgi", input, false);
607
    var searchURL = make_query_URL(bugzilla+"buglist.cgi", input, false);
606
    if (searchURL != no_result) {
608
    if (searchURL != no_result) {
607
        var pieces = searchURL.replace(/[\?]/g,"\n?").replace(/[\&]/g,"\n&");
609
        var pieces = searchURL.replace(/[\?]/g,"\n?").replace(/[\&]/g,"\n&");
684
// derived from http://www.cs.hmc.edu/~jruderma/s/bugz.html
686
// derived from http://www.cs.hmc.edu/~jruderma/s/bugz.html
685
 
687
 
686
// QuickSearch combines lookup-by-bug-number and search
688
// QuickSearch combines lookup-by-bug-number and search
687
// in a single textbox. It's name must be document.f.id .
689
// in a single textbox. 
688
//
690
//
689
// type nothing:
691
// type nothing:
690
//    --> go to bugzilla front page
692
//    --> go to bugzilla front page
696
//    --> search summary, product, component, keywords, status whiteboard
698
//    --> search summary, product, component, keywords, status whiteboard
697
//        (and URL if it's an IP address, a host.name, or an absolute://URL)
699
//        (and URL if it's an IP address, a host.name, or an absolute://URL)
698
 
700
 
699
function QuickSearch ()
701
function QuickSearch (input)
700
{
702
{
701
    var input = document.f.id.value;
 
 
702
 
 
 
703
    //remove leading and trailing whitespace
703
    //remove leading and trailing whitespace
704
    input = input.replace(/^[\s]+/,"").replace(/[\s]+$/,"");
704
    input = input.replace(/^[\s]+/,"").replace(/[\s]+$/,"");
705
 
705
 
726
    return;
726
    return;
727
}
727
}
728
 
728
 
729
function LoadQuery() {
729
function LoadQuery(input) {
730
    var input = document.f.id.value;
 
 
731
 
 
 
732
    //remove leading and trailing whitespace
730
    //remove leading and trailing whitespace
733
    input = input.replace(/^[\s]+/,"").replace(/[\s]+$/,"");
731
    input = input.replace(/^[\s]+/,"").replace(/[\s]+$/,"");
734
 
732
 
12
 
12
 
13
Type in one or more words (or word fragments) to search for:
13
Type in one or more words (or word fragments) to search for:
14
 
14
 
15
<!-- The name of the form must be "f" (used in "quicksearch.js"). -->
 
 
16
 
 
 
17
<form name="f" action="show_bug.cgi" method="get"
15
<form name="f" action="show_bug.cgi" method="get"
18
      onsubmit="QuickSearch(); return false;">
16
      onsubmit="QuickSearch(f.id.value); return false;">
19
  <table>
17
  <table>
20
    <tr>
18
    <tr>
21
      <td><input type="text" size="40" name="id"/></td>
19
      <td><input type="text" size="40" name="id"/></td>
22
      <td align=left><input type="submit" name="run"  value="Search"/></td>
20
      <td align=left><input type="submit" name="run"  value="Search"/></td>
23
      <td align=left><input type="button" name="load" value="Load Query"
21
      <td align=left><input type="button" name="load" value="Load Query"
24
                      onclick="LoadQuery();" />
22
                      onclick="LoadQuery(f.id.value);" />
25
      </td>
23
      </td>
26
    </tr>
24
    </tr>
27
  </table>
25
  </table>

Loggerhead runs on Bazaar branches