aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Open311.pm
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2011-08-02 00:12:22 +0200
committerPetter Reinholdtsen <pere@hungry.com>2011-08-02 00:12:22 +0200
commit14ec45fe5b09ca46f30968ca4f173e909cabdec7 (patch)
tree25f927c7a984644351aba1c0d4fb3146676704fe /perllib/FixMyStreet/App/Controller/Open311.pm
parent16e086f9519b03853f30895dfa51e9d4aa10dae0 (diff)
Try different approachh.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Open311.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Open311.pm19
1 files changed, 18 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm
index 99d7bddee..f4985915f 100644
--- a/perllib/FixMyStreet/App/Controller/Open311.pm
+++ b/perllib/FixMyStreet/App/Controller/Open311.pm
@@ -379,13 +379,30 @@ sub get_requests : Private {
$c->stash->{type} = 'new_problems';
$c->stash->{search_criteria} = $criteria;
$c->stash->{max_requests} = $max_requests;
- # Call Controller::Rss::output
+ $c->stash->{query_func} = '/open311/rss_query';
$c->forward( '/rss/output' );
} else {
$c->forward( 'output_requests', [ $criteria, $max_requests ] );
}
}
+# Based on Controller::Rss::query_main
+sub rss_query : Private {
+ my ( $self, $c ) = @_;
+
+ my $limit = $c->stash->{max_requests};
+ $limit = $c->config->{RSS_LIMIT}
+ unless $limit && $limit <= $c->config->{RSS_LIMIT};
+
+ my $attr = {
+ order_by => { -desc => 'confirmed' },
+ rows => $limit
+ };
+
+ my $problems = $c->cobrand->problems->search( $criteria, $attr );
+ $c->stash->{query_main} = $problems;
+}
+
# Example
# http://seeclickfix.com/open311/requests/1.xml?jurisdiction_id=sfgov.org
sub get_request : Private {