




CREATE VIEW [dbo].[ApiWorkersPHView]
AS
SELECT     op.ID Id, op.Name ,op. FullName Surname, ISNULL(f.Data,'')  AS Passwd,0 GroupId,
99  Priviliges, 'pl' lang, 'PLN' Currency,1 RepositoryId, 480 WorkTime,
'{"Menu":{"Customers":false,"Devices":false,"Activities":false,"toSummary":false,"Summaries":false,"Operators":true,"Items":false,"ErpDocuments":false,"ProdActions":false,"ProdOperations":false},"Tasks":{"DeleteTask":true,"OthersTasks":true,"OthersActivities":true},"Overtimes":{"OthersOvertimes":true,"SettlementOvertimes":true},"Config":{"ConfigOperators":true},"Items":{"showPrices":true},"Documents":{"showPrices":true,"onlyDefRepository":false,"onlyVendorDocuments":false},"Customers":{"onlyVendorCustomers":false}}' [Permissions],
'' Position, 0 SuperiorId, 0 WorkFrom,
0 [CustId]
      ,'' [EmailAdress]
      ,'' [ImapServer]
      ,'' [ImapUser]
      ,'' [ImapPassword]
      ,0 [ImapPort]
      ,0 [ImapSSL]
      ,'' [SmtpServer]
      ,'' [SmtpUser]
      ,'' [SmtpPassword]
      ,0 [SmtpPort]
      ,0 [SmtpSSL]
      ,0 [CheckMailBox]
      ,0 [ModelWorkerId]
      ,0 [EmaiTaskDefId]
      ,0 [SendEmailNotyfications]
	  , Id [ErpId], '' [CardNumber], 0 [WorkerId],0 [DepartamentId]

FROM         dbo.Operators AS op LEFT OUTER JOIN
              dbo.Features AS f ON f.ParentType = 'Operators' AND f.Name = 'PHpasswd' AND f.Parent = op.ID
GO


