From 893530a9b913a3867125ecca1d09e4b6962c26c1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 1 Mar 2013 19:27:49 -0500 Subject: [PATCH] IDEMPIERE-127 Implement Recent Items dashboard / Let modified items appear on top --- .../src/org/compiere/model/MRecentItem.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MRecentItem.java b/org.adempiere.base/src/org/compiere/model/MRecentItem.java index 588645a2da..f66b1ceb97 100644 --- a/org.adempiere.base/src/org/compiere/model/MRecentItem.java +++ b/org.adempiere.base/src/org/compiere/model/MRecentItem.java @@ -170,11 +170,22 @@ public class MRecentItem extends X_AD_RecentItem ri.setAD_Table_ID(AD_Table_ID); ri.setRecord_ID(Record_ID); ri.setAD_User_ID(AD_User_ID); + ri.setAD_Role_ID(AD_Role_ID); + ri.setAD_Window_ID(AD_Window_ID); + ri.setAD_Tab_ID(AD_Tab_ID); + ri.saveEx(); + } else { + if ( ri.getAD_Role_ID() != AD_Role_ID + || ri.getAD_Window_ID() != AD_Window_ID + || ri.getAD_Tab_ID() != AD_Tab_ID) { + ri.setAD_Role_ID(AD_Role_ID); + ri.setAD_Window_ID(AD_Window_ID); + ri.setAD_Tab_ID(AD_Tab_ID); + ri.saveEx(); + } else { + DB.executeUpdateEx("UPDATE AD_RecentItem SET Updated=SYSDATE WHERE AD_RecentItem_ID=?", new Object[] {ri.getAD_RecentItem_ID()}, null); + } } - ri.setAD_Role_ID(AD_Role_ID); - ri.setAD_Window_ID(AD_Window_ID); - ri.setAD_Tab_ID(AD_Tab_ID); - ri.saveEx(); publishChangedEvent(AD_User_ID); }