Defect #1461 » redmine_work_time_0.3.3_MSSQL2012_fix.patch
redmine/plugins/redmine_work_time/app/controllers/work_time_controller.rb Mon Jan 23 12:44:27 2017 +0300 → redmine/plugins/redmine_work_time/app/controllers/work_time_controller.rb Mon Jan 23 15:14:38 2017 +0300 | ||
---|---|---|
if @this_uid==@crnt_uid then
|
||
add_issue = Issue.find_by_id(@add_issue_id)
|
||
@add_issue_children_cnt = Issue.count(
|
||
"parent_id = " + add_issue.id.to_s
|
||
#"parent_id = " + add_issue.id.to_s
|
||
"case when parent_id = " + add_issue.id.to_s + " then parent_id else null end"
|
||
)
|
||
if add_issue && add_issue.visible? then
|
||
prj = add_issue.project
|
||
... | ... | |
unless UserIssueMonth.exists?(["uid=:u and issue=:i",{:u=>uid, :i=>@add_issue_id}]) then
|
||
# 既存のレコードが存在していなければ追加
|
||
UserIssueMonth.create(:uid=>uid, :issue=>@add_issue_id,
|
||
:odr=>UserIssueMonth.count("uid=#{uid}")+1)
|
||
#:odr=>UserIssueMonth.count("uid=#{uid}")+1)
|
||
:odr=>UserIssueMonth.count("case when uid = #{uid} then uid else null end")+1)
|
||
end
|
||
end
|
||
end
|
||
... | ... | |
prj_pack[:odr_issues].push issue_pack
|
||
prj_pack[:count_issues] += 1
|
||
cnt_childrens = Issue.count(
|
||
"parent_id = " + new_issue.id.to_s
|
||
#"parent_id = " + new_issue.id.to_s
|
||
"case when parent_id = " + new_issue.id.to_s + " then parent_id else null end"
|
||
)
|
||
issue_pack[:cnt_childrens] = cnt_childrens
|
||
end
|