UPDATE TBDD_MODULES SET DB_VERSION = '2.4.2.2' where NAME = 'Process-Manager';
GO
--Changed	10.07.2025	MS	Dynamisch LangPhrase erstellen wenn nicht vorhanden
ALTER PROCEDURE [dbo].[PRPM_CHANGE_CONTROL_CAPTION] (@pCTRL_ID INT,@NEW_CAPTION VARCHAR(100), @WHO VARCHAR(100),@LANG_CODE VARCHAR(5))
AS
    DECLARE @RESULT VARCHAR(250), @CTRL_CONFIG_TITLE VARCHAR(100)
    SELECT @CTRL_CONFIG_TITLE =  CTRL_TYPE + '.' + NAME FROM TBPM_PROFILE_CONTROLS WHERE GUID = @pCTRL_ID;
	PRINT '@CTRL_CONFIG_TITLE: ' + @CTRL_CONFIG_TITLE
	IF NOT EXISTS(SELECT GUID FROM TBDD_GUI_LANGUAGE_PHRASE WHERE MODULE = 'PM' AND TITLE = @CTRL_CONFIG_TITLE AND [LANGUAGE] = @LANG_CODE)
		BEGIN
			PRINT 'CONFIGURATION FOR CONTROL NOT EXISTING IN TBDD_GUI_LANGUAGE_PHRASE'
			INSERT INTO [TBDD_GUI_LANGUAGE_PHRASE] (
			[MODULE],	[TITLE],			[LANGUAGE],	CAPT_TYPE,						STRING1,		STRING2	,	OBJ_NAME) VALUES (
			'PM',		@CTRL_CONFIG_TITLE,	@LANG_CODE,	'Caption Validator Control',	@NEW_CAPTION,	'',			'frmValidator' );
		END
	ELSE
		UPDATE TBDD_GUI_LANGUAGE_PHRASE SET STRING1 = @NEW_CAPTION, CHANGED_WHO = @WHO
        WHERE OBJ_NAME = 'frmValidator' AND MODULE = 'PM' AND TITLE = @CTRL_CONFIG_TITLE AND [LANGUAGE] = @LANG_CODE;




