Project

General

Profile

Defect #1461 » redmine_work_time_0.3.3_MSSQL2012_fix.patch

Alexander Ryabinovskiy, 01/23/2017 09:38 PM

View differences:

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
439 439
    if @this_uid==@crnt_uid then
440 440
      add_issue = Issue.find_by_id(@add_issue_id)
441 441
      @add_issue_children_cnt = Issue.count(
442
          "parent_id = " + add_issue.id.to_s
442
          #"parent_id = " + add_issue.id.to_s
443
		  "case when parent_id = " + add_issue.id.to_s + " then parent_id else null end"
443 444
      )
444 445
      if add_issue && add_issue.visible? then
445 446
        prj = add_issue.project
......
473 474
          unless UserIssueMonth.exists?(["uid=:u and issue=:i",{:u=>uid, :i=>@add_issue_id}]) then
474 475
            # 既存のレコードが存在していなければ追加
475 476
            UserIssueMonth.create(:uid=>uid, :issue=>@add_issue_id,
476
              :odr=>UserIssueMonth.count("uid=#{uid}")+1)
477
              #:odr=>UserIssueMonth.count("uid=#{uid}")+1)
478
			  :odr=>UserIssueMonth.count("case when uid = #{uid} then uid else null end")+1)
477 479
          end
478 480
        end
479 481
      end
......
1379 1381
        prj_pack[:odr_issues].push issue_pack
1380 1382
        prj_pack[:count_issues] += 1
1381 1383
        cnt_childrens = Issue.count(
1382
            "parent_id = " + new_issue.id.to_s
1384
            #"parent_id = " + new_issue.id.to_s
1385
			"case when parent_id = " + new_issue.id.to_s + " then parent_id else null end"
1383 1386
        )
1384 1387
        issue_pack[:cnt_childrens] = cnt_childrens
1385 1388
      end
    (1-1/1)