Used landscape parameter in call to SaveWordDoc in MigrateLibDoc method

Added new table function vefn_GetVersionFormatItems
Used comparison of DocStyle PageWidth to PageLength to determine value for landscape parameter in call to SaveSectionDocument
Added ability to disable checkoffs for a section based on 16-bit data
This commit is contained in:
Rich
2013-06-11 18:39:39 +00:00
parent d099c1a881
commit 4885c21734
3 changed files with 65 additions and 3 deletions

View File

@@ -7001,4 +7001,63 @@ GO
IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_FindROUsageIDs Succeeded'
ELSE PRINT 'TableFunction Creation: vefn_FindROUsageIDs Error on Creation'
GO
/****** Object: TableFunction [vefn_GetVersionFormatItems] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_GetVersionFormatItems]') AND OBJECTPROPERTY(id,N'IsTableFunction') = 1)
DROP FUNCTION [vefn_GetVersionFormatItems];
GO
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
CREATE FUNCTION [dbo].[vefn_GetVersionFormatItems](@DocVersionList varchar(MAX))
RETURNS @VersionItems TABLE
(
VersionID int,
ItemID int,
ContentID int primary key,
FormatID int
)
WITH EXECUTE AS OWNER
AS
BEGIN
BEGIN
with Itemz([VersionID], [ItemID], [ContentID], [FormatID], [ParentFormatID]) as
(Select DV.VersionID, [I].[ItemID], [I].[ContentID],
isnull(C.[FormatID],isnull(DV2.[FormatID],isnull(F.[FormatID],P.[FormatID]))),
isnull(DV2.[FormatID],isnull(F.[FormatID],P.[FormatID]))
FROM [Items] I
JOIN vefn_DocVersionSplit(@DocVersionList) DV ON I.[ItemID] = DV.[ItemID]
join docversions DV2 on DV.[VersionID] = DV2.[VersionID]
join folders F on DV2.[FolderID] = F.[FolderID]
join folders P on P.[FolderID] = F.[ParentID]
join Contents C on I.ContentID = C.ContentID
Union All
-- Children
select Z.VersionID, I.[ItemID], I.[ContentID], isnull(C.[FormatID],Z.[FormatID]), Z.[FormatID]
from Itemz Z
join Parts P on P.ContentID = Z.ContentID
join Items I on I.ItemID = P.ItemID
join Contents C on I.ContentID = C.ContentID
Union All
-- Siblings
select Z.VersionID, I.[ItemID], I.[ContentID], isnull(C.[FormatID],Z.[ParentFormatID]), Z.[ParentFormatID]
from Itemz Z
join Items I on I.PreviousID = Z.ItemID
join Contents C on I.ContentID = C.ContentID
)
insert into @VersionItems
select VersionID, [ItemID], [ContentID], [FormatID]
from ItemZ I
--Select * From rousages RU Where RU.ContentID in (Select ContentID from ItemZ)
OPTION (MAXRECURSION 10000)
END
RETURN
END
GO
-- Display the status of func creation
IF (@@Error = 0) PRINT 'TableFunction Creation: vefn_GetVersionFormatItems Succeeded'
ELSE PRINT 'TableFunction Creation: vefn_GetVersionFormatItems Error on Creation'
GO