aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin_request_controller.rb17
-rw-r--r--app/views/admin_request/show.rhtml11
2 files changed, 27 insertions, 1 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index 33b04e7fe..153d5eb75 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_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: admin_request_controller.rb,v 1.30 2009-03-10 12:04:55 tony Exp $
+# $Id: admin_request_controller.rb,v 1.31 2009-04-02 11:25:43 francis Exp $
class AdminRequestController < AdminController
def index
@@ -244,6 +244,21 @@ class AdminRequestController < AdminController
render :text => @raw_email.data
end
+ # used so due dates get fixed
+ def mark_event_as_clarification
+ info_request_event = InfoRequestEvent.find(params[:info_request_event_id])
+ if info_request_event.event_type != 'response'
+ raise Exception("can only mark responses as requires clarification")
+ end
+ info_request_event.described_state = 'waiting_clarification'
+ info_request_event.calculated_state = 'waiting_clarification'
+ # XXX deliberately don't update described_at so doesn't reenter search?
+ info_request_event.save!
+
+ flash[:notice] = "Old response marked as having been a clarification"
+ redirect_to request_admin_url(info_request_event.info_request)
+ end
+
private
end
diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml
index ddab744e9..84d54b579 100644
--- a/app/views/admin_request/show.rhtml
+++ b/app/views/admin_request/show.rhtml
@@ -27,6 +27,7 @@
<% for column in InfoRequestEvent.content_columns %>
<th><%= column.human_name %></th>
<% end %>
+ <th>Actions</th>
</tr>
<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
@@ -43,6 +44,16 @@
<% end %>
</td>
<% end %>
+ <td>
+ <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
+ <% form_tag '../mark_event_as_clarification' do %>
+ <div>
+ <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
+ <%= submit_tag "Was clarification request" %>
+ </div>
+ <% end %>
+ <% end %>
+ </td>
</tr>
<% end %>
</table>