Fixed logic to not add annotation if transition format is the same.

This commit is contained in:
Rich 2010-10-25 17:28:43 +00:00
parent 2e548621f4
commit 0188c05d23

View File

@ -1540,6 +1540,7 @@ CREATE PROCEDURE [dbo].[addTransition]
@FromID int,
@ToID int,
@RangeID int,
@IsRange int,
@TranType int,
@Config nvarchar(MAX)=null,
@DTS datetime,
@ -1556,6 +1557,7 @@ BEGIN TRY -- Try Block
[FromID],
[ToID],
[RangeID],
[IsRange],
[TranType],
[Config],
[DTS],
@ -1566,6 +1568,7 @@ BEGIN TRY -- Try Block
@FromID,
@ToID,
@RangeID,
@IsRange,
@TranType,
@Config,
@DTS,
@ -1913,12 +1916,12 @@ UPDATE RON SET [ROID] = ROO.[ROID]
-- have part of the range pointing to the new and part of the range pointing to the original
-- locations.
INSERT INTO .[dbo].[Transitions] ([FromID],[ToID],[RangeID],[TranType],[Config],[DTS],[UserID])
INSERT INTO .[dbo].[Transitions] ([FromID],[ToID],[RangeID],[IsRange],[TranType],[Config],[DTS],[UserID])
SELECT NNF.[NewContentID],
-- if both toid & range are null, use the original toid & rangeid
CASE WHEN NNT.[NewItemID] is null or NNR.[NewItemID] is null THEN [ToID] ELSE NNT.[NewItemID] END,
CASE WHEN NNT.[NewItemID] is null or NNR.[NewItemID] is null THEN [RangeID] ELSE NNR.[NewItemID] END,
[TransitionID],[Config],@DTS,@UserID
[IsRange],[TransitionID],[Config],@DTS,@UserID
FROM .[dbo].[Transitions] TT
JOIN @Children NNF on TT.[FromID] = NNF.[ContentID]
LEFT JOIN @Children NNT on TT.[ToID] = NNT.[ItemID]
@ -3758,6 +3761,7 @@ AS
[FromID],
[ToID],
[RangeID],
[IsRange],
[TranType],
[Config],
[DTS],
@ -4691,6 +4695,7 @@ AS
[Transitions].[FromID],
[Transitions].[ToID],
[Transitions].[RangeID],
[Transitions].[IsRange],
[Transitions].[TranType],
[Transitions].[Config],
[Transitions].[DTS],
@ -5378,6 +5383,7 @@ AS
TT.[FromID],
TT.[ToID],
TT.[RangeID],
TT.[IsRange],
TT.[TranType],
TT.[Config],
TT.[DTS],
@ -6224,6 +6230,7 @@ AS
[Transitions].[FromID],
[Transitions].[ToID],
[Transitions].[RangeID],
[Transitions].[IsRange],
[Transitions].[TranType],
[Transitions].[Config],
[Transitions].[DTS],
@ -6248,6 +6255,7 @@ AS
[Transitions].[FromID],
[Transitions].[ToID],
[Transitions].[RangeID],
[Transitions].[IsRange],
[Transitions].[TranType],
[Transitions].[Config],
[Transitions].[DTS],
@ -6971,6 +6979,7 @@ SELECT
[FromID],
[ToID],
[RangeID],
[IsRange],
[TranType],
[Config],
[DTS],
@ -7985,6 +7994,7 @@ AS
[FromID],
[ToID],
[RangeID],
[IsRange],
[TranType],
[Config],
[DTS],
@ -8023,6 +8033,7 @@ AS
[FromID],
[ToID],
[RangeID],
[IsRange],
[TranType],
[Config],
[DTS],
@ -8055,6 +8066,7 @@ AS
[Transitions].[FromID],
[Transitions].[ToID],
[Transitions].[RangeID],
[Transitions].[IsRange],
[Transitions].[TranType],
[Transitions].[Config],
[Transitions].[DTS],
@ -8102,6 +8114,7 @@ AS
[Transitions].[FromID],
[Transitions].[ToID],
[Transitions].[RangeID],
[Transitions].[IsRange],
[Transitions].[TranType],
[Transitions].[Config],
[Transitions].[DTS],
@ -8146,6 +8159,7 @@ AS
[Transitions].[FromID],
[Transitions].[ToID],
[Transitions].[RangeID],
[Transitions].[IsRange],
[Transitions].[TranType],
[Transitions].[Config],
[Transitions].[DTS],
@ -10128,6 +10142,7 @@ CREATE PROCEDURE [dbo].[updateTransition]
@FromID int,
@ToID int,
@RangeID int,
@IsRange int,
@TranType int,
@Config nvarchar(MAX)=null,
@DTS datetime,
@ -10144,6 +10159,7 @@ BEGIN TRY -- Try Block
[FromID]=@FromID,
[ToID]=@ToID,
[RangeID]=@RangeID,
[IsRange]=@IsRange,
[TranType]=@TranType,
[Config]=@Config,
[DTS]=@DTS,
@ -11169,7 +11185,7 @@ AS
BEGIN
--
IF @FormatID = @NewFormatID
RETURN @TranType
RETURN 0 -- Exactly the same format file
DECLARE @TransFormat varchar(max)
DECLARE @NewTransFormat varchar(max)
SET @TransFormat = isnull(.dbo.vefn_GetTransFormat(@FormatID, @TranType),'')
@ -11295,7 +11311,7 @@ join transitions tt on ttz.TransitionID = tt.TransitionID
join contents cc on tt.FromID = cc.contentid
*/
Create FUNCTION [dbo].[vefn_FindAffectedTransitions](@ItemID int)
CREATE FUNCTION [dbo].[vefn_FindAffectedTransitions](@ItemID int)
RETURNS @Transitions TABLE
(
TransitionID int
@ -11323,9 +11339,25 @@ Union All
join Items I on I.PreviousID = Z.ItemID
--where Z.[Level] > 0 -- This would limit the siblings to the siblings of the children and not the initial ItemID
)
, Itemz2([Level], [Ordinal], [ItemID], [PreviousID], [FromType], [ContentID], [DTS], [UserID], [LastChanged],[pContentID], [pDTS],[pUserID],[pLastChanged]) as (
Select 0 [Level], 0 [Ordinal], [ItemID], [PreviousID],0 [FromType],[ContentID],[DTS],[UserID],[LastChanged]
,0 [pContentID],[DTS] [pDTS], [UserID] [pUserID], [LastChanged] [pLastChanged]
FROM [Items]
where [ItemID]=@ItemID
-- All Siblings
Union All
select [Level] ,Z.[Ordinal] -1, I.[ItemID], I.[PreviousID], [FromType],I.[ContentID],I.[DTS],I.[UserID],I.[LastChanged]
,null,null,null,null
from Itemz2 Z
join Items I on Z.PreviousID = I.ItemID
--where Z.[Level] > 0 -- This would limit the siblings to the siblings of the children and not the initial ItemID
)
insert into @Transitions
select TransitionID from Transitions TT
where (ToID in(select ItemID from Itemz) OR RangeID in(select ItemID from Itemz))
UNION
select TransitionID from Transitions TT
JOIN Itemz2 on ToID=ItemID and RangeID=ItemID and IsRange = 2
RETURN
END
GO