aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm1
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm8
-rw-r--r--perllib/FixMyStreet/DB/Result/Body.pm6
3 files changed, 12 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 5fe513a28..96fe086c3 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -452,6 +452,7 @@ sub body_params : Private {
%defaults = ( %defaults,
send_comments => 0,
fetch_problems => 0,
+ convert_latlong => 0,
blank_updates_permitted => 0,
suppress_alerts => 0,
comment_user_id => undef,
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index df4dc5f77..1646bc4d5 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -475,7 +475,13 @@ sub inspect : Private {
if ($update_text || %update_params) {
my $timestamp = \'current_timestamp';
if (my $saved_at = $c->get_param('saved_at')) {
- $timestamp = DateTime->from_epoch( epoch => $saved_at );
+ # this comes in as a UTC epoch but the database expects everything
+ # to have the FMS timezone so we need to add the timezone otherwise
+ # dates come back out the database at time +/- timezone offset.
+ $timestamp = DateTime->from_epoch(
+ time_zone => FixMyStreet->time_zone || FixMyStreet->local_time_zone,
+ epoch => $saved_at
+ );
}
my $name = $c->user->from_body ? $c->user->from_body->name : $c->user->name;
$problem->add_to_comments( {
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm
index a9df1aeb7..0b11f2771 100644
--- a/perllib/FixMyStreet/DB/Result/Body.pm
+++ b/perllib/FixMyStreet/DB/Result/Body.pm
@@ -47,6 +47,8 @@ __PACKAGE__->add_columns(
"fetch_problems",
{ data_type => "boolean", default_value => \"false", is_nullable => 0 },
"blank_updates_permitted",
+ { data_type => "boolean", default_value => \"false", is_nullable => 1 },
+ "convert_latlong",
{ data_type => "boolean", default_value => \"false", is_nullable => 0 },
);
__PACKAGE__->set_primary_key("id");
@@ -122,8 +124,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.07035 @ 2018-03-01 12:27:28
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dzqgZI1wkGDPS2PfJgDEIg
+# Created by DBIx::Class::Schema::Loader v0.07035 @ 2018-03-15 12:38:36
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rturOWpYmPRO0yE9yWHXjA
use Moo;
use namespace::clean;