iDempiere IDEMPIERE-234 Configure Toolbar.

- Added AD_Column.IsToolbarButton to support  column button as part of toolbar instead of as field.
- Added API to support dialog implementation of AD_Form.
This commit is contained in:
Heng Sin Low 2012-10-19 20:44:11 +08:00
parent fb9b7176fa
commit 44d6da7dd8
22 changed files with 1042 additions and 39 deletions

View File

@ -19,7 +19,7 @@ CREATE OR REPLACE VIEW AD_FIELD_V AS
c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
f.isdisplayedgrid, f.isdisplayedgrid,
f.seqnogrid, f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines c.seqnoselection, f.xposition, f.columnspan, f.numlines, c.isToolbarButton
FROM AD_FIELD f FROM AD_FIELD f
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)

View File

@ -18,7 +18,7 @@ CREATE OR REPLACE VIEW AD_FIELD_VT AS
c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
f.isdisplayedgrid, f.isdisplayedgrid,
f.seqnogrid, f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines c.seqnoselection, f.xposition, f.columnspan, f.numlines, c.isToolbarButton
FROM AD_FIELD f FROM AD_FIELD f
INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID) INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)

View File

@ -15,7 +15,7 @@ CREATE OR REPLACE VIEW ad_field_v AS
COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
f.isdisplayedgrid, f.isdisplayedgrid,
f.seqnogrid, f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines c.seqnoselection, f.xposition, f.columnspan, f.numlines, c.isToolbarButton
FROM ad_field f FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id

View File

@ -10,7 +10,7 @@ CREATE OR REPLACE VIEW ad_field_vt AS
COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
f.isdisplayedgrid, f.isdisplayedgrid,
f.seqnogrid, f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines c.seqnoselection, f.xposition, f.columnspan, f.numlines, c.isToolbarButton
FROM ad_field f FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id

View File

@ -0,0 +1,365 @@
-- Oct 19, 2012 2:04:03 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Element (ColumnName,AD_Client_ID,Created,Updated,EntityType,PrintName,AD_Element_UU,AD_Element_ID,Help,Name,Description,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsToolbarButton',0,TO_DATE('2012-10-19 14:04:01','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-10-19 14:04:01','YYYY-MM-DD HH24:MI:SS'),'D','Toolbar Button','3c610247-e801-43ff-a7f7-9540f04150fa',200187,'There IsToolbarButton check box indicates if this column button is part of the toolbar''s process button popup list or render as field.','Toolbar Button','Add the column button to the toolbar',0,100,100,'Y')
;
-- Oct 19, 2012 2:04:03 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, PO_Description,PO_Help,PrintName,PO_Name,PO_PrintName,Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.PO_Description,t.PO_Help,t.PrintName,t.PO_Name,t.PO_PrintName,t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200187 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- Oct 19, 2012 2:06:09 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Column (Version,AD_Table_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,CreatedBy,Updated,AD_Org_ID,IsActive,IsAutocomplete,IsAllowLogging,Created,IsUpdateable,AD_Column_UU,IsAlwaysUpdateable,Help,IsAllowCopy,UpdatedBy,DefaultValue,IsEncrypted,ColumnName,Description,Name,AD_Client_ID,AD_Column_ID,SeqNoSelection) VALUES (1,101,'D','Y','N','N',0,'N',1,'N',20,'N','N',200187,100,TO_DATE('2012-10-19 14:06:08','YYYY-MM-DD HH24:MI:SS'),0,'Y','N','Y',TO_DATE('2012-10-19 14:06:08','YYYY-MM-DD HH24:MI:SS'),'Y','0a289e70-0e89-449c-b748-f337a6bff84e','N','There IsToolbarButton check box indicates if this column button is part of the toolbar''s process button popup list or render as field.','Y',100,'Y','N','IsToolbarButton','Add the column button to the toolbar','Toolbar Button',0,200703,0)
;
-- Oct 19, 2012 2:06:09 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200703 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Oct 19, 2012 2:09:23 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,Help,CreatedBy,Updated,EntityType,IsDisplayed,IsFieldOnly,IsDisplayedGrid,SeqNoGrid,AD_Field_UU,DisplayLength,DisplayLogic,Description,Name,IsActive,XPosition,ColumnSpan,NumLines) VALUES (0,'N',101,'N','N',200703,420,'Y',200648,'N',100,0,TO_DATE('2012-10-19 14:09:21','YYYY-MM-DD HH24:MI:SS'),0,'There IsToolbarButton check box indicates if this column button is part of the toolbar''s process button popup list or render as field.',100,TO_DATE('2012-10-19 14:09:21','YYYY-MM-DD HH24:MI:SS'),'D','Y','N','Y',400,'452b8d03-a4f0-4597-a30c-24e525f90590',0,'@AD_Reference_ID@=28','Add the column button to the toolbar','Toolbar Button','Y',2,1,1)
;
-- Oct 19, 2012 2:09:23 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200648 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Oct 19, 2012 2:09:37 PM MYT
-- IDEMPIERE-234 Configure Toolbar
ALTER TABLE AD_Column ADD IsToolbarButton CHAR(1) DEFAULT 'Y' CHECK (IsToolbarButton IN ('Y','N')) NOT NULL
;
UPDATE AD_Column SET IsToolbarButton='N' WHERE AD_Reference_ID != 28;
CREATE OR REPLACE VIEW AD_FIELD_V AS
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) AS AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fg.NAME AS FieldGroup, vr.Code AS ValidationCode,
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
f.isdisplayedgrid,
f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines, c.isToolbarButton
FROM AD_FIELD f
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';
CREATE OR REPLACE VIEW AD_FIELD_VT AS
SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) as AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fgt.NAME AS FieldGroup, vr.Code AS ValidationCode,
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
f.isdisplayedgrid,
f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines, c.isToolbarButton
FROM AD_FIELD f
INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
LEFT OUTER JOIN AD_FIELDGROUP_TRL fgt ON
(f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_LANGUAGE=fgt.AD_LANGUAGE)
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=200648
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=54403
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=2574
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=2573
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=160
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=161
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=162
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=166
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=2370
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=169
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=10128
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=4941
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=50188
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=168
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=159
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=825
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=4940
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=200288
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=167
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=5121
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=56317
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=62467
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=5122
;
-- Oct 19, 2012 8:18:29 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET XPosition=1,Updated=TO_DATE('2012-10-19 20:18:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54403
;
-- Oct 19, 2012 8:24:01 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=200648
;
-- Oct 19, 2012 8:24:01 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=171
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=56374
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=2526
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=200648
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=171
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y' WHERE AD_Field_ID=54403
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y' WHERE AD_Field_ID=2574
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y' WHERE AD_Field_ID=2573
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=160
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=161
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=162
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=166
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=2370
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=290,IsDisplayedGrid='Y' WHERE AD_Field_ID=169
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=300,IsDisplayedGrid='Y' WHERE AD_Field_ID=10128
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=310,IsDisplayedGrid='Y' WHERE AD_Field_ID=4941
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=320,IsDisplayedGrid='Y' WHERE AD_Field_ID=50188
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=330,IsDisplayedGrid='Y' WHERE AD_Field_ID=168
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=340,IsDisplayedGrid='Y' WHERE AD_Field_ID=159
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=350,IsDisplayedGrid='Y' WHERE AD_Field_ID=825
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=360,IsDisplayedGrid='Y' WHERE AD_Field_ID=4940
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=370,IsDisplayedGrid='Y' WHERE AD_Field_ID=167
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=380,IsDisplayedGrid='Y' WHERE AD_Field_ID=5121
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=390,IsDisplayedGrid='Y' WHERE AD_Field_ID=56317
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=400,IsDisplayedGrid='Y' WHERE AD_Field_ID=62467
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=410,IsDisplayedGrid='Y' WHERE AD_Field_ID=5122
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=420,IsDisplayedGrid='Y' WHERE AD_Field_ID=200288
;
SELECT register_migration_script('938_IDEMPIERE-234.sql') FROM dual
;

View File

@ -0,0 +1,351 @@
-- Oct 19, 2012 2:04:03 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Element (ColumnName,AD_Client_ID,Created,Updated,EntityType,PrintName,AD_Element_UU,AD_Element_ID,Help,Name,Description,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsToolbarButton',0,TO_TIMESTAMP('2012-10-19 14:04:01','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-10-19 14:04:01','YYYY-MM-DD HH24:MI:SS'),'D','Toolbar Button','3c610247-e801-43ff-a7f7-9540f04150fa',200187,'There IsToolbarButton check box indicates if this column button is part of the toolbar''s process button popup list or render as field.','Toolbar Button','Add the column button to the toolbar',0,100,100,'Y')
;
-- Oct 19, 2012 2:04:03 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, PO_Description,PO_Help,PrintName,PO_Name,PO_PrintName,Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.PO_Description,t.PO_Help,t.PrintName,t.PO_Name,t.PO_PrintName,t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200187 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- Oct 19, 2012 2:06:09 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Column (Version,AD_Table_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,CreatedBy,Updated,AD_Org_ID,IsActive,IsAutocomplete,IsAllowLogging,Created,IsUpdateable,AD_Column_UU,IsAlwaysUpdateable,Help,IsAllowCopy,UpdatedBy,DefaultValue,IsEncrypted,ColumnName,Description,Name,AD_Client_ID,AD_Column_ID,SeqNoSelection) VALUES (1,101,'D','Y','N','N',0,'N',1,'N',20,'N','N',200187,100,TO_TIMESTAMP('2012-10-19 14:06:08','YYYY-MM-DD HH24:MI:SS'),0,'Y','N','Y',TO_TIMESTAMP('2012-10-19 14:06:08','YYYY-MM-DD HH24:MI:SS'),'Y','0a289e70-0e89-449c-b748-f337a6bff84e','N','There IsToolbarButton check box indicates if this column button is part of the toolbar''s process button popup list or render as field.','Y',100,'Y','N','IsToolbarButton','Add the column button to the toolbar','Toolbar Button',0,200703,0)
;
-- Oct 19, 2012 2:06:09 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200703 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Oct 19, 2012 2:09:23 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,Help,CreatedBy,Updated,EntityType,IsDisplayed,IsFieldOnly,IsDisplayedGrid,SeqNoGrid,AD_Field_UU,DisplayLength,DisplayLogic,Description,Name,IsActive,XPosition,ColumnSpan,NumLines) VALUES (0,'N',101,'N','N',200703,420,'Y',200648,'N',100,0,TO_TIMESTAMP('2012-10-19 14:09:21','YYYY-MM-DD HH24:MI:SS'),0,'There IsToolbarButton check box indicates if this column button is part of the toolbar''s process button popup list or render as field.',100,TO_TIMESTAMP('2012-10-19 14:09:21','YYYY-MM-DD HH24:MI:SS'),'D','Y','N','Y',400,'452b8d03-a4f0-4597-a30c-24e525f90590',0,'@AD_Reference_ID@=28','Add the column button to the toolbar','Toolbar Button','Y',2,1,1)
;
-- Oct 19, 2012 2:09:23 PM MYT
-- IDEMPIERE-234 Configure Toolbar
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200648 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Oct 19, 2012 2:09:37 PM MYT
-- IDEMPIERE-234 Configure Toolbar
ALTER TABLE AD_Column ADD COLUMN IsToolbarButton CHAR(1) DEFAULT 'Y' CHECK (IsToolbarButton IN ('Y','N')) NOT NULL
;
UPDATE AD_Column SET IsToolbarButton='N' WHERE AD_Reference_ID != 28;
CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id,
f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno,
f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield,
f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat,
COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent,
COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout,
COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id,
c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax,
fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault,
COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
f.isdisplayedgrid,
f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines, c.isToolbarButton
FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;
CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description,
trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly,
f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode,
f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy,
f.isdisplayedgrid,
f.seqnogrid,
c.seqnoselection, f.xposition, f.columnspan, f.numlines, c.isToolbarButton
FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=200648
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=54403
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=2574
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=2573
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=160
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=161
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=162
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=166
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=2370
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=169
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=10128
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=4941
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=50188
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=168
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=159
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=825
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=4940
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=200288
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=167
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=5121
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=56317
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=62467
;
-- Oct 19, 2012 8:15:51 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=5122
;
-- Oct 19, 2012 8:18:29 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET XPosition=1,Updated=TO_TIMESTAMP('2012-10-19 20:18:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54403
;
-- Oct 19, 2012 8:24:01 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=200648
;
-- Oct 19, 2012 8:24:01 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=171
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=170,IsDisplayedGrid='Y' WHERE AD_Field_ID=56374
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=180,IsDisplayedGrid='Y' WHERE AD_Field_ID=2526
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=190,IsDisplayedGrid='Y' WHERE AD_Field_ID=200648
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=200,IsDisplayedGrid='Y' WHERE AD_Field_ID=171
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=210,IsDisplayedGrid='Y' WHERE AD_Field_ID=54403
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=220,IsDisplayedGrid='Y' WHERE AD_Field_ID=2574
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=230,IsDisplayedGrid='Y' WHERE AD_Field_ID=2573
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=240,IsDisplayedGrid='Y' WHERE AD_Field_ID=160
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=250,IsDisplayedGrid='Y' WHERE AD_Field_ID=161
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=260,IsDisplayedGrid='Y' WHERE AD_Field_ID=162
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=270,IsDisplayedGrid='Y' WHERE AD_Field_ID=166
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=280,IsDisplayedGrid='Y' WHERE AD_Field_ID=2370
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=290,IsDisplayedGrid='Y' WHERE AD_Field_ID=169
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=300,IsDisplayedGrid='Y' WHERE AD_Field_ID=10128
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=310,IsDisplayedGrid='Y' WHERE AD_Field_ID=4941
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=320,IsDisplayedGrid='Y' WHERE AD_Field_ID=50188
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=330,IsDisplayedGrid='Y' WHERE AD_Field_ID=168
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=340,IsDisplayedGrid='Y' WHERE AD_Field_ID=159
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=350,IsDisplayedGrid='Y' WHERE AD_Field_ID=825
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=360,IsDisplayedGrid='Y' WHERE AD_Field_ID=4940
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=370,IsDisplayedGrid='Y' WHERE AD_Field_ID=167
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=380,IsDisplayedGrid='Y' WHERE AD_Field_ID=5121
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=390,IsDisplayedGrid='Y' WHERE AD_Field_ID=56317
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=400,IsDisplayedGrid='Y' WHERE AD_Field_ID=62467
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=410,IsDisplayedGrid='Y' WHERE AD_Field_ID=5122
;
-- Oct 19, 2012 8:25:00 PM MYT
-- IDEMPIERE-234 Configure Toolbar
UPDATE AD_Field SET SeqNoGrid=420,IsDisplayedGrid='Y' WHERE AD_Field_ID=200288
;
SELECT register_migration_script('938_IDEMPIERE-234.sql') FROM dual
;

View File

@ -165,7 +165,7 @@ public class WArchive implements EventListener
else // all Reports else // all Reports
av.query(true, m_AD_Table_ID, 0); av.query(true, m_AD_Table_ID, 0);
form.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED); form.setAttribute(Window.MODE_KEY, form.getWindowMode());
SessionManager.getAppDesktop().showWindow(form); SessionManager.getAppDesktop().showWindow(form);
} }
} }

View File

@ -102,6 +102,8 @@ DataStatusListener, IADTabpanel
public static final String ON_ACTIVATE_EVENT = "onActivate"; public static final String ON_ACTIVATE_EVENT = "onActivate";
public static final String ON_DYNAMIC_DISPLAY_EVENT = "onDynamicDisplay";
private static final String ATTR_ON_ACTIVATE_POSTED = "org.adempiere.webui.adwindow.ADTabpanel.onActivatePosted"; private static final String ATTR_ON_ACTIVATE_POSTED = "org.adempiere.webui.adwindow.ADTabpanel.onActivatePosted";
/** /**
@ -393,6 +395,22 @@ DataStatusListener, IADTabpanel
if (!field.isDisplayed()) if (!field.isDisplayed())
continue; continue;
if (field.isToolbarButton()) {
WButtonEditor editor = (WButtonEditor) WebEditorFactory.getEditor(gridTab, field, false);
if (editor != null) {
if (windowPanel != null)
editor.addActionListener(windowPanel);
editor.setGridTab(this.getGridTab());
editor.setADTabpanel(this);
field.addPropertyChangeListener(editor);
editors.add(editor);
editorComps.add(editor.getComponent());
continue;
}
}
// field group // field group
String fieldGroup = field.getFieldGroup(); String fieldGroup = field.getFieldGroup();
if (!Util.isEmpty(fieldGroup) && !fieldGroup.equals(currentFieldGroup)) // group changed if (!Util.isEmpty(fieldGroup) && !fieldGroup.equals(currentFieldGroup)) // group changed
@ -693,6 +711,11 @@ DataStatusListener, IADTabpanel
group.setOpen(false); group.setOpen(false);
} }
if (listPanel.isVisible()) {
listPanel.dynamicDisplay(col);
}
Events.sendEvent(this, new Event(ON_DYNAMIC_DISPLAY_EVENT, this));
logger.config(gridTab.toString() + " - fini - " + (col<=0 ? "complete" : "seletive")); logger.config(gridTab.toString() + " - fini - " + (col<=0 ? "complete" : "seletive"));
} // dynamicDisplay } // dynamicDisplay
@ -1172,5 +1195,26 @@ DataStatusListener, IADTabpanel
} }
listPanel.setDetailPaneMode(detailPaneMode, vflex); listPanel.setDetailPaneMode(detailPaneMode, vflex);
} }
/**
* Get all visible button editors
* @return List<WButtonEditor>
*/
public List<WButtonEditor> getToolbarButtons() {
List<WButtonEditor> buttonList = new ArrayList<WButtonEditor>();
if (isGridView()) {
buttonList = listPanel.getToolbarButtons();
} else {
for(WEditor editor : editors) {
if (editor instanceof WButtonEditor && editor.getComponent() != null
&& editor.getComponent().isVisible()
&& editor.getGridField() != null
&& editor.getGridField().isToolbarButton()) {
buttonList.add((WButtonEditor) editor);
}
}
}
return buttonList;
}
} }

View File

@ -87,6 +87,8 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
private ToolBarButton btnExport; private ToolBarButton btnExport;
private ToolBarButton btnProcess;
private HashMap<String, ToolBarButton> buttons = new HashMap<String, ToolBarButton>(); private HashMap<String, ToolBarButton> buttons = new HashMap<String, ToolBarButton>();
// private ToolBarButton btnExit; // private ToolBarButton btnExit;
@ -163,6 +165,9 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
btnCustomize= createButton("Customize", "Customize", "Customize"); btnCustomize= createButton("Customize", "Customize", "Customize");
btnCustomize.setDisabled(false); btnCustomize.setDisabled(false);
btnProcess= createButton("Process", "Process", "Process");
btnProcess.setDisabled(false);
// Help and Exit should always be enabled // Help and Exit should always be enabled
btnHelp.setDisabled(false); btnHelp.setDisabled(false);
@ -574,4 +579,10 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
ToolBarMenuRestictionLoaded = true; ToolBarMenuRestictionLoaded = true;
} }
public void enableProcessButton(boolean b) {
if (btnProcess != null) {
btnProcess.setDisabled(!b);
}
}
} }

View File

@ -533,6 +533,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
else else
{ {
ADTabpanel fTabPanel = new ADTabpanel(); ADTabpanel fTabPanel = new ADTabpanel();
fTabPanel.addEventListener(ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT, this);
gTab.addDataStatusListener(this); gTab.addDataStatusListener(this);
fTabPanel.init(this, curWindowNo, gTab, gridWindow); fTabPanel.init(this, curWindowNo, gTab, gridWindow);
adTabbox.addTab(gTab, fTabPanel); adTabbox.addTab(gTab, fTabPanel);
@ -943,6 +944,13 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
onModalClose(dialog.getProcessInfo()); onModalClose(dialog.getProcessInfo());
onRefresh(false, false); onRefresh(false, false);
} }
else if (ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT.equals(event.getName()))
{
ADTabpanel adtab = (ADTabpanel) event.getTarget();
if (adtab == adTabbox.getSelectedTabpanel()) {
toolbar.enableProcessButton(adtab.getToolbarButtons().size() > 0);
}
}
} }
private void setActiveTab(final int newTabIndex, final Callback<Boolean> callback) { private void setActiveTab(final int newTabIndex, final Callback<Boolean> callback) {
@ -2444,7 +2452,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
pi.setAD_Client_ID (Env.getAD_Client_ID(ctx)); pi.setAD_Client_ID (Env.getAD_Client_ID(ctx));
ADForm form = ADForm.openForm(adFormID); ADForm form = ADForm.openForm(adFormID);
form.setProcessInfo(pi); form.setProcessInfo(pi);
form.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED); form.setAttribute(Window.MODE_KEY, form.getWindowMode());
form.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT); form.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT);
SessionManager.getAppDesktop().showWindow(form); SessionManager.getAppDesktop().showWindow(form);
onRefresh(false, false); onRefresh(false, false);
@ -2515,6 +2523,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
public IADTabpanel findADTabpanel(WButtonEditor button) { public IADTabpanel findADTabpanel(WButtonEditor button) {
IADTabpanel adtab = null; IADTabpanel adtab = null;
if (button.getADTabpanel() != null)
return button.getADTabpanel();
Component c = button.getComponent(); Component c = button.getComponent();
while (c != null) { while (c != null) {
if (c instanceof IADTabpanel) { if (c instanceof IADTabpanel) {
@ -2637,4 +2648,16 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
CustomizeGridViewDialog.showCustomize(0, adTabbox.getSelectedGridTab().getAD_Tab_ID(), columnsWidth,gridFieldIds,tabPanel.getGridView()); CustomizeGridViewDialog.showCustomize(0, adTabbox.getSelectedGridTab().getAD_Tab_ID(), columnsWidth,gridFieldIds,tabPanel.getGridView());
} }
/**
* @see org.adempiere.webui.event.ToolbarListener#onProcess()
*/
@Override
public void onProcess() {
ProcessButtonPopup popup = new ProcessButtonPopup();
ADTabpanel adtab = (ADTabpanel) adTabbox.getSelectedTabpanel();
popup.render(adtab.getToolbarButtons());
LayoutUtils.openPopupWindow(toolbar.getButton("Process"), popup, "after_start");
}
} }

View File

@ -417,6 +417,7 @@ public class CompositeADTabbox extends AbstractADTabbox
adtabpanel.addDetails(detailPane); adtabpanel.addDetails(detailPane);
detailPane.setVflex(Boolean.toString(isUseVflexForDetailPane())); detailPane.setVflex(Boolean.toString(isUseVflexForDetailPane()));
detailPane.setSelectedIndex(0); detailPane.setSelectedIndex(0);
activateDetailADTabpanel();
} }
headerTab.setDetailPaneMode(false, isUseVflexForDetailPane()); headerTab.setDetailPaneMode(false, isUseVflexForDetailPane());
@ -644,6 +645,8 @@ public class CompositeADTabbox extends AbstractADTabbox
if (tabPanel instanceof ADSortTab) { if (tabPanel instanceof ADSortTab) {
detailPane.invalidate(); detailPane.invalidate();
detailPane.updateToolbar(false, true); detailPane.updateToolbar(false, true);
} else {
tabPanel.dynamicDisplay(0);
} }
} }

View File

@ -51,6 +51,7 @@ public class DetailPane extends Panel implements EventListener<Event> {
private static final String DELETE_IMAGE = "/images/Delete16.png"; private static final String DELETE_IMAGE = "/images/Delete16.png";
private static final String EDIT_IMAGE = "/images/EditRecord16.png"; private static final String EDIT_IMAGE = "/images/EditRecord16.png";
private static final String NEW_IMAGE = "/images/New16.png"; private static final String NEW_IMAGE = "/images/New16.png";
private static final String PROCESS_IMAGE = "/images/Process16.png";
/** /**
* generated serial id * generated serial id
@ -143,6 +144,27 @@ public class DetailPane extends Panel implements EventListener<Event> {
tab.setSclass("adwindow-detailpane-sub-tab"); tab.setSclass("adwindow-detailpane-sub-tab");
} }
tab.addEventListener(Events.ON_DOUBLE_CLICK, new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
Tab tab = (Tab) event.getTarget();
if (!tab.isSelected())
return;
org.zkoss.zul.Tabpanel zkTabpanel = tab.getLinkedPanel();
ADTabpanel adtab = null;
for(Component c : zkTabpanel.getChildren()) {
if (c instanceof ADTabpanel) {
adtab = (ADTabpanel) c;
break;
}
}
if (adtab != null && adtab.getGridView() != null
&& adtab.getGridView().isDetailPaneMode()) {
onEdit();
}
}
});
Tabpanels tabpanels = tabbox.getTabpanels(); Tabpanels tabpanels = tabbox.getTabpanels();
if (tabpanels == null) { if (tabpanels == null) {
tabpanels = new Tabpanels(); tabpanels = new Tabpanels();
@ -191,6 +213,17 @@ public class DetailPane extends Panel implements EventListener<Event> {
}); });
button.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Delete"))); button.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Delete")));
button = new ToolBarButton();
button.setImage(PROCESS_IMAGE);
toolbar.appendChild(button);
button.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
onProcess(event.getTarget());
}
});
button.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Process")));
Hbox messageContainer = new Hbox(); Hbox messageContainer = new Hbox();
messageContainer.setPack("end"); messageContainer.setPack("end");
messageContainer.setAlign("center"); messageContainer.setAlign("center");
@ -203,9 +236,9 @@ public class DetailPane extends Panel implements EventListener<Event> {
tabPanel.setAttribute("AD_Tab_ID", tabLabel.AD_Tab_ID); tabPanel.setAttribute("AD_Tab_ID", tabLabel.AD_Tab_ID);
tp.appendChild(tabPanel); tp.appendChild(tabPanel);
if (tabPanel instanceof ADTabpanel) { if (tabPanel.getGridView() != null) {
ADTabpanel adtab = (ADTabpanel) tabPanel; tabPanel.addEventListener(ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT, this);
adtab.getGridView().addEventListener(ON_EDIT_EVENT, new EventListener<Event>() { tabPanel.getGridView().addEventListener(ON_EDIT_EVENT, new EventListener<Event>() {
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
GridView gridView = (GridView) event.getTarget(); GridView gridView = (GridView) event.getTarget();
@ -216,6 +249,14 @@ public class DetailPane extends Panel implements EventListener<Event> {
} }
} }
protected void onProcess(Component button) {
ProcessButtonPopup popup = new ProcessButtonPopup();
ADTabpanel adtab = (ADTabpanel) getSelectedADTabpanel();
popup.render(adtab.getToolbarButtons());
LayoutUtils.openPopupWindow(button, popup, "after_start");
}
public void setEventListener(EventListener<Event> listener) { public void setEventListener(EventListener<Event> listener) {
eventListener = listener; eventListener = listener;
} }
@ -339,6 +380,8 @@ public class DetailPane extends Panel implements EventListener<Event> {
createPopupContent(status); createPopupContent(status);
showPopup(error, messageContainer); showPopup(error, messageContainer);
} else if (event.getName().equals(ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT)) {
updateProcessToolbar();
} }
} }
@ -417,6 +460,30 @@ public class DetailPane extends Panel implements EventListener<Event> {
} }
} }
private void updateProcessToolbar() {
int index = getSelectedIndex();
if (index < 0 || index >= getTabcount()) return;
Tabpanel tabpanel = tabbox.getTabpanel(index);
Toolbar toolbar = (Toolbar) tabpanel.getFirstChild();
IADTabpanel adtab = getADTabpanel(index);
for(Component c : toolbar.getChildren()) {
if (c instanceof ToolBarButton) {
ToolBarButton btn = (ToolBarButton) c;
if (PROCESS_IMAGE.equals(btn.getImage())) {
if (adtab.getGridTab().isSortTab()) {
btn.setDisabled(true);
} else {
btn.setDisabled(((ADTabpanel)adtab).getToolbarButtons().isEmpty());
}
break;
}
}
}
}
public void onEdit() throws Exception { public void onEdit() throws Exception {
Event openEvent = new Event(ON_EDIT_EVENT, DetailPane.this); Event openEvent = new Event(ON_EDIT_EVENT, DetailPane.this);
eventListener.onEvent(openEvent); eventListener.onEvent(openEvent);

View File

@ -76,6 +76,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
private int windowNo; private int windowNo;
private GridTabDataBinder dataBinder; private GridTabDataBinder dataBinder;
private Map<GridField, WEditor> editors = new LinkedHashMap<GridField, WEditor>(); private Map<GridField, WEditor> editors = new LinkedHashMap<GridField, WEditor>();
private Map<GridField, WEditor> toolbarEditors = new LinkedHashMap<GridField, WEditor>();
private Paging paging; private Paging paging;
private Map<String, Map<Object, String>> lookupCache = null; private Map<String, Map<Object, String>> lookupCache = null;
@ -276,6 +277,13 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
return editorList; return editorList;
} }
public List<WEditor> getToolbarEditors() {
List<WEditor> editorList = new ArrayList<WEditor>();
if (!toolbarEditors.isEmpty())
editorList.addAll(toolbarEditors.values());
return editorList;
}
/** /**
* @param paging * @param paging
*/ */
@ -411,10 +419,15 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
int colIndex = -1; int colIndex = -1;
for (int i = 0; i < columnCount; i++) { for (int i = 0; i < columnCount; i++) {
if (editors.get(gridPanelFields[i]) == null) if (editors.get(gridPanelFields[i]) == null) {
editors.put(gridPanelFields[i], WebEditorFactory.getEditor(gridPanelFields[i], true)); WEditor editor = WebEditorFactory.getEditor(gridPanelFields[i], true);
editors.put(gridPanelFields[i], editor);
if (editor instanceof WButtonEditor) {
((WButtonEditor)editor).addActionListener(buttonListener);
}
}
if (!gridPanelFields[i].isDisplayedGrid()) { if (!gridPanelFields[i].isDisplayedGrid() || gridPanelFields[i].isToolbarButton()) {
continue; continue;
} }
colIndex ++; colIndex ++;
@ -443,6 +456,16 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
row.appendChild(div); row.appendChild(div);
} }
for (GridField gridField : gridTabFields) {
if (gridField.isToolbarButton() && gridField.isDisplayed()) {
if (toolbarEditors.get(gridField) == null) {
WButtonEditor editor = (WButtonEditor) WebEditorFactory.getEditor(gridField, true);
toolbarEditors.put(gridField, editor);
editor.addActionListener(buttonListener);
}
}
}
if (rowIndex == gridTab.getCurrentRow()) { if (rowIndex == gridTab.getCurrentRow()) {
setCurrentRow(row); setCurrentRow(row);
} }
@ -506,7 +529,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
//skip indicator column //skip indicator column
int colIndex = 0; int colIndex = 0;
for (int i = 0; i < columnCount; i++) { for (int i = 0; i < columnCount; i++) {
if (!gridPanelFields[i].isDisplayedGrid()) { if (!gridPanelFields[i].isDisplayedGrid() || gridPanelFields[i].isToolbarButton()) {
continue; continue;
} }
colIndex ++; colIndex ++;

View File

@ -28,6 +28,7 @@ import org.adempiere.webui.component.Columns;
import org.adempiere.webui.component.EditorBox; import org.adempiere.webui.component.EditorBox;
import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.NumberBox; import org.adempiere.webui.component.NumberBox;
import org.adempiere.webui.editor.WButtonEditor;
import org.adempiere.webui.editor.WEditor; import org.adempiere.webui.editor.WEditor;
import org.adempiere.webui.event.TouchEventHelper; import org.adempiere.webui.event.TouchEventHelper;
import org.adempiere.webui.util.SortComparator; import org.adempiere.webui.util.SortComparator;
@ -271,7 +272,7 @@ public class GridView extends Vbox implements EventListener<Event>
int AD_Field_ID = Integer.parseInt(fieldIdStr); int AD_Field_ID = Integer.parseInt(fieldIdStr);
for(GridField gridField : tmpFields) { for(GridField gridField : tmpFields) {
if (gridField.getAD_Field_ID() == AD_Field_ID) { if (gridField.getAD_Field_ID() == AD_Field_ID) {
if(gridField.isDisplayedGrid()) if(gridField.isDisplayedGrid() && !gridField.isToolbarButton())
fieldList.add(gridField); fieldList.add(gridField);
break; break;
@ -289,7 +290,7 @@ public class GridView extends Vbox implements EventListener<Event>
ArrayList<GridField> gridFieldList = new ArrayList<GridField>(); ArrayList<GridField> gridFieldList = new ArrayList<GridField>();
for(GridField field:tmpFields){ for(GridField field:tmpFields){
if(field.isDisplayedGrid()){ if(field.isDisplayedGrid() && !field.isToolbarButton()) {
gridFieldList.add(field); gridFieldList.add(field);
} }
} }
@ -449,7 +450,7 @@ public class GridView extends Vbox implements EventListener<Event>
int index = 0; int index = 0;
for (int i = 0; i < numColumns; i++) for (int i = 0; i < numColumns; i++)
{ {
if (gridField[i].isDisplayedGrid()) if (gridField[i].isDisplayedGrid() && !gridField[i].isToolbarButton())
{ {
colnames.put(index, gridField[i].getHeader()); colnames.put(index, gridField[i].getHeader());
index++; index++;
@ -766,6 +767,9 @@ public class GridView extends Vbox implements EventListener<Event>
return; return;
} }
if (renderer.getEditors().isEmpty())
listbox.onInitRender();
// Selective // Selective
if (col > 0) if (col > 0)
{ {
@ -781,7 +785,13 @@ public class GridView extends Vbox implements EventListener<Event>
boolean noData = gridTab.getRowCount() == 0; boolean noData = gridTab.getRowCount() == 0;
List<WEditor> list = renderer.getEditors(); List<WEditor> list = renderer.getEditors();
for (WEditor comp : list) dynamicDisplayEditors(noData, list);
list = renderer.getToolbarEditors();
dynamicDisplayEditors(noData, list); // all components
}
private void dynamicDisplayEditors(boolean noData, List<WEditor> list) {
for (WEditor comp : list)
{ {
GridField mField = comp.getGridField(); GridField mField = comp.getGridField();
if (mField != null) if (mField != null)
@ -799,7 +809,7 @@ public class GridView extends Vbox implements EventListener<Event>
comp.setVisible(mField.isDisplayedGrid()); comp.setVisible(mField.isDisplayedGrid());
} }
} // all components }
} }
/** /**
@ -899,4 +909,18 @@ public class GridView extends Vbox implements EventListener<Event>
} }
return details; return details;
} }
public List<WButtonEditor> getToolbarButtons() {
List<WButtonEditor> buttonList = new ArrayList<WButtonEditor>();
List<WEditor> editors = renderer.getToolbarEditors();
for(WEditor editor : editors) {
if (editor instanceof WButtonEditor && editor.getComponent() != null && editor.getComponent().isVisible()) {
WButtonEditor btnEditor = (WButtonEditor) editor;
buttonList.add(btnEditor);
editor.setValue(editor.getGridField().getValue());
btnEditor.setADTabpanel((IADTabpanel) this.getParent());
}
}
return buttonList;
}
} }

View File

@ -0,0 +1,42 @@
/**
*
*/
package org.adempiere.webui.adwindow;
import java.util.List;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.editor.WButtonEditor;
import org.zkoss.zul.Vbox;
/**
* @author hengsin
*
*/
public class ProcessButtonPopup extends Window {
/**
* generated serial id
*/
private static final long serialVersionUID = 304878472233552113L;
public void render(List<WButtonEditor> editors) {
setSclass("toolbar-popup-window");
//setWidth("250px");
setHflex("min");
setBorder("normal");
Vbox vbox = new Vbox();
appendChild(vbox);
vbox.setSclass("toolbar-popup-window-cnt");
vbox.setAlign("stretch");
for(WButtonEditor editor : editors) {
if (editor.getComponent().getPage() != null) {
editor.getComponent().detach();
}
vbox.appendChild(editor.getComponent());
}
}
}

View File

@ -587,7 +587,8 @@ public class WWFActivity extends ADForm implements EventListener
{ {
int AD_Form_ID = node.getAD_Form_ID(); int AD_Form_ID = node.getAD_Form_ID();
Window form = ADForm.openForm(AD_Form_ID); ADForm form = ADForm.openForm(AD_Form_ID);
form.setAttribute(Window.MODE_KEY, form.getWindowMode());
AEnv.showWindow(form); AEnv.showWindow(form);
} }
else else

View File

@ -77,5 +77,29 @@ public class Window extends org.zkoss.zul.Window
Events.sendEvent(this, new Event(DialogEvents.ON_WINDOW_CLOSE, this, null)); Events.sendEvent(this, new Event(DialogEvents.ON_WINDOW_CLOSE, this, null));
} }
/**
* Get the window mode attribute
* @return Window.Mode
*/
public Mode getModeAttribute() {
Object modeValue = getAttribute(Window.MODE_KEY);
if (modeValue instanceof Mode) {
return (Mode) modeValue;
}
final String mode = modeValue != null ? modeValue.toString() : Window.MODE_HIGHLIGHTED;
if (Window.MODE_EMBEDDED.equals(mode)) {
return Mode.EMBEDDED;
} else if (Window.MODE_HIGHLIGHTED.equals(mode)) {
return Mode.HIGHLIGHTED;
} else if (Window.MODE_MODAL.equals(mode)) {
return Mode.MODAL;
} else if (Window.MODE_OVERLAPPED.equals(mode)) {
return Mode.OVERLAPPED;
} else if (Window.MODE_POPUP.equals(mode)) {
return Mode.POPUP;
} else {
return Mode.HIGHLIGHTED;
}
}
} }

View File

@ -28,6 +28,7 @@ import org.compiere.util.Env;
import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Window.Mode;
/** /**
* Base class for desktop implementation * Base class for desktop implementation
@ -148,11 +149,9 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop
*/ */
public void showWindow(final Window win, final String pos) public void showWindow(final Window win, final String pos)
{ {
Object objMode = win.getAttribute(Window.MODE_KEY); final Window.Mode windowMode = win.getModeAttribute();
final String mode = objMode != null ? objMode.toString() : Window.MODE_HIGHLIGHTED; if (Mode.MODAL == windowMode)
if (Window.MODE_MODAL.equals(mode))
{ {
if (pos != null) if (pos != null)
win.setPosition(pos); win.setPosition(pos);
@ -162,14 +161,14 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop
{ {
if (Executions.getCurrent() != null) if (Executions.getCurrent() != null)
{ {
showNonModalWindow(win, pos, mode); showNonModalWindow(win, pos, windowMode);
} }
else else
{ {
Executions.schedule(getComponent().getDesktop(), new EventListener<Event>() { Executions.schedule(getComponent().getDesktop(), new EventListener<Event>() {
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
showNonModalWindow(win, pos, mode); showNonModalWindow(win, pos, windowMode);
} }
}, new Event("onExecute")); }, new Event("onExecute"));
} }
@ -177,20 +176,20 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop
} }
private void showNonModalWindow(final Window win, final String pos, private void showNonModalWindow(final Window win, final String pos,
final String mode) { final Mode mode) {
if (Window.MODE_POPUP.equals(mode)) if (Mode.POPUP == mode)
{ {
showPopup(win, pos); showPopup(win, pos);
} }
else if (Window.MODE_OVERLAPPED.equals(mode)) else if (Mode.OVERLAPPED == mode)
{ {
showOverlapped(win, pos); showOverlapped(win, pos);
} }
else if (Window.MODE_EMBEDDED.equals(mode)) else if (Mode.EMBEDDED == mode)
{ {
showEmbedded(win); showEmbedded(win);
} }
else if (Window.MODE_HIGHLIGHTED.equals(mode)) else if (Mode.HIGHLIGHTED == mode)
{ {
showHighlighted(win, pos); showHighlighted(win, pos);
} }

View File

@ -78,12 +78,17 @@ public abstract class TabbedDesktop extends AbstractDesktop {
public ADForm openForm(int formId) { public ADForm openForm(int formId) {
ADForm form = ADForm.openForm(formId); ADForm form = ADForm.openForm(formId);
DesktopTabpanel tabPanel = new DesktopTabpanel(); if (Window.Mode.EMBEDDED == form.getWindowMode()) {
form.setParent(tabPanel); DesktopTabpanel tabPanel = new DesktopTabpanel();
//do not show window title when open as tab form.setParent(tabPanel);
form.setTitle(null); //do not show window title when open as tab
preOpenNewTab(); form.setTitle(null);
windowContainer.addWindow(tabPanel, form.getFormName(), true); preOpenNewTab();
windowContainer.addWindow(tabPanel, form.getFormName(), true);
} else {
form.setAttribute(Window.MODE_KEY, form.getWindowMode());
showWindow(form);
}
return form; return form;
} }

View File

@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.webui.adwindow.IADTabpanel;
import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Button;
import org.adempiere.webui.event.ActionEvent; import org.adempiere.webui.event.ActionEvent;
import org.adempiere.webui.event.ActionListener; import org.adempiere.webui.event.ActionListener;
@ -72,6 +73,8 @@ public class WButtonEditor extends WEditor
private ArrayList<ActionListener> actionListeners = new ArrayList<ActionListener>(); private ArrayList<ActionListener> actionListeners = new ArrayList<ActionListener>();
private IADTabpanel adTabpanel;
public WButtonEditor(GridField gridField) public WButtonEditor(GridField gridField)
{ {
this(gridField, -1); this(gridField, -1);
@ -284,4 +287,12 @@ public class WButtonEditor extends WEditor
} }
} }
} }
public void setADTabpanel(IADTabpanel adTabpanel) {
this.adTabpanel = adTabpanel;
}
public IADTabpanel getADTabpanel() {
return adTabpanel;
}
} }

View File

@ -169,4 +169,6 @@ public interface ToolbarListener
* Customize grid view. * Customize grid view.
*/ */
public void onCustomize(); public void onCustomize();
public void onProcess();
} }

View File

@ -397,4 +397,12 @@ public abstract class ADForm extends Window implements EventListener
{ {
return m_customForm; return m_customForm;
} }
/**
* Default to embedded mode, subclass may override this to open form in different mode
* @return Window mode
*/
public Mode getWindowMode() {
return Mode.EMBEDDED;
}
} }