diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2014-03-24 11:59:40 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2014-04-07 17:49:58 +0100 |
commit | b0170c4be0c2c3befcbe0159d4e218db5e0e37a8 (patch) | |
tree | 8f10f2a215fe1a6e7548e20ed535ce06339279a7 /perllib/FixMyStreet/DB/Result/Problem.pm | |
parent | 8f8d5e017e34a0b68a4b9c5c6958c827dcb6a172 (diff) |
Update old-style open311 script to use bodies.
Add some comments to the top of the open311 bin scripts.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index a06a339bf..7b5460c51 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -436,7 +436,7 @@ sub bodies_str_ids { =head2 bodies -Returns an arrayref of bodies to which a report was sent. +Returns a hashref of bodies to which a report was sent. =cut @@ -678,13 +678,16 @@ sub local_coords { =head2 update_from_open311_service_request - $p->update_from_open311_service_request( $request, $council_details, $system_user ); + $p->update_from_open311_service_request( $request, $body, $system_user ); -Updates the problem based on information in the passed in open311 request. If the request -has an older update time than the problem's lastupdate time then nothing happens. +Updates the problem based on information in the passed in open311 request +(standard, not the extension that uses GetServiceRequestUpdates) . If the +request has an older update time than the problem's lastupdate time then +nothing happens. -Otherwise a comment will be created if there is status update text in the open311 request. -If the open311 request has a state of closed then the problem will be marked as fixed. +Otherwise a comment will be created if there is status update text in the +open311 request. If the open311 request has a state of closed then the problem +will be marked as fixed. NB: a comment will always be created if the problem is being marked as fixed. @@ -693,7 +696,7 @@ Fixed problems will not be re-opened by this method. =cut sub update_from_open311_service_request { - my ( $self, $request, $council_details, $system_user ) = @_; + my ( $self, $request, $body, $system_user ) = @_; my ( $updated, $status_notes ); @@ -716,11 +719,10 @@ sub update_from_open311_service_request { mark_fixed => 0, user => $system_user, anonymous => 0, - name => $council_details->{name}, + name => $body->name, } ); - my $w3c = DateTime::Format::W3CDTF->new; my $req_time = $w3c->parse_datetime( $request->{updated_datetime} ); |