diff options
-rw-r--r-- | app/controllers/admin_request_controller.rb | 15 | ||||
-rw-r--r-- | app/models/info_request_event.rb | 3 | ||||
-rw-r--r-- | app/models/outgoing_message.rb | 13 | ||||
-rw-r--r-- | app/views/admin_general/timeline.rhtml | 4 | ||||
-rw-r--r-- | app/views/admin_request/edit_outgoing.rhtml | 9 | ||||
-rw-r--r-- | config/foimongreld.ugly | 2 | ||||
-rw-r--r-- | todo.txt | 16 |
7 files changed, 58 insertions, 4 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index df22f1341..d0bf9cd48 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.37 2009-06-30 14:28:25 francis Exp $ +# $Id: admin_request_controller.rb,v 1.38 2009-07-21 12:09:29 francis Exp $ class AdminRequestController < AdminController def index @@ -91,6 +91,19 @@ class AdminRequestController < AdminController @outgoing_message = OutgoingMessage.find(params[:id]) end + def destroy_outgoing + @outgoing_message = OutgoingMessage.find(params[:outgoing_message_id]) + @info_request = @outgoing_message.info_request + outgoing_message_id = @outgoing_message.id + + @outgoing_message.fully_destroy + @outgoing_message.info_request.log_event("destroy_outgoing", + { :editor => admin_http_auth_user(), :deleted_outgoing_message_id => outgoing_message_id }) + + flash[:notice] = 'Outgoing message successfully destroyed.' + redirect_to request_admin_url(@info_request) + end + def update_outgoing @outgoing_message = OutgoingMessage.find(params[:id]) diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 76f50c8d5..c2f515b6b 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.85 2009-07-03 11:43:37 francis Exp $ +# $Id: info_request_event.rb,v 1.86 2009-07-21 12:09:30 francis Exp $ class InfoRequestEvent < ActiveRecord::Base belongs_to :info_request @@ -44,6 +44,7 @@ class InfoRequestEvent < ActiveRecord::Base 'edit_outgoing', # outgoing message edited in admin interface 'edit_comment', # comment edited in admin interface 'destroy_incoming', # deleted an incoming message + 'destroy_outgoing', # deleted an outgoing message 'redeliver_incoming', # redelivered an incoming message elsewhere 'manual', # you did something in the db by hand 'response', diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 253bd000d..6d1900d64 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.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: outgoing_message.rb,v 1.86 2009-06-30 16:30:28 francis Exp $ +# $Id: outgoing_message.rb,v 1.87 2009-07-21 12:09:30 francis Exp $ class OutgoingMessage < ActiveRecord::Base strip_attributes! @@ -220,6 +220,17 @@ class OutgoingMessage < ActiveRecord::Base return text end + def fully_destroy + ActiveRecord::Base.transaction do + info_request_event = InfoRequestEvent.find_by_outgoing_message_id(self.id) + info_request_event.track_things_sent_emails.each { |a| a.destroy } + info_request_event.user_info_request_sent_alerts.each { |a| a.destroy } + info_request_event.destroy + self.destroy + end + end + + end diff --git a/app/views/admin_general/timeline.rhtml b/app/views/admin_general/timeline.rhtml index cadde541e..6cbe105b6 100644 --- a/app/views/admin_general/timeline.rhtml +++ b/app/views/admin_general/timeline.rhtml @@ -64,7 +64,9 @@ <% end %> <% elsif event.event_type == 'destroy_incoming' %> had incoming message deleted by administrator <strong><%=h event.params[:editor] %></strong>. - <% elsif event.event_type == 'redeliver_incoming' %> + <% elsif event.event_type == 'destroy_outgoing' %> + had outgoing message deleted 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' %> <% incoming_message = event.incoming_message %> diff --git a/app/views/admin_request/edit_outgoing.rhtml b/app/views/admin_request/edit_outgoing.rhtml index 01ba32227..ad78e82be 100644 --- a/app/views/admin_request/edit_outgoing.rhtml +++ b/app/views/admin_request/edit_outgoing.rhtml @@ -24,3 +24,12 @@ <%= link_to 'List all', '../list' %> </p> +<% form_tag '../destroy_outgoing' do %> + <div> + <%= hidden_field_tag 'outgoing_message_id', @outgoing_message.id %> + Warning, this is permanent! ---> + <%= submit_tag "Destroy outgoing message" %> + </div> +<% end %> + + diff --git a/config/foimongreld.ugly b/config/foimongreld.ugly index 2eb7aa5c4..6f27a0a7d 100644 --- a/config/foimongreld.ugly +++ b/config/foimongreld.ugly @@ -2,6 +2,8 @@ # # !!(*= $daemon_name *)!! Start the WhatDoTheyKnow web server daemon (mongrel) +# XXX remove this after a while - no longer used now we use Passenger + NAME=!!(*= $daemon_name *)!! RUNDIR=/data/vhost/!!(*= $vhost *)!!/mysociety/foi PIDDIR=/data/vhost/!!(*= $vhost *)!!/mysociety/foi/log @@ -1,6 +1,9 @@ Next (things that will reduce admin time mainly) ==== +Cache some common pages, such as "view requests": + http://www.whatdotheyknow.com/list/successful + Emails sent to stopped requests should follow RFC: http://tools.ietf.org/html/rfc3834 Shouldn't bounce message back to Auto-Submitted Should check from address being replied to is valid @@ -12,6 +15,8 @@ authorities can still have followups to existing requests. Add help about not adding extraneous or possibly libelous content to requests or followups. Explain how to write things to avoid libel law. +Perhaps use these house rules: + http://www.theyworkforyou.com/houserules/ Button for people to say "this status is really quite wrong please fix it"? @@ -68,11 +73,17 @@ and let people move them to the right place. Give authorities interface for editing their request email address and resend messages to them +Page cacheing - the cookie setting stops the expires_on caching working well, +as even when not logged in second page you go to isnt serverd from Squid cache. +Maybe change to fragment caching for things like the "view requests" page? +Then will help logged in users too. Later ===== +Test for duplicate followups, as we do requests. + For followups, have radio button to say is it a new request or followup Do by uncommenting the "new information" option when writing a followup, so that it makes a new request @@ -375,6 +386,11 @@ Quoting fixing TODO: http://www.whatdotheyknow.com/request/enforcement_forders_for_replacin#incoming-6277 # over zealous quoting http://www.whatdotheyknow.com/request/renewable_energy_consumption_by # over zealous + http://www.whatdotheyknow.com/request/can_my_mp_ask_questions_on_my_be#incoming-33112 # hyperlink broken + +Display pasted quotes in annotations better: +http://www.whatdotheyknow.com/request/scientology_incidents#comment-3352 + Totally new features -------------------- |