Closed Bug 2900 Opened 26 years ago Closed 23 years ago

PATCH to synchronize static html file with 'bannerhtml' param

Categories

(Bugzilla :: Administration, task, P3)

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jay, Assigned: justdave)

Details

the static html files are not update when the bannerhtml is changed. with more static files being added (two this week), a mechanism for a) placing a standard, site specific header and b) keeping it in sync would be nice. so, here is a patch for doeditparms.cgi which will edit the .html files and update the header. it does this by placing a meta-tag (<!--bannerhtml-begin--> and <!--bannerhtml-end-->) in the html file. this is replaced with Param{'bannerhtml'} whenever the param changes. thus, each static html file needs to have these two tags inserted at the appropriate place. also, you need to edit the doeditparams.cgi program to do the updating. the @htmlfile array should be updated to list all static html files. here is the diff (BEWARE WORD WRAP IN PASTING!): [jay@bic prod]$ cvs -z3 diff doeditparams.cgi Index: doeditparams.cgi =================================================================== RCS file: /cvsroot/mozilla/webtools/bugzilla/doeditparams.cgi,v retrieving revision 1.4 diff -r1.4 doeditparams.cgi 65c65,74 < $::param{$i} = $::FORM{$i} --- > $::param{$i} = $::FORM{$i}; > > if ( $i eq "bannerhtml" ) { > my $ok = ChangeBanners(); > if ($ok ne "" ) { > print "<b>WARNING: </b> Unable to write one or more html files<br>\n"; > print "<b>WARNING: </b> Banner saved, but some html files unchanged.<br>\n"; > print "<p style=\"padding-left: 10%\">$ok</p>\n"; > } > } 68a78,114 > sub ChangeBanners { > > my @htmlfiles = ('index.html' , 'newquip.html'); > my $i; > my $ret = ""; > > my $begin = '<!--bannerhtml-begin-->'; > my $end = '<!--bannerhtml-end-->'; > > foreach $i ( @htmlfiles ) { > if ( undef == open(F,"<$i") ) { > $ret .= "Error opening for read $i: $!<br>\n"; > next; > } > my $f=''; > $f .= $_ while <F>; > if (undef == close(F) ) { > $ret .= "Error closing for read $i: $!<br>\n"; > next; > } > $_ = $f; > my $replacement = PerformSubsts(Param("bannerhtml"), undef); > > s/(.*)($begin)(.*)($end)(.*)/$1$2\n$replacement\n$4$5/sg; > > if (undef == open(F,">$i")) { > $ret .= "Error opening for write $i: $!<br>\n"; > next; > } > print F $_; > if ( undef == close(F) ) { > $ret .= "Error closing for write $i: $!<br>\n"; > next; > } > } > return $ret; > }
I ran into the same issue experimenting with Bugzilla at my company. My solution was to turn all of the .html files into .cgi files. This fixes the bannerhtml problem, plus it adds the capability to access any of the other params. For example, I added a "ProgramName" param so that I could call Bugzilla by another name here.
Reassigning to dmose@mozilla.org, who now has front-line responsibility for all Bonsai and Bugzilla bugs.
Reassigning back to me. That stuff about me no longer being the front-line person responsible for Bugzilla and Bonsai turned out to be short-lived. Please pardon our confusion, and I'm very sorry about the spam.
Status: NEW → ASSIGNED
tara@tequilarista.org is the new owner of Bugzilla and Bonsai. (For details, see my posting in netscape.public.mozilla.webtools, news://news.mozilla.org/38F5D90D.F40E8C1A%40geocast.com .)
Assignee: terry → tara
Status: ASSIGNED → NEW
Keywords: patch
QA Contact: matty
Chris, this looks like a good thing for the next pre3.0 bugzilla (i.e., before we redo the output model). 2.12? Jay: Sorry it has taken over a year to get to your patch! Development of Bugzilla is not exactly a very fast process, since we all have other jobs! ;-)
Assignee: tara → cyeh
Whiteboard: 2.12
wow, this was like one of my first suggestions. i forgot this was here. heck, i've even changed jobs and email and obviously bugzilla logins. it is nice that it will be in the next pre3.0, so, i think i'll vote for it too. thanks for the confidence vote ian.
Question: what happens if someone puts %commandmenu% in bannerhtml? Wouldn't it generate the menu with the privs and settings of whoever was editing the params at the time?
Given our obscene schedule and pathetic desire to bundle sooner rather later, bumping this to the 2.16
Whiteboard: 2.12 → 2.16
moving to real milestones...
Target Milestone: --- → Bugzilla 2.16
Taking all of cyeh's Bugzilla bugs.
Assignee: Chris.Yeh → justdave
-> Bugzilla product, Administration component, reassigning.
Component: Bugzilla → Administration
Product: Webtools → Bugzilla
Whiteboard: 2.16
Version: other → unspecified
Removing patch keyword. This patch is from 1999. This bug should remain open in case a) anyone can work out what it's about and b) wants to fix it. But this patch is in no state to be checked in. Gerv
Keywords: patch
Actually, bug 80183 is the much prefered method of doing this (using an index.cgi which uses a template). index.html then can be either removed or changed to a simple <meta> refresh to index.cgi [Probably have to do the former to support users who can't/won't change the Apache config to use index.cgi as an index page (RedHat ships that way be default, IIRC, but I don't think ever Apache config allows that).
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WONTFIX
clearing milestone for invalid/wontfix/worksforme/duplicate so they'll show up as untriaged if they get reopened.
Target Milestone: Bugzilla 2.16 → ---
Yes, it loooks goood.
what looks good?
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.