This commit is contained in:
dev_amdtel 2015-02-24 03:40:02 +04:00
commit 1433fd46b9
317 changed files with 60097 additions and 399 deletions

View file

@ -8605,6 +8605,104 @@ WHERE
RETURN
GO
--Webdav portal users settings
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'WebDavPortalUsersSettings')
CREATE TABLE WebDavPortalUsersSettings
(
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
AccountId INT NOT NULL,
Settings NVARCHAR(max)
)
GO
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_NAME ='FK_WebDavPortalUsersSettings_UserId')
ALTER TABLE [dbo].[WebDavPortalUsersSettings]
DROP CONSTRAINT [FK_WebDavPortalUsersSettings_UserId]
GO
ALTER TABLE [dbo].[WebDavPortalUsersSettings] WITH CHECK ADD CONSTRAINT [FK_WebDavPortalUsersSettings_UserId] FOREIGN KEY([AccountID])
REFERENCES [dbo].[ExchangeAccounts] ([AccountID])
ON DELETE CASCADE
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetWebDavPortalUsersSettingsByAccountId')
DROP PROCEDURE GetWebDavPortalUsersSettingsByAccountId
GO
CREATE PROCEDURE [dbo].[GetWebDavPortalUsersSettingsByAccountId]
(
@AccountId INT
)
AS
SELECT TOP 1
US.Id,
US.AccountId,
US.Settings
FROM WebDavPortalUsersSettings AS US
WHERE AccountId = @AccountId
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddWebDavPortalUsersSettings')
DROP PROCEDURE AddWebDavPortalUsersSettings
GO
CREATE PROCEDURE [dbo].[AddWebDavPortalUsersSettings]
(
@WebDavPortalUsersSettingsId INT OUTPUT,
@AccountId INT,
@Settings NVARCHAR(max)
)
AS
INSERT INTO WebDavPortalUsersSettings
(
AccountId,
Settings
)
VALUES
(
@AccountId,
@Settings
)
SET @WebDavPortalUsersSettingsId = SCOPE_IDENTITY()
RETURN
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateWebDavPortalUsersSettings')
DROP PROCEDURE UpdateWebDavPortalUsersSettings
GO
CREATE PROCEDURE [dbo].[UpdateWebDavPortalUsersSettings]
(
@AccountId INT,
@Settings NVARCHAR(max)
)
AS
UPDATE WebDavPortalUsersSettings
SET
Settings = @Settings
WHERE AccountId = @AccountId
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'SmarterMail 10.x +')
BEGIN
INSERT [dbo].[Providers] ([ProviderId], [GroupId], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES(66, 4, N'SmarterMail', N'SmarterMail 10.x +', N'WebsitePanel.Providers.Mail.SmarterMail10, WebsitePanel.Providers.Mail.SmarterMail10', N'SmarterMail100', NULL)
END
ELSE
BEGIN
UPDATE [dbo].[Providers] SET [EditorControl] = 'SmarterMail100' WHERE [DisplayName] = 'SmarterMail 10.x +'
END
GO
-- Service items count by name and serviceid
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetServiceItemsCountByNameAndServiceId')