aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-06-04 00:05:46 +0100
committerRobin Houston <robin.houston@gmail.com>2012-06-04 00:05:46 +0100
commit4ec7f6edbf2c00abc8464eafc889047f43533f90 (patch)
treeb9b8c249019e9eca4864b258e3535ff25647823b
parent509f9c70cc0fd2e3fea0886416ab811391c53174 (diff)
Log an event when a request is hidden
-rw-r--r--app/controllers/admin_request_controller.rb10
-rw-r--r--app/models/info_request_event.rb1
-rw-r--r--app/views/admin_general/timeline.rhtml2
3 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index 4821a14e2..fd1405319 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -343,8 +343,16 @@ class AdminRequestController < AdminController
subject = params[:subject]
explanation = params[:explanation]
info_request = InfoRequest.find(params[:id])
- info_request.set_described_state(params[:reason])
info_request.prominence = "requester_only"
+
+ info_request.log_event("hide", {
+ :editor => admin_http_auth_user(),
+ :reason => params[:reason],
+ :subject => subject,
+ :explanation => explanation
+ })
+
+ info_request.set_described_state(params[:reason])
info_request.save!
ContactMailer.deliver_from_admin_message(
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index a410328b0..9a4f6d9fe 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -51,6 +51,7 @@ class InfoRequestEvent < ActiveRecord::Base
'destroy_outgoing', # deleted an outgoing message (in admin interface)
'redeliver_incoming', # redelivered an incoming message elsewhere (in admin interface)
'move_request', # changed user or public body (in admin interface)
+ 'hide', # hid a request (in admin interface)
'manual', # you did something in the db by hand
'response',
diff --git a/app/views/admin_general/timeline.rhtml b/app/views/admin_general/timeline.rhtml
index 39a4b3e36..eecab4823 100644
--- a/app/views/admin_general/timeline.rhtml
+++ b/app/views/admin_general/timeline.rhtml
@@ -65,6 +65,8 @@
had incoming message deleted by administrator <strong><%=h event.params[:editor] %></strong>.
<% elsif event.event_type == 'destroy_outgoing' %>
had outgoing message deleted by administrator <strong><%=h event.params[:editor] %></strong>.
+ <% elsif event.event_type == 'hide' %>
+ was hidden by administrator <strong><%=h event.params[:editor] %></strong>.
<% elsif event.event_type == 'redeliver_outgoing' %>
had incoming message redelivered to another request by administrator <strong><%=h event.params[:editor] %></strong>.
<% elsif event.event_type == 'response' %>