From 2780e73f8b3eb29dd97162444bdf2ecb0f6e83cf Mon Sep 17 00:00:00 2001 From: "cyeh%netscape.com" Date: Fri, 23 Jul 1999 18:43:07 +0000 Subject: [PATCH] support terse=1 flag,mostly as a way to support pager notification git-svn-id: svn://10.0.0.236/trunk@40914 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/tinderbox/viewallnotes.cgi | 115 ++++++++++++-------- 1 file changed, 72 insertions(+), 43 deletions(-) diff --git a/mozilla/webtools/tinderbox/viewallnotes.cgi b/mozilla/webtools/tinderbox/viewallnotes.cgi index 07085d1e392..5cee4d2bb1a 100755 --- a/mozilla/webtools/tinderbox/viewallnotes.cgi +++ b/mozilla/webtools/tinderbox/viewallnotes.cgi @@ -45,10 +45,79 @@ sub str2timeAndCheck { return 0; } -if (!($form{text})) { +if ($form{terse}) { + + if (defined $tree && defined $start && defined $end) { + my $first = str2timeAndCheck($start); + my $last = str2timeAndCheck($end); + if ($first > 0 && $last > 0) { + if (open(IN, "<$tree/notes.txt")) { + my %stats; + while () { + chop; + my ($nbuildtime,$nbuildname,$nwho,$nnow,$nenc_note) + = split /\|/; + if ($nnow >= $first && $nnow <= $last) { + my $note = &url_decode($nenc_note); + $nbuildtime = print_time($nbuildtime); + $nnow = print_time($nnow); + print "$nbuildname "; + print "$nwho "; + print "$note "; + print "\n"; + } + } + } + } else { + print "There does not appear to be a tree " . + "named '$tree'."; + } + } + +} elsif ($form{text}) { + +my $header = "
\nBuild Time\t\tBuild Name\t\t\tWho\t\t\Note Time\t\t\tNote\n" . 
+"----------------------------------------------------------------------------------------------------------------------------\n";
+
+ if (defined $tree && defined $start && defined $end) {
+    my $first = str2timeAndCheck($start);
+    my $last = str2timeAndCheck($end);
+    if ($first > 0 && $last > 0) {
+        if (open(IN, "<$tree/notes.txt")) {
+            print "
Notes for $tree\n\nfrom " .
+                time2str($TIMEFORMAT, $first) . " to " .
+                    time2str($TIMEFORMAT, $last) . "\n
"; + my %stats; + print "$header\n"; + while () { + chop; + my ($nbuildtime,$nbuildname,$nwho,$nnow,$nenc_note) + = split /\|/; + if ($nnow >= $first && $nnow <= $last) { + my $note = &url_decode($nenc_note); + $nbuildtime = print_time($nbuildtime); + $nnow = print_time($nnow); + print "$nbuildtime\t"; + print "$nbuildname\t"; + print "$nwho\t"; + print "$nnow\t\t"; + print "$note\t"; + print "\n"; + } + } + } + } else { + print "

There does not appear to be a tree " . + "named '$tree'.

"; + } + } + print "\n<\PRE>"; + +} else { + my $header = ""; -if (defined $tree && defined $start && defined $end) { + if (defined $tree && defined $start && defined $end) { my $first = str2timeAndCheck($start); my $last = str2timeAndCheck($end); if ($first > 0 && $last > 0) { @@ -86,47 +155,7 @@ if (defined $tree && defined $start && defined $end) { } } print "
Build timeBuild nameWhoNote timeNote
\n"; -} -} #end html - -else { - -my $header = "

\nBuild Time\t\tBuild Name\t\t\tWho\t\t\Note Time\t\t\tNote\n" . 
-"----------------------------------------------------------------------------------------------------------------------------\n";
-
-if (defined $tree && defined $start && defined $end) {
-    my $first = str2timeAndCheck($start);
-    my $last = str2timeAndCheck($end);
-    if ($first > 0 && $last > 0) {
-        if (open(IN, "<$tree/notes.txt")) {
-            print "
Notes for $tree\n\nfrom " .
-                time2str($TIMEFORMAT, $first) . " to " .
-                    time2str($TIMEFORMAT, $last) . "\n
"; - my %stats; - print "$header\n"; - while () { - chop; - my ($nbuildtime,$nbuildname,$nwho,$nnow,$nenc_note) - = split /\|/; - if ($nnow >= $first && $nnow <= $last) { - my $note = &url_decode($nenc_note); - $nbuildtime = print_time($nbuildtime); - $nnow = print_time($nnow); - print "$nbuildtime\t"; - print "$nbuildname\t"; - print "$nwho\t"; - print "$nnow\t\t"; - print "$note\t"; - print "\n"; - } - } - } - } else { - print "

There does not appear to be a tree " . - "named '$tree'.

"; - } - } - print "\n<\PRE>"; + } }