UPDATE TBDD_MODULES SET DB_VERSION = '2.2.1.2' where NAME = 'Process-Manager'
GO

ALTER TABLE TBPM_PROFILE_CONTROLS ADD SAVE_CHANGE_ON_ENABLED BIT NOT NULL DEFAULT 0
GO
ALTER VIEW [dbo].[VWPM_CONTROL_INDEX] AS
SELECT TOP 100 PERCENT
	T1.GUID,
	T.GUID				PROFIL_ID,
	T.NAME				PROFIL_NAME,
	T.LOG_INDEX,
	T1.NAME				CTRL_NAME,
	T1.CTRL_TYPE,
	T1.CTRL_TEXT,
	T1.X_LOC,
	T1.Y_LOC,
	T1.FONT_COLOR,
	T1.FONT_FAMILY,
	T1.FONT_SIZE,
	T1.FONT_STYLE,
	T1.WIDTH,
	T1.HEIGHT,
	COALESCE(T1.INDEX_NAME,'') INDEX_NAME,
	0 AS IDB_TYP,
	T1.VALIDATION,
	T1.CHOICE_LIST,
	T1.TYP,
	T1.CONNECTION_ID,
	CASE  WHEN T1.[SQL_UEBERPRUEFUNG] IS NULL THEN '' ELSE T1.[SQL_UEBERPRUEFUNG] END AS [SQL_UEBERPRUEFUNG],
	T1.[READ_ONLY],
	T1.LOAD_IDX_VALUE,
	T1.DEFAULT_VALUE,
	T1.REGEX_MATCH,
	T1.REGEX_MESSAGE_DE,
	T1.REGEX_MESSAGE_EN,
	T1.OVERWRITE_DATA,
	T1.SET_CONTROL_DATA,
	T1.SAVE_CHANGE_ON_ENABLED
FROM 
	TBPM_PROFILE T,
	TBPM_PROFILE_CONTROLS T1
WHERE
	T.GUID = T1.PROFIL_ID
	AND T1.CONTROL_ACTIVE = 1
ORDER BY 
	T.GUID,
	T1.X_LOC,
	T1.Y_LOC
GO