diff options
-rw-r--r-- | app/controllers/admin_request_controller.rb | 18 | ||||
-rw-r--r-- | app/views/admin_request/edit_outgoing.rhtml | 7 | ||||
-rw-r--r-- | todo.txt | 4 |
3 files changed, 18 insertions, 11 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index a6146fc9c..3b69ff8ed 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.4 2008-02-06 12:20:37 francis Exp $ +# $Id: admin_request_controller.rb,v 1.5 2008-02-14 07:45:08 francis Exp $ class AdminRequestController < ApplicationController layout "admin" @@ -31,15 +31,23 @@ class AdminRequestController < ApplicationController def edit_outgoing @outgoing_message = OutgoingMessage.find(params[:id]) + @info_request = @outgoing_message.info_request end def update_outgoing @outgoing_message = OutgoingMessage.find(params[:id]) + @info_request = @outgoing_message.info_request + old_body = @outgoing_message.body - if @outgoing_message.update_attributes(params[:outgoing_message]) - @outgoing_message.info_request.log_event("edit_outgoing", { :outgoing_message_id => @outgoing_message.id, :editor => admin_http_auth_user(), :old_body => old_body, :body => @outgoing_message.body }) - flash[:notice] = 'OutgoingMessage was successfully updated.' - redirect_to request_admin_url(@outgoing_message.info_request) + old_title = @info_request.title + + if @outgoing_message.update_attributes(params[:outgoing_message]) and @info_request.update_attributes(params[:info_request]) + @outgoing_message.info_request.log_event("edit_outgoing", + { :outgoing_message_id => @outgoing_message.id, :editor => admin_http_auth_user(), + :old_title => old_title, :title => @info_request.title, + :old_body => old_body, :body => @outgoing_message.body }) + flash[:notice] = 'Request successfully updated.' + redirect_to request_admin_url(@info_request) else render :action => 'edit_outgoing' end diff --git a/app/views/admin_request/edit_outgoing.rhtml b/app/views/admin_request/edit_outgoing.rhtml index cbeff25f8..3f59fad1f 100644 --- a/app/views/admin_request/edit_outgoing.rhtml +++ b/app/views/admin_request/edit_outgoing.rhtml @@ -4,8 +4,11 @@ <% form_tag '../update_outgoing/' + @outgoing_message.id.to_s do %> - <p><label for="outgoing_message_body">Body of message</label><br/> - <%= text_area 'outgoing_message', 'body', :rows => 10, :cols => 60 %></p> + <p><label for="info_request_title">Title</label><br/> + <%= text_field 'info_request', 'title', :size => 50 %></p> + + <p><label for="outgoing_message_body">Body of message</label><br/> + <%= text_area 'outgoing_message', 'body', :rows => 10, :cols => 60 %></p> <p><strong>Note:</strong> This is mainly to be used to excise information that users inadvertently put in their messages, not realising it would be @@ -14,10 +14,6 @@ BAILII - relationship with law courts, robots.txt ? Status of messages stuff ======================== -On request received /describe page the formatting of the dialogues asking for -state change is broken now. - - Use sent again date when there has been resent?, e.g. for http://foi.mysociety.org/request/16 Make date estimate use follow up time etc. |