Hello,
Yesterday I installed this plugin in our TWiki. I noticed that with Firefox works very well, but with Explorer 6 and 7 direct state updates don't work at all.
After some debugging I think that the problem are the options values, Explorer left empties while Firefox takes Text values.
I have patched the file
Action.pm adding options values and encoding url because we have spanish words with specials characters and doesn't work well too.
Functions modified:
sub _formatField_state_original {
my ( $this, $args, $asHTML ) = @_;
return $this->{state} unless $asHTML;
return $this->{state} unless $this->{uid};
# SMELL: assumes a prior call has loaded the options
require TWiki::Plugins::ActionTrackerPlugin::Options;
return $this->{state} unless
$TWiki::Plugins::ActionTrackerPlugin::Options::options{ENABLESTATESHORTCUT};
my $input = '';
foreach my $option (@{$types{state}->{values}}) {
my %attrs;
$attrs{selected} = 'selected' if ($option eq $this->{state});
$attrs{value} = $option; # <--- THIS
$input .= CGI::option(\%attrs, $option);
}
return CGI::Select(
{
onChange => 'atp_update(this, "%SCRIPTURLPATH{rest}%/ActionTrackerPlugin/update?topic='.
$this->{web}.'.'.CGI::escape($this->{topic}). # <--- THIS
';uid='.$this->{uid}.'", "state")',
class => 'atpState'.$this->{state},
},
$input);
}
sub _formatField_state {
my ( $this, $args, $asHTML ) = @_;
return $this->{state} unless $asHTML;
return $this->{state} unless $this->{uid};
# SMELL: assumes a prior call has loaded the options
require TWiki::Plugins::ActionTrackerPlugin::Options;
return $this->{state} unless
$TWiki::Plugins::ActionTrackerPlugin::Options::options{ENABLESTATESHORTCUT};
my $input = '';
foreach my $option (@{$types{state}->{values}}) {
my %attrs;
$attrs{selected} = 'selected' if ($option eq $this->{state});
$attrs{value} = $option;
# <--- THIS $attrs{value} = $option;
# <--- THIS $attrs{value} = $option;
# <--- THIS $attrs{value} = $option;
# <--- THIS
$input .= CGI::option(\%attrs, $option);
}
return CGI::Select(
{
onChange => 'atp_update(this, "%SCRIPTURLPATH{rest}%/ActionTrackerPlugin/update?topic='.
$this->{web}.'.'.CGI::escape($this->{topic}).
# <--- THIS $this->{web}.'.'.CGI::escape($this->{topic}).
# <--- THIS $this->{web}.'.'.CGI::escape($this->{topic}).
# <--- THIS $this->{web}.'.'.CGI::escape($this->{topic}).
# <--- THIS
';uid='.$this->{uid}.'", "state")',
class => 'atpState'.$this->{state},
},
$input);
}
I don't know if It is this the place for tell this, sorry afterwards.
Thank you for this fantastic plugin (and for TWiki too).
Regards.
--
TWiki:Main/JoaquinBuendia - 11 Sep 2007
Explorer doesn't working, Firefox works perfect but I can't do that Explorer changes the state of the tasks. Sometimes Explorer do it but after somes changes don't.
Any ideas?
Thank you
--
TWiki:Main.JoaquinBuendia - 11 Sep 2007
The problem with Explorer is the cache. After two first changes, explorer gets content from cache because urls are the same before that.
There are almost 4 solutions to this, but I think that the more simple is adding a new parameter with a random value in the javasctipt file atp.js: [...] url = ";field=" field; url = ";value=" element.value; url = ";nocache=" parseInt( Math.random() * 10000000000 ); xml.open("GET", url, true); [...]
Other solution is open url with POST method (requires more changes), adding custom header in server script with instructions for don't cache (possibly the best solution) the content and last change options in Explorer for always test new content with all pages (it's not sound much eficient, isn't it?).
Link about Explorer solutions (spanish):
http://www.formatoweb.com.ar/ajax/cache_y_refresco_de_datos.php
Now, plugin works very well !!!
Regards!!!
--
TWiki:Main.JoaquinBuendia - 12 Sep 2007
[...]
url = ";field=" field;
url = ";value=" element.value;
url = ";nocache=" parseInt( Math.random() * 10000000000 );
xml.open("GET", url, true);
[...]
--
TWiki:Main.JoaquinBuendia - 12 Sep 2007
OK, good solution. I will incorporate it when i get a chance.
Later: Done, thanks Joaquin
CC
ok, not at all.
--
TWiki:Main.JoaquinBuendia - 12 Sep 2007