From af82e4c2cb44751b4dfb64692f400bf6950c58b6 Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 25 Aug 2015 14:52:59 +0000 Subject: [PATCH] =?UTF-8?q?C2015-036:=20Modified=20=E2=80=9Cvesp=5FGetTran?= =?UTF-8?q?sitionReportData=E2=80=9D=20to=20return=20correct=20data=20for?= =?UTF-8?q?=20outside=20transitions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/DataLoader/PROMSFixes.Sql | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/PROMS/DataLoader/PROMSFixes.Sql b/PROMS/DataLoader/PROMSFixes.Sql index 83f74c4c..cf0d1445 100644 --- a/PROMS/DataLoader/PROMSFixes.Sql +++ b/PROMS/DataLoader/PROMSFixes.Sql @@ -9584,7 +9584,7 @@ GO SET QUOTED_IDENTIFIER ON GO /* -vesp_GetTransitionReportData 1,1 +vesp_GetTransitionReportData 5, 6078 */ CREATE PROCEDURE vesp_GetTransitionReportData ( @@ -9612,9 +9612,11 @@ BEGIN ( tid int primary key ) - insert into @itmp select * from vefn_getversionprocedureitems(@VersionID) + insert into @itmp select * from vefn_getversionprocedureitems('') insert into @ctmp select * from @itmp - insert into @ttmp select tt.TransitionID from Transitions tt join @ctmp ct on tt.FromID = ct.cid join @itmp it on tt.ToID = it.iid + insert into @ttmp + select tt.TransitionID from Transitions tt join @ctmp ct on tt.FromID = ct.cid join @itmp it on tt.ToID = it.iid + where ct.pid = @ProcedureID or it.pid = @ProcedureID --internal select 1 level,tt.*, (SELECT COUNT(*) FROM [ZTransitions] WHERE [ZTransitions].[TransitionID]=tt.[TransitionID]) [ZTransitionCount] @@ -9631,7 +9633,7 @@ BEGIN join @ttmp tp on tt.TransitionID = tp.tid join @ctmp ct on tt.FromID = ct.cid join @itmp it on tt.ToID = it.iid - where ct.pid = @ProcedureID and it.pid != @ProcedureID + where ct.vid = it.vid and ct.pid = @ProcedureID and it.pid != @ProcedureID --external to union select 3 level,tt.*, @@ -9640,7 +9642,7 @@ BEGIN join @ttmp tp on tt.TransitionID = tp.tid join @ctmp ct on tt.FromID = ct.cid join @itmp it on tt.ToID = it.iid - where ct.pid != @ProcedureID and it.pid = @ProcedureID + where ct.vid = it.vid and ct.pid != @ProcedureID and it.pid = @ProcedureID --outside from union select 4 level,tt.*, @@ -9648,8 +9650,8 @@ BEGIN from Transitions tt join @ttmp tp on tt.TransitionID = tp.tid join @ctmp ct on tt.FromID = ct.cid - join Items ii on tt.ToID = ii.ItemID - where ct.pid = @ProcedureID and ii.ItemID not in (select iid from @itmp) + join @itmp it on tt.ToID = it.iid + where ct.vid != it.vid and ct.pid = @ProcedureID-- and ii.ItemID not in (select iid from @itmp) --outside to union select 5 level,tt.*, @@ -9657,12 +9659,11 @@ BEGIN from Transitions tt join @ttmp tp on tt.TransitionID = tp.tid join @itmp it on tt.ToID = it.iid - join Items ii on tt.FromID = ii.ContentID - where it.pid = @ProcedureID and ii.ContentID not in (select cid from @ctmp) + join @ctmp ct on tt.FromID = ct.cid + where ct.vid != it.vid and it.pid = @ProcedureID --and ii.ContentID not in (select cid from @ctmp) RETURN END GO - -- Display the status of Proc creation IF (@@Error = 0) PRINT 'Procedure Creation: vesp_GetTransitionReportData Succeeded' ELSE PRINT 'Procedure Creation: vesp_GetTransitionReportData Error on Creation'