2 ################################################################################
4 # File: releasenotes.cgi,v
6 # Description: Produce an HTML table of bugs for a release page
7 # Author: Andrew@DeFaria.com
8 # Created: Fri May 31 15:34:50 2002
9 # Modified: 2007/05/17 07:45:48
12 # (c) Copyright 2007, ClearSCM, Inc., all rights reserved.
14 ################################################################################
16 use CGI qw/:standard *table/;
18 use lib qw(//sonscentral/users/adefaria/www/cgi-bin);
26 my $release = $page->param ("release");
31 my $header_background = "#ffffcc";
32 my $header_foreground = "#000000";
33 my $data_background = "#ffffff";
34 my $data_foreground = "#000000";
41 start_form ({-action => "/Release/releasenotes.cgi",
43 h4 ("Look up other Release:",
44 textfield ({-name => "release",
46 -value => "Please specify"}),
47 submit ({-value => "Display"})
55 print header (-title => "Release $release") . "\n" .
56 start_html (-title => "Release $release",
57 -author => "Andrew\@DeFaria.com",
61 -bgcolor => "#eeffff",
63 -script => {-language => "JavaScript1.2",
64 -src => "/Javascript/Heading.js"}),
65 p ({-align => "right"},
66 a ({-href => "/Release/addbug"}, "Add a bug to a release") . "\n" . br
67 a ({-href => "file://///sons-clearcase/Views/official/Tools/bin/clearcase/triggers/data/rel_2.2.lst"}, "Official US 2.2 list") . "\n" . br
68 a ({-href => "file://///sons-cc/Views/official/Tools/bin/clearcase/triggers/data/china_2.2.lst"}, "Official Shanghai 2.2 list")) . "\n" .
69 h1 ({-align=>"CENTER"}, "Release $release") . "\n" .
70 h2 ("Introduction") . "\n";
72 print header (-title => "Release $release") . "\n" .
73 start_html (-title => "Release $release",
74 -author => "Andrew\@DeFaria.com") . "\n";
75 Error "Release not specified!";
81 print script ({-language => "JavaScript1.2",
82 -src => "/JavaScript/Footing.js"}) . "\n";
87 (scalar (@intro_notes) == 0) ? return : print ul (@intro_notes) . "\n";
93 # We need to set a view context. Use the official view
96 my $vob_server = "sons-clearcase";
97 my $view_path = "Views";
98 my $view_name = "official";
100 my $official_view = '\\\\' .
109 chdir $official_view or die "Unable to set view context";
110 my $output = `cleartool lslock -short lbtype:$bugid`;
112 chdir $cwd or die "Unable to return from view context\n";
114 # lslock returns the label if it is locked, otherwise it returns
121 my ($result, $owner, $description, $bugid, $state, $line);
125 open BUGLIST, "$buglist" or Error "Unable to open buglist: $buglist";
127 while ($line = <BUGLIST>) {
128 next if $line =~ /^\#/; # Skip comments
130 if ($line =~ /^\*/) {
131 ($result, $line) = split (/\* /, $line);
132 push (@intro_notes, li ([$line]) . "\n");
134 ($bugid) = split (/\s+/, $line);
135 $result = cqc::GetBugRecord ($bugid, %fields);
136 ($result <= 0) ? $owner = "Unknown" : $owner = $fields {owner};
138 $description = "Unable to connect to server!";
139 } elsif ($result > 0) {
140 $description = "Bug ID not found in Clearquest!";
142 # Description's too large. Use headline instead.
143 $description = $fields {headline};
146 if (LockedLabel ($bugid)) {
147 $locked = img ({-src => "/Images/CheckMark.gif"});
152 if ($fields {state} eq "Verified" or $fields {state} eq "Closed") {
153 $state = $fields {state};
154 $locked = img ({-src => "/Images/CheckMark.gif"});
156 $state = b (font ({-color => "Red"}, $fields {state}));
162 -bgcolor => $data_background},
164 td ({-bgcolor => $data_background},
165 small (a ({-href => "/cgi-bin/bugdetails.cgi?bugid=$bugid"}, $bugid))) .
166 td ({-bgcolor => $data_background},
168 td ({-align => "center",
169 -bgcolor => $data_background},
170 small (a ({-href => "mailto:$owner\@salira.com"}, $owner))) .
171 td ({-align => "center",
173 -bgcolor => $data_background},
175 td ({-bgcolor => $data_background},
176 small $description) . "\n");
182 if (scalar (@buglines) == 0) {
183 print h3 ("No bugs found!");
185 my $bugs = (scalar (@buglines) > 1) ? " bugs" : " bug";
186 print "<table cellpadding=0 cellspacing=1 border=0 width=95% align=center bgcolor=Black>\n";
187 print caption (small (strong (scalar (@buglines) . $bugs . " in this release"))) . "\n";
188 print "<tbody><tr><td valign=top>\n";
189 print start_table({-align => "center",
193 -width => "100%"}) . "\n" .
194 Tr ({-valign => "top", -bgcolor => $header_background}, [
195 th ({-width => "25"},
196 font ({-color => $header_foreground}, small ("#"))) .
197 th (font ({-color => $header_foreground}, small ("Bug ID"))) .
198 th (font ({-color => $header_foreground}, small ("State"))) .
199 th (font ({-color => $header_foreground}, small ("Owner"))) .
200 th (font ({-color => $header_foreground}, small ("Locked?"))) .
201 th (font ({-color => $header_foreground}, small ("Description")))
203 Tr({-valign=>"TOP"}, \@buglines) . "\n" .
211 print h3 ({-style => "Color: red;",
212 -align => "CENTER"}, "ERROR: " . $errmsg);
220 ParseBugFile ($release . ".bugs");
221 PrintIntroNotes (@intro_notes);
222 PrintBugTable (@buglines);