Merge branch 'master' into feature/widgets_merge

pull/6827/head
jwollert 13 years ago
commit a4e249bdc5
  1. 2
      README.rdoc
  2. 3
      app/controllers/costlog_controller.rb
  3. 6
      app/views/cost_reports/_list_items.rhtml
  4. 20
      config/routes.rb
  5. 2
      init.rb
  6. 1
      lib/costs_user_patch.rb
  7. 0
      lib/tasks/schema.rake
  8. 18
      tasks/gloc_to_i18n.rake

@ -1,6 +1,6 @@
= Cost Control Plugin
This plugin ads the ability to book costs and reports on them.
This plugin adds the ability to book costs and reports on them.
= Requirements

@ -5,8 +5,6 @@ class CostlogController < ApplicationController
before_filter :find_project, :authorize, :only => [:edit, :destroy]
before_filter :find_optional_project, :only => [:report, :details]
verify :method => :post, :only => :destroy, :redirect_to => { :action => :details }
helper :sort
include SortHelper
helper :issues
@ -139,6 +137,7 @@ class CostlogController < ApplicationController
end
end
verify :method => :delete, :only => :destroy, :render => {:nothing => true, :status => :method_not_allowed }
def destroy
render_404 and return unless @cost_entry
render_403 and return unless @cost_entry.editable_by?(User.current)

@ -16,7 +16,7 @@
<th></th>
</tr></thead>
<tbody>
<% @entries.each do |entry| %>
<% page_costs += entry.real_costs if entry.costs_visible_by?(User.current)%>
<tr class="<%= cycle('odd', 'even') %>">
@ -41,14 +41,14 @@
:title => l(:button_edit) %>
<%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry},
:confirm => l(:text_are_you_sure),
:method => :post,
:method => :delete,
:title => l(:button_delete) %>
<% else %>
<%= link_to image_tag('edit.png'), {:controller => 'costlog', :action => 'edit', :id => entry},
:title => l(:button_edit) %>
<%= link_to image_tag('delete.png'), {:controller => 'costlog', :action => 'destroy', :id => entry},
:confirm => l(:text_are_you_sure),
:method => :post,
:method => :delete,
:title => l(:button_delete) %>
<% end -%>
<% end -%>

@ -1,11 +1,11 @@
ActionController::Routing::Routes.draw do |map|
ActionController::Routing::Routes.draw do |map|
map.connect 'cost_entries/:id/edit', :action => 'edit', :controller => 'costlog'
map.connect 'projects/:project_id/cost_entries/new', :action => 'edit', :controller => 'costlog'
map.connect 'projects/:project_id/issues/:issue_id/cost_entries/new', :action => 'edit', :controller => 'costlog'
map.with_options :controller => 'costlog' do |costlog|
costlog.connect 'projects/:project_id/cost_entries', :action => 'details'
costlog.with_options :action => 'details', :conditions => {:method => :get} do |cost_details|
cost_details.connect 'cost_entries'
cost_details.connect 'cost_entries.:format'
@ -15,21 +15,21 @@ ActionController::Routing::Routes.draw do |map|
cost_details.connect 'projects/:project_id/issues/:issue_id/cost_entries'
cost_details.connect 'projects/:project_id/issues/:issue_id/cost_entries.:format'
end
costlog.with_options :action => 'edit', :conditions => {:method => :get} do |cost_edit|
cost_edit.connect 'issues/:issue_id/cost_entries/new'
end
costlog.connect 'cost_entries/:id/destroy', :action => 'destroy', :conditions => {:method => :post}
costlog.connect 'cost_entries/:id/', :action => 'destroy', :conditions => {:method => :delete}
end
map.with_options :controller => 'cost_objects' do |cost_objects|
cost_objects.with_options :conditions => {:method => :get} do |co_views|
co_views.connect 'cost_objects', :action => 'index'
co_views.connect 'cost_objects.:format', :action => 'index'
co_views.connect 'projects/:project_id/cost_objects', :action => 'index'
co_views.connect 'projects/:project_id/cost_objects.:format', :action => 'index'
co_views.connect 'projects/:project_id/cost_objects/new', :action => 'new'
co_views.connect 'projects/:project_id/cost_objects/:copy_from/copy', :action => 'new'
co_views.connect 'cost_objects/:id', :action => 'show', :id => /\d+/
@ -43,7 +43,7 @@ ActionController::Routing::Routes.draw do |map|
end
cost_objects.connect 'cost_objects/:action'
end
map.with_options :controller => 'hourly_rates' do |hourly_rates|
hourly_rates.with_options :conditions => {:method => :get} do |hr_views|
hr_views.connect 'users/:id/default_rates', :action => 'show', :id => /\d+/
@ -58,7 +58,7 @@ ActionController::Routing::Routes.draw do |map|
hr_actions.connect 'projects/:project_id/hourly_rates/:id/:action', :action => /edit/, :id => /\d+/
end
end
map.connect 'projects/:project_id/costlog/:action/:id', :controller => 'costlog', :project_id => /.+/
# map.connect 'projects/:project_id/hourly_rates/:action/:id', :controller => 'hourly_rates', :project_id => /.+/

@ -60,7 +60,7 @@ Redmine::Plugin.register :redmine_costs do
author 'Holger Just @ finnlabs'
author_url 'http://finn.de/team#h.just'
description 'The costs plugin provides basic cost management functionality for Redmine.'
version '1.0.6'
version '1.0.9'
requires_redmine :version_or_higher => '0.9'

@ -53,6 +53,7 @@ module CostsUserPatch
return roles unless project && project.active?
if logged?
# Find project membership
# FIXME: Use AR proxy object properly and avoid the use enumberable methods
membership = memberships.detect {|m| m.project_id == project.id}
if membership
roles = granular_roles(membership.member_roles)

@ -1,18 +0,0 @@
directory = File.dirname File.dirname(__FILE__)
project = File.basename directory
namespace :gloc_to_i18n do
task project do
chdir(directory) do
Dir.glob("lang/*.yml") do |file|
lang = file[5..-5]
target = "config/locales/#{lang}.yml"
mkdir_p File.dirname(target)
File.open(target, "w") do |f|
f << ({lang => YAML.load_file(file)}.to_yaml)
end
end
end
end
end
task :gloc_to_i18n => "gloc_to_i18n:#{project}"
Loading…
Cancel
Save