From 4727e6c09f88e63f02e6c8f359862d0c0942ed36 Mon Sep 17 00:00:00 2001 From: "terry%netscape.com" <> Date: Wed, 16 Sep 1998 04:49:23 +0000 Subject: Everything has been ported to now run under Perl. --- colchange.cgi | 99 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 45 deletions(-) (limited to 'colchange.cgi') diff --git a/colchange.cgi b/colchange.cgi index 0b137f8eb..bd3b23d6f 100755 --- a/colchange.cgi +++ b/colchange.cgi @@ -1,5 +1,5 @@ -#! /usr/bonsaitools/bin/mysqltcl -# -*- Mode: tcl; indent-tabs-mode: nil -*- +#!/usr/bonsaitools/bin/perl -w +# -*- Mode: perl; indent-tabs-mode: nil -*- # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in @@ -19,70 +19,79 @@ # # Contributor(s): Terry Weissman -source "CGI.tcl" +use diagnostics; +use strict; -puts "Content-type: text/html" +require "CGI.pl"; + +print "Content-type: text/html\n"; # The master list not only says what fields are possible, but what order # they get displayed in. -set masterlist {opendate changeddate severity priority platform owner reporter status - resolution component product version project os summary summaryfull } +my @masterlist = ("opendate", "changeddate", "severity", "priority", + "platform", "owner", "reporter", "status", "resolution", + "component", "product", "version", "project", "os", + "summary", "summaryfull"); -if {[info exists FORM(rememberedquery)]} { - if {[info exists FORM(resetit)]} { - set collist $default_column_list +my @collist; +if (defined $::FORM{'rememberedquery'}) { + if (defined $::FORM{'resetit'}) { + @collist = @::default_column_list; } else { - set collist {} - foreach i $masterlist { - if {[info exists FORM(column_$i)]} { - lappend collist $i + foreach my $i (@masterlist) { + if (defined $::FORM{"column_$i"}) { + push @collist, $i; } } } - puts "Set-Cookie: COLUMNLIST=$collist ; path=/ ; expires=Sun, 30-Jun-99 00:00:00 GMT" - puts "Refresh: 0; URL=buglist.cgi?$FORM(rememberedquery)" - puts "" - puts "What a hack." - puts "Resubmitting your query with new columns..." - exit + my $list = join(" ", @collist); + print "Set-Cookie: COLUMNLIST=$list ; path=/ ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n"; + print "Refresh: 0; URL=buglist.cgi?$::FORM{'rememberedquery'}\n"; + print "\n"; + print "What a hack.\n"; + print "Resubmitting your query with new columns...\n"; + exit; } -if {[info exists COOKIE(COLUMNLIST)]} { - set collist $COOKIE(COLUMNLIST) +if (defined $::COOKIE{'COLUMNLIST'}) { + @collist = split(/ /, $::COOKIE{'COLUMNLIST'}); } else { - set collist $default_column_list + @collist = @::default_column_list; } -foreach i $masterlist { - set desc($i) $i + +my %desc; +foreach my $i (@masterlist) { + $desc{$i} = $i; } -set desc(summary) "Summary (first 60 characters)" -set desc(summaryfull) "Full Summary" +$desc{'summary'} = "Summary (first 60 characters)"; +$desc{'summaryfull'} = "Full Summary"; -puts "" -puts "Check which columns you wish to appear on the list, and then click on" -puts "submit." -puts "

" -puts "

" -puts "" +print "\n"; +print "Check which columns you wish to appear on the list, and then click\n"; +print "on submit.\n"; +print "

\n"; +print "\n"; +print "\n"; -foreach i $masterlist { - if {[lsearch $collist $i] >= 0} { - set c CHECKED +foreach my $i (@masterlist) { + my $c; + if (lsearch(\@collist, $i) >= 0) { + $c = 'CHECKED'; } else { - set c "" + $c = ''; } - puts "$desc($i)
" + print "$desc{$i}
\n"; } -puts "

" -puts "" -puts "

" -puts "
" -puts "" -puts "" -puts "" -puts "
" +print "

\n"; +print "\n"; +print "\n"; +print "

\n"; +print "\n"; +print "\n"; +print "\n"; +print "
\n"; -- cgit v1.2.3-24-g4f1b