aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-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
11 files changed, 91 insertions, 12 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? %>