IDEMPIERE-1788:Value preference for info window process parameters
This commit is contained in:
parent
ce124d7624
commit
85ed9b016f
|
@ -0,0 +1,118 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- Jun 4, 2014 9:40:09 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
INSERT INTO AD_Reference (AD_Reference_ID,Name,EntityType,AD_Reference_UU,IsOrderByValue,Description,ValidationType,AD_Org_ID,CreatedBy,Updated,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (200084,'ParentPreferenceType','D','8412d243-d7da-4064-8784-db1cca37c95e','N','Type of preference WEditor lie on (process, info window, window)','L',0,100,TO_DATE('2014-06-04 21:40:03','YYYY-MM-DD HH24:MI:SS'),'Y',TO_DATE('2014-06-04 21:40:03','YYYY-MM-DD HH24:MI:SS'),100,0)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 9:56:17 PM ICT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,Name,AD_Ref_List_UU,Value,Created,CreatedBy,Updated,UpdatedBy,IsActive,EntityType,AD_Client_ID,AD_Org_ID) VALUES (200188,200084,'Window','d16e365d-8cc1-489e-b909-89054fdf58af','W',TO_DATE('2014-06-04 21:56:08','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-06-04 21:56:08','YYYY-MM-DD HH24:MI:SS'),100,'Y','D',0,0)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 9:56:31 PM ICT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,Name,AD_Ref_List_UU,Value,Created,CreatedBy,Updated,UpdatedBy,IsActive,EntityType,AD_Client_ID,AD_Org_ID) VALUES (200189,200084,'Process','a9497c99-06dd-40ab-b866-b37d3fb60bc7','P',TO_DATE('2014-06-04 21:56:30','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2014-06-04 21:56:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','U',0,0)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 9:56:36 PM ICT
|
||||
UPDATE AD_Ref_List SET EntityType='D',Updated=TO_DATE('2014-06-04 21:56:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=200189
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:09:25 PM ICT
|
||||
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,FKConstraintName,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Table_ID) VALUES (0,'N',0,211276,'N','N','N',0,'N',22,'N','N','N','Y','4b259980-d1cd-4aed-87a0-7aa6787a53ee','Y','AD_Process_ID','Process or Report','The Process field identifies a unique Process or Report in the system.','Process','Y',TO_DATE('2014-06-04 22:09:24','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2014-06-04 22:09:24','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N','N','ad_process_preference','N',117,19,195)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:09:33 PM ICT
|
||||
ALTER TABLE AD_Preference ADD AD_Process_ID NUMBER(10) DEFAULT NULL
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:09:33 PM ICT
|
||||
ALTER TABLE AD_Preference ADD CONSTRAINT ad_process_preference FOREIGN KEY (AD_Process_ID) REFERENCES ad_process(ad_process_id) DEFERRABLE INITIALLY DEFERRED
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:13:04 PM ICT
|
||||
INSERT INTO AD_Element (ColumnName,AD_Element_ID,Name,Description,PrintName,AD_Element_UU,AD_Org_ID,CreatedBy,UpdatedBy,IsActive,AD_Client_ID,EntityType,Created,Updated) VALUES ('PreferenceFor',202716,'Preference For','Type of preference, it can window, info window or parameter process','Preference For','71eeaffc-a430-4bca-ad26-8ff04fc0e6ac',0,100,100,'Y',0,'D',TO_DATE('2014-06-04 22:12:53','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2014-06-04 22:12:53','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:14:15 PM ICT
|
||||
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID) VALUES (0,'N',0,211277,'N','N','N',0,'N',1,'N','N','N','Y','462b65e9-7f17-44dc-879c-771182fa0a3c','Y','PreferenceFor','Type of preference, it can window, info window or parameter process','W','Preference For','Y',TO_DATE('2014-06-04 22:14:14','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2014-06-04 22:14:14','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N','N','N',202716,17,200084,195)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:14:20 PM ICT
|
||||
ALTER TABLE AD_Preference ADD PreferenceFor CHAR(1) DEFAULT 'W'
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:16:12 PM ICT
|
||||
INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,IsActive,Updated,UpdatedBy,AD_TableIndex_ID,SeqNo,AD_Column_ID,EntityType) VALUES (0,0,201242,'74e5f7d2-2f62-4b48-a1ec-0ef1f85c9a63',TO_DATE('2014-06-04 22:16:11','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2014-06-04 22:16:11','YYYY-MM-DD HH24:MI:SS'),100,200141,0,211277,'D')
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:16:48 PM ICT
|
||||
INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,IsActive,Updated,UpdatedBy,AD_TableIndex_ID,SeqNo,AD_Column_ID,EntityType) VALUES (0,0,201243,'423ef2ae-1412-470c-857e-949614c5946c',TO_DATE('2014-06-04 22:16:47','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_DATE('2014-06-04 22:16:47','YYYY-MM-DD HH24:MI:SS'),100,200141,0,211276,'D')
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:18:27 PM ICT
|
||||
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2014-06-04 22:18:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211277
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:18:33 PM ICT
|
||||
ALTER TABLE AD_Preference MODIFY PreferenceFor CHAR(1) DEFAULT 'W'
|
||||
;
|
||||
|
||||
|
||||
UPDATE AD_Preference SET preferencefor = 'W'
|
||||
;
|
||||
|
||||
|
||||
-- Jun 4, 2014 10:18:33 PM ICT
|
||||
ALTER TABLE AD_Preference MODIFY PreferenceFor NOT NULL
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:20:18 PM ICT
|
||||
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus,AD_Column_ID,EntityType,Created) VALUES (0,'N',156,0,'N','N',90,'Y',203058,'N','Type of preference, it can window, info window or parameter process','Preference For','792c877f-3415-43e4-8660-a4c0a1f78552','Y','N',100,0,100,TO_DATE('2014-06-04 22:20:17','YYYY-MM-DD HH24:MI:SS'),'Y','Y',90,1,'N',0,1,1,'N','N',211277,'D',TO_DATE('2014-06-04 22:20:17','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:20:52 PM ICT
|
||||
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus,AD_Column_ID,EntityType,Created) VALUES (0,'N',156,0,'N','N',100,'Y',203059,'N','The Process field identifies a unique Process or Report in the system.','Process or Report','Process','407aabeb-f94d-405b-bdaa-6212bd2df853','Y','N',100,0,100,TO_DATE('2014-06-04 22:20:51','YYYY-MM-DD HH24:MI:SS'),'Y','Y',100,1,'N',0,1,1,'N','N',211276,'D',TO_DATE('2014-06-04 22:20:51','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=10,Updated=TO_DATE('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=661
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=20,Updated=TO_DATE('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=902
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=30, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=663
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=40, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=659
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=60, IsDisplayed='Y', XPosition=4, ColumnSpan=2,Updated=TO_DATE('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203059
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=70, IsDisplayed='Y', XPosition=1, ColumnSpan=2,Updated=TO_DATE('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203058
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=80, IsDisplayed='Y', XPosition=4, ColumnSpan=2,Updated=TO_DATE('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=877
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=90,Updated=TO_DATE('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=662
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=658
|
||||
;
|
||||
-- Jun 6, 2014 1:19:24 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
INSERT INTO AD_Window (Processing,WindowType,IsSOTrx,IsDefault,IsBetaFunctionality,WinHeight,WinWidth,EntityType,Name,Description,AD_Window_ID,AD_Window_UU,Updated,AD_Org_ID,IsActive,UpdatedBy,CreatedBy,AD_Client_ID,Created) VALUES ('N','Q','Y','N','N',0,0,'D','Dummy','This window if for save preference for process parameter panel and info window in case open from menu (stand alone window)',200054,'25099c88-2b91-4f01-8b21-02ef5de79505',TO_DATE('2014-06-06 13:19:22','YYYY-MM-DD HH24:MI:SS'),0,'Y',100,100,0,TO_DATE('2014-06-06 13:19:22','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
SELECT register_migration_script('201406041604_IDEMPIERE-1788.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,14 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- Jul 10, 2014 6:44:09 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
DROP INDEX ad_preference_attribute
|
||||
;
|
||||
|
||||
-- Jul 10, 2014 6:44:09 PM ICT
|
||||
CREATE UNIQUE INDEX ad_preference_attribute ON AD_Preference (PreferenceFor,AD_Process_ID,AD_Client_ID,AD_Org_ID,AD_Window_ID,AD_User_ID,Attribute)
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201407101604_IDEMPIERE-1788-fix-unq-index.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,113 @@
|
|||
-- Jun 4, 2014 9:40:09 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
INSERT INTO AD_Reference (AD_Reference_ID,Name,EntityType,AD_Reference_UU,IsOrderByValue,Description,ValidationType,AD_Org_ID,CreatedBy,Updated,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (200084,'ParentPreferenceType','D','8412d243-d7da-4064-8784-db1cca37c95e','N','Type of preference WEditor lie on (process, info window, window)','L',0,100,TO_TIMESTAMP('2014-06-04 21:40:03','YYYY-MM-DD HH24:MI:SS'),'Y',TO_TIMESTAMP('2014-06-04 21:40:03','YYYY-MM-DD HH24:MI:SS'),100,0)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 9:56:17 PM ICT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,Name,AD_Ref_List_UU,Value,Created,CreatedBy,Updated,UpdatedBy,IsActive,EntityType,AD_Client_ID,AD_Org_ID) VALUES (200188,200084,'Window','d16e365d-8cc1-489e-b909-89054fdf58af','W',TO_TIMESTAMP('2014-06-04 21:56:08','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-06-04 21:56:08','YYYY-MM-DD HH24:MI:SS'),100,'Y','D',0,0)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 9:56:31 PM ICT
|
||||
INSERT INTO AD_Ref_List (AD_Ref_List_ID,AD_Reference_ID,Name,AD_Ref_List_UU,Value,Created,CreatedBy,Updated,UpdatedBy,IsActive,EntityType,AD_Client_ID,AD_Org_ID) VALUES (200189,200084,'Process','a9497c99-06dd-40ab-b866-b37d3fb60bc7','P',TO_TIMESTAMP('2014-06-04 21:56:30','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2014-06-04 21:56:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','U',0,0)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 9:56:36 PM ICT
|
||||
UPDATE AD_Ref_List SET EntityType='D',Updated=TO_TIMESTAMP('2014-06-04 21:56:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=200189
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:09:25 PM ICT
|
||||
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,FKConstraintName,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Table_ID) VALUES (0,'N',0,211276,'N','N','N',0,'N',22,'N','N','N','Y','4b259980-d1cd-4aed-87a0-7aa6787a53ee','Y','AD_Process_ID','Process or Report','The Process field identifies a unique Process or Report in the system.','Process','Y',TO_TIMESTAMP('2014-06-04 22:09:24','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2014-06-04 22:09:24','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N','N','ad_process_preference','N',117,19,195)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:09:33 PM ICT
|
||||
ALTER TABLE AD_Preference ADD COLUMN AD_Process_ID NUMERIC(10) DEFAULT NULL
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:09:33 PM ICT
|
||||
ALTER TABLE AD_Preference ADD CONSTRAINT ad_process_preference FOREIGN KEY (AD_Process_ID) REFERENCES ad_process(ad_process_id) DEFERRABLE INITIALLY DEFERRED
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:13:04 PM ICT
|
||||
INSERT INTO AD_Element (ColumnName,AD_Element_ID,Name,Description,PrintName,AD_Element_UU,AD_Org_ID,CreatedBy,UpdatedBy,IsActive,AD_Client_ID,EntityType,Created,Updated) VALUES ('PreferenceFor',202716,'Preference For','Type of preference, it can window, info window or parameter process','Preference For','71eeaffc-a430-4bca-ad26-8ff04fc0e6ac',0,100,100,'Y',0,'D',TO_TIMESTAMP('2014-06-04 22:12:53','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2014-06-04 22:12:53','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:14:15 PM ICT
|
||||
INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,IsSecure,FKConstraintType,AD_Element_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID) VALUES (0,'N',0,211277,'N','N','N',0,'N',1,'N','N','N','Y','462b65e9-7f17-44dc-879c-771182fa0a3c','Y','PreferenceFor','Type of preference, it can window, info window or parameter process','W','Preference For','Y',TO_TIMESTAMP('2014-06-04 22:14:14','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2014-06-04 22:14:14','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N','N','N',202716,17,200084,195)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:14:20 PM ICT
|
||||
ALTER TABLE AD_Preference ADD COLUMN PreferenceFor CHAR(1) DEFAULT 'W'
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:16:12 PM ICT
|
||||
INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,IsActive,Updated,UpdatedBy,AD_TableIndex_ID,SeqNo,AD_Column_ID,EntityType) VALUES (0,0,201242,'74e5f7d2-2f62-4b48-a1ec-0ef1f85c9a63',TO_TIMESTAMP('2014-06-04 22:16:11','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2014-06-04 22:16:11','YYYY-MM-DD HH24:MI:SS'),100,200141,0,211277,'D')
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:16:48 PM ICT
|
||||
INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,IsActive,Updated,UpdatedBy,AD_TableIndex_ID,SeqNo,AD_Column_ID,EntityType) VALUES (0,0,201243,'423ef2ae-1412-470c-857e-949614c5946c',TO_TIMESTAMP('2014-06-04 22:16:47','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2014-06-04 22:16:47','YYYY-MM-DD HH24:MI:SS'),100,200141,0,211276,'D')
|
||||
;
|
||||
|
||||
UPDATE AD_Preference SET preferencefor = 'W'
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:18:27 PM ICT
|
||||
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2014-06-04 22:18:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211277
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:18:33 PM ICT
|
||||
INSERT INTO t_alter_column values('ad_preference','PreferenceFor','CHAR(1)',null,'W')
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:18:33 PM ICT
|
||||
INSERT INTO t_alter_column values('ad_preference','PreferenceFor',null,'NOT NULL',null)
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:20:18 PM ICT
|
||||
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus,AD_Column_ID,EntityType,Created) VALUES (0,'N',156,0,'N','N',90,'Y',203058,'N','Type of preference, it can window, info window or parameter process','Preference For','792c877f-3415-43e4-8660-a4c0a1f78552','Y','N',100,0,100,TO_TIMESTAMP('2014-06-04 22:20:17','YYYY-MM-DD HH24:MI:SS'),'Y','Y',90,1,'N',0,1,1,'N','N',211277,'D',TO_TIMESTAMP('2014-06-04 22:20:17','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:20:52 PM ICT
|
||||
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines,IsAdvancedField,IsDefaultFocus,AD_Column_ID,EntityType,Created) VALUES (0,'N',156,0,'N','N',100,'Y',203059,'N','The Process field identifies a unique Process or Report in the system.','Process or Report','Process','407aabeb-f94d-405b-bdaa-6212bd2df853','Y','N',100,0,100,TO_TIMESTAMP('2014-06-04 22:20:51','YYYY-MM-DD HH24:MI:SS'),'Y','Y',100,1,'N',0,1,1,'N','N',211276,'D',TO_TIMESTAMP('2014-06-04 22:20:51','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=10,Updated=TO_TIMESTAMP('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=661
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=20,Updated=TO_TIMESTAMP('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=902
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=30, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=663
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=40, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=659
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=60, IsDisplayed='Y', XPosition=4, ColumnSpan=2,Updated=TO_TIMESTAMP('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203059
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=70, IsDisplayed='Y', XPosition=1, ColumnSpan=2,Updated=TO_TIMESTAMP('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=203058
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=80, IsDisplayed='Y', XPosition=4, ColumnSpan=2,Updated=TO_TIMESTAMP('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=877
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=662
|
||||
;
|
||||
|
||||
-- Jun 4, 2014 10:22:09 PM ICT
|
||||
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2014-06-04 22:22:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=658
|
||||
;
|
||||
-- Jun 6, 2014 1:19:24 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
INSERT INTO AD_Window (Processing,WindowType,IsSOTrx,IsDefault,IsBetaFunctionality,WinHeight,WinWidth,EntityType,Name,Description,AD_Window_ID,AD_Window_UU,Updated,AD_Org_ID,IsActive,UpdatedBy,CreatedBy,AD_Client_ID,Created) VALUES ('N','Q','Y','N','N',0,0,'D','Dummy','This window if for save preference for process parameter panel and info window in case open from menu (stand alone window)',200054,'25099c88-2b91-4f01-8b21-02ef5de79505',TO_TIMESTAMP('2014-06-06 13:19:22','YYYY-MM-DD HH24:MI:SS'),0,'Y',100,100,0,TO_TIMESTAMP('2014-06-06 13:19:22','YYYY-MM-DD HH24:MI:SS'))
|
||||
;
|
||||
SELECT register_migration_script('201406041604_IDEMPIERE-1788.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,10 @@
|
|||
-- Jul 10, 2014 6:44:09 PM ICT
|
||||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
|
||||
DROP INDEX ad_preference_attribute
|
||||
;
|
||||
|
||||
-- Jul 10, 2014 6:44:09 PM ICT
|
||||
CREATE UNIQUE INDEX ad_preference_attribute ON AD_Preference (PreferenceFor,AD_Process_ID,AD_Client_ID,AD_Org_ID,AD_Window_ID,AD_User_ID,Attribute)
|
||||
;
|
||||
SELECT register_migration_script('201407101604_IDEMPIERE-1788-fix-unq-index.sql') FROM dual
|
||||
;
|
|
@ -81,7 +81,7 @@ public class GridField
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -2699974883136279635L;
|
||||
private static final long serialVersionUID = -3759342619253398035L;
|
||||
|
||||
/**
|
||||
* Field Constructor.
|
||||
|
@ -660,6 +660,14 @@ public class GridField
|
|||
} // while more Tokens
|
||||
} // Default value
|
||||
|
||||
if (getAD_Process_ID_Of_Panel() > 0){
|
||||
defStr = Env.getPreference (m_vo.ctx, getAD_Window_ID_Of_Panel(), getAD_Process_ID_Of_Panel(), m_vo.ColumnName);
|
||||
if (!defStr.equals(""))
|
||||
{
|
||||
if (log.isLoggable(Level.FINE)) log.fine("[Process Parameter Preference] " + m_vo.ColumnName + "=" + defStr);
|
||||
return createDefault(defStr);
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* (d) Preference (user) - P|
|
||||
*/
|
||||
|
@ -680,6 +688,8 @@ public class GridField
|
|||
return createDefault(defStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* (f) DataType defaults
|
||||
*/
|
||||
|
@ -1053,6 +1063,23 @@ public class GridField
|
|||
{
|
||||
return m_vo.AD_Window_ID;
|
||||
}
|
||||
/**
|
||||
* in case this field lie on parameter process panel, AD_Process_ID_Of_Panel is id of process will run in this panel
|
||||
* it's difference with AD_Process_ID
|
||||
*/
|
||||
public int getAD_Process_ID_Of_Panel()
|
||||
{
|
||||
return m_vo.AD_Process_ID_Of_Panel;
|
||||
}
|
||||
|
||||
/**
|
||||
* in case this field lie on parameter process panel, AD_Process_ID_Of_Panel is id of process will run in this panel
|
||||
* it's difference with AD_Process_ID
|
||||
*/
|
||||
public int getAD_Window_ID_Of_Panel()
|
||||
{
|
||||
return m_vo.AD_Window_ID_Of_Panel > 0 ? m_vo.AD_Window_ID_Of_Panel : m_vo.AD_Window_ID;
|
||||
}
|
||||
|
||||
/** get AD_Chart_ID
|
||||
* @return chart id
|
||||
|
|
|
@ -46,9 +46,7 @@ public class GridFieldVO implements Serializable
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 7595228091613559685L;
|
||||
|
||||
|
||||
private static final long serialVersionUID = 6391887120974125904L;
|
||||
|
||||
/**
|
||||
* Return the SQL statement used for the MFieldVO.create
|
||||
|
@ -314,13 +312,15 @@ public class GridFieldVO implements Serializable
|
|||
* @param rs result set AD_Process_Para
|
||||
* @return MFieldVO
|
||||
*/
|
||||
public static GridFieldVO createParameter (Properties ctx, int WindowNo, ResultSet rs)
|
||||
public static GridFieldVO createParameter (Properties ctx, int WindowNo, int ProcessIDOfPanel, int WindowIDOfPanel, ResultSet rs)
|
||||
{
|
||||
GridFieldVO vo = new GridFieldVO (ctx, WindowNo, 0, 0, 0, false);
|
||||
vo.isProcess = true;
|
||||
vo.IsDisplayed = true;
|
||||
vo.IsReadOnly = false;
|
||||
vo.IsUpdateable = true;
|
||||
vo.AD_Process_ID_Of_Panel = ProcessIDOfPanel;
|
||||
vo.AD_Window_ID_Of_Panel = WindowIDOfPanel;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -399,6 +399,7 @@ public class GridFieldVO implements Serializable
|
|||
voT.IsEncryptedField = voF.IsEncryptedField;
|
||||
voT.ReadOnlyLogic = voF.ReadOnlyLogic;
|
||||
voT.DisplayLogic = voF.DisplayLogic;
|
||||
voT.AD_Process_ID_Of_Panel = voF.AD_Process_ID_Of_Panel;
|
||||
voT.initFinish();
|
||||
|
||||
return voT;
|
||||
|
@ -487,6 +488,12 @@ public class GridFieldVO implements Serializable
|
|||
public int TabNo;
|
||||
/** AD_Winmdow_ID */
|
||||
public int AD_Window_ID;
|
||||
/**
|
||||
* in case this field lie on parameter process panel, AD_Process_ID_Of_Panel is id of process will run in this panel
|
||||
* it's difference with AD_Process_ID
|
||||
*/
|
||||
public int AD_Process_ID_Of_Panel;
|
||||
public int AD_Window_ID_Of_Panel;
|
||||
/** AD_Tab_ID */
|
||||
public int AD_Tab_ID;
|
||||
/** Is the Tab Read Only */
|
||||
|
@ -756,7 +763,8 @@ public class GridFieldVO implements Serializable
|
|||
// Process Parameter
|
||||
clone.isRange = isRange;
|
||||
clone.DefaultValue2 = DefaultValue2;
|
||||
|
||||
clone.AD_Process_ID_Of_Panel = AD_Process_ID_Of_Panel;
|
||||
clone.AD_Window_ID_Of_Panel = AD_Window_ID_Of_Panel;
|
||||
return clone;
|
||||
} // clone
|
||||
|
||||
|
|
|
@ -84,6 +84,21 @@ public interface I_AD_Preference
|
|||
/** Get AD_Preference_UU */
|
||||
public String getAD_Preference_UU();
|
||||
|
||||
/** Column name AD_Process_ID */
|
||||
public static final String COLUMNNAME_AD_Process_ID = "AD_Process_ID";
|
||||
|
||||
/** Set Process.
|
||||
* Process or Report
|
||||
*/
|
||||
public void setAD_Process_ID (int AD_Process_ID);
|
||||
|
||||
/** Get Process.
|
||||
* Process or Report
|
||||
*/
|
||||
public int getAD_Process_ID();
|
||||
|
||||
public org.compiere.model.I_AD_Process getAD_Process() throws RuntimeException;
|
||||
|
||||
/** Column name AD_User_ID */
|
||||
public static final String COLUMNNAME_AD_User_ID = "AD_User_ID";
|
||||
|
||||
|
@ -152,6 +167,19 @@ public interface I_AD_Preference
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/** Column name PreferenceFor */
|
||||
public static final String COLUMNNAME_PreferenceFor = "PreferenceFor";
|
||||
|
||||
/** Set Preference For.
|
||||
* Type of preference, it can window, info window or parameter process
|
||||
*/
|
||||
public void setPreferenceFor (String PreferenceFor);
|
||||
|
||||
/** Get Preference For.
|
||||
* Type of preference, it can window, info window or parameter process
|
||||
*/
|
||||
public String getPreferenceFor();
|
||||
|
||||
/** Column name Updated */
|
||||
public static final String COLUMNNAME_Updated = "Updated";
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public class X_AD_Preference extends PO implements I_AD_Preference, I_Persistent
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20131031L;
|
||||
private static final long serialVersionUID = 20140604L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_AD_Preference (Properties ctx, int AD_Preference_ID, String trxName)
|
||||
|
@ -40,6 +40,8 @@ public class X_AD_Preference extends PO implements I_AD_Preference, I_Persistent
|
|||
{
|
||||
setAD_Preference_ID (0);
|
||||
setAttribute (null);
|
||||
setPreferenceFor (null);
|
||||
// W
|
||||
setValue (null);
|
||||
} */
|
||||
}
|
||||
|
@ -109,6 +111,34 @@ public class X_AD_Preference extends PO implements I_AD_Preference, I_Persistent
|
|||
return (String)get_Value(COLUMNNAME_AD_Preference_UU);
|
||||
}
|
||||
|
||||
public org.compiere.model.I_AD_Process getAD_Process() throws RuntimeException
|
||||
{
|
||||
return (org.compiere.model.I_AD_Process)MTable.get(getCtx(), org.compiere.model.I_AD_Process.Table_Name)
|
||||
.getPO(getAD_Process_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Process.
|
||||
@param AD_Process_ID
|
||||
Process or Report
|
||||
*/
|
||||
public void setAD_Process_ID (int AD_Process_ID)
|
||||
{
|
||||
if (AD_Process_ID < 1)
|
||||
set_Value (COLUMNNAME_AD_Process_ID, null);
|
||||
else
|
||||
set_Value (COLUMNNAME_AD_Process_ID, Integer.valueOf(AD_Process_ID));
|
||||
}
|
||||
|
||||
/** Get Process.
|
||||
@return Process or Report
|
||||
*/
|
||||
public int getAD_Process_ID ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Process_ID);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException
|
||||
{
|
||||
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
|
||||
|
@ -187,6 +217,30 @@ public class X_AD_Preference extends PO implements I_AD_Preference, I_Persistent
|
|||
return new KeyNamePair(get_ID(), getAttribute());
|
||||
}
|
||||
|
||||
/** PreferenceFor AD_Reference_ID=200084 */
|
||||
public static final int PREFERENCEFOR_AD_Reference_ID=200084;
|
||||
/** Window = W */
|
||||
public static final String PREFERENCEFOR_Window = "W";
|
||||
/** Process = P */
|
||||
public static final String PREFERENCEFOR_Process = "P";
|
||||
/** Set Preference For.
|
||||
@param PreferenceFor
|
||||
Type of preference, it can window, info window or parameter process
|
||||
*/
|
||||
public void setPreferenceFor (String PreferenceFor)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_PreferenceFor, PreferenceFor);
|
||||
}
|
||||
|
||||
/** Get Preference For.
|
||||
@return Type of preference, it can window, info window or parameter process
|
||||
*/
|
||||
public String getPreferenceFor ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_PreferenceFor);
|
||||
}
|
||||
|
||||
/** Set Search Key.
|
||||
@param Value
|
||||
Search key for the record in the format required - must be unique
|
||||
|
|
|
@ -960,6 +960,17 @@ public final class Env
|
|||
return (retValue == null ? "" : retValue);
|
||||
} // getPreference
|
||||
|
||||
public static String getPreference (Properties ctx, int AD_Window_ID, int AD_Process_ID_Of_Panel, String context)
|
||||
{
|
||||
if (ctx == null || context == null)
|
||||
throw new IllegalArgumentException ("Require Context");
|
||||
String retValue = null;
|
||||
|
||||
retValue = ctx.getProperty("P"+AD_Window_ID+"|"+ AD_Process_ID_Of_Panel + "|" + context);
|
||||
|
||||
return (retValue == null ? "" : retValue);
|
||||
} // getPreference
|
||||
|
||||
/**************************************************************************
|
||||
* Language issues
|
||||
*/
|
||||
|
|
|
@ -928,7 +928,7 @@ public class Login
|
|||
|
||||
// This reads all relevant window neutral defaults
|
||||
// overwriting superseeded ones. Window specific is read in Mainain
|
||||
sql = "SELECT Attribute, Value, AD_Window_ID "
|
||||
sql = "SELECT Attribute, Value, AD_Window_ID, AD_Process_ID, PreferenceFor "
|
||||
+ "FROM AD_Preference "
|
||||
+ "WHERE AD_Client_ID IN (0, @#AD_Client_ID@)"
|
||||
+ " AND AD_Org_ID IN (0, @#AD_Org_ID@)"
|
||||
|
@ -946,11 +946,22 @@ public class Login
|
|||
while (rs.next())
|
||||
{
|
||||
int AD_Window_ID = rs.getInt(3);
|
||||
boolean isAllWindow = rs.wasNull();
|
||||
int AD_Process_ID = rs.getInt(4);
|
||||
String PreferenceFor = rs.getString(5);
|
||||
String at = "";
|
||||
if (rs.wasNull())
|
||||
|
||||
// preference for window
|
||||
if ("W".equals(PreferenceFor)){
|
||||
if (isAllWindow)
|
||||
at = "P|" + rs.getString(1);
|
||||
else
|
||||
else
|
||||
at = "P" + AD_Window_ID + "|" + rs.getString(1);
|
||||
}else if ("P".equals(PreferenceFor)){ // preference for processs
|
||||
// when apply for all window or all process format is "P0|0|m_Attribute;
|
||||
at = "P" + AD_Window_ID + "|" + AD_Process_ID + "|" + rs.getString(1);
|
||||
}
|
||||
|
||||
String va = rs.getString(2);
|
||||
Env.setContext(m_ctx, at, va);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ProcessParameter extends CDialog
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3898982577949513358L;
|
||||
private static final long serialVersionUID = 5813968036015697042L;
|
||||
|
||||
/**
|
||||
* Dynamic generated Parameter Dialog screen.
|
||||
|
@ -91,11 +91,15 @@ public class ProcessParameter extends CDialog
|
|||
//
|
||||
m_WindowNo = WindowNo;
|
||||
m_processInfo = pi;
|
||||
|
||||
// TODO: set m_AD_Window_ID, is AD_Window_ID of window below this dialog
|
||||
//
|
||||
} // ProcessParameter
|
||||
|
||||
private Frame m_frame;
|
||||
private int m_WindowNo;
|
||||
// AD_Window of window below this dialog in case show parameter dialog panel
|
||||
private int m_AD_Window_ID;
|
||||
private ProcessInfo m_processInfo;
|
||||
private boolean m_isOK = false;
|
||||
/** Logger */
|
||||
|
@ -292,7 +296,7 @@ public class ProcessParameter extends CDialog
|
|||
private void createField (ResultSet rs)
|
||||
{
|
||||
// Create Field
|
||||
GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo, rs);
|
||||
GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo, m_processInfo.getAD_Process_ID(), m_AD_Window_ID, rs);
|
||||
GridField mField = new GridField (voF);
|
||||
m_mFields.add(mField); // add to Fields
|
||||
|
||||
|
|
|
@ -63,10 +63,10 @@ import org.compiere.util.Msg;
|
|||
* @version 2006-12-01
|
||||
*/
|
||||
public class ProcessParameterPanel extends CPanel implements VetoableChangeListener, IProcessParameter {
|
||||
/**
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -111202562692738248L;
|
||||
private static final long serialVersionUID = -8583999032745045111L;
|
||||
|
||||
/**
|
||||
* Dynamic generated Parameter panel.
|
||||
|
@ -86,11 +86,14 @@ public class ProcessParameterPanel extends CPanel implements VetoableChangeListe
|
|||
//
|
||||
m_WindowNo = WindowNo;
|
||||
m_processInfo = pi;
|
||||
// TODO: set m_AD_Window_ID, is AD_Window_ID of window below this dialog
|
||||
//
|
||||
} // ProcessParameterPanel
|
||||
|
||||
private int m_WindowNo;
|
||||
private ProcessInfo m_processInfo;
|
||||
// AD_Window of window below this dialog in case show parameter dialog panel
|
||||
private int m_AD_Window_ID;
|
||||
/** Logger */
|
||||
private static CLogger log = CLogger.getCLogger(ProcessParameterPanel.class);
|
||||
//
|
||||
|
@ -283,7 +286,7 @@ public class ProcessParameterPanel extends CPanel implements VetoableChangeListe
|
|||
private void createField (ResultSet rs)
|
||||
{
|
||||
// Create Field
|
||||
GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo, rs);
|
||||
GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo, m_processInfo.getAD_Process_ID(), m_AD_Window_ID, rs);
|
||||
GridField mField = new GridField (voF);
|
||||
m_mFields.add(mField); // add to Fields
|
||||
|
||||
|
|
|
@ -62,11 +62,11 @@ import org.zkoss.zul.Vbox;
|
|||
* @version $Id: ValuePreference.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
|
||||
*/
|
||||
public class ValuePreference extends Window implements EventListener<Event>
|
||||
{
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 471820722501563271L;
|
||||
private static final long serialVersionUID = 737741552754618206L;
|
||||
|
||||
/**
|
||||
* Factory
|
||||
|
@ -105,7 +105,7 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
|
||||
// Get from mField
|
||||
// AD_Window_ID, DisplayAttribute, Attribute, DisplayType, AD_Referenece_ID
|
||||
int AD_Window_ID = mField.getAD_Window_ID();
|
||||
int AD_Window_ID = mField.getAD_Window_ID_Of_Panel();
|
||||
String Attribute = mField.getColumnName();
|
||||
String DisplayAttribute = mField.getHeader();
|
||||
int displayType = mField.getDisplayType();
|
||||
|
@ -121,7 +121,7 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
// Create Editor
|
||||
@SuppressWarnings("unused")
|
||||
ValuePreference vp = new ValuePreference (WindowNo,
|
||||
AD_Client_ID, AD_Org_ID, AD_User_ID, AD_Window_ID,
|
||||
AD_Client_ID, AD_Org_ID, AD_User_ID, AD_Window_ID, mField.getAD_Process_ID_Of_Panel(),
|
||||
Attribute, DisplayAttribute, Value, DisplayValue,
|
||||
displayType, AD_Reference_ID, ref);
|
||||
} // create
|
||||
|
@ -183,7 +183,7 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
* @param ref
|
||||
*/
|
||||
public ValuePreference (int WindowNo,
|
||||
int AD_Client_ID, int AD_Org_ID, int AD_User_ID, int AD_Window_ID,
|
||||
int AD_Client_ID, int AD_Org_ID, int AD_User_ID, int AD_Window_ID, int AD_Process_ID_Of_Panel,
|
||||
String Attribute, String DisplayAttribute, String Value, String DisplayValue,
|
||||
int displayType, int AD_Reference_ID, Component ref)
|
||||
{
|
||||
|
@ -206,6 +206,7 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
m_Value = Value;
|
||||
m_DisplayValue = DisplayValue;
|
||||
m_DisplayType = displayType;
|
||||
m_AD_Process_ID_Of_Panel = AD_Process_ID_Of_Panel;
|
||||
//
|
||||
m_role = MRole.getDefault();
|
||||
try
|
||||
|
@ -247,6 +248,7 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
private String m_DisplayValue;
|
||||
private int m_DisplayType;
|
||||
private MRole m_role;
|
||||
private int m_AD_Process_ID_Of_Panel;
|
||||
|
||||
// Display
|
||||
private Panel setPanel = new Panel();
|
||||
|
@ -262,6 +264,7 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
private Checkbox cbOrg = new Checkbox();
|
||||
private Checkbox cbUser = new Checkbox();
|
||||
private Checkbox cbWindow = new Checkbox();
|
||||
private Checkbox cbProcess = new Checkbox();
|
||||
private Label lExplanation = new Label();
|
||||
|
||||
private ConfirmPanel confirmPanel = new ConfirmPanel(true);
|
||||
|
@ -283,6 +286,8 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
cbUser.setChecked(true);
|
||||
cbWindow.setLabel(Msg.translate(m_ctx, "AD_Window_ID"));
|
||||
cbWindow.setChecked(true);
|
||||
cbProcess.setLabel(Msg.translate(m_ctx, "AD_Process_ID"));
|
||||
cbProcess.setChecked(true);
|
||||
//
|
||||
setPanel.appendChild(setLayout);
|
||||
setPanel.setHflex("1");
|
||||
|
@ -330,7 +335,10 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
chlayout.appendChild(cbOrg);
|
||||
chlayout.appendChild(cbUser);
|
||||
chlayout.appendChild(cbWindow);
|
||||
row.appendCellChild(chlayout, 4);
|
||||
if(m_AD_Process_ID_Of_Panel > 0){
|
||||
chlayout.appendChild(cbProcess);
|
||||
}
|
||||
row.appendCellChild(chlayout, 5);
|
||||
rows.appendChild(row);
|
||||
|
||||
row = new Row();
|
||||
|
@ -393,6 +401,7 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
}
|
||||
// Can change all/specific
|
||||
cbWindow.addEventListener(Events.ON_CHECK, this);
|
||||
cbProcess.addEventListener(Events.ON_CHECK, this);
|
||||
|
||||
// Other
|
||||
confirmPanel.addComponentsLeft(confirmPanel.createButton("Delete"));
|
||||
|
@ -457,6 +466,14 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
expl.append(" and this Window");
|
||||
else
|
||||
expl.append(" and all Windows");
|
||||
//
|
||||
if (m_AD_Process_ID_Of_Panel > 0){
|
||||
if (cbProcess.isChecked())
|
||||
expl.append(" and this Process");
|
||||
else
|
||||
expl.append(" and all Process");
|
||||
}
|
||||
|
||||
//
|
||||
if (Env.getLanguage(Env.getCtx()).isBaseLanguage())
|
||||
{
|
||||
|
@ -483,6 +500,20 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
sql.append(" AND AD_Window_ID=").append(m_AD_Window_ID);
|
||||
else
|
||||
sql.append(" AND AD_Window_ID IS NULL");
|
||||
|
||||
if (m_AD_Process_ID_Of_Panel > 0){
|
||||
// preference for process parameter
|
||||
sql.append(" AND PreferenceFor = 'P'");
|
||||
if (cbProcess.isChecked())
|
||||
sql.append(" AND AD_Process_ID=").append(m_AD_Process_ID_Of_Panel);
|
||||
else
|
||||
sql.append(" AND AD_Process_ID IS NULL");
|
||||
}else{
|
||||
// preference for process window
|
||||
sql.append(" AND PreferenceFor = 'W'");
|
||||
sql.append(" AND AD_Process_ID IS NULL");
|
||||
}
|
||||
|
||||
sql.append(" AND Attribute='").append(m_Attribute).append("'");
|
||||
//
|
||||
if (log.isLoggable(Level.FINE)) log.fine( sql.toString());
|
||||
|
@ -498,10 +529,19 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
*/
|
||||
private String getContextKey()
|
||||
{
|
||||
if (m_AD_Process_ID_Of_Panel > 0){
|
||||
if (cbProcess.isChecked())
|
||||
return "P" + m_AD_Window_ID + "|" + m_AD_Process_ID_Of_Panel + "|" + m_Attribute;
|
||||
else{
|
||||
return "P" + m_AD_Window_ID + "|0|" + m_Attribute;
|
||||
}
|
||||
}else{
|
||||
if (cbWindow.isChecked())
|
||||
return "P" + m_AD_Window_ID + "|" + m_Attribute;
|
||||
else
|
||||
return "P|" + m_Attribute;
|
||||
}
|
||||
|
||||
} // getContextKey
|
||||
|
||||
/**
|
||||
|
@ -535,13 +575,31 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
//
|
||||
StringBuilder sql = new StringBuilder ("INSERT INTO AD_Preference ("
|
||||
+ "AD_Preference_ID, AD_Preference_UU, AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy,Updated,UpdatedBy,"
|
||||
+ "AD_Window_ID, AD_User_ID, Attribute, Value) VALUES (");
|
||||
+ "AD_Window_ID, AD_Process_ID, PreferenceFor, AD_User_ID, Attribute, Value) VALUES (");
|
||||
sql.append(AD_Preference_ID).append(",").append(DB.TO_STRING(UUID.randomUUID().toString())).append(",").append(Client_ID).append(",").append(Org_ID)
|
||||
.append(", 'Y',SysDate,").append(m_AD_User_ID).append(",SysDate,").append(m_AD_User_ID).append(", ");
|
||||
|
||||
if (cbWindow.isChecked())
|
||||
sql.append(m_AD_Window_ID).append(",");
|
||||
else
|
||||
sql.append("NULL,") ;
|
||||
|
||||
// set value for AD_Process_ID and PreferenceFor
|
||||
if(m_AD_Process_ID_Of_Panel > 0){
|
||||
if (cbProcess.isChecked()){
|
||||
sql.append(m_AD_Process_ID_Of_Panel).append(",");
|
||||
}else{
|
||||
sql.append("NULL,");
|
||||
}
|
||||
// in case Preference for process, set PreferenceFor = P
|
||||
sql.append("'P',");
|
||||
}else{
|
||||
// in case Preference for window, AD_Process_ID always null
|
||||
sql.append("NULL,");
|
||||
// in case Preference for window, set PreferenceFor = P
|
||||
sql.append("'W',");
|
||||
}
|
||||
|
||||
if (cbUser.isChecked())
|
||||
sql.append(m_AD_User_ID).append(",");
|
||||
else
|
||||
|
|
|
@ -124,7 +124,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2592856355985389339L;
|
||||
private static final long serialVersionUID = -3728896318124756192L;
|
||||
|
||||
private static final String ON_SAVE_OPEN_PREFERENCE_EVENT = "onSaveOpenPreference";
|
||||
|
||||
|
@ -1079,7 +1079,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
|
|||
int windowId = getGridTab().getAD_Window_ID();
|
||||
int adTabId = getGridTab().getAD_Tab_ID();
|
||||
if (windowId > 0 && adTabId > 0) {
|
||||
Query query = new Query(Env.getCtx(), MTable.get(Env.getCtx(), I_AD_Preference.Table_ID), "AD_Window_ID=? AND Attribute=?", null);
|
||||
Query query = new Query(Env.getCtx(), MTable.get(Env.getCtx(), I_AD_Preference.Table_ID), "AD_Window_ID=? AND Attribute=? AND AD_Process_ID IS NULL AND PreferenceFor = 'W'", null);
|
||||
MPreference preference = query.setOnlyActiveRecords(true)
|
||||
.setApplyAccessFilter(true)
|
||||
.setParameters(windowId, adTabId+"|DetailPane.IsOpen")
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.adwindow.ADWindow;
|
||||
import org.adempiere.webui.component.Column;
|
||||
import org.adempiere.webui.component.Columns;
|
||||
import org.adempiere.webui.component.EditorBox;
|
||||
|
@ -77,7 +78,7 @@ public class ProcessParameterPanel extends Panel implements
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -6089753824709746119L;
|
||||
private static final long serialVersionUID = 195320654866887445L;
|
||||
|
||||
private String width;
|
||||
|
||||
|
@ -105,12 +106,36 @@ public class ProcessParameterPanel extends Panel implements
|
|||
//
|
||||
m_WindowNo = WindowNo;
|
||||
m_processInfo = pi;
|
||||
m_AD_Window_ID = getADWindowID (WindowNo);
|
||||
this.width = width;
|
||||
//
|
||||
initComponent();
|
||||
addEventListener("onDynamicDisplay", this);
|
||||
} // ProcessParameterPanel
|
||||
|
||||
/**
|
||||
* Get adWindowId below gridField
|
||||
* when field lie in window, it's id of this window
|
||||
* when field lie in process parameter dialog it's ad_window_id of window open this process
|
||||
* when field lie in process parameter open in a standalone window (run process from menu) return id of dummy window
|
||||
* @param mField
|
||||
* @return
|
||||
*/
|
||||
public static int getADWindowID (int windowNo){
|
||||
int adWindowID = 0;
|
||||
// form process parameter panel
|
||||
|
||||
Object window = SessionManager.getAppDesktop().findWindow(windowNo);
|
||||
// case show a process dialog, window is below window of process dialog
|
||||
if (window != null && window instanceof ADWindow){
|
||||
adWindowID = ((ADWindow)window).getAD_Window_ID();
|
||||
}else if (window != null && window instanceof ProcessDialog){
|
||||
adWindowID = 200054;// dummy window
|
||||
}
|
||||
|
||||
return adWindowID;
|
||||
}
|
||||
|
||||
private void initComponent() {
|
||||
centerPanel = GridFactory.newGridLayout();
|
||||
centerPanel.setInnerWidth(width);
|
||||
|
@ -129,6 +154,8 @@ public class ProcessParameterPanel extends Panel implements
|
|||
|
||||
private int m_WindowNo;
|
||||
private ProcessInfo m_processInfo;
|
||||
// AD_Window of window below this dialog in case show parameter dialog panel
|
||||
private int m_AD_Window_ID = 0;
|
||||
/** Logger */
|
||||
private static CLogger log = CLogger
|
||||
.getCLogger(ProcessParameterPanel.class);
|
||||
|
@ -280,7 +307,7 @@ public class ProcessParameterPanel extends Panel implements
|
|||
*/
|
||||
private void createField(ResultSet rs, Rows rows) {
|
||||
// Create Field
|
||||
GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo,
|
||||
GridFieldVO voF = GridFieldVO.createParameter(Env.getCtx(), m_WindowNo, m_processInfo.getAD_Process_ID(), m_AD_Window_ID,
|
||||
rs);
|
||||
GridField mField = new GridField(voF);
|
||||
m_mFields.add(mField); // add to Fields
|
||||
|
|
|
@ -574,8 +574,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
|
|||
* @return boolean
|
||||
*/
|
||||
protected boolean isShowPreference() {
|
||||
return MRole.getDefault().isShowPreference() && gridField != null && !gridField.isEncrypted() && !gridField.isEncryptedColumn()
|
||||
&& gridTab != null; // don't show preference for process parameters
|
||||
return MRole.getDefault().isShowPreference() && gridField != null && !gridField.isEncrypted() && !gridField.isEncryptedColumn();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,8 +30,11 @@ import org.compiere.util.Language;
|
|||
* <li>FR [ 2694043 ] Query. first/firstOnly usage best practice
|
||||
*/
|
||||
public final class UserPreference implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5334572174003341079L;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -9128019013390545760L;
|
||||
|
||||
/** Language */
|
||||
public static final String P_LANGUAGE = "Language";
|
||||
private static final String DEFAULT_LANGUAGE = Language.getName
|
||||
|
@ -111,7 +114,7 @@ public final class UserPreference implements Serializable {
|
|||
*/
|
||||
public void savePreference() {
|
||||
if (m_AD_User_ID >= 0) {
|
||||
Query query = new Query(Env.getCtx(), I_AD_Preference.Table_Name, "NVL(AD_User_ID,0) = ? AND Attribute = ? AND AD_Window_ID Is NULL", null);
|
||||
Query query = new Query(Env.getCtx(), I_AD_Preference.Table_Name, "NVL(AD_User_ID,0) = ? AND Attribute = ? AND AD_Window_ID Is NULL AND AD_Process_ID IS NULL AND PreferenceFor = 'W'", null);
|
||||
for (int i = 0; i < PROPERTIES.length; i++) {
|
||||
String attribute = PROPERTIES[i];
|
||||
String value = props.getProperty(attribute);
|
||||
|
@ -141,7 +144,7 @@ public final class UserPreference implements Serializable {
|
|||
m_AD_User_ID = AD_User_ID;
|
||||
props = new Properties();
|
||||
|
||||
Query query = new Query(Env.getCtx(), I_AD_Preference.Table_Name, "NVL(AD_User_ID,0) = ? AND Attribute = ? AND AD_Window_ID Is NULL", null);
|
||||
Query query = new Query(Env.getCtx(), I_AD_Preference.Table_Name, "NVL(AD_User_ID,0) = ? AND Attribute = ? AND AD_Window_ID Is NULL AND AD_Process_ID IS NULL AND PreferenceFor = 'W'", null);
|
||||
|
||||
for (int i = 0; i < PROPERTIES.length; i++) {
|
||||
String attribute = PROPERTIES[i];
|
||||
|
@ -164,7 +167,7 @@ public final class UserPreference implements Serializable {
|
|||
if (m_AD_User_ID > 0) {
|
||||
props = new Properties();
|
||||
|
||||
Query query = new Query(Env.getCtx(), I_AD_Preference.Table_Name, "AD_User_ID = ? AND Attribute = ? AND AD_Window_ID Is NULL", null);
|
||||
Query query = new Query(Env.getCtx(), I_AD_Preference.Table_Name, "AD_User_ID = ? AND Attribute = ? AND AD_Window_ID Is NULL AND AD_Process_ID IS NULL AND PreferenceFor = 'W'", null);
|
||||
for (int i = 0; i < PROPERTIES.length; i++) {
|
||||
String attribute = PROPERTIES[i];
|
||||
|
||||
|
|
Loading…
Reference in New Issue