Environment
Server: TS6.1 (build 33333) on Solaris 8
Client: Mozilla 1.6 on MacOS 10.3
Background
I've got a pretty trivial custom menu CGI script that "touches" selected files.
Because this should modify at least the icon if not the last modified timestamp and modified by aspects of the CCP GUI, I also want to have my CGI force the parent CCP window to get refreshed. The code I used for doing this is highlighted below.
Code
(gratis)#!/usr/local/iw-home/iw-perl/bin/iwperl
use strict;
use warnings;
use TeamSite::Config;
use TeamSite::CGI_lite;
my $iwmount = TeamSite::Config::iwgetmount();
$|=1;
my $cgi = TeamSite::CGI_lite->new();
$cgi->parse_data();
print qq(Content-type: text/html\n\n);
print qq(<html>\n<body bgcolor='white'>
<h2 align="center">The time stamps have been set to now for the following files:</h2>);
my $now = time;
my $filelist;
my $vpath = $cgi->{form}{vpath};
my @paths;
push(@paths, (ref($vpath) eq "ARRAY") ? @$vpath : $vpath);
foreach (@paths){
s|^//[^/]+|$iwmount|;
my $filename = $cgi->escape_html_data($_);
utime($now, $now, $filename);
$filelist .= "$filename<br />\n";
}
# force parent window to redraw
print qq(<script language="Javascript">
<!--
opener.window.location.reload();
// -->
</script>\n);
# print results and prompt for window closure
print qq(<center>\n$filelist<form><br /><br />
<p><input type=button value='Close' onClick='self.close();'>
</form></center>\n</body>\n</html>\n);
Problem
If I'm in a given directory within CCP (e.g.: area-root/modules) and I then click on a different directory (e.g.: area-root/cgi) in the left-hand navigation portion of the UI - the main window portion refreshes to show the contents of this newly selected directory (so far, so good).
I then select one or more files within the main window portion of the UI and then run my custom menu item - the files are touched (good) the main window starts to refresh (good) and then during the course of the refresh it changes the current directory being displayed from area-root/cgi to area-root/moduoles (bad).
I've been able to reproduce this several times; and also to determine that if I manually force a browser refresh after changing into the cgi directory that the refresh from the custom menu item keeps me in that directory.
Is there something about the javascript command I'm using that causes this behavior or is this a bug in the UI code that doesn't preserve the current working directory ?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com