From fb6a6c496fd57417a7405ca3742d24bdffc56490 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 20 Jun 2011 17:16:14 +0200 Subject: [PATCH 1/7] Releasing 1.0.7 * minor changes in test code and for environment only --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 73782f06cb..962e37574d 100644 --- a/init.rb +++ b/init.rb @@ -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.7' requires_redmine :version_or_higher => '0.9' From d5a52d3144543dc6a1e624efb98714b39cbdf7e9 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Wed, 6 Jul 2011 15:27:13 +0200 Subject: [PATCH 2/7] Adding FIXME - this one will hurt, if you're member in loads of projects --- lib/costs_user_patch.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/costs_user_patch.rb b/lib/costs_user_patch.rb index 7ec9816f25..f5ef7cd3e6 100644 --- a/lib/costs_user_patch.rb +++ b/lib/costs_user_patch.rb @@ -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) From 7c4d089c4e632fb368f7dce3e59a53220f5c5ebb Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Wed, 6 Jul 2011 15:27:47 +0200 Subject: [PATCH 3/7] Releasing 1.0.8 No changes - just comments --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 962e37574d..0586dde673 100644 --- a/init.rb +++ b/init.rb @@ -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.7' + version '1.0.8' requires_redmine :version_or_higher => '0.9' From c3fd8ba82df7f284e9bded1755918f28f4b02e53 Mon Sep 17 00:00:00 2001 From: Markus Kahl Date: Wed, 13 Jul 2011 17:19:43 +0200 Subject: [PATCH 4/7] make cost_entry routes same as for time_entries, delete per DELETE /_entry/ --- app/controllers/costlog_controller.rb | 3 +-- app/views/cost_reports/_list_items.rhtml | 6 +++--- config/routes.rb | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/controllers/costlog_controller.rb b/app/controllers/costlog_controller.rb index 5af0db3f5b..4cc10b6805 100644 --- a/app/controllers/costlog_controller.rb +++ b/app/controllers/costlog_controller.rb @@ -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) diff --git a/app/views/cost_reports/_list_items.rhtml b/app/views/cost_reports/_list_items.rhtml index 2a2981a5bd..1197f632a7 100644 --- a/app/views/cost_reports/_list_items.rhtml +++ b/app/views/cost_reports/_list_items.rhtml @@ -16,7 +16,7 @@ - + <% @entries.each do |entry| %> <% page_costs += entry.real_costs if entry.costs_visible_by?(User.current)%> @@ -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 -%> diff --git a/config/routes.rb b/config/routes.rb index cfd3565c27..cbf03cdb7c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 => /.+/ From ee48dbb92c15182cc3e4c8b8b2f69aa18782eced Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Wed, 13 Jul 2011 17:39:04 +0200 Subject: [PATCH 5/7] Fixing tpyo in README --- README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index aade0a3f30..a956ee47e4 100644 --- a/README.rdoc +++ b/README.rdoc @@ -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 From 28c2995e938862b28887e917e957649419ed2a6f Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Thu, 21 Jul 2011 11:51:57 +0200 Subject: [PATCH 6/7] Releasing 1.0.9 Fixing bug when deleting cost entries --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 0586dde673..583603fe41 100644 --- a/init.rb +++ b/init.rb @@ -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.8' + version '1.0.9' requires_redmine :version_or_higher => '0.9' From f07eafc6d8a95e4e23dd4cb0f82fd66bf1a59a8c Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Tue, 26 Jul 2011 09:19:34 +0200 Subject: [PATCH 7/7] Moving tasks to lib folder, removing strange looking task which is probably outdated anyway Sorry, if I got anything wrong here. --- {tasks => lib/tasks}/schema.rake | 0 tasks/gloc_to_i18n.rake | 18 ------------------ 2 files changed, 18 deletions(-) rename {tasks => lib/tasks}/schema.rake (100%) delete mode 100644 tasks/gloc_to_i18n.rake diff --git a/tasks/schema.rake b/lib/tasks/schema.rake similarity index 100% rename from tasks/schema.rake rename to lib/tasks/schema.rake diff --git a/tasks/gloc_to_i18n.rake b/tasks/gloc_to_i18n.rake deleted file mode 100644 index cd0a1bdae5..0000000000 --- a/tasks/gloc_to_i18n.rake +++ /dev/null @@ -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}" \ No newline at end of file