aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-10-03 17:09:05 +0000
committerfrancis <francis>2008-10-03 17:09:05 +0000
commit0d6f3ecd0f117c6df12ad814970cf9db6cbdeea5 (patch)
tree9f00a1c7a7dea25b7d5631d6aaa965ad1239b764
parent7b0a69b450b31f5ad5a45c9c637c641f04e1cac4 (diff)
State of a request when response is to be by post.
-rw-r--r--app/controllers/request_controller.rb20
-rw-r--r--app/helpers/link_to_helper.rb13
-rw-r--r--app/models/info_request.rb5
-rw-r--r--app/models/info_request_event.rb5
-rw-r--r--app/models/request_mailer.rb10
-rw-r--r--app/views/admin_request/edit.rhtml1
-rw-r--r--app/views/general/search.rhtml1
-rw-r--r--app/views/help/contact.rhtml5
-rw-r--r--app/views/request/_describe_state.rhtml4
-rw-r--r--app/views/request/show.rhtml2
-rw-r--r--app/views/request/show_response.rhtml37
-rw-r--r--public/stylesheets/main.css4
-rw-r--r--todo.txt8
13 files changed, 98 insertions, 17 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index ee64a1efc..bb3bd8b85 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.116 2008-10-02 13:37:21 francis Exp $
+# $Id: request_controller.rb,v 1.117 2008-10-03 17:09:05 francis Exp $
class RequestController < ApplicationController
@@ -267,6 +267,8 @@ class RequestController < ApplicationController
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 == 'gone_postal'
+ redirect_to respond_to_last_url(@info_request) + "?gone_postal=1"
elsif @info_request.calculate_status == 'requires_admin'
flash[:notice] = "Thanks! The WhatDoTheyKnow team have been notified. <a href=\"/help/contact\">Contact us</a> if you have more to say about how we should handle this."
redirect_to request_url(@info_request)
@@ -304,6 +306,22 @@ class RequestController < ApplicationController
@info_request = InfoRequest.find(params[:id].to_i)
@collapse_quotes = params[:unfold] ? false : true
@is_owning_user = !authenticated_user.nil? && (authenticated_user.id == @info_request.user_id || authenticated_user.owns_every_request?)
+ @gone_postal = params[:gone_postal] ? true : false
+ if !@is_owning_user
+ @gone_postal = false
+ end
+
+ if @gone_postal
+ who_can_followup_to = @info_request.who_can_followup_to
+ if who_can_followup_to.size == 0
+ @postal_email = @info_request.request_email
+ @postal_email_name = @info_request.name
+ else
+ @postal_email = who_can_followup_to[-1][1]
+ @postal_email_name = who_can_followup_to[-1][0]
+ end
+ end
+
params_outgoing_message = params[:outgoing_message]
if params_outgoing_message.nil?
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 4c0516171..e8be14162 100644
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -5,7 +5,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: link_to_helper.rb,v 1.43 2008-09-24 19:25:50 francis Exp $
+# $Id: link_to_helper.rb,v 1.44 2008-10-03 17:09:06 francis Exp $
module LinkToHelper
@@ -38,6 +38,17 @@ module LinkToHelper
def comment_url(comment)
return request_url(comment.info_request)+"#comment-"+comment.id.to_s
end
+
+ # Respond to request
+ def respond_to_last_url(info_request)
+ last_response = info_request.get_last_response
+ if last_response.nil?
+ respond_url = show_response_no_followup_url(:id => info_request.id)
+ else
+ respond_url = show_response_url(:id => info_request.id, :incoming_message_id => last_response.id)
+ end
+ return respond_url
+ end
# Public bodies
def public_body_url(public_body)
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index e9f76f445..b1d411113 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -23,7 +23,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.144 2008-10-02 23:11:40 francis Exp $
+# $Id: info_request.rb,v 1.145 2008-10-03 17:09:06 francis Exp $
require 'digest/sha1'
require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian')
@@ -49,6 +49,7 @@ class InfoRequest < ActiveRecord::Base
validates_inclusion_of :described_state, :in => [
'waiting_response',
'waiting_clarification',
+ 'gone_postal',
'not_held',
'rejected',
'successful',
@@ -629,6 +630,8 @@ public
"Successful."
elsif status == 'waiting_clarification'
"Waiting clarification."
+ elsif status == 'gone_postal'
+ "Handled by post."
elsif status == 'requires_admin'
"Unusual response."
else
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index 0b6e126a9..37a968770 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -21,7 +21,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.62 2008-10-02 23:11:40 francis Exp $
+# $Id: info_request_event.rb,v 1.63 2008-10-03 17:09:06 francis Exp $
class InfoRequestEvent < ActiveRecord::Base
belongs_to :info_request
@@ -55,6 +55,7 @@ class InfoRequestEvent < ActiveRecord::Base
nil,
'waiting_response',
'waiting_clarification',
+ 'gone_postal',
'not_held',
'rejected',
'successful',
@@ -200,6 +201,8 @@ class InfoRequestEvent < ActiveRecord::Base
"Acknowledgement"
elsif status == 'waiting_clarification'
"Clarification required"
+ elsif status == 'gone_postal'
+ "Handled by post"
elsif status == 'not_held'
"Information not held"
elsif status == 'rejected'
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index 4f3e34806..dfe8d9830 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.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_mailer.rb,v 1.59 2008-09-25 12:23:01 francis Exp $
+# $Id: request_mailer.rb,v 1.60 2008-10-03 17:09:06 francis Exp $
class RequestMailer < ApplicationMailer
@@ -116,13 +116,7 @@ class RequestMailer < ApplicationMailer
# Tell the requester that the public body is late in replying
def overdue_alert(info_request, user)
- last_response = info_request.get_last_response
- if last_response.nil?
- respond_url = show_response_no_followup_url(:id => info_request.id)
- else
- respond_url = show_response_url(:id => info_request.id, :incoming_message_id => last_response.id)
- end
- respond_url = respond_url + "#followup"
+ respond_url = respond_to_last_url(info_request) + "#followup"
post_redirect = PostRedirect.new(
:uri => respond_url,
diff --git a/app/views/admin_request/edit.rhtml b/app/views/admin_request/edit.rhtml
index b6c84426d..b5f31e403 100644
--- a/app/views/admin_request/edit.rhtml
+++ b/app/views/admin_request/edit.rhtml
@@ -19,6 +19,7 @@
[
'waiting_response',
'waiting_clarification',
+ 'gone_postal',
'not_held',
'rejected',
'successful',
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml
index 53a931ffc..fba1a2a6b 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -127,6 +127,7 @@
<tr><td><strong>status:partially_successful</strong></td><td> Some of the information requested has been received </td></tr>
<tr><td><strong>status:successful</strong></td><td> All of the information requested has been received </td></tr>
<tr><td><strong>status:waiting_clarification</strong></td><td> The public authority would like part of the request explained </td></tr>
+ <tr><td><strong>status:gone_postal</strong></td><td> The public authority would like to / has responded by post </td></tr>
<tr><td><strong>status:requires_admin</strong></td><td> A strange reponse, required attention by the WhatDoTheyKnow team </td></tr>
</table>
<% end %>
diff --git a/app/views/help/contact.rhtml b/app/views/help/contact.rhtml
index 14b2740ac..c031fbc4b 100644
--- a/app/views/help/contact.rhtml
+++ b/app/views/help/contact.rhtml
@@ -53,6 +53,11 @@
<%= f.text_area :message, :rows => 10, :cols => 60 %>
</p>
+ <p class="form_note">
+ If you are referring to a specific request or authority, it would
+ be helpful if you could include a link to it in your message.
+ </p>
+
<div class="form_button">
<%= hidden_field_tag(:submitted_contact_form, 1) %>
<%= submit_tag "Send message to the WhatDoTheyKnow team" %>
diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml
index 0c29ca01c..2eea28bbd 100644
--- a/app/views/request/_describe_state.rhtml
+++ b/app/views/request/_describe_state.rhtml
@@ -10,6 +10,10 @@
<%= radio_button "incoming_message", "described_state", "waiting_clarification", :id => 'waiting_clarification' + id_suffix %>
<label for="waiting_clarification<%=id_suffix%>">I'm about to <strong>clarify</strong> my request</label>
</div>
+ <div>
+ <%= radio_button "incoming_message", "described_state", "gone_postal", :id => 'gone_postal' + id_suffix %>
+ <label for="gone_postal<%=id_suffix%>">They would like to / are going to reply <strong>by post</strong></label>
+ </div>
<hr>
<div>
<%= radio_button "incoming_message", "described_state", "not_held", :id => 'not_held' + id_suffix %>
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index 644330a21..d530631a7 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -92,6 +92,8 @@
<%= user_link(@info_request.user) %>, please
<%= link_to "sign in", signin_url(:r => request.request_uri) %> to send a follow up message.
<% end %>
+ <% elsif @status == 'gone_postal' %>
+ The authority would like to / has <strong>responded by post</strong> to this request.
<% elsif @status == 'requires_admin' %>
This request has had an unusual response, and <strong>requires attention</strong> from the WhatDoTheyKnow team.
<% else %>
diff --git a/app/views/request/show_response.rhtml b/app/views/request/show_response.rhtml
index 725ee5ba9..e8f99fc4e 100644
--- a/app/views/request/show_response.rhtml
+++ b/app/views/request/show_response.rhtml
@@ -8,6 +8,43 @@
<%= foi_error_messages_for :incoming_message, :outgoing_message %>
+<% if @gone_postal %>
+ <div class="gone_postal_help">
+ <h1>What exactly is happening?</h1>
+
+ <dl>
+
+ <dt>
+ The authority say that they <strong>need a postal
+ address</strong>, not just an email, for it to be a valid FOI request
+ </dt>
+ <dd>
+ The law, the Ministry of Justice and the Information Commissioner
+ all say that an email is sufficient (<a href="/help/about#full_address">more details</a>).
+ At the bottom of this page, write a reply to the authority explaining this to them.
+ </dd>
+
+ <dt>
+ The authority only has a <strong>paper copy</strong> of the information.
+ </dt>
+ <dd>
+ At the bottom of this page, write a reply to them trying to persuade them to scan it in
+ (<a href="/help/about#postal_answer">more details</a>).
+ </dd>
+
+ <dt>
+ You want to <strong>give your postal address</strong> to the authority in private.
+ </dt>
+ <dd>
+ To do that please send a private email to <%=h(@postal_email_name)%>
+ &lt;<%=link_to h(@postal_email), "mailto:" + @postal_email%>&gt;
+ containing your postal address, and asking them to reply to this request.
+ </dd>
+
+ </dl>
+ </div>
+<% end %>
+
<div id="show_response_view">
<% if @is_owning_user %>
<% if @incoming_message.nil? %>
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index 0ed76a0f1..aa78bfc15 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -582,7 +582,7 @@ div.pagination { text-align: center; padding-top: 0.3em;}
}
/*-------------------- Content : action notice */
-#notice, .describe_state_form, .undescribed_requests
+#notice, .describe_state_form, .undescribed_requests, .gone_postal_help
{
color: #16C132;
font-size: 1.4em;
@@ -593,7 +593,7 @@ div.pagination { text-align: center; padding-top: 0.3em;}
background-color: #D5FFD8;
padding: 0.5em;
}
-.describe_state_form, .undescribed_requests {
+.describe_state_form, .undescribed_requests, .gone_postal_help {
font-weight: normal;
margin-bottom: 1em;
font-size: 1.0em;
diff --git a/todo.txt b/todo.txt
index 3e7c432d0..c74440b28 100644
--- a/todo.txt
+++ b/todo.txt
@@ -3,6 +3,8 @@ Test data for Tony
Next
====
+Make "None of the above" box only apper when you select it.
+
Make it so signin link from being emailed that you have new response
goes to the # link on main page rather than the describe page that
needs login
@@ -14,6 +16,9 @@ Performance:
Upload Julian's large Cambridgeshire contract
+Respond to request (FOI officers only) ---> NAME_OF_AUTHORITY only
+Move "view raw email" further away from destroy message
+
Internal review status/marker?
http://www.whatdotheyknow.com/request/search_engine_advertising_bought
http://www.whatdotheyknow.com/request/communications_from_home_office
@@ -92,9 +97,6 @@ http://www.whatdotheyknow.com/list?page=2 - too many monitoring officer
favicon.ico would be nice
-Flag bad comments, delete comments from admin interface
- - perhaps via contact form, and form sending refering URL?
-
Protect from CSRF with this in app controller (care it doesn't break anything):
# See ActionController::RequestForgeryProtection for details
# Uncomment the :secret if you're not using the cookie session store