aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-08 17:56:04 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-08 17:56:04 +0100
commiteb46ea44a80374aa01fd0fe9bac75525dba85f08 (patch)
tree80c63c0a2c9690e33eadb41324becc2bac00a4b7
parente03badcf0559e01538aaaed215a14a87fcd02b3f (diff)
switch to using c->cobrand->problems instead of site restriction
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index b76447233..f4c40d5da 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -44,7 +44,7 @@ sub index : Path : Args(0) {
my ( $sql_restriction, $id, $site_restriction ) = $c->cobrand->site_restriction();
my $cobrand_restriction = $c->cobrand->moniker eq 'fixmystreet' ? {} : { cobrand => $c->cobrand->moniker };
- my $problems = $c->model('DB::Problem')->summary_count( $site_restriction );
+ my $problems = $c->cobrand->problems->summary_count;
my %prob_counts =
map { $_->state => $_->get_column('state_count') } $problems->all;
@@ -115,7 +115,7 @@ sub timeline : Path( 'timeline' ) : Args(0) {
$c->model('DB')->schema->storage->sql_maker->quote_char( '"' );
- my $probs = $c->model('DB::Problem')->timeline( $site_restriction );
+ my $probs = $c->cobrand->problems->timeline;
foreach ($probs->all) {
push @{$time{$_->created->epoch}}, { type => 'problemCreated', date => $_->created_local, obj => $_ };
@@ -408,7 +408,7 @@ sub search_reports : Path('search_reports') {
# it for this query and then switch it off afterwards.
$c->model('DB')->schema->storage->sql_maker->quote_char( '"' );
- my $problems = $c->model('DB::Problem')->search(
+ my $problems = $c->cobrand->problems->search(
{
-or => [
'me.id' => $search_n,
@@ -418,7 +418,6 @@ sub search_reports : Path('search_reports') {
detail => { ilike => $like_search },
council => { like => $like_search },
cobrand_data => { like => $like_search },
- %{ $site_restriction },
]
},
{
@@ -464,10 +463,9 @@ sub report_edit : Path('report_edit') : Args(1) {
my ( $site_res_sql, $site_key, $site_restriction ) = $c->cobrand->site_restriction;
- my $problem = $c->model('DB::Problem')->search(
+ my $problem = $c->cobrand->problems->search(
{
id => $id,
- %{ $site_restriction },
}
)->first;