C2015-036: Modified “vesp_GetTransitionReportData” to return correct data for outside transitions
This commit is contained in:
parent
f4e1c63ec1
commit
af82e4c2cb
@ -9584,7 +9584,7 @@ GO
|
|||||||
SET QUOTED_IDENTIFIER ON
|
SET QUOTED_IDENTIFIER ON
|
||||||
GO
|
GO
|
||||||
/*
|
/*
|
||||||
vesp_GetTransitionReportData 1,1
|
vesp_GetTransitionReportData 5, 6078
|
||||||
*/
|
*/
|
||||||
CREATE PROCEDURE vesp_GetTransitionReportData
|
CREATE PROCEDURE vesp_GetTransitionReportData
|
||||||
(
|
(
|
||||||
@ -9612,9 +9612,11 @@ BEGIN
|
|||||||
(
|
(
|
||||||
tid int primary key
|
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 @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
|
--internal
|
||||||
select 1 level,tt.*,
|
select 1 level,tt.*,
|
||||||
(SELECT COUNT(*) FROM [ZTransitions] WHERE [ZTransitions].[TransitionID]=tt.[TransitionID]) [ZTransitionCount]
|
(SELECT COUNT(*) FROM [ZTransitions] WHERE [ZTransitions].[TransitionID]=tt.[TransitionID]) [ZTransitionCount]
|
||||||
@ -9631,7 +9633,7 @@ BEGIN
|
|||||||
join @ttmp tp on tt.TransitionID = tp.tid
|
join @ttmp tp on tt.TransitionID = tp.tid
|
||||||
join @ctmp ct on tt.FromID = ct.cid
|
join @ctmp ct on tt.FromID = ct.cid
|
||||||
join @itmp it on tt.ToID = it.iid
|
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
|
--external to
|
||||||
union
|
union
|
||||||
select 3 level,tt.*,
|
select 3 level,tt.*,
|
||||||
@ -9640,7 +9642,7 @@ BEGIN
|
|||||||
join @ttmp tp on tt.TransitionID = tp.tid
|
join @ttmp tp on tt.TransitionID = tp.tid
|
||||||
join @ctmp ct on tt.FromID = ct.cid
|
join @ctmp ct on tt.FromID = ct.cid
|
||||||
join @itmp it on tt.ToID = it.iid
|
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
|
--outside from
|
||||||
union
|
union
|
||||||
select 4 level,tt.*,
|
select 4 level,tt.*,
|
||||||
@ -9648,8 +9650,8 @@ BEGIN
|
|||||||
from Transitions tt
|
from Transitions tt
|
||||||
join @ttmp tp on tt.TransitionID = tp.tid
|
join @ttmp tp on tt.TransitionID = tp.tid
|
||||||
join @ctmp ct on tt.FromID = ct.cid
|
join @ctmp ct on tt.FromID = ct.cid
|
||||||
join Items ii on tt.ToID = ii.ItemID
|
join @itmp it on tt.ToID = it.iid
|
||||||
where ct.pid = @ProcedureID and ii.ItemID not in (select iid from @itmp)
|
where ct.vid != it.vid and ct.pid = @ProcedureID-- and ii.ItemID not in (select iid from @itmp)
|
||||||
--outside to
|
--outside to
|
||||||
union
|
union
|
||||||
select 5 level,tt.*,
|
select 5 level,tt.*,
|
||||||
@ -9657,12 +9659,11 @@ BEGIN
|
|||||||
from Transitions tt
|
from Transitions tt
|
||||||
join @ttmp tp on tt.TransitionID = tp.tid
|
join @ttmp tp on tt.TransitionID = tp.tid
|
||||||
join @itmp it on tt.ToID = it.iid
|
join @itmp it on tt.ToID = it.iid
|
||||||
join Items ii on tt.FromID = ii.ContentID
|
join @ctmp ct on tt.FromID = ct.cid
|
||||||
where it.pid = @ProcedureID and ii.ContentID not in (select cid from @ctmp)
|
where ct.vid != it.vid and it.pid = @ProcedureID --and ii.ContentID not in (select cid from @ctmp)
|
||||||
RETURN
|
RETURN
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
-- Display the status of Proc creation
|
-- Display the status of Proc creation
|
||||||
IF (@@Error = 0) PRINT 'Procedure Creation: vesp_GetTransitionReportData Succeeded'
|
IF (@@Error = 0) PRINT 'Procedure Creation: vesp_GetTransitionReportData Succeeded'
|
||||||
ELSE PRINT 'Procedure Creation: vesp_GetTransitionReportData Error on Creation'
|
ELSE PRINT 'Procedure Creation: vesp_GetTransitionReportData Error on Creation'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user