diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-24 09:35:15 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-24 09:35:15 +0100 |
commit | 6b4e84909554224ea30f901146610d452d612a55 (patch) | |
tree | 6583679645a14267fab10ebaa5a15b9011b27a43 /app/models/info_request.rb | |
parent | bd1dede2591fd9c4ebc54e5ef41232193f0a0f5b (diff) |
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.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 10 |
1 files changed, 8 insertions, 2 deletions
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 |