Survey 2.0 - "Cancel" button not working as expected (#9217)

added call to 'loadSurvey' after 'cancel'
also added code in 'loadSurvey' to allow for a refresh without
displaying an edit window.
This commit is contained in:
David Delikat 2008-12-19 16:11:03 +00:00
parent eeef2fb330
commit d0b8dd17bc
3 changed files with 11 additions and 3 deletions

View file

@ -429,13 +429,19 @@ sub www_dragDrop {
#-------------------------------------------------------------------
sub www_loadSurvey {
my ( $self, $options ) = @_;
my $editflag = 1;
$self->loadSurveyJSON();
my $address = defined $options->{address} ? $options->{address} : undef;
if ( !defined $address ) {
if ( my $inAddress = $self->session->form->process("data") ) {
$address = [ split /-/, $inAddress ];
if( $inAddress eq '-' ) {
$editflag = 0;
$address = [ 0 ];
} else {
$address = [ split /-/, $inAddress ];
}
}
else {
$address = [0];
@ -509,7 +515,8 @@ sub www_loadSurvey {
#ids is a list of all ids passed in which are draggable (for adding events)
#type is the object type
my $return = {
"address", $address, "buttons", \%buttons, "edithtml", $editHtml,
"address", $address, "buttons", \%buttons,
"edithtml", $editflag ? $editHtml : '',
"ddhtml", $html, "ids", \@ids, "type", $var->{type}
};
$self->session->http->setMimeType('application/json');