spClone_Jobboards

Parameters

Parameter Parameter Type Mode Description
@PKID int INOUT
@CloneContentID int IN
@ClonedContentID int IN
@CurrentUsersID int IN

Definition

Copy


                CREATE   Procedure [dbo].[spClone_Jobboards]
                (
                @PKID int output,
                @CloneContentID int,
                @ClonedContentID int,
                @CurrentUsersID int
                )
                as

                BEGIN TRANSACTION

                DECLARE @PKID_Cloned int
                DECLARE @NewGuid uniqueidentifier
                SET @NewGuid = NEWID()

                Insert into JobBoards
                    (JobBoardName,
                     RequiresApproval,
                     Guid,
                     SiteContentID,
                     LegendText,
                     SearchLinkText,
                     SearchLegendText,
                     PostLinkText,
                     PostLegendText,
                     PostJobLegend)

                Select   JobBoardName,
                     RequiresApproval,
                     @NewGuid,
                     @CloneContentID, -- DMB CR268798-030207: Was copying old SiteContentID
                     LegendText,
                     SearchLinkText,
                     SearchLegendText,
                     PostLinkText,
                     PostLegendText,
                     PostJobLegend
                From JobBoards
                Where SiteContentiD = @ClonedContentID

                SELECT @PKID = @@Identity

                DECLARE @OldGuid uniqueidentifier
                SELECT @OldGuid=Guid FROM JobBoards WHERE SiteContentiD = @ClonedContentID

                -- DMB CR268459-022807: Security rights were not copying
                exec spClone_RoleObjectPrivs @OldGuid, @NewGuid

                exec spAuditThis @CurrentUsersID, 1, @NewGuid, 1

                COMMIT