Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed request.method checking from 'change_status' method and

request method name passing from action links i.e. Exception Reopen,
Close and Ignore.
  • Loading branch information...
commit 7cf4fff9197d8d057d92f2d600bb62bbaabdaf48 1 parent f1bcac8
@hokam hokam authored Nikunj Limbaseeya committed
View
51 src/admin_panel/app/controllers/exceptions_controller.rb
@@ -104,36 +104,35 @@ def list_statuswise_exceptions
#Method is used to update the status for selected exceptions.
def change_status
- if request.method == :put
- @application_name = params[:app_name]
- app_id = App.get_application_data(@application_name).id
- if params[:exception_ids] and params[:status_name]
- params[:exception_ids].collect! do |e|
- e.to_i
- end
- case params[:status_name].downcase
- when 'delete'
-
- when 'ignore'
- AppException.update_all_status_to(IGNORED_EXCEPTION, params[:exception_ids])
- when 'close'
- AppException.update_all_status_to(CLOSED_EXCEPTION, params[:exception_ids])
- when 'open'
- AppException.update_all_status_to(OPEN_EXCEPTION, params[:exception_ids])
- end
- end
- status = get_status_const(params[:current_status])
- session[:per_page] = 5 if not session[:per_page]
- @exceptions = AppException.get_all(status, app_id, params[:page],session[:per_page])
- if @exceptions.out_of_bounds? and (page = params[:page].to_i - 1) > 0
- @exceptions = AppException.get_all(status, app_id, page,session[:per_page])
+
+ @application_name = params[:app_name]
+ app_id = App.get_application_data(@application_name).id
+ if params[:exception_ids] and params[:status_name]
+ params[:exception_ids].collect! do |e|
+ e.to_i
end
- render :update do |page|
- page.replace_html 'data_div', :partial => 'exception_list_partial', :locals => { :current_status => status, :status_name => params[:current_status]}
+ case params[:status_name].downcase
+ when 'delete'
+
+ when 'ignore'
+ AppException.update_all_status_to(IGNORED_EXCEPTION, params[:exception_ids])
+ when 'close'
+ AppException.update_all_status_to(CLOSED_EXCEPTION, params[:exception_ids])
+ when 'open'
+ AppException.update_all_status_to(OPEN_EXCEPTION, params[:exception_ids])
end
end
+ status = get_status_const(params[:current_status])
+ session[:per_page] = 5 if not session[:per_page]
+ @exceptions = AppException.get_all(status, app_id, params[:page],session[:per_page])
+ if @exceptions.out_of_bounds? and (page = params[:page].to_i - 1) > 0
+ @exceptions = AppException.get_all(status, app_id, page,session[:per_page])
+ end
+ render :update do |page|
+ page.replace_html 'data_div', :partial => 'exception_list_partial', :locals => { :current_status => status, :status_name => params[:current_status]}
+ end
end
-
+
# This method is used to render the add_application_class_form partial with all the exception classes
# stored in configuration file, with respect to the selected application
def save_exception_class_form
View
8 src/admin_panel/app/views/exceptions/_exception_list_partial.html.erb
@@ -56,18 +56,18 @@
<td colspan = 6>
<b>Take Action:</b>
<% unless current_status == OPEN_EXCEPTION %>
- <b><%=link_to_remote 'Reopen', :condition => "checkMarked('Reopen')", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "open", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list', :method => :put %></b>
+ <b><%=link_to_remote 'Reopen', :condition => "checkMarked('Reopen')", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "open", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list' %></b>
<% end %>
<% unless current_status == CLOSED_EXCEPTION %>
- <b><%=link_to_remote 'Close', :condition => "checkMarked('Close')", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "close", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list', :method => :put %></b>
+ <b><%=link_to_remote 'Close', :condition => "checkMarked('Close')", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "close", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list' %></b>
<% end %>
<% unless current_status == IGNORED_EXCEPTION %>
- <b><%=link_to_remote 'Ignore', :condition => "checkMarked('Ignore')", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "ignore", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list', :method => :put %></b>
+ <b><%=link_to_remote 'Ignore', :condition => "checkMarked('Ignore')", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "ignore", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list' %></b>
<% end %>
<span style='margin-left:21%;'>
( <%= @exceptions.offset + 1 %> to <%= @exceptions.size + @exceptions.offset %> of <%= @exceptions.total_entries %> )
</span>
- <%#=link_to_remote 'Delete', :condition => "checkMarked('delete')", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "delete", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list', :method => :put %>
+ <%#=link_to_remote 'Delete', :condition => "checkMarked('delete')", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "delete", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list' %>
</td>
</tr>
<% if will_paginate @exceptions %>
Please sign in to comment.
Something went wrong with that request. Please try again.