From 6b4e84909554224ea30f901146610d452d612a55 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Thu, 24 May 2012 09:35:15 +0100 Subject: First stab at new feature. Adds new box in sidebar for reporting an issue, a new "needs admin attention"-type state to InfoRequests, a flag indicating that a request has ever been marked as needing admin attention, and a controller method and route for setting this state & flag. Also adds the reason something needs admin attention to the subject of the email that gets sent to administrators. Neeeds tests. --- app/models/info_request.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 1e55f92ae..4a70e365d 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -88,7 +88,8 @@ class InfoRequest < ActiveRecord::Base 'internal_review', 'error_message', 'requires_admin', - 'user_withdrawn' + 'user_withdrawn', + 'attention_requested' ] if @@custom_states_loaded states += InfoRequest.theme_extra_states @@ -503,7 +504,7 @@ public # states which require administrator action (hence email administrators # when they are entered, and offer state change dialog to them) def InfoRequest.requires_admin_states - return ['requires_admin', 'error_message'] + return ['requires_admin', 'error_message', 'attention_requested'] end def requires_admin? @@ -511,6 +512,9 @@ public return false end + def can_have_attention_requested? + end + # change status, including for last event for later historical purposes def set_described_state(new_state) ActiveRecord::Base.transaction do @@ -803,6 +807,8 @@ public _("Delivery error") elsif status == 'requires_admin' _("Unusual response.") + elsif status == 'attention_requested' + _("Reported for administrator attention.") elsif status == 'user_withdrawn' _("Withdrawn by the requester.") else -- cgit v1.2.3 From 211d62c99dc70a2c259a2d00485f6f15c353ab2f Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Thu, 24 May 2012 10:14:05 +0100 Subject: Re-annotate models --- app/models/info_request.rb | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 4a70e365d..a6e108970 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1,24 +1,3 @@ -# == Schema Information -# Schema version: 108 -# -# Table name: info_requests -# -# id :integer not null, primary key -# title :text not null -# user_id :integer not null -# public_body_id :integer not null -# created_at :datetime not null -# updated_at :datetime not null -# described_state :string(255) not null -# awaiting_description :boolean default(FALSE), not null -# prominence :string(255) default("normal"), not null -# url_title :text not null -# law_used :string(255) default("foi"), not null -# allow_new_responses_from :string(255) default("anybody"), not null -# handle_rejected_responses :string(255) default("bounce"), not null -# idhash :string(255) not null -# - require 'digest/sha1' @@ -1072,3 +1051,25 @@ public end end end + +# == Schema Information +# +# Table name: info_requests +# +# id :integer not null, primary key +# title :text not null +# user_id :integer not null +# public_body_id :integer not null +# created_at :datetime not null +# updated_at :datetime not null +# described_state :string(255) not null +# awaiting_description :boolean default(FALSE), not null +# prominence :string(255) default("normal"), not null +# url_title :text not null +# law_used :string(255) default("foi"), not null +# allow_new_responses_from :string(255) default("anybody"), not null +# handle_rejected_responses :string(255) default("bounce"), not null +# idhash :string(255) not null +# attention_requested :boolean default(FALSE) +# + -- cgit v1.2.3 From b89fe3a3b65cad4d6cf0c044b2569e0ea8e8e163 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Thu, 24 May 2012 11:32:49 +0100 Subject: Further annotation corrections --- app/models/info_request.rb | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index a6e108970..47398dabb 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1,3 +1,25 @@ +# == Schema Information +# Schema version: 114 +# +# Table name: info_requests +# +# id :integer not null, primary key +# title :text not null +# user_id :integer not null +# public_body_id :integer not null +# created_at :datetime not null +# updated_at :datetime not null +# described_state :string(255) not null +# awaiting_description :boolean default(FALSE), not null +# prominence :string(255) default("normal"), not null +# url_title :text not null +# law_used :string(255) default("foi"), not null +# allow_new_responses_from :string(255) default("anybody"), not null +# handle_rejected_responses :string(255) default("bounce"), not null +# idhash :string(255) not null +# attention_requested :boolean default(FALSE) +# + require 'digest/sha1' @@ -1052,24 +1074,3 @@ public end end -# == Schema Information -# -# Table name: info_requests -# -# id :integer not null, primary key -# title :text not null -# user_id :integer not null -# public_body_id :integer not null -# created_at :datetime not null -# updated_at :datetime not null -# described_state :string(255) not null -# awaiting_description :boolean default(FALSE), not null -# prominence :string(255) default("normal"), not null -# url_title :text not null -# law_used :string(255) default("foi"), not null -# allow_new_responses_from :string(255) default("anybody"), not null -# handle_rejected_responses :string(255) default("bounce"), not null -# idhash :string(255) not null -# attention_requested :boolean default(FALSE) -# - -- cgit v1.2.3