From d45467da85febfdaeb2dc308dacbf86b195972f1 Mon Sep 17 00:00:00 2001 From: Gempalm Date: Mon, 9 Jun 2014 10:47:27 +0900 Subject: [PATCH 1/9] Update common_logic.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit for redmine 2.5 RAILS_DEFAULT_LOGGER → Rails.logger --- lib/common_logic.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/common_logic.rb b/lib/common_logic.rb index a50fd6f..178a155 100644 --- a/lib/common_logic.rb +++ b/lib/common_logic.rb @@ -13,7 +13,7 @@ def self.get_members(project_id) end def self.size_round(num, size) - RAILS_DEFAULT_LOGGER.debug "round num = #{num.to_s}" + Rails.logger.debug "round num = #{num.to_s}" num = num * (10 ** size) return num.round / (10.0 ** size) @@ -34,8 +34,8 @@ def self.is_valid_version(version_id, effective_date) finish_num = get_closed_num(version_id, 1) unfinish_num = get_closed_num(version_id, 0) - RAILS_DEFAULT_LOGGER.debug "finish_num = #{finish_num}" - RAILS_DEFAULT_LOGGER.debug "unfinish_num = #{unfinish_num}" + Rails.logger.debug "finish_num = #{finish_num}" + Rails.logger.debug "unfinish_num = #{unfinish_num}" # closed version unless effective_date.nil? From 42ddf26663c2ef7499ab305501cd3a3b5706667a Mon Sep 17 00:00:00 2001 From: Gempalm Date: Mon, 9 Jun 2014 10:53:30 +0900 Subject: [PATCH 2/9] Update roadmaps_logic.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit for redmine 2.5 RAILS_DEFAULT_LOGGER → Rails.logger --- lib/roadmaps_logic.rb | 48 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/roadmaps_logic.rb b/lib/roadmaps_logic.rb index eec626c..ff60fe8 100644 --- a/lib/roadmaps_logic.rb +++ b/lib/roadmaps_logic.rb @@ -24,63 +24,63 @@ def self.get_versions(project_id) vo.project_name = project.name end - RAILS_DEFAULT_LOGGER.debug "set version information" + Rails.logger.debug "set version information" vo.version_id = version.id vo.name = version.name vo.description = version.description vo.effective_date = version.effective_date - RAILS_DEFAULT_LOGGER.debug "set closed num" + Rails.logger.debug "set closed num" vo.finish_num = CommonLogic.get_closed_num(version.id, 1) - RAILS_DEFAULT_LOGGER.debug "set unfinish_num" + Rails.logger.debug "set unfinish_num" vo.unfinish_num = CommonLogic.get_closed_num(version.id, 0) - RAILS_DEFAULT_LOGGER.debug "set ticket num" + Rails.logger.debug "set ticket num" vo.ticket_num = vo.finish_num + vo.unfinish_num - RAILS_DEFAULT_LOGGER.debug "set finish percentage" + Rails.logger.debug "set finish percentage" if vo.ticket_num != 0 vo.finish_percentage = CommonLogic.size_round(vo.finish_num.to_f / vo.ticket_num.to_f, 2) * 100 else vo.finish_percentage = 0 end - RAILS_DEFAULT_LOGGER.debug "finish percentage = #{vo.finish_percentage.to_s}" + Rails.logger.debug "finish percentage = #{vo.finish_percentage.to_s}" - RAILS_DEFAULT_LOGGER.debug "set unfinish percentage" + Rails.logger.debug "set unfinish percentage" if vo.ticket_num != 0 vo.unfinish_percentage = CommonLogic.size_round(vo.unfinish_num.to_f / vo.ticket_num.to_f, 2) * 100 else vo.unfinish_percentage = 0 end - RAILS_DEFAULT_LOGGER.debug "unfinish percentage = #{vo.unfinish_percentage.to_s}" + Rails.logger.debug "unfinish percentage = #{vo.unfinish_percentage.to_s}" - RAILS_DEFAULT_LOGGER.debug "set start date" + Rails.logger.debug "set start date" vo.start_date = get_start_date(version.id) - RAILS_DEFAULT_LOGGER.debug "start date = #{vo.start_date.to_s}" - RAILS_DEFAULT_LOGGER.debug "start date = #{vo.start_date.class.to_s}" + Rails.logger.debug "start date = #{vo.start_date.to_s}" + Rails.logger.debug "start date = #{vo.start_date.class.to_s}" - RAILS_DEFAULT_LOGGER.debug "set due date" + Rails.logger.debug "set due date" vo.due_date = get_due_date(version.id) - RAILS_DEFAULT_LOGGER.debug "due date = #{vo.due_date.to_s}" - RAILS_DEFAULT_LOGGER.debug "due date = #{vo.due_date.class.to_s}" + Rails.logger.debug "due date = #{vo.due_date.to_s}" + Rails.logger.debug "due date = #{vo.due_date.class.to_s}" - RAILS_DEFAULT_LOGGER.debug "set late" + Rails.logger.debug "set late" vo.late = get_late(vo.effective_date) - RAILS_DEFAULT_LOGGER.debug "set done ratio" + Rails.logger.debug "set done ratio" vo.done_ratio = get_all_done_ratio(version.id) - RAILS_DEFAULT_LOGGER.debug "done ratio = #{vo.done_ratio.to_s}" + Rails.logger.debug "done ratio = #{vo.done_ratio.to_s}" - RAILS_DEFAULT_LOGGER.debug "set estimated hours" + Rails.logger.debug "set estimated hours" vo.estimated_hours = CommonLogic.size_round(get_estimated_hours(version.id), 2) - RAILS_DEFAULT_LOGGER.debug "estimated hours = #{vo.estimated_hours.to_s}" + Rails.logger.debug "estimated hours = #{vo.estimated_hours.to_s}" - RAILS_DEFAULT_LOGGER.debug "set passed hours" + Rails.logger.debug "set passed hours" vo.passed_hours = CommonLogic.size_round(get_passed_hours(version.id), 2) - RAILS_DEFAULT_LOGGER.debug "passed hours = #{vo.passed_hours.to_s}" + Rails.logger.debug "passed hours = #{vo.passed_hours.to_s}" - RAILS_DEFAULT_LOGGER.debug "set assigned user" + Rails.logger.debug "set assigned user" vo.assigned_users = get_assigned_users(version.id) results.push(vo) @@ -137,10 +137,10 @@ def self.get_all_done_ratio(version_id) end end - RAILS_DEFAULT_LOGGER.debug "sum = #{sum.to_s}" + Rails.logger.debug "sum = #{sum.to_s}" count = Issue.count(:all, :conditions => ["fixed_version_id = ?", version_id]) - RAILS_DEFAULT_LOGGER.debug "count = #{count.to_s}" + Rails.logger.debug "count = #{count.to_s}" if count.to_i != 0 return CommonLogic.size_round(sum / count, 2) From 78e6e2b3a403ffe783bd64897490d7228bfb671c Mon Sep 17 00:00:00 2001 From: Gempalm Date: Mon, 9 Jun 2014 10:57:39 +0900 Subject: [PATCH 3/9] Update routes.rb for redmine2.5 --- config/routes.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index a7ffddc..14ba7ea 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,6 @@ -ActionController::Routing::Routes.draw do |map| - map.connect "/roadmaps", :controller => "roadmaps_main", :action => "index", :conditions => { :method => :get} +Rails.application.routes.draw do + resources :projects do + resources :roadmaps_main + end + resources :projects, :path => 'projects/:action', :only => [:index, :show] end From 95c8cd245a78d151f92b933eb24378c0f19cf224 Mon Sep 17 00:00:00 2001 From: Gempalm Date: Fri, 11 Jul 2014 16:34:14 +0900 Subject: [PATCH 4/9] =?UTF-8?q?route=E5=AE=9A=E7=BE=A9=E3=81=8C=E9=96=93?= =?UTF-8?q?=E9=81=95=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 14ba7ea..fae2687 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,5 @@ Rails.application.routes.draw do resources :projects do - resources :roadmaps_main + resources :roadmaps_main, :only => :index end - resources :projects, :path => 'projects/:action', :only => [:index, :show] end From 2cb6edde7b0ebd54f9ffe9d66fb8930af9aefea7 Mon Sep 17 00:00:00 2001 From: Gempalm Date: Thu, 4 Sep 2014 14:05:59 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=E9=80=B2=E6=8D=97=E7=8E=87=E3=81=8C?= =?UTF-8?q?=E5=B0=8F=E6=95=B0=E7=AC=AC=EF=BC=92=E4=BD=8D=E3=81=BE=E3=81=A7?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/roadmaps_logic.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/roadmaps_logic.rb b/lib/roadmaps_logic.rb index ff60fe8..f24167a 100644 --- a/lib/roadmaps_logic.rb +++ b/lib/roadmaps_logic.rb @@ -41,7 +41,7 @@ def self.get_versions(project_id) Rails.logger.debug "set finish percentage" if vo.ticket_num != 0 - vo.finish_percentage = CommonLogic.size_round(vo.finish_num.to_f / vo.ticket_num.to_f, 2) * 100 + vo.finish_percentage = CommonLogic.size_round(vo.finish_num.to_f / vo.ticket_num.to_f * 100, 2) else vo.finish_percentage = 0 end @@ -49,7 +49,7 @@ def self.get_versions(project_id) Rails.logger.debug "set unfinish percentage" if vo.ticket_num != 0 - vo.unfinish_percentage = CommonLogic.size_round(vo.unfinish_num.to_f / vo.ticket_num.to_f, 2) * 100 + vo.unfinish_percentage = CommonLogic.size_round(vo.unfinish_num.to_f / vo.ticket_num.to_f * 100, 2) else vo.unfinish_percentage = 0 end From 979a2031ee7d345599c783607fe2740fa82daeeb Mon Sep 17 00:00:00 2001 From: Gempalm Date: Thu, 14 May 2015 22:47:17 +0900 Subject: [PATCH 6/9] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E9=96=8B=E5=A7=8B=E6=97=A5=E3=81=8C=E6=9C=AA=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E6=99=82=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=A1?= =?UTF-8?q?=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/ja.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 1d34360..69ee122 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -19,3 +19,4 @@ ja: no_due_date: "期限日が設定されていません" no_date: "開始日、期限日が設定されていません" no_version_effective_date: "バージョンの期限日が設定されていません" + no_version_start_date: "バージョンの開始日が設定されていません" From 0e52e75046df42d914f5682e65bb751ad364b37d Mon Sep 17 00:00:00 2001 From: Gempalm Date: Thu, 14 May 2015 22:48:20 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E9=96=8B=E5=A7=8B=E6=97=A5=E3=81=8C=E6=9C=AA=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E6=99=82=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=A1?= =?UTF-8?q?=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/en.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index d985040..3a50e82 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -19,3 +19,4 @@ en: no_due_date: "due date is not setting" no_date: "start date and due date are not setting" no_version_effective_date: "version effective date is not setting" + no_version_start_date: "version start date is not setting" From 87c32533d61039e1a35e8a839c9f96cc77f3e875 Mon Sep 17 00:00:00 2001 From: Gempalm Date: Thu, 14 May 2015 22:56:37 +0900 Subject: [PATCH 8/9] =?UTF-8?q?no=5Fversion=5Fstart=5Fdate:=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E3=81=AE=E3=81=9F=E3=82=81=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/en.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 3a50e82..d985040 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -19,4 +19,3 @@ en: no_due_date: "due date is not setting" no_date: "start date and due date are not setting" no_version_effective_date: "version effective date is not setting" - no_version_start_date: "version start date is not setting" From 7e77f0f32203937cb7985929a1fad11fff5755d4 Mon Sep 17 00:00:00 2001 From: Gempalm Date: Thu, 14 May 2015 22:57:21 +0900 Subject: [PATCH 9/9] =?UTF-8?q?no=5Fversion=5Fstart=5Fdate:=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E3=81=AE=E3=81=9F=E3=82=81=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/ja.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 69ee122..1d34360 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -19,4 +19,3 @@ ja: no_due_date: "期限日が設定されていません" no_date: "開始日、期限日が設定されていません" no_version_effective_date: "バージョンの期限日が設定されていません" - no_version_start_date: "バージョンの開始日が設定されていません"