Minor fix. JSON no longer assumes proper utf8, but uses whatever off-brand locale a luser wants to use.
This commit is contained in:
parent
a4207e7ec5
commit
5127a307b7
3 changed files with 9 additions and 9 deletions
|
|
@ -277,7 +277,7 @@ sub www_submitObjectEdit {
|
||||||
return $self->session->privilege->insufficient()
|
return $self->session->privilege->insufficient()
|
||||||
unless ($self->session->user->isInGroup($self->get('groupToEditSurvey')));
|
unless ($self->session->user->isInGroup($self->get('groupToEditSurvey')));
|
||||||
|
|
||||||
# my $ref = @{decode_json($self->session->form->process("data"))};
|
# my $ref = @{from_json($self->session->form->process("data"))};
|
||||||
my $responses = $self->session->form->paramsHashRef();
|
my $responses = $self->session->form->paramsHashRef();
|
||||||
|
|
||||||
my @address = split /-/, $responses->{id};
|
my @address = split /-/, $responses->{id};
|
||||||
|
|
@ -367,7 +367,7 @@ sub www_dragDrop {
|
||||||
return $self->session->privilege->insufficient()
|
return $self->session->privilege->insufficient()
|
||||||
unless ($self->session->user->isInGroup($self->get('groupToEditSurvey')));
|
unless ($self->session->user->isInGroup($self->get('groupToEditSurvey')));
|
||||||
|
|
||||||
my $p = decode_json( $self->session->form->process("data") );
|
my $p = from_json( $self->session->form->process("data") );
|
||||||
|
|
||||||
my @tid = split /-/, $p->{target}->{id};
|
my @tid = split /-/, $p->{target}->{id};
|
||||||
my @bid = split /-/, $p->{before}->{id};
|
my @bid = split /-/, $p->{before}->{id};
|
||||||
|
|
@ -512,7 +512,7 @@ sub www_loadSurvey {
|
||||||
"ddhtml", $html, "ids", \@ids, "type", $var->{type}
|
"ddhtml", $html, "ids", \@ids, "type", $var->{type}
|
||||||
};
|
};
|
||||||
$self->session->http->setMimeType('application/json');
|
$self->session->http->setMimeType('application/json');
|
||||||
return encode_json($return);
|
return to_json($return);
|
||||||
} ## end sub www_loadSurvey
|
} ## end sub www_loadSurvey
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -768,7 +768,7 @@ sub surveyEnd {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# $self->session->http->setRedirect($url);
|
# $self->session->http->setRedirect($url);
|
||||||
return encode_json({ "type", "forward", "url", $url });
|
return to_json({ "type", "forward", "url", $url });
|
||||||
} ## end sub surveyEnd
|
} ## end sub surveyEnd
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -825,7 +825,7 @@ sub prepareShowSurveyTemplate {
|
||||||
my $out = $self->processTemplate( $section, $self->get("surveyQuestionsId") );
|
my $out = $self->processTemplate( $section, $self->get("surveyQuestionsId") );
|
||||||
|
|
||||||
$self->session->http->setMimeType('application/json');
|
$self->session->http->setMimeType('application/json');
|
||||||
return encode_json( { "type", "displayquestions", "section", $section, "questions", $questions, "html", $out } );
|
return to_json( { "type", "displayquestions", "section", $section, "questions", $questions, "html", $out } );
|
||||||
} ## end sub prepareShowSurveyTemplate
|
} ## end sub prepareShowSurveyTemplate
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ sub new {
|
||||||
my $json = shift;
|
my $json = shift;
|
||||||
my $log = shift;
|
my $log = shift;
|
||||||
my $survey = shift;
|
my $survey = shift;
|
||||||
my $temp = decode_json($json) if defined $json;
|
my $temp = from_json($json) if defined $json;
|
||||||
my $self = defined $temp ? $temp : {};
|
my $self = defined $temp ? $temp : {};
|
||||||
$self->{survey} = $survey;
|
$self->{survey} = $survey;
|
||||||
$self->{log} = $log;
|
$self->{log} = $log;
|
||||||
|
|
@ -84,7 +84,7 @@ sub freeze {
|
||||||
my %temp = %{$self};
|
my %temp = %{$self};
|
||||||
delete $temp{log};
|
delete $temp{log};
|
||||||
delete $temp{survey};
|
delete $temp{survey};
|
||||||
return encode_json( \%temp );
|
return to_json( \%temp );
|
||||||
}
|
}
|
||||||
|
|
||||||
#Hash the survey timed out?
|
#Hash the survey timed out?
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ sub new {
|
||||||
my $log = shift;
|
my $log = shift;
|
||||||
my $self = {};
|
my $self = {};
|
||||||
$self->{log} = $log;
|
$self->{log} = $log;
|
||||||
my $temp = decode_json($json) if defined $json;
|
my $temp = from_json($json) if defined $json;
|
||||||
$self->{sections} = defined $temp->{sections} ? $temp->{sections} : [];
|
$self->{sections} = defined $temp->{sections} ? $temp->{sections} : [];
|
||||||
$self->{survey} = defined $temp->{survey} ? $temp->{survey} : {};
|
$self->{survey} = defined $temp->{survey} ? $temp->{survey} : {};
|
||||||
bless( $self, $class );
|
bless( $self, $class );
|
||||||
|
|
@ -75,7 +75,7 @@ sub freeze {
|
||||||
my %temp;
|
my %temp;
|
||||||
$temp{sections} = $self->{sections};
|
$temp{sections} = $self->{sections};
|
||||||
$temp{survey} = $self->{survey};
|
$temp{survey} = $self->{survey};
|
||||||
return encode_json( \%temp );
|
return to_json( \%temp );
|
||||||
}
|
}
|
||||||
|
|
||||||
=head2 newObject ( $address )
|
=head2 newObject ( $address )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue