renames costlog details to index

pull/6827/head
Jens Ulferts 12 years ago
parent d7ea268fe0
commit e48a1b8dec
  1. 13
      app/controllers/costlog_controller.rb
  2. 4
      app/views/cost_objects/_show_variable_cost_object.html.erb
  3. 0
      app/views/costlog/index.html.erb
  4. 2
      lib/open_project/costs/patches/issues_helper_patch.rb

@ -10,14 +10,17 @@ class CostlogController < ApplicationController
before_filter :find_associated_objects, :only => [:create,
:update]
before_filter :find_optional_project, :only => [:report,
:details]
:index]
helper :sort
include SortHelper
helper :issues
include CostlogHelper
def details
def index
# this looks like it should be moved to openproject_reporting
# as it redirects to the CostReportsController and uses CostQuery.
# both are defined in openproject_reporting
unless @project.nil?
filters = {:operators => {}, :values => {}}
@ -132,7 +135,7 @@ class CostlogController < ApplicationController
elsif @cost_entry.save
flash[:notice] = l(:notice_successful_create)
redirect_back_or_default :action => 'details', :project_id => @cost_entry.project
redirect_back_or_default :action => 'index', :project_id => @cost_entry.project
else
render :action => 'edit'
@ -149,7 +152,7 @@ class CostlogController < ApplicationController
elsif @cost_entry.save
flash[:notice] = l(:notice_successful_update)
redirect_back_or_default :action => 'details', :project_id => @cost_entry.project
redirect_back_or_default :action => 'index', :project_id => @cost_entry.project
else
render :action => 'edit'
@ -169,7 +172,7 @@ class CostlogController < ApplicationController
redirect_to :back
end
rescue ::ActionController::RedirectBackError
redirect_to :action => 'details', :project_id => @cost_entry.project
redirect_to :action => 'index', :project_id => @cost_entry.project
end
def get_cost_type_unit_plural

@ -51,7 +51,7 @@
%>
<tr>
<td class="subject"><%= link_to_issue issue %></td>
<td><%= link_to pluralize(c.units, c.cost_type.unit, c.cost_type.unit_plural), {:controller => "costlog", :action => "details", :cost_type_id => c.cost_type, :issue_id => issue} %></td>
<td><%= link_to pluralize(c.units, c.cost_type.unit, c.cost_type.unit_plural), {:controller => "costlog", :action => "index", :cost_type_id => c.cost_type, :issue_id => issue} %></td>
<td><%= c.cost_type %></td>
<td class="currency"><%= c.costs_visible_by?(User.current) ? number_to_currency(c.real_costs) : "" %></td>
</tr>
@ -127,7 +127,7 @@
%>
<tr>
<td class="subject"><%= link_to_issue issue %></td>
<td class="hours"><%= link_to "#{t.hours}h", {:controller => "timelog", :action => "details", :issue_id => issue} %></td>
<td class="hours"><%= link_to "#{t.hours}h", {:controller => "timelog", :action => "index", :issue_id => issue} %></td>
<td><%=h t.user.name %></td>
<td class="currency"><%= number_to_currency(t.real_costs) %></td>
</tr>

@ -29,7 +29,7 @@ module OpenProject::Costs::Patches::IssuesHelperPatch
txt = pluralize(v[:units], v[:unit], v[:unit_plural])
if create_link
str_array << link_to(txt, { :controller => 'costlog',
:action => 'details',
:action => 'index',
:project_id => @issue.project,
:issue_id => @issue,
:cost_type_id => k },

Loading…
Cancel
Save