Ticket #1001002: Move the Menu to be a Portlet

This commit is contained in:
Elaine Tan 2012-08-07 20:04:10 +08:00
parent 108cb60e9b
commit 064c654e85
19 changed files with 666 additions and 61 deletions

View File

@ -0,0 +1,195 @@
-- Aug 7, 2012 5:22:34 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Flat View',1000000,'U','1d68fb0b-318d-463e-aa36-442ec9bc2d90','FlatView','Y',TO_DATE('2012-08-07 17:22:34','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_DATE('2012-08-07 17:22:34','YYYY-MM-DD HH24:MI:SS'))
;
-- Aug 7, 2012 5:22:34 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=1000000 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- Aug 7, 2012 5:22:50 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Message SET MsgType='M',Updated=TO_DATE('2012-08-07 17:22:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=1000000
;
-- Aug 7, 2012 5:28:39 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (0,50010,1000007,'U','N','N','N',0,'N',10,'N',19,'N','N',138,'N','Y','7a1348ca-67c6-43a4-8edb-b4993fe73f37','N','Y','N','AD_User_ID','User within the system - Internal or Business Partner Contact','The User identifies a unique user in the system. This could be an internal user or a business partner contact','User/Contact','Y',100,TO_DATE('2012-08-07 17:28:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-08-07 17:28:39','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Aug 7, 2012 5:28:39 PM SGT
-- Move the Menu to be a Portlet
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=1000007 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)
;
-- Aug 7, 2012 5:28:45 PM SGT
-- Move the Menu to be a Portlet
ALTER TABLE PA_DashboardContent ADD AD_User_ID NUMBER(10) DEFAULT NULL
;
-- Aug 7, 2012 5:29:23 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (0,50010,1000008,'U','N','N','N',0,'N',10,'N',19,'N','N',123,'N','Y','0ef8fece-cda5-4349-a7ca-a84cfc808b2c','N','Y','N','AD_Role_ID','Responsibility Role','The Role determines security and access a user who has this Role will have in the System.','Role','Y',100,TO_DATE('2012-08-07 17:29:23','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-08-07 17:29:23','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Aug 7, 2012 5:29:23 PM SGT
-- Move the Menu to be a Portlet
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=1000008 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)
;
-- Aug 7, 2012 5:29:26 PM SGT
-- Move the Menu to be a Portlet
ALTER TABLE PA_DashboardContent ADD AD_Role_ID NUMBER(10) DEFAULT NULL
;
-- Aug 7, 2012 5:29:50 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',50010,10,'N','N',1000008,'Y',1000010,'N','The Role determines security and access a user who has this Role will have in the System.','U','Responsibility Role','Role','Y','N','7c90c0dc-696b-450b-a00c-54027171422b',100,0,TO_DATE('2012-08-07 17:29:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-08-07 17:29:50','YYYY-MM-DD HH24:MI:SS'),'Y')
;
-- Aug 7, 2012 5:29:51 PM SGT
-- Move the Menu to be a Portlet
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=1000010 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)
;
-- Aug 7, 2012 5:29:51 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',50010,10,'N','N',1000007,'Y',1000011,'N','The User identifies a unique user in the system. This could be an internal user or a business partner contact','U','User within the system - Internal or Business Partner Contact','User/Contact','Y','N','8766c305-21db-43d0-8739-055b1e82d90d',100,0,TO_DATE('2012-08-07 17:29:51','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-08-07 17:29:51','YYYY-MM-DD HH24:MI:SS'),'Y')
;
-- Aug 7, 2012 5:29:51 PM SGT
-- Move the Menu to be a Portlet
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=1000011 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)
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=1000011
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=1000010
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=51007
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=51008
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=56485
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=51009
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=51010
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=51011
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=56486
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=51012
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=51013
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=57344
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=56504
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=1000009
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=1000001
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=1000003
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=1000002
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=1000004
;
-- Aug 7, 2012 5:30:22 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2012-08-07 17:30:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000010
;
-- Aug 7, 2012 6:41:20 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Column SET DefaultValue='0',Updated=TO_DATE('2012-08-07 18:41:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1000008
;
-- Aug 7, 2012 6:41:23 PM SGT
-- Move the Menu to be a Portlet
ALTER TABLE PA_DashboardContent MODIFY AD_Role_ID NUMBER(10) DEFAULT 0
;
-- Aug 7, 2012 6:41:23 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET AD_Role_ID=0 WHERE AD_Role_ID IS NULL
;
-- Aug 7, 2012 6:41:48 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Column SET DefaultValue='0',Updated=TO_DATE('2012-08-07 18:41:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1000007
;
-- Aug 7, 2012 6:41:53 PM SGT
-- Move the Menu to be a Portlet
ALTER TABLE PA_DashboardContent MODIFY AD_User_ID NUMBER(10) DEFAULT 0
;
-- Aug 7, 2012 6:41:53 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET AD_User_ID=0 WHERE AD_User_ID IS NULL
;
UPDATE AD_System
SET LastMigrationScriptApplied='863_IDEMPIERE-357_MenuPortlet.sql'
WHERE LastMigrationScriptApplied<'863_IDEMPIERE-357_MenuPortlet.sql'
OR LastMigrationScriptApplied IS NULL
;

View File

@ -0,0 +1,195 @@
-- Aug 7, 2012 5:22:34 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Flat View',1000000,'U','1d68fb0b-318d-463e-aa36-442ec9bc2d90','FlatView','Y',TO_TIMESTAMP('2012-08-07 17:22:34','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-08-07 17:22:34','YYYY-MM-DD HH24:MI:SS'))
;
-- Aug 7, 2012 5:22:34 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=1000000 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- Aug 7, 2012 5:22:50 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Message SET MsgType='M',Updated=TO_TIMESTAMP('2012-08-07 17:22:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=1000000
;
-- Aug 7, 2012 5:28:39 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (0,50010,1000007,'U','N','N','N',0,'N',10,'N',19,'N','N',138,'N','Y','7a1348ca-67c6-43a4-8edb-b4993fe73f37','N','Y','N','AD_User_ID','User within the system - Internal or Business Partner Contact','The User identifies a unique user in the system. This could be an internal user or a business partner contact','User/Contact','Y',100,TO_TIMESTAMP('2012-08-07 17:28:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-08-07 17:28:39','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Aug 7, 2012 5:28:39 PM SGT
-- Move the Menu to be a Portlet
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=1000007 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)
;
-- Aug 7, 2012 5:28:45 PM SGT
-- Move the Menu to be a Portlet
ALTER TABLE PA_DashboardContent ADD COLUMN AD_User_ID NUMERIC(10) DEFAULT NULL
;
-- Aug 7, 2012 5:29:23 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID) VALUES (0,50010,1000008,'U','N','N','N',0,'N',10,'N',19,'N','N',123,'N','Y','0ef8fece-cda5-4349-a7ca-a84cfc808b2c','N','Y','N','AD_Role_ID','Responsibility Role','The Role determines security and access a user who has this Role will have in the System.','Role','Y',100,TO_TIMESTAMP('2012-08-07 17:29:23','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-08-07 17:29:23','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Aug 7, 2012 5:29:23 PM SGT
-- Move the Menu to be a Portlet
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=1000008 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)
;
-- Aug 7, 2012 5:29:26 PM SGT
-- Move the Menu to be a Portlet
ALTER TABLE PA_DashboardContent ADD COLUMN AD_Role_ID NUMERIC(10) DEFAULT NULL
;
-- Aug 7, 2012 5:29:50 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',50010,10,'N','N',1000008,'Y',1000010,'N','The Role determines security and access a user who has this Role will have in the System.','U','Responsibility Role','Role','Y','N','7c90c0dc-696b-450b-a00c-54027171422b',100,0,TO_TIMESTAMP('2012-08-07 17:29:50','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-08-07 17:29:50','YYYY-MM-DD HH24:MI:SS'),'Y')
;
-- Aug 7, 2012 5:29:51 PM SGT
-- Move the Menu to be a Portlet
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=1000010 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)
;
-- Aug 7, 2012 5:29:51 PM SGT
-- Move the Menu to be a Portlet
INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',50010,10,'N','N',1000007,'Y',1000011,'N','The User identifies a unique user in the system. This could be an internal user or a business partner contact','U','User within the system - Internal or Business Partner Contact','User/Contact','Y','N','8766c305-21db-43d0-8739-055b1e82d90d',100,0,TO_TIMESTAMP('2012-08-07 17:29:51','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-08-07 17:29:51','YYYY-MM-DD HH24:MI:SS'),'Y')
;
-- Aug 7, 2012 5:29:51 PM SGT
-- Move the Menu to be a Portlet
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=1000011 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)
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=1000011
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=1000010
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=51007
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=51008
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=56485
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=51009
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=51010
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=51011
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=56486
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=51012
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=51013
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=57344
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=56504
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=1000009
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=1000001
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=1000003
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=1000002
;
-- Aug 7, 2012 5:30:14 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=1000004
;
-- Aug 7, 2012 5:30:22 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2012-08-07 17:30:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000010
;
-- Aug 7, 2012 6:41:20 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Column SET DefaultValue='0',Updated=TO_TIMESTAMP('2012-08-07 18:41:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1000008
;
-- Aug 7, 2012 6:41:23 PM SGT
-- Move the Menu to be a Portlet
ALTER TABLE PA_DashboardContent ALTER AD_Role_ID SET DEFAULT 0
;
-- Aug 7, 2012 6:41:23 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET AD_Role_ID=0 WHERE AD_Role_ID IS NULL
;
-- Aug 7, 2012 6:41:48 PM SGT
-- Move the Menu to be a Portlet
UPDATE AD_Column SET DefaultValue='0',Updated=TO_TIMESTAMP('2012-08-07 18:41:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1000007
;
-- Aug 7, 2012 6:41:53 PM SGT
-- Move the Menu to be a Portlet
ALTER TABLE PA_DashboardContent ALTER AD_User_ID SET DEFAULT 0
;
-- Aug 7, 2012 6:41:53 PM SGT
-- Move the Menu to be a Portlet
UPDATE PA_DashboardContent SET AD_User_ID=0 WHERE AD_User_ID IS NULL
;
UPDATE AD_System
SET LastMigrationScriptApplied='863_IDEMPIERE-357_MenuPortlet.sql'
WHERE LastMigrationScriptApplied<'863_IDEMPIERE-357_MenuPortlet.sql'
OR LastMigrationScriptApplied IS NULL
;

View File

@ -77,6 +77,36 @@ public interface I_PA_DashboardContent
public org.compiere.model.I_AD_Process getAD_Process() throws RuntimeException;
/** Column name AD_Role_ID */
public static final String COLUMNNAME_AD_Role_ID = "AD_Role_ID";
/** Set Role.
* Responsibility Role
*/
public void setAD_Role_ID (int AD_Role_ID);
/** Get Role.
* Responsibility Role
*/
public int getAD_Role_ID();
public org.compiere.model.I_AD_Role getAD_Role() throws RuntimeException;
/** Column name AD_User_ID */
public static final String COLUMNNAME_AD_User_ID = "AD_User_ID";
/** Set User/Contact.
* User within the system - Internal or Business Partner Contact
*/
public void setAD_User_ID (int AD_User_ID);
/** Get User/Contact.
* User within the system - Internal or Business Partner Contact
*/
public int getAD_User_ID();
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
/** Column name AD_Window_ID */
public static final String COLUMNNAME_AD_Window_ID = "AD_Window_ID";

View File

@ -4,6 +4,7 @@
package org.compiere.model;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@ -20,23 +21,36 @@ public class MDashboardContent extends X_PA_DashboardContent
*/
private static final long serialVersionUID = 5425307033413466516L;
public static int getForSessionColumnCount(boolean isShowInDashboard)
public static int getForSessionColumnCount(boolean isShowInDashboard, int AD_User_ID)
{
int noOfCols = getForSessionQuery(isShowInDashboard).aggregate("DISTINCT "+COLUMNNAME_ColumnNo, Query.AGGREGATE_COUNT, Integer.class);
int noOfCols = getForSessionQuery(isShowInDashboard, AD_User_ID).aggregate("DISTINCT "+COLUMNNAME_ColumnNo, Query.AGGREGATE_COUNT, Integer.class);
return noOfCols;
}
public static MDashboardContent[] getForSession(boolean isShowInDashboard)
public static MDashboardContent[] getForSession(boolean isShowInDashboard, int AD_User_ID)
{
List<MDashboardContent> list = getForSessionQuery(isShowInDashboard).list();
List<MDashboardContent> list = getForSessionQuery(isShowInDashboard, AD_User_ID).list();
return list.toArray(new MDashboardContent[list.size()]);
}
public static Query getForSessionQuery(boolean isShowInDashboard)
public static Query getForSessionQuery(boolean isShowInDashboard, int AD_User_ID)
{
Properties ctx = Env.getCtx();
return new Query(ctx, Table_Name, COLUMNNAME_IsShowInDashboard+"=?", null)
.setParameters(isShowInDashboard)
String whereClause = COLUMNNAME_IsShowInDashboard+"=? AND ("
+COLUMNNAME_AD_Role_ID+" IS NULL OR "+COLUMNNAME_AD_Role_ID+" IN (0,?))";
if (AD_User_ID == 0)
whereClause += " AND ("+COLUMNNAME_AD_User_ID+" IS NULL OR "+COLUMNNAME_AD_User_ID+"=?)";
else
whereClause += " AND "+COLUMNNAME_AD_User_ID+"=?";
List<Object> parameters = new ArrayList<Object>();
parameters.add(isShowInDashboard);
parameters.add(Env.getAD_Role_ID(ctx));
parameters.add(AD_User_ID);
return new Query(ctx, Table_Name, whereClause, null)
.setParameters(parameters)
.setOnlyActiveRecords(true)
.setApplyAccessFilter(true, false)
.setOrderBy(COLUMNNAME_ColumnNo+","+COLUMNNAME_AD_Client_ID+","+COLUMNNAME_Line);

View File

@ -32,7 +32,7 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
/**
*
*/
private static final long serialVersionUID = 20120803L;
private static final long serialVersionUID = 20120807L;
/** Standard Constructor */
public X_PA_DashboardContent (Properties ctx, int PA_DashboardContent_ID, String trxName)
@ -109,6 +109,62 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
return ii.intValue();
}
public org.compiere.model.I_AD_Role getAD_Role() throws RuntimeException
{
return (org.compiere.model.I_AD_Role)MTable.get(getCtx(), org.compiere.model.I_AD_Role.Table_Name)
.getPO(getAD_Role_ID(), get_TrxName()); }
/** Set Role.
@param AD_Role_ID
Responsibility Role
*/
public void setAD_Role_ID (int AD_Role_ID)
{
if (AD_Role_ID < 0)
set_Value (COLUMNNAME_AD_Role_ID, null);
else
set_Value (COLUMNNAME_AD_Role_ID, Integer.valueOf(AD_Role_ID));
}
/** Get Role.
@return Responsibility Role
*/
public int getAD_Role_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Role_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException
{
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
.getPO(getAD_User_ID(), get_TrxName()); }
/** Set User/Contact.
@param AD_User_ID
User within the system - Internal or Business Partner Contact
*/
public void setAD_User_ID (int AD_User_ID)
{
if (AD_User_ID < 1)
set_Value (COLUMNNAME_AD_User_ID, null);
else
set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID));
}
/** Get User/Contact.
@return User within the system - Internal or Business Partner Contact
*/
public int getAD_User_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_AD_Window getAD_Window() throws RuntimeException
{
return (org.compiere.model.I_AD_Window)MTable.get(getCtx(), org.compiere.model.I_AD_Window.Table_Name)

View File

@ -143,7 +143,16 @@ public class HtmlDashboard extends JPanel implements MouseListener,
String appendToHome = null;
try
{
for (final MDashboardContent dp : MDashboardContent.getForSession(true))
int AD_User_ID = Env.getAD_User_ID(Env.getCtx());
MDashboardContent[] dps = MDashboardContent.getForSession(true, AD_User_ID); // based on user
if (dps.length == 0)
{
AD_User_ID = 0;
dps = MDashboardContent.getForSession(true, AD_User_ID); // based on client
}
for (final MDashboardContent dp : dps)
{
if (!Util.isEmpty(dp.getZulFilePath(), true))
continue;

View File

@ -18,8 +18,13 @@ import java.util.Enumeration;
import org.adempiere.exceptions.DBException;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.event.TouchEventHelper;
import org.adempiere.webui.exception.ApplicationException;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.window.ADWindow;
import org.adempiere.webui.window.FDialog;
import org.compiere.model.GridTab;
import org.compiere.model.MMenu;
import org.compiere.model.MQuery;
import org.compiere.model.MTree;
import org.compiere.model.MTreeNode;
import org.compiere.model.SystemIDs;
@ -35,11 +40,13 @@ import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.A;
import org.zkoss.zul.Box;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Image;
import org.zkoss.zul.Label;
import org.zkoss.zul.Panel;
import org.zkoss.zul.Panelchildren;
import org.zkoss.zul.Toolbar;
import org.zkoss.zul.Toolbarbutton;
import org.zkoss.zul.Treeitem;
import org.zkoss.zul.Treerow;
import org.zkoss.zul.Vbox;
@ -123,10 +130,15 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
{
MTreeNode nd = (MTreeNode)en.nextElement();
if (nd.isOnBar()) {
Hbox hbox = new Hbox();
hbox.setSpacing("0px");
bxFav.appendChild(hbox);
String label = nd.toString().trim();
A btnFavItem = new A();
btnFavItem.setAttribute(NODE_ID_ATTR, String.valueOf(nd.getNode_ID()));
bxFav.appendChild(btnFavItem);
hbox.appendChild(btnFavItem);
btnFavItem.setLabel(label);
btnFavItem.setImage(getIconFile(nd));
btnFavItem.setDraggable(DELETE_FAV_DROPPABLE);
@ -146,6 +158,15 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
Events.echoEvent(new Event(ON_ADD_TAP_EVENT_LISTENER, btnFavItem, null));
}
}
if (nd.isWindow())
{
Toolbarbutton newBtn = new Toolbarbutton(null, "/images/New10.png");
newBtn.setAttribute(NODE_ID_ATTR, String.valueOf(nd.getNode_ID()));
newBtn.setStyle("margin-bottom:5px");
hbox.appendChild(newBtn);
newBtn.addEventListener(Events.ON_CLICK, this);
}
}
}
}
@ -244,6 +265,41 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
if(menuId > 0) SessionManager.getAppDesktop().onMenuSelected(menuId);
}
else if (comp instanceof Toolbarbutton) {
Toolbarbutton btn = (Toolbarbutton) comp;
int menuId = 0;
try
{
menuId = Integer.valueOf((String)btn.getAttribute(NODE_ID_ATTR));
}
catch (Exception e) {
}
if(menuId > 0)
{
try
{
MMenu menu = new MMenu(Env.getCtx(), menuId, null);
MQuery query = new MQuery("");
query.addRestriction("1=2");
query.setRecordCount(0);
ADWindow frame = SessionManager.getAppDesktop().openWindow(menu.getAD_Window_ID(), query);
if(frame == null)
return;
GridTab tab = frame.getADWindowPanel().getActiveGridTab();
tab.dataNew(false);
}
catch (Exception e)
{
throw new ApplicationException(e.getMessage(), e);
}
}
}
}
private void removeLink(A btn) {
@ -254,7 +310,9 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
int Node_ID = Integer.valueOf(value.toString());
if(barDBupdate(false, Node_ID))
{
bxFav.removeChild(btn);
if (btn.getParent() instanceof Hbox)
bxFav.removeChild(btn.getParent());
// bxFav.removeChild(btn);
if(bxFav.getChildren().isEmpty())
bxFav.appendChild(lblMsg);
@ -275,6 +333,13 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
int Node_ID = Integer.valueOf(value.toString());
if(barDBupdate(true, Node_ID))
{
String menuType = (String) treeitem.getAttribute("menu.type");
boolean isWindow = menuType != null && menuType.equals("window");
Hbox hbox = new Hbox();
hbox.setSpacing("0px");
bxFav.appendChild(hbox);
String label = null;
String image = null;
if (treeitem.getLabel() != null && treeitem.getLabel().trim().length() > 0)
@ -289,7 +354,7 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
image = link.getImage();
}
A btnFavItem = new A();
bxFav.appendChild(btnFavItem);
hbox.appendChild(btnFavItem);
btnFavItem.setAttribute(NODE_ID_ATTR, String.valueOf(Node_ID));
btnFavItem.setLabel(label);
btnFavItem.setImage(image);
@ -300,6 +365,16 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
if (AEnv.isTablet()) {
TouchEventHelper.addOnTapEventListener(btnFavItem, this);
}
if (isWindow)
{
Toolbarbutton newBtn = new Toolbarbutton(null, "/images/New10.png");
newBtn.setAttribute(NODE_ID_ATTR, String.valueOf(Node_ID));
newBtn.setStyle("margin-bottom:5px");
hbox.appendChild(newBtn);
newBtn.addEventListener(Events.ON_CLICK, this);
}
bxFav.removeChild(lblMsg);
bxFav.invalidate();
} else {

View File

@ -15,7 +15,6 @@ package org.adempiere.webui.desktop;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.net.URL;
@ -127,9 +126,19 @@ public class DashboardController implements EventListener<Event> {
try
{
noOfCols = MDashboardContent.getForSessionColumnCount(isShowInDashboard);
int AD_User_ID = Env.getAD_User_ID(Env.getCtx());
MDashboardContent[] dps = MDashboardContent.getForSession(isShowInDashboard, AD_User_ID); // based on user
if (dps.length == 0)
{
AD_User_ID = 0;
dps = MDashboardContent.getForSession(isShowInDashboard, AD_User_ID); // based on client
}
noOfCols = MDashboardContent.getForSessionColumnCount(isShowInDashboard, AD_User_ID);
width = noOfCols <= 0 ? 100 : 100 / noOfCols;
for (final MDashboardContent dp : MDashboardContent.getForSession(isShowInDashboard))
for (final MDashboardContent dp : dps)
{
int columnNo = dp.getColumnNo();
if(dashboardColumnLayout == null || currentColumnNo != columnNo)
@ -178,9 +187,11 @@ public class DashboardController implements EventListener<Event> {
ins = new InputStreamReader(url.openStream());
BufferedReader bufferedReader = new BufferedReader( ins );
String cssLine;
result.append("<style type=\"text/css\">");
while ((cssLine = bufferedReader.readLine()) != null)
result.append(cssLine + "\n");
} catch (IOException e1) {
result.append("</style>");
} catch (Exception e1) {
logger.log(Level.SEVERE, e1.getLocalizedMessage(), e1);
}
@ -189,7 +200,7 @@ public class DashboardController implements EventListener<Event> {
// if(description != null)
// result.append("<h2>" + description + "</h2>\n");
result.append(stripHtml(htmlContent, false) + "<br>\n");
result.append("</div>\n</body>\n</html>\n</html>");
result.append("</div>\n</body>\n</html>");
Html html = new Html();
html.setContent(result.toString());

View File

@ -111,6 +111,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
pnlHead.setParent(n);
West w = new West();
w.setTitle(" ");
layout.appendChild(w);
w.setSclass("desktop-left-column");
w.setCollapsible(true);

View File

@ -111,6 +111,7 @@ public class NavBar2Desktop extends TabbedDesktop implements MenuListener, Seria
pnlHead.setParent(n);
West w = new West();
w.setTitle(" ");
layout.appendChild(w);
w.setWidth("300px");
w.setCollapsible(true);

View File

@ -203,6 +203,7 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener<E
Treerow treeRow = new Treerow();
treeitem.appendChild(treeRow);
Treecell treeCell = new Treecell();
treeCell.setSclass("menu-treecell-cnt");
treeRow.appendChild(treeCell);
A link = new A();
treeCell.appendChild(link);
@ -228,7 +229,7 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener<E
treeitem.setAttribute("menu.type", "window");
Toolbarbutton newBtn = new Toolbarbutton(null, "/images/New10.png");
newBtn.setStyle("margin-bottom:5px");
newBtn.setStyle("padding-left:3px; margin-bottom:5px");
treeCell.appendChild(newBtn);
newBtn.addEventListener(Events.ON_CLICK, this);
}

View File

@ -26,9 +26,9 @@ import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center;
import org.zkoss.zul.West;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Image;
import org.zkoss.zul.Vbox;
import org.zkoss.zul.West;
/**
*
@ -68,13 +68,14 @@ public class HeaderPanel extends Panel implements EventListener<Event>
West west = new West();
west.setParent(layout);
Vbox vb = new Vbox();
vb.setParent(west);
vb.setHeight("100%");
vb.setPack("center");
vb.setAlign("left");
Hbox hbox = new Hbox();
hbox.setParent(west);
hbox.setHeight("100%");
hbox.setPack("center");
hbox.setAlign("left");
image.setParent(vb);
image.setParent(hbox);
new MenuSearchPanel(this).setParent(hbox);
LayoutUtils.addSclass("desktop-header-left", west);
//the following doesn't work when declare as part of the header-left style

View File

@ -16,11 +16,12 @@ package org.adempiere.webui.panel;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.EventQueues;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Panelchildren;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Style;
import org.zkoss.zul.Toolbar;
import org.zkoss.zul.Toolbarbutton;
/**
* Menu Search Panel
@ -34,11 +35,7 @@ public class MenuSearchPanel extends AbstractMenuPanel
*/
private static final long serialVersionUID = 5308522340852904168L;
private TreeSearchPanel pnlSearch;
private MenuTreeFilterPanel filterPanel;
private Toolbarbutton filterBtn;
public MenuSearchPanel(Component parent)
{
@ -49,6 +46,25 @@ public class MenuSearchPanel extends AbstractMenuPanel
{
super.init();
pnlSearch.initialise();
EventQueues.lookup(MenuTreeFilterPanel.MENU_TREE_FILTER_CHECKED_QUEUE, EventQueues.APPLICATION, true).subscribe(new EventListener<Event>() {
public void onEvent(Event event) throws Exception {
if (event.getName() == Events.ON_CHECK)
{
Checkbox chk = (Checkbox) event.getData();
if (chk != null)
{
if ("flatView".equals(chk.getId()))
MenuTreeFilterPanel.toggleFlatView(getMenuTree(), chk);
else
MenuTreeFilterPanel.toggle(getMenuTree(), chk);
if (pnlSearch != null)
pnlSearch.refreshSearchList();
getMenuTree().invalidate();
}
}
}
});
}
protected void initComponents()
@ -64,22 +80,5 @@ public class MenuSearchPanel extends AbstractMenuPanel
style.setContent(".z-comboitem-img{ vertical-align:top; padding-right:2px; padding-bottom:4px; }");
pnlSearch.insertBefore(style, pnlSearch.getFirstChild());
toolbar.appendChild(pnlSearch);
filterBtn = new Toolbarbutton();
filterBtn.setImage("/images/Preference16.png");
filterBtn.addEventListener(Events.ON_CLICK, this);
toolbar.appendChild(filterBtn);
Panelchildren pc = new Panelchildren();
this.appendChild(pc);
filterPanel = new MenuTreeFilterPanel(getMenuTree(), pnlSearch);
pc.appendChild(filterPanel);
}
public void onEvent(Event event)
{
super.onEvent(event);
if (event.getName().equals(Events.ON_CLICK) && event.getTarget() == filterBtn)
filterPanel.open(filterBtn);
}
}

View File

@ -2,6 +2,8 @@ package org.adempiere.webui.panel;
import org.adempiere.webui.util.TreeItemAction;
import org.adempiere.webui.util.TreeUtils;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.zkoss.zk.ui.IdSpace;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
@ -58,7 +60,7 @@ public class MenuTreeFilterPanel extends Popup implements EventListener<Event>,
box.appendChild(window);
Checkbox single = new Checkbox();
single.setLabel("Flat View");
single.setLabel(Msg.getMsg(Env.getCtx(), "FlatView"));
single.setId("flatView");
single.setChecked(false);
single.addEventListener(Events.ON_CHECK, this);
@ -69,14 +71,14 @@ public class MenuTreeFilterPanel extends Popup implements EventListener<Event>,
public void onEvent(Event event) throws Exception {
final Checkbox chk = (Checkbox) event.getTarget();
if ("flatView".equals(chk.getId()))
/* if ("flatView".equals(chk.getId()))
toggleFlatView(tree, chk);
else
toggle(tree, chk);
if (searchPanel != null)
searchPanel.refreshSearchList();
tree.invalidate();
*/
EventQueues.lookup(MENU_TREE_FILTER_CHECKED_QUEUE, EventQueues.APPLICATION, true).publish(new Event(Events.ON_CHECK, null, chk));
}

View File

@ -29,6 +29,7 @@ import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Panelchildren;
import org.zkoss.zul.Toolbar;
import org.zkoss.zul.Toolbarbutton;
/**
* Menu Tree Panel
@ -42,7 +43,10 @@ public class MenuTreePanel extends AbstractMenuPanel
*/
private static final long serialVersionUID = -911113870835089567L;
private static final String ON_EXPAND_MENU_EVENT = "onExpandMenu";
private ToolBarButton expandToggle;
private MenuTreeFilterPanel filterPanel;
private Toolbarbutton filterBtn;
public MenuTreePanel(Component parent)
{
@ -87,15 +91,23 @@ public class MenuTreePanel extends AbstractMenuPanel
// Elaine 2009/02/27 - expand tree
Toolbar toolbar = new Toolbar();
toolbar.setStyle("verticle-align: middle; padding: 2px");
this.appendChild(toolbar);
expandToggle = new ToolBarButton();
expandToggle.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "ExpandTree")));
expandToggle.setMode("toggle");
expandToggle.addEventListener(Events.ON_CHECK, this);
toolbar.appendChild(expandToggle);
toolbar.setMold("panel");
this.appendChild(toolbar);
this.addEventListener(ON_EXPAND_MENU_EVENT, this);
filterPanel = new MenuTreeFilterPanel(getMenuTree(), null);
pc.appendChild(filterPanel);
filterBtn = new Toolbarbutton();
filterBtn.setImage("/images/Preference16.png");
filterBtn.addEventListener(Events.ON_CLICK, this);
toolbar.appendChild(filterBtn);
}
public void onEvent(Event event)
@ -115,6 +127,8 @@ public class MenuTreePanel extends AbstractMenuPanel
Clients.clearBusy();
}
//
else if (event.getName().equals(Events.ON_CLICK) && event.getTarget() == filterBtn)
filterPanel.open(filterBtn);
}
/**

View File

@ -73,20 +73,15 @@ public class UserPanel extends Vbox implements EventListener<Event>
this.setAlign("right");
//
Hbox hbox = new Hbox();
this.appendChild(hbox);
hbox.appendChild(new MenuSearchPanel(this));
Vbox vbox = new Vbox();
hbox.appendChild(vbox);
this.appendChild(vbox);
lblUserNameValue.setValue(getUserName() + "@" + getClientName() + "." + getOrgName());
lblUserNameValue.setStyle("text-align:right");
LayoutUtils.addSclass("desktop-header-font", lblUserNameValue);
vbox.appendChild(lblUserNameValue);
hbox = new Hbox();
Hbox hbox = new Hbox();
vbox.appendChild(hbox);
preference.setLabel(Msg.getMsg(Env.getCtx(), "Preference"));

View File

@ -591,4 +591,9 @@ div.z-filetree-body td.menu-tree-cell {
div.z-vfiletree-body td.menu-tree-cell {
cursor: pointer; padding: 0 2px;
font-size: ${fontSizeM}; font-weight: normal; overflow: visible;
}
<%-- dashlet --%>
.z-panel-hl .z-panel-header {
padding: 0 0 2px 0;
}

View File

@ -10,6 +10,7 @@ Export-Package: org.compiere.apps,
org.compiere.apps.wf,
org.compiere.grid,
org.compiere.grid.ed,
org.compiere.images,
org.compiere.install,
org.compiere.minigrid,
org.compiere.print,