Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
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, :only => :index
end
end
6 changes: 3 additions & 3 deletions lib/common_logic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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?
Expand Down
52 changes: 26 additions & 26 deletions lib/roadmaps_logic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
vo.finish_percentage = CommonLogic.size_round(vo.finish_num.to_f / vo.ticket_num.to_f * 100, 2)
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
vo.unfinish_percentage = CommonLogic.size_round(vo.unfinish_num.to_f / vo.ticket_num.to_f * 100, 2)
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)
Expand Down Expand Up @@ -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)
Expand Down