diff --git a/db/ddlutils/oracle/views/AD_FIELD_V.sql b/db/ddlutils/oracle/views/AD_FIELD_V.sql index 7be05843f5..9d7ca395d9 100644 --- a/db/ddlutils/oracle/views/AD_FIELD_V.sql +++ b/db/ddlutils/oracle/views/AD_FIELD_V.sql @@ -19,7 +19,7 @@ CREATE OR REPLACE VIEW AD_FIELD_V AS c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, f.isdisplayedgrid, f.seqnogrid, - c.seqnoselection, f.xposition, f.columnspan, f.numlines + 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) diff --git a/db/ddlutils/oracle/views/AD_FIELD_VT.sql b/db/ddlutils/oracle/views/AD_FIELD_VT.sql index 550477edbc..b84f819d03 100644 --- a/db/ddlutils/oracle/views/AD_FIELD_VT.sql +++ b/db/ddlutils/oracle/views/AD_FIELD_VT.sql @@ -18,7 +18,7 @@ CREATE OR REPLACE VIEW AD_FIELD_VT AS c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, f.isdisplayedgrid, f.seqnogrid, - c.seqnoselection, f.xposition, f.columnspan, f.numlines + 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) diff --git a/db/ddlutils/postgresql/views/AD_FIELD_V.sql b/db/ddlutils/postgresql/views/AD_FIELD_V.sql index cf3bc20218..1b483d739a 100644 --- a/db/ddlutils/postgresql/views/AD_FIELD_V.sql +++ b/db/ddlutils/postgresql/views/AD_FIELD_V.sql @@ -15,7 +15,7 @@ CREATE OR REPLACE VIEW ad_field_v AS COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, f.isdisplayedgrid, f.seqnogrid, - c.seqnoselection, f.xposition, f.columnspan, f.numlines + 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 diff --git a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql index 2d15d0a1fc..c206131551 100644 --- a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql +++ b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql @@ -10,7 +10,7 @@ CREATE OR REPLACE VIEW ad_field_vt AS COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, f.isdisplayedgrid, f.seqnogrid, - c.seqnoselection, f.xposition, f.columnspan, f.numlines + 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 diff --git a/migration/360lts-release/oracle/938_IDEMPIERE-234.sql b/migration/360lts-release/oracle/938_IDEMPIERE-234.sql new file mode 100644 index 0000000000..c544c66a5a --- /dev/null +++ b/migration/360lts-release/oracle/938_IDEMPIERE-234.sql @@ -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 +; diff --git a/migration/360lts-release/postgresql/938_IDEMPIERE-234.sql b/migration/360lts-release/postgresql/938_IDEMPIERE-234.sql new file mode 100644 index 0000000000..10507120f0 --- /dev/null +++ b/migration/360lts-release/postgresql/938_IDEMPIERE-234.sql @@ -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 +; + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WArchive.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WArchive.java index f64cd1bb46..451c217a65 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WArchive.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WArchive.java @@ -165,7 +165,7 @@ public class WArchive implements EventListener else // all Reports 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); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 6f4324e594..420c48cdfb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -102,6 +102,8 @@ DataStatusListener, IADTabpanel 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"; /** @@ -393,6 +395,22 @@ DataStatusListener, IADTabpanel if (!field.isDisplayed()) 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 String fieldGroup = field.getFieldGroup(); if (!Util.isEmpty(fieldGroup) && !fieldGroup.equals(currentFieldGroup)) // group changed @@ -692,7 +710,12 @@ DataStatusListener, IADTabpanel for (Group group : collapsedGroups) { 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")); } // dynamicDisplay @@ -1172,5 +1195,26 @@ DataStatusListener, IADTabpanel } listPanel.setDetailPaneMode(detailPaneMode, vflex); } + + /** + * Get all visible button editors + * @return List + */ + public List getToolbarButtons() { + List buttonList = new ArrayList(); + 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; + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java index 7d1a47ca06..d7a1fcb11f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java @@ -86,6 +86,8 @@ public class ADWindowToolbar extends FToolbar implements EventListener private ToolBarButton btnCustomize; private ToolBarButton btnExport; + + private ToolBarButton btnProcess; private HashMap buttons = new HashMap(); @@ -163,6 +165,9 @@ public class ADWindowToolbar extends FToolbar implements EventListener btnCustomize= createButton("Customize", "Customize", "Customize"); btnCustomize.setDisabled(false); + btnProcess= createButton("Process", "Process", "Process"); + btnProcess.setDisabled(false); + // Help and Exit should always be enabled btnHelp.setDisabled(false); @@ -574,4 +579,10 @@ public class ADWindowToolbar extends FToolbar implements EventListener ToolBarMenuRestictionLoaded = true; } + public void enableProcessButton(boolean b) { + if (btnProcess != null) { + btnProcess.setDisabled(!b); + } + } + } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 5bc47062fe..74c82dc9ea 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -533,6 +533,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements else { ADTabpanel fTabPanel = new ADTabpanel(); + fTabPanel.addEventListener(ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT, this); gTab.addDataStatusListener(this); fTabPanel.init(this, curWindowNo, gTab, gridWindow); adTabbox.addTab(gTab, fTabPanel); @@ -943,6 +944,13 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements onModalClose(dialog.getProcessInfo()); 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 callback) { @@ -2444,7 +2452,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements pi.setAD_Client_ID (Env.getAD_Client_ID(ctx)); ADForm form = ADForm.openForm(adFormID); 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); SessionManager.getAppDesktop().showWindow(form); onRefresh(false, false); @@ -2515,6 +2523,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements public IADTabpanel findADTabpanel(WButtonEditor button) { IADTabpanel adtab = null; + if (button.getADTabpanel() != null) + return button.getADTabpanel(); + Component c = button.getComponent(); while (c != null) { 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()); } + + /** + * @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"); + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java index 043dde7ba4..692002cdcb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java @@ -417,6 +417,7 @@ public class CompositeADTabbox extends AbstractADTabbox adtabpanel.addDetails(detailPane); detailPane.setVflex(Boolean.toString(isUseVflexForDetailPane())); detailPane.setSelectedIndex(0); + activateDetailADTabpanel(); } headerTab.setDetailPaneMode(false, isUseVflexForDetailPane()); @@ -644,6 +645,8 @@ public class CompositeADTabbox extends AbstractADTabbox if (tabPanel instanceof ADSortTab) { detailPane.invalidate(); detailPane.updateToolbar(false, true); + } else { + tabPanel.dynamicDisplay(0); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java index d9fb1ce435..e035967e28 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java @@ -51,6 +51,7 @@ public class DetailPane extends Panel implements EventListener { private static final String DELETE_IMAGE = "/images/Delete16.png"; private static final String EDIT_IMAGE = "/images/EditRecord16.png"; private static final String NEW_IMAGE = "/images/New16.png"; + private static final String PROCESS_IMAGE = "/images/Process16.png"; /** * generated serial id @@ -143,6 +144,27 @@ public class DetailPane extends Panel implements EventListener { tab.setSclass("adwindow-detailpane-sub-tab"); } + tab.addEventListener(Events.ON_DOUBLE_CLICK, new EventListener() { + @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(); if (tabpanels == null) { tabpanels = new Tabpanels(); @@ -191,6 +213,17 @@ public class DetailPane extends Panel implements EventListener { }); 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() { + @Override + public void onEvent(Event event) throws Exception { + onProcess(event.getTarget()); + } + }); + button.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Process"))); + Hbox messageContainer = new Hbox(); messageContainer.setPack("end"); messageContainer.setAlign("center"); @@ -203,9 +236,9 @@ public class DetailPane extends Panel implements EventListener { tabPanel.setAttribute("AD_Tab_ID", tabLabel.AD_Tab_ID); tp.appendChild(tabPanel); - if (tabPanel instanceof ADTabpanel) { - ADTabpanel adtab = (ADTabpanel) tabPanel; - adtab.getGridView().addEventListener(ON_EDIT_EVENT, new EventListener() { + if (tabPanel.getGridView() != null) { + tabPanel.addEventListener(ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT, this); + tabPanel.getGridView().addEventListener(ON_EDIT_EVENT, new EventListener() { @Override public void onEvent(Event event) throws Exception { GridView gridView = (GridView) event.getTarget(); @@ -216,6 +249,14 @@ public class DetailPane extends Panel implements EventListener { } } + 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 listener) { eventListener = listener; } @@ -339,7 +380,9 @@ public class DetailPane extends Panel implements EventListener { createPopupContent(status); showPopup(error, messageContainer); - } + } else if (event.getName().equals(ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT)) { + updateProcessToolbar(); + } } protected void createPopupContent(String status) { @@ -416,6 +459,30 @@ public class DetailPane extends Panel implements EventListener { } } } + + 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 { Event openEvent = new Event(ON_EDIT_EVENT, DetailPane.this); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java index f5d56eba1b..0d63776195 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java @@ -76,6 +76,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt private int windowNo; private GridTabDataBinder dataBinder; private Map editors = new LinkedHashMap(); + private Map toolbarEditors = new LinkedHashMap(); private Paging paging; private Map> lookupCache = null; @@ -275,6 +276,13 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt return editorList; } + + public List getToolbarEditors() { + List editorList = new ArrayList(); + if (!toolbarEditors.isEmpty()) + editorList.addAll(toolbarEditors.values()); + return editorList; + } /** * @param paging @@ -411,10 +419,15 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt int colIndex = -1; for (int i = 0; i < columnCount; i++) { - if (editors.get(gridPanelFields[i]) == null) - editors.put(gridPanelFields[i], WebEditorFactory.getEditor(gridPanelFields[i], true)); + if (editors.get(gridPanelFields[i]) == null) { + 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; } colIndex ++; @@ -443,6 +456,16 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt 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()) { setCurrentRow(row); } @@ -506,7 +529,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt //skip indicator column int colIndex = 0; for (int i = 0; i < columnCount; i++) { - if (!gridPanelFields[i].isDisplayedGrid()) { + if (!gridPanelFields[i].isDisplayedGrid() || gridPanelFields[i].isToolbarButton()) { continue; } colIndex ++; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java index b270602dee..e77074d15f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java @@ -28,6 +28,7 @@ import org.adempiere.webui.component.Columns; import org.adempiere.webui.component.EditorBox; import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.NumberBox; +import org.adempiere.webui.editor.WButtonEditor; import org.adempiere.webui.editor.WEditor; import org.adempiere.webui.event.TouchEventHelper; import org.adempiere.webui.util.SortComparator; @@ -271,7 +272,7 @@ public class GridView extends Vbox implements EventListener int AD_Field_ID = Integer.parseInt(fieldIdStr); for(GridField gridField : tmpFields) { if (gridField.getAD_Field_ID() == AD_Field_ID) { - if(gridField.isDisplayedGrid()) + if(gridField.isDisplayedGrid() && !gridField.isToolbarButton()) fieldList.add(gridField); break; @@ -289,7 +290,7 @@ public class GridView extends Vbox implements EventListener ArrayList gridFieldList = new ArrayList(); for(GridField field:tmpFields){ - if(field.isDisplayedGrid()){ + if(field.isDisplayedGrid() && !field.isToolbarButton()) { gridFieldList.add(field); } } @@ -449,7 +450,7 @@ public class GridView extends Vbox implements EventListener int index = 0; for (int i = 0; i < numColumns; i++) { - if (gridField[i].isDisplayedGrid()) + if (gridField[i].isDisplayedGrid() && !gridField[i].isToolbarButton()) { colnames.put(index, gridField[i].getHeader()); index++; @@ -765,6 +766,9 @@ public class GridView extends Vbox implements EventListener { return; } + + if (renderer.getEditors().isEmpty()) + listbox.onInitRender(); // Selective if (col > 0) @@ -781,7 +785,13 @@ public class GridView extends Vbox implements EventListener boolean noData = gridTab.getRowCount() == 0; List list = renderer.getEditors(); - for (WEditor comp : list) + dynamicDisplayEditors(noData, list); + list = renderer.getToolbarEditors(); + dynamicDisplayEditors(noData, list); // all components + } + + private void dynamicDisplayEditors(boolean noData, List list) { + for (WEditor comp : list) { GridField mField = comp.getGridField(); if (mField != null) @@ -799,7 +809,7 @@ public class GridView extends Vbox implements EventListener comp.setVisible(mField.isDisplayedGrid()); } - } // all components + } } /** @@ -899,4 +909,18 @@ public class GridView extends Vbox implements EventListener } return details; } + + public List getToolbarButtons() { + List buttonList = new ArrayList(); + List 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; + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ProcessButtonPopup.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ProcessButtonPopup.java new file mode 100644 index 0000000000..4bb1036351 --- /dev/null +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ProcessButtonPopup.java @@ -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 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()); + } + } + +} diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java index cba1db924b..1236352ed6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java @@ -587,7 +587,8 @@ public class WWFActivity extends ADForm implements EventListener { 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); } else diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Window.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Window.java index 410492b109..4a54f53044 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Window.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Window.java @@ -76,6 +76,30 @@ public class Window extends org.zkoss.zul.Window super.onPageDetached(page); 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; + } + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java index 7de1385727..86830f3b2c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java @@ -28,6 +28,7 @@ import org.compiere.util.Env; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Window.Mode; /** * 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) { - Object objMode = win.getAttribute(Window.MODE_KEY); - - final String mode = objMode != null ? objMode.toString() : Window.MODE_HIGHLIGHTED; + final Window.Mode windowMode = win.getModeAttribute(); - if (Window.MODE_MODAL.equals(mode)) + if (Mode.MODAL == windowMode) { if (pos != null) win.setPosition(pos); @@ -162,14 +161,14 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop { if (Executions.getCurrent() != null) { - showNonModalWindow(win, pos, mode); + showNonModalWindow(win, pos, windowMode); } else { Executions.schedule(getComponent().getDesktop(), new EventListener() { @Override public void onEvent(Event event) throws Exception { - showNonModalWindow(win, pos, mode); + showNonModalWindow(win, pos, windowMode); } }, new Event("onExecute")); } @@ -177,20 +176,20 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop } private void showNonModalWindow(final Window win, final String pos, - final String mode) { - if (Window.MODE_POPUP.equals(mode)) + final Mode mode) { + if (Mode.POPUP == mode) { showPopup(win, pos); } - else if (Window.MODE_OVERLAPPED.equals(mode)) + else if (Mode.OVERLAPPED == mode) { showOverlapped(win, pos); } - else if (Window.MODE_EMBEDDED.equals(mode)) + else if (Mode.EMBEDDED == mode) { showEmbedded(win); } - else if (Window.MODE_HIGHLIGHTED.equals(mode)) + else if (Mode.HIGHLIGHTED == mode) { showHighlighted(win, pos); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/TabbedDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/TabbedDesktop.java index 73afe6ea71..8e09b54229 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/TabbedDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/TabbedDesktop.java @@ -78,12 +78,17 @@ public abstract class TabbedDesktop extends AbstractDesktop { public ADForm openForm(int formId) { ADForm form = ADForm.openForm(formId); - DesktopTabpanel tabPanel = new DesktopTabpanel(); - form.setParent(tabPanel); - //do not show window title when open as tab - form.setTitle(null); - preOpenNewTab(); - windowContainer.addWindow(tabPanel, form.getFormName(), true); + if (Window.Mode.EMBEDDED == form.getWindowMode()) { + DesktopTabpanel tabPanel = new DesktopTabpanel(); + form.setParent(tabPanel); + //do not show window title when open as tab + form.setTitle(null); + preOpenNewTab(); + windowContainer.addWindow(tabPanel, form.getFormName(), true); + } else { + form.setAttribute(Window.MODE_KEY, form.getWindowMode()); + showWindow(form); + } return form; } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WButtonEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WButtonEditor.java index 93b2c51d4d..87bdd3b169 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WButtonEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WButtonEditor.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.logging.Level; +import org.adempiere.webui.adwindow.IADTabpanel; import org.adempiere.webui.component.Button; import org.adempiere.webui.event.ActionEvent; import org.adempiere.webui.event.ActionListener; @@ -71,6 +72,8 @@ public class WButtonEditor extends WEditor private GridField gridfield = null; private ArrayList actionListeners = new ArrayList(); + + private IADTabpanel adTabpanel; public WButtonEditor(GridField gridField) { @@ -284,4 +287,12 @@ public class WButtonEditor extends WEditor } } } + + public void setADTabpanel(IADTabpanel adTabpanel) { + this.adTabpanel = adTabpanel; + } + + public IADTabpanel getADTabpanel() { + return adTabpanel; + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/event/ToolbarListener.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/event/ToolbarListener.java index ec53a8324a..cbb0d30787 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/event/ToolbarListener.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/event/ToolbarListener.java @@ -169,4 +169,6 @@ public interface ToolbarListener * Customize grid view. */ public void onCustomize(); + + public void onProcess(); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java index 07a91d9a1c..eeb1510c41 100755 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java @@ -397,4 +397,12 @@ public abstract class ADForm extends Window implements EventListener { 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; + } }