From 46d8838d0e73bb4e2b6d967779ca00133cceb67c Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Fri, 4 Apr 2025 10:48:48 -0400 Subject: [PATCH] B2022-031-Add-filtering-for-Proc-and-Section-name-from-Global-Search --- PROMS/VEPROMS User Interface/PROMSFixes.Sql | 31 ++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index 0d9474cf..a291dcb2 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -1497,9 +1497,9 @@ GO select Text from vefn_SiblingAndChildrenItemsNewByWord('194','','%[^a-zA-Z]step 25[^0-9a-zA-Z.vbpi:\\-]%','%[^a-zA-Z]step 25[^0-9a-zA-Z.vbpi:\\-]%',''); ========================================================================================================== */ -Create Function [dbo].[vefn_SiblingAndChildrenItemsNewByWord](@DocVersionList VarChar(Max), @UnitPrefix VarChar(Max), @SearchString VarChar(Max), +CREATE Function [dbo].[vefn_SiblingAndChildrenItemsNewByWord](@DocVersionList VarChar(Max), @UnitPrefix VarChar(Max), @SearchString VarChar(Max), @SearchStringx VarChar(Max), @StepTypeList VarChar(Max), - @includeLinks int, @includeRtfFormatting int , @includeSpecialCharacters int) + @includeLinks int, @includeRtfFormatting int , @includeSpecialCharacters int, @ProcSectSrch Int) Returns @SiblingAndChildren Table ( ILastChanged VarBinary(8), @@ -1583,7 +1583,7 @@ Begin Cast(0 as VarBinary(8)) as 'PLastChanged' From Items i with (NoLock) join Contents c with (NoLock) on c.ContentID = i.ContentID - join dbo.vefn_DocVersionSplit(@DocVersionList) dv on i.ItemID = dv.ItemID + join dbo.vefn_DocVersionSplit(@DocVersionList) dv on i.ItemID = dv.ItemID Union All @@ -1674,8 +1674,8 @@ Begin From zItems zi join Items i with (NoLock) on i.PreviousID = zi.ItemID join Contents c with (NoLock) on c.ContentID = i.ContentID - - ) + ) + Insert Into @SiblingAndChildren Select zi.ILastChanged, zi.ItemID, @@ -1713,7 +1713,12 @@ Begin like @SearchStringx Or Replace(d.DocAscii, nChar(176), '\''B0') like @SearchStringx) And (IsNull(@StepTypeList,'') = '' or (dbo.vefn_AllSections(zi.CType) in (Select ID from dbo.vefn_SplitInt(@StepTypeList,',')))) Option (Recompile, MaxRecursion 10000); - + + if @ProcSectSrch = 1 + begin + delete from @SiblingAndChildren where ctype/10000 IN (0,1) + end + Return; End Go @@ -15710,7 +15715,7 @@ GO exec vesp_SearchItemAndChildrenNewByWord '194','','25',0,0,0,0,'','',''; ========================================================================================================== */ -Create Procedure [dbo].[vesp_SearchItemAndChildrenNewByWord] (@DocVersionList VarChar(Max), @StepTypeList VarChar(Max), @SearchString VarChar(Max), @CaseSensitive Int, +CREATE Procedure [dbo].[vesp_SearchItemAndChildrenNewByWord] (@DocVersionList VarChar(Max), @StepTypeList VarChar(Max), @SearchString VarChar(Max), @CaseSensitive Int, @ProcSectSrch int, @IncludeLinks Int, @IncludeRtfFormatting Int, @IncludeSpecialCharacters Int, @UnitPrefix VarChar(Max), @ByWordPrefix VarChar(64), @ByWordSuffix VarChar(64)) With Execute As Owner @@ -15780,7 +15785,7 @@ Begin (Select Count(1) From RoUsages ru with (NoLock) Where ru.ContentID = z.ContentID) as 'RoUsageCount', (Select Count(1) From Transitions t with (NoLock) Where t.FromID = z.ContentID) as 'TransitionCount', (Select Count(1) From ZContents zc with (NoLock) Where zc.ContentID = z.ContentID) as 'ZContentCount' - From dbo.vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx, @StepTypeList, @includeLinks, @includeRtfFormatting, @includeSpecialCharacters) z + From dbo.vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx, @StepTypeList, @includeLinks, @includeRtfFormatting, @includeSpecialCharacters, @ProcSectSrch) z Order By z.DvPath Asc Option (Recompile); @@ -15828,7 +15833,7 @@ Begin (Select Count(1) From RoUsages ru with (NoLock) Where ru.ContentID = z.ContentID) as 'RoUsageCount', (Select Count(1) From Transitions t with (NoLock) Where t.FromID = z.ContentID) as 'TransitionCount', (Select Count(1) From ZContents zc with (NoLock) Where zc.ContentID = z.ContentID) as 'ZContentCount' - From dbo.vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx, @StepTypeList, @includeLinks, @includeRtfFormatting, @includeSpecialCharacters) z + From dbo.vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx, @StepTypeList, @includeLinks, @includeRtfFormatting, @includeSpecialCharacters, @ProcSectSrch) z Where (@TextPrefix + z.Text + @TextSuffix Collate SQL_Latin1_General_CP1_CS_AS like @SearchString or @TextPrefix + z.Text + @TextSuffix Collate SQL_Latin1_General_CP1_CS_AS like @SearchStringx or Replace(z.DocAscii,nChar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchString @@ -15887,7 +15892,7 @@ Begin (Select Count(1) From RoUsages ru with (NoLock) Where ru.ContentID = z.ContentID) as 'RoUsageCount', (Select Count(1) From Transitions t with (NoLock) Where t.FromID = z.ContentID) as 'TransitionCount', (Select Count(1) From ZContents zc with (NoLock) Where zc.ContentID = z.ContentID) as 'ZContentCount' - From dbo.vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx, @StepTypeList, @includeLinks, @includeRtfFormatting, @includeSpecialCharacters) z + From dbo.vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx, @StepTypeList, @includeLinks, @includeRtfFormatting, @includeSpecialCharacters, @ProcSectSrch) z Where (dbo.vefn_RemoveExtraText(@TextPrefix + z.Text + @TextSuffix, @IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CI_AS like @SearchString Or dbo.vefn_RemoveExtraText(@TextPrefix + z.Text + @TextSuffix, @IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CI_AS like @SearchStringx Or Replace(z.DocAscii, nChar(176), '\''B0') Collate SQL_Latin1_General_CP1_CI_AS like @SearchString @@ -15941,7 +15946,7 @@ Begin (Select Count(1) From RoUsages ru with (NoLock) Where ru.ContentID = z.ContentID) as 'RoUsageCount', (Select Count(1) From Transitions t with (NoLock) Where t.FromID = z.ContentID) as 'TransitionCount', (Select Count(1) From ZContents zc with (NoLock) Where zc.ContentID = z.ContentID) as 'ZContentCount' - From dbo.vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx, @StepTypeList, @includeLinks, @includeRtfFormatting, @includeSpecialCharacters) z + From dbo.vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx, @StepTypeList, @includeLinks, @includeRtfFormatting, @includeSpecialCharacters, @ProcSectSrch) z Where (dbo.vefn_RemoveExtraText(Replace(@TextPrefix + z.Text + @TextSuffix,'\''b0', '\''B0'), @IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CS_AS like Replace(@SearchString,'\''b0', '\''B0') Or dbo.vefn_RemoveExtraText(Replace(@TextPrefix + z.Text + @TextSuffix,'\''b0', '\''B0'), @IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CS_AS like Replace(@SearchStringx,'\''b0', '\''B0') Or Replace(z.DocAscii,nChar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchString @@ -23837,8 +23842,8 @@ BEGIN TRY -- Try Block DECLARE @RevDate varchar(255) DECLARE @RevDescription varchar(255) - set @RevDate = '2/19/2025 11:24' - set @RevDescription = 'Added support for legacy ROs with brackets in Unit Values' + set @RevDate = '4/03/2025 6:14 PM' + set @RevDescription = 'B2022-031 Add filtering for Proc and Section name from Global Search' Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription