diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 7ad39926c..16ce54cdb 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -25,6 +25,7 @@ - fixed #4196: update button doesn't work in IE 7.6.6 + - fixed #9217: Survey 2.0 - "Cancel" button not working as expected(David Delikat) - fixed #8792: Image Preview gives ERROR in Collateral Manager - fixed #8774: Forum Rich Edit no longer supports indent/outdent - fixed #4173: fieldnames in profilefields can contain spaces diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index 23f40952a..cfd9f45ae 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -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'); diff --git a/www/extras/wobject/Survey/editsurvey/object.js b/www/extras/wobject/Survey/editsurvey/object.js index cf67d07d1..80a10b874 100644 --- a/www/extras/wobject/Survey/editsurvey/object.js +++ b/www/extras/wobject/Survey/editsurvey/object.js @@ -11,7 +11,7 @@ Survey.ObjectTemplate = new function(){ var butts = [ { text:"Submit", handler:function(){this.submit();}, isDefault:true }, { text:"Copy", handler:function(){document.getElementById('copy').value = 1; this.submit();}}, - { text:"Cancel", handler:function(){this.cancel();}}, + { text:"Cancel", handler:function(){this.cancel(); Survey.Comm.loadSurvey('-');}}, { text:"Delete", handler:function(){document.getElementById('delete').value = 1; this.submit();}} ];