IDEMPIERE-5393 - Allow rendering status line as widget/gadget in dashboard (#1449)

* IDEMPIERE-5393 - Allow rendering status line as widget/gadget in dashboard

* IDEMPIERE-5393 - css class for status line

* IDEMPIERE-5393 - update default theme version
This commit is contained in:
Peter Takács 2022-08-24 09:49:06 +02:00 committed by GitHub
parent 2dab2d9882
commit 0aaf904e34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 183 additions and 38 deletions

View File

@ -0,0 +1,46 @@
-- IDEMPIERE-5393
SELECT register_migration_script('202208220922_IDEMPIERE-5393.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Aug 18, 2022, 11:13:06 AM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (215099,0,'Status Line',50010,'AD_StatusLine_ID',22,'N','N','N','N','N',0,'N',19,0,0,'Y',TO_TIMESTAMP('2022-08-18 11:13:06','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-08-18 11:13:06','YYYY-MM-DD HH24:MI:SS'),100,202635,'Y','N','D','N','N','N','Y','6318c76d-e4e1-4846-a1e8-57d4c5a52df3','N',0,'N','N','N','N')
;
-- Aug 18, 2022, 11:13:15 AM CEST
UPDATE AD_Column SET FKConstraintName='ADStatusLine_PADashboardConten', FKConstraintType='N',Updated=TO_TIMESTAMP('2022-08-18 11:13:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215099
;
-- Aug 18, 2022, 11:13:15 AM CEST
ALTER TABLE PA_DashboardContent ADD AD_StatusLine_ID NUMBER(10) DEFAULT NULL
;
-- Aug 18, 2022, 11:13:15 AM CEST
ALTER TABLE PA_DashboardContent ADD CONSTRAINT ADStatusLine_PADashboardConten FOREIGN KEY (AD_StatusLine_ID) REFERENCES ad_statusline(ad_statusline_id) DEFERRABLE INITIALLY DEFERRED
;
-- Aug 18, 2022, 11:13:37 AM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207135,'Status Line',50010,215099,'Y',22,220,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-08-18 11:13:37','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-08-18 11:13:37','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','b855dcfe-397a-48a7-bebc-0903f6caf14e','Y',210,2)
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207135
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56504
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200268
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200260
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202286
;

View File

@ -0,0 +1,43 @@
-- IDEMPIERE-5393
SELECT register_migration_script('202208220922_IDEMPIERE-5393.sql') FROM dual;
-- Aug 18, 2022, 11:13:06 AM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (215099,0,'Status Line',50010,'AD_StatusLine_ID',22,'N','N','N','N','N',0,'N',19,0,0,'Y',TO_TIMESTAMP('2022-08-18 11:13:06','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-08-18 11:13:06','YYYY-MM-DD HH24:MI:SS'),100,202635,'Y','N','D','N','N','N','Y','6318c76d-e4e1-4846-a1e8-57d4c5a52df3','N',0,'N','N','N','N')
;
-- Aug 18, 2022, 11:13:15 AM CEST
UPDATE AD_Column SET FKConstraintName='ADStatusLine_PADashboardConten', FKConstraintType='N',Updated=TO_TIMESTAMP('2022-08-18 11:13:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=215099
;
-- Aug 18, 2022, 11:13:15 AM CEST
ALTER TABLE PA_DashboardContent ADD COLUMN AD_StatusLine_ID NUMERIC(10) DEFAULT NULL
;
-- Aug 18, 2022, 11:13:15 AM CEST
ALTER TABLE PA_DashboardContent ADD CONSTRAINT ADStatusLine_PADashboardConten FOREIGN KEY (AD_StatusLine_ID) REFERENCES ad_statusline(ad_statusline_id) DEFERRABLE INITIALLY DEFERRED
;
-- Aug 18, 2022, 11:13:37 AM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (207135,'Status Line',50010,215099,'Y',22,220,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-08-18 11:13:37','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2022-08-18 11:13:37','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','b855dcfe-397a-48a7-bebc-0903f6caf14e','Y',210,2)
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207135
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56504
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200268
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200260
;
-- Aug 18, 2022, 11:15:07 AM CEST
UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-08-18 11:15:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202286
;

View File

@ -55,8 +55,8 @@ public interface I_PA_DashboardContent
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
/** Get Tenant.
* Tenant for this installation.
*/
public int getAD_Client_ID();
@ -64,12 +64,12 @@ public interface I_PA_DashboardContent
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
* Organizational entity within tenant
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
* Organizational entity within tenant
*/
public int getAD_Org_ID();
@ -103,6 +103,17 @@ public interface I_PA_DashboardContent
public org.compiere.model.I_AD_Role getAD_Role() throws RuntimeException;
/** Column name AD_StatusLine_ID */
public static final String COLUMNNAME_AD_StatusLine_ID = "AD_StatusLine_ID";
/** Set Status Line */
public void setAD_StatusLine_ID (int AD_StatusLine_ID);
/** Get Status Line */
public int getAD_StatusLine_ID();
public org.compiere.model.I_AD_StatusLine getAD_StatusLine() throws RuntimeException;
/** Column name AD_User_ID */
public static final String COLUMNNAME_AD_User_ID = "AD_User_ID";
@ -262,15 +273,6 @@ public interface I_PA_DashboardContent
*/
public boolean isShowInDashboard();
/** Column name IsShowinLogin */
public static final String COLUMNNAME_IsShowinLogin = "IsShowinLogin";
/** Set Show on Login */
public void setIsShowinLogin (boolean IsShowinLogin);
/** Get Show on Login */
public boolean isShowinLogin();
/** Column name IsShowTitle */
public static final String COLUMNNAME_IsShowTitle = "IsShowTitle";
@ -280,6 +282,15 @@ public interface I_PA_DashboardContent
/** Get Show Title */
public boolean isShowTitle();
/** Column name IsShowinLogin */
public static final String COLUMNNAME_IsShowinLogin = "IsShowinLogin";
/** Set Show on Login */
public void setIsShowinLogin (boolean IsShowinLogin);
/** Get Show on Login */
public boolean isShowinLogin();
/** Column name Line */
public static final String COLUMNNAME_Line = "Line";
@ -380,4 +391,4 @@ public interface I_PA_DashboardContent
* URI for Dashboard Gadget
*/
public String getZulFilePath();
}
}

View File

@ -33,7 +33,7 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
/**
*
*/
private static final long serialVersionUID = 20220712L;
private static final long serialVersionUID = 20220818L;
/** Standard Constructor */
public X_PA_DashboardContent (Properties ctx, int PA_DashboardContent_ID, String trxName)
@ -188,6 +188,33 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
return ii.intValue();
}
public org.compiere.model.I_AD_StatusLine getAD_StatusLine() throws RuntimeException
{
return (org.compiere.model.I_AD_StatusLine)MTable.get(getCtx(), org.compiere.model.I_AD_StatusLine.Table_ID)
.getPO(getAD_StatusLine_ID(), get_TrxName());
}
/** Set Status Line.
@param AD_StatusLine_ID Status Line
*/
public void setAD_StatusLine_ID (int AD_StatusLine_ID)
{
if (AD_StatusLine_ID < 1)
set_Value (COLUMNNAME_AD_StatusLine_ID, null);
else
set_Value (COLUMNNAME_AD_StatusLine_ID, Integer.valueOf(AD_StatusLine_ID));
}
/** Get Status Line.
@return Status Line */
public int getAD_StatusLine_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_StatusLine_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_ID)
@ -409,28 +436,6 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
return false;
}
/** Set Show on Login.
@param IsShowinLogin Show on Login
*/
public void setIsShowinLogin (boolean IsShowinLogin)
{
set_Value (COLUMNNAME_IsShowinLogin, Boolean.valueOf(IsShowinLogin));
}
/** Get Show on Login.
@return Show on Login */
public boolean isShowinLogin()
{
Object oo = get_Value(COLUMNNAME_IsShowinLogin);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Show Title.
@param IsShowTitle Show Title
*/
@ -453,6 +458,28 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent,
return false;
}
/** Set Show on Login.
@param IsShowinLogin Show on Login
*/
public void setIsShowinLogin (boolean IsShowinLogin)
{
set_Value (COLUMNNAME_IsShowinLogin, Boolean.valueOf(IsShowinLogin));
}
/** Get Show on Login.
@return Show on Login */
public boolean isShowinLogin()
{
Object oo = get_Value(COLUMNNAME_IsShowinLogin);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Line No.
@param Line Unique line for this document
*/

View File

@ -57,6 +57,6 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI).
<!-- this js module doesn't actually exists and it is here for default theme version -->
<!-- since loading of js module is on demand, it doesn't cause any error as long as you don't try to load it -->
<javascript-module name="idempiere.theme.default" version="202208021400" />
<javascript-module name="idempiere.theme.default" version="202208230800" />
</language>

View File

@ -61,6 +61,7 @@ import org.compiere.model.MPInstance;
import org.compiere.model.MPInstancePara;
import org.compiere.model.MProcess;
import org.compiere.model.MProcessPara;
import org.compiere.model.MStatusLine;
import org.compiere.model.MSysConfig;
import org.compiere.model.PO;
import org.compiere.print.ReportEngine;
@ -559,6 +560,19 @@ public class DashboardController implements EventListener<Event> {
});
}
// Status Line
final int AD_StatusLine_ID = dc.getAD_StatusLine_ID();
if(AD_StatusLine_ID > 0) {
MStatusLine sl = new MStatusLine(Env.getCtx(), AD_StatusLine_ID, null);
final Html statusLineHtml = new Html();
statusLineHtml.setContent(sl.parseLine(0));
Div div = new Div();
div.appendChild(statusLineHtml);
div.setSclass("statusline-gadget");
content.appendChild(div);
empty = false;
}
return !empty;
}

View File

@ -212,6 +212,10 @@
height: 100% !important;
}
.statusline-gadget {
padding: 0px 10px 10px;
}
.help-content
{
padding: 2px;