diff options
-rw-r--r-- | app/controllers/request_controller.rb | 24 | ||||
-rw-r--r-- | app/models/info_request.rb | 19 | ||||
-rw-r--r-- | app/models/info_request_event.rb | 3 | ||||
-rw-r--r-- | app/views/admin_request/edit.rhtml | 1 | ||||
-rw-r--r-- | app/views/general/search.rhtml | 3 | ||||
-rw-r--r-- | app/views/request/_describe_state.rhtml | 3 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 2 | ||||
-rw-r--r-- | todo.txt | 21 |
8 files changed, 40 insertions, 36 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 43a4e53c0..677633588 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: request_controller.rb,v 1.66 2008-03-15 04:44:37 francis Exp $ +# $Id: request_controller.rb,v 1.67 2008-03-16 23:32:10 francis Exp $ class RequestController < ApplicationController @@ -100,7 +100,7 @@ class RequestController < ApplicationController # XXX send_message needs the database id, so we send after saving, which isn't ideal if the request broke here. @outgoing_message.send_message flash[:notice] = "Your Freedom of Information request has been created and sent on its way!" - redirect_to show_request_url(:url_title => @info_request.url_title) + redirect_to request_url(@info_request) else # do nothing - as "authenticated?" has done the redirect to signin page for us end @@ -115,7 +115,7 @@ class RequestController < ApplicationController if !params[:submitted_describe_state].nil? flash[:notice] = "The status of this request was made up to date elsewhere while you were filling in the form." end - redirect_to show_request_url(:url_title => @info_request.url_title) + redirect_to request_url(@info_request) return end @@ -128,7 +128,7 @@ class RequestController < ApplicationController if @last_info_request_event_id.nil? flash[:notice] = "Internal error - awaiting description, but no event to describe" - redirect_to show_request_url(:url_title => @info_request.url_title) + redirect_to request_url(@info_request) return end @@ -160,10 +160,14 @@ class RequestController < ApplicationController # Display appropriate next page (e.g. help for complaint etc.) if @info_request.calculate_status == 'waiting_response' flash[:notice] = "<p>Thank you! Hopefully your wait isn't too long.</p> <p>By law, you should get a response before the end of <strong>" + simple_date(@info_request.date_response_required_by) + "</strong>.</p>" - redirect_to show_request_url(:url_title => @info_request.url_title) + redirect_to request_url(@info_request) elsif @info_request.calculate_status == 'waiting_response_overdue' flash[:notice] = "<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response before the end of <strong>" + simple_date(@info_request.date_response_required_by) + "</strong>.</p>" - redirect_to show_request_url(:url_title => @info_request.url_title) + redirect_to request_url(@info_request) + elsif @info_request.calculate_status == 'not_held' + flash[:notice] = "Thank you! You may want to send your request to another public authority. To do so, first copy the text of your request below, then <a href=\"/new\">cick here</a> and find the other authority." + # XXX offer fancier option to duplicate request? + redirect_to request_url(@info_request) elsif @info_request.calculate_status == 'rejected' # XXX explain how to complain flash[:notice] = "Oh no! Sorry to hear that your request was rejected. Here is what to do now." @@ -171,17 +175,17 @@ class RequestController < ApplicationController elsif @info_request.calculate_status == 'successful' flash[:notice] = "We're glad you got all the information that you wanted. Thank you for using WhatDoTheyKnow." # XXX quiz them here for a comment - redirect_to show_request_url(:url_title => @info_request.url_title) + redirect_to request_url(@info_request) elsif @info_request.calculate_status == 'partially_successful' flash[:notice] = "We're glad you got some of the information that you wanted." # XXX explain how to complain / quiz them for a comment - redirect_to show_request_url(:url_title => @info_request.url_title) + redirect_to request_url(@info_request) elsif @info_request.calculate_status == 'waiting_clarification' flash[:notice] = "Please write your follow up message containing the necessary clarifications below." redirect_to show_response_url(:id => @info_request.id, :incoming_message_id => @events_needing_description[-1].params[:incoming_message_id]) elsif @info_request.calculate_status == 'requires_admin' flash[:notice] = "Thanks! The WhatDoTheyKnow team have been notified." - redirect_to show_request_url(:url_title => @info_request.url_title) + redirect_to request_url(@info_request) else raise "unknown calculate_status " + @info_request.calculate_status end @@ -233,7 +237,7 @@ class RequestController < ApplicationController @outgoing_message.send_message @outgoing_message.save! flash[:notice] = "Your follow up message has been created and sent on its way." - redirect_to show_request_url(:url_title => @info_request.url_title) + redirect_to request_url(@info_request) else # do nothing - as "authenticated?" has done the redirect to signin page for us end diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 4d1d577dc..0f3fa4e39 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -22,7 +22,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request.rb,v 1.66 2008-03-15 04:19:04 francis Exp $ +# $Id: info_request.rb,v 1.67 2008-03-16 23:32:11 francis Exp $ require 'digest/sha1' @@ -45,6 +45,7 @@ class InfoRequest < ActiveRecord::Base validates_inclusion_of :described_state, :in => [ 'waiting_response', 'waiting_clarification', + 'not_held', 'rejected', 'successful', 'partially_successful', @@ -243,14 +244,10 @@ public end end - # Work out what the situation of the request is + # Work out what the situation of the request is In addition to values of + # self.described_state, can take these two values: # waiting_classification - # waiting_response - # waiting_response_overdue # XXX calculated, should be cached for display? - # waiting_clarification - # rejected - # successful - # partially_successful + # waiting_response_overdue def calculate_status if self.awaiting_description return 'waiting_classification' @@ -450,10 +447,12 @@ public "Awaiting response." elsif status == 'waiting_response_overdue' "Response overdue." - elsif status == 'partially_successful' - "Partially successful." + elsif status == 'not_held' + "Information not held." elsif status == 'rejected' "Rejected." + elsif status == 'partially_successful' + "Partially successful." elsif status == 'successful' "Successful." elsif status == 'waiting_clarification' diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index e8d6098ee..4e55aa0be 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -16,7 +16,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request_event.rb,v 1.20 2008-03-12 16:07:13 francis Exp $ +# $Id: info_request_event.rb,v 1.21 2008-03-16 23:32:11 francis Exp $ class InfoRequestEvent < ActiveRecord::Base belongs_to :info_request @@ -38,6 +38,7 @@ class InfoRequestEvent < ActiveRecord::Base nil, 'waiting_response', 'waiting_clarification', + 'not_held', 'rejected', 'successful', 'partially_successful', diff --git a/app/views/admin_request/edit.rhtml b/app/views/admin_request/edit.rhtml index 46ab70ca0..c343c2c49 100644 --- a/app/views/admin_request/edit.rhtml +++ b/app/views/admin_request/edit.rhtml @@ -19,6 +19,7 @@ [ 'waiting_response', 'waiting_clarification', + 'not_held', 'rejected', 'successful', 'partially_successful', diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index e91aef2e5..e41294a1f 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -57,9 +57,10 @@ <table> <tr><td>status:waiting_response</td><td> Waiting for the public body to reply </td></tr> <tr><td>status:waiting_response_overdue</td><td> Waiting for the public body to reply, they are late </td></tr> + <tr><td>status:not_held</td><td> The public body does not have the information requested </td></tr> + <tr><td>status:rejected</td><td> The request was rejected by the public body </td></tr> <tr><td>status:partially_successful</td><td> Some of the information requested has been received </td></tr> <tr><td>status:successful</td><td> All of the information requested has been received </td></tr> - <tr><td>status:rejected</td><td> The request was rejected by the public body </td></tr> <tr><td>status:waiting_clarification</td><td> The public body would like part of the request explained </td></tr> <tr><td>status:waiting_classification</td><td> A new response has arrived, but it hasn't been categorised yet </td></tr> <tr><td>status:requires_admin</td><td> A strange reponse, required attention by the WhatDoTheyKnow team </td></tr> diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml index 5f2ec98dd..1dd789998 100644 --- a/app/views/request/_describe_state.rhtml +++ b/app/views/request/_describe_state.rhtml @@ -8,6 +8,9 @@ <%= radio_button "incoming_message", "described_state", "waiting_clarification" %> <label for="incoming_message_described_state_waiting_clarification">I'm about to <strong>clarify</strong> my request</label> <br> + <%= radio_button "incoming_message", "described_state", "not_held" %> + <label for="incoming_message_described_state_not_held">The authority <strong>does not have</strong> the information (perhaps they suggest making the request elsewhere)</label> + <br> <%= radio_button "incoming_message", "described_state", "rejected" %> <label for="incoming_message_described_state_rejected">My request has been <strong>rejected</strong></label> <br> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index 6f13430b8..9627d5d29 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -34,6 +34,8 @@ public_body_link(@info_request.public_body) %>. The <%= link_to "response was due", about_url + "#quickly_response" %></li> on <strong><%= simple_date(@info_request.date_response_required_by) %></strong>. + <% elsif @status == 'not_held' %> + <%= public_body_link(@info_request.public_body) %> <strong>did not have</strong> the information requested. <% elsif @status == 'rejected' %> The request was <strong>rejected</strong> by <%= public_body_link(@info_request.public_body) %>. <% elsif @status == 'successful' %> @@ -1,28 +1,16 @@ -Contact: - Check user contact messages look nice on live site (think about subject?) - - Search: Gah - test to see if it queries solr when new message arrives Search for successful requests now has bogus date order :( Doesn't fit in -with paradigm of request / incoming message being separate objects. + with paradigm of request / incoming message being separate objects. Perhaps we should be indexing events + or maybe index success/failure by type known for message? Search by tags on public bodies Check cron jobs are running -Send mail re university requests - http://www.whatdotheyknow.com/user/jennifer_jones#user-55 - Mention duty to provide assistance: - http://opsi.gov.uk/acts/acts2000/ukpga_20000036_en_2#pt1-pb1-l1g16 - http://www.caat.org.uk/campaigns/clean-investment/universities/ - -This search gives a runtime error: - "19 hours - FOI requests to use to test it ============================== @@ -73,9 +61,14 @@ Send email to remind people to classify Send email to tell admins something isn't classified Send email to remind people to clarify +Now of course when ids go into requests/users for new ones it just adds an _ on end which is crap! + Later ===== +This search gives a runtime error: + "19 hours + Search date ranges http://lucene.apache.org/java/docs/queryparsersyntax.html (at Louise's mail) Preview when sending followups - especially people need to see quoting/subject |