diff options
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Contact.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/AlertType.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Nearby.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 4 |
5 files changed, 16 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index 2a6ffa2fe..993e3524b 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -36,6 +36,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0 }, "extra", { data_type => "text", is_nullable => 1 }, + "non_public", + { data_type => "boolean", default_value => \"false", is_nullable => 1 }, "endpoint", { data_type => "text", is_nullable => 1 }, "jurisdiction", @@ -49,8 +51,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->add_unique_constraint("contacts_area_id_category_idx", ["area_id", "category"]); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-08-29 17:34:28 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:getDAgTeXkAYQTcxHWflmA +# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-08-31 10:29:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t6yOPhZmedV/eH6AUvHI6w __PACKAGE__->filter_column( extra => { diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index af62a299b..761f57b01 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -92,6 +92,8 @@ __PACKAGE__->add_columns( { data_type => "timestamp", is_nullable => 1 }, "send_method_used", { data_type => "text", is_nullable => 1 }, + "non_public", + { data_type => "boolean", default_value => \"false", is_nullable => 1 }, "external_source", { data_type => "text", is_nullable => 1 }, "external_source_id", @@ -120,8 +122,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-08-23 12:14:00 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:05LIWlb0CUWAR7bN5RAhOA +# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-08-31 10:25:34 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mudIAiLAUdmK8gGWIPiq6g # Add fake relationship to stored procedure table __PACKAGE__->has_one( diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm index a0320ccc3..2d206d84e 100644 --- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm +++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm @@ -65,6 +65,9 @@ sub email_alerts ($) { # call checks if this is the host that sends mail for this cobrand. next unless $cobrand->email_host; + # this is for the new_updates alerts + next if $row->{non_public} and $row->{user_id} != $row->{alert_user_id}; + my $hashref_restriction = $cobrand->site_restriction( $row->{cobrand_data} ); FixMyStreet::App->model('DB::AlertSent')->create( { @@ -151,6 +154,7 @@ sub email_alerts ($) { where nearby.problem_id = problem.id and problem.user_id = users.id and problem.state in ($states) + and problem.non_public = 'f' and problem.confirmed >= ? and problem.confirmed >= ms_current_timestamp() - '7 days'::interval and (select whenqueued from alert_sent where alert_sent.alert_id = ? and alert_sent.parameter::integer = problem.id) is null and users.email <> ? diff --git a/perllib/FixMyStreet/DB/ResultSet/Nearby.pm b/perllib/FixMyStreet/DB/ResultSet/Nearby.pm index 83fc85a88..191223572 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Nearby.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Nearby.pm @@ -8,6 +8,7 @@ sub nearby { my ( $rs, $c, $dist, $ids, $limit, $mid_lat, $mid_lon, $interval ) = @_; my $params = { + non_public => 0, state => [ FixMyStreet::DB::Result::Problem::visible_states() ], }; $params->{'current_timestamp-lastupdate'} = { '<', \"'$interval'::interval" } diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index e946e01c2..f7f88edf0 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -85,7 +85,8 @@ sub _recent { $key .= ":$site_key:$num"; my $query = { - state => [ FixMyStreet::DB::Result::Problem->visible_states() ], + non_public => 0, + state => [ FixMyStreet::DB::Result::Problem->visible_states() ], }; $query->{photo} = { '!=', undef } if $photos; @@ -141,6 +142,7 @@ sub around_map { $attr->{rows} = $limit if $limit; my $q = { + non_public => 0, state => [ FixMyStreet::DB::Result::Problem->visible_states() ], latitude => { '>=', $min_lat, '<', $max_lat }, longitude => { '>=', $min_lon, '<', $max_lon }, |