USE [Licenses_mdb]
GO

IF NOT EXISTS(SELECT nID FROM [tblFeatures] WHERE nID=140)
	INSERT [dbo].[tblFeatures] ([nID], [tName], [fVisible], [tFunctionName], [tFormName], [nMode]) 
	VALUES (140, N'Web View - Add & Edit Choice Values', 1, N'', N'', 0);

GO

/*	** Add the new feature to Admins, HelpDesk-Analysts, IT Asset Managers, IT Managers and SoftwareManagers by default	***/
IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=140 AND [tGroup]='Admins' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'Admins', 140, 1);
GO

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=140 AND [tGroup]='HelpDesk-Analysts' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'HelpDesk-Analysts', 140, 1);
GO

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=140 AND [tGroup]='IT Asset Managers' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'IT Asset Managers', 140, 1);
GO

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=140 AND [tGroup]='IT Managers' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'IT Managers', 140, 1);
GO

IF NOT EXISTS(SELECT [nFeatureID] FROM [tblGroupPrivileges] WHERE [nFeatureID]=140 AND [tGroup]='SoftwareManagers' )
	INSERT [dbo].[tblGroupPrivileges] ([tGroup], [nFeatureID], [fEnabled]) VALUES (N'SoftwareManagers', 140, 1);
GO


