IDEMPIERE-396 Home Count is not adding the unprocessed docs #
This commit is contained in:
parent
7771156f10
commit
dfe6970d3d
|
@ -42,7 +42,6 @@ import org.zkoss.zul.Vbox;
|
|||
* CarlosRuiz - globalqss - Add unprocessed button to iDempiere
|
||||
*/
|
||||
public class DPActivities extends DashboardPanel implements EventListener<Event> {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -56,8 +55,6 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
|
|||
|
||||
private int noOfNotice, noOfRequest, noOfWorkflow, noOfUnprocessed;
|
||||
|
||||
private boolean isShowUnprocessed;
|
||||
|
||||
public DPActivities()
|
||||
{
|
||||
super();
|
||||
|
@ -66,8 +63,6 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
|
|||
|
||||
private Box createActivitiesPanel()
|
||||
{
|
||||
isShowUnprocessed = (Env.getAD_Client_ID(Env.getCtx()) > 0);
|
||||
|
||||
Vbox vbox = new Vbox();
|
||||
|
||||
btnNotice = new Button();
|
||||
|
@ -100,7 +95,7 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
|
|||
btnWorkflow.setName(String.valueOf(AD_Menu_ID));
|
||||
btnWorkflow.addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
if (isShowUnprocessed) {
|
||||
if (isShowUnprocessed()) {
|
||||
btnUnprocessed = new Button();
|
||||
vbox.appendChild(btnUnprocessed);
|
||||
labelU = Util.cleanAmp(Msg.translate(Env.getCtx(), "UnprocessedDocs"));
|
||||
|
@ -115,6 +110,10 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
|
|||
return vbox;
|
||||
}
|
||||
|
||||
private static boolean isShowUnprocessed() {
|
||||
return (Env.getAD_Client_ID(Env.getCtx()) > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notice count
|
||||
* @return number of notice
|
||||
|
@ -204,6 +203,9 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
|
|||
*/
|
||||
public static int getUnprocessedCount()
|
||||
{
|
||||
if (! isShowUnprocessed())
|
||||
return 0;
|
||||
|
||||
String sql = "SELECT COUNT(1) FROM RV_Unprocessed "
|
||||
+ "WHERE AD_Client_ID=? AND CreatedBy=?";
|
||||
|
||||
|
@ -217,7 +219,7 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
|
|||
noOfNotice = getNoticeCount();
|
||||
noOfRequest = getRequestCount();
|
||||
noOfWorkflow = getWorkflowCount();
|
||||
if (isShowUnprocessed) noOfUnprocessed = getUnprocessedCount();
|
||||
noOfUnprocessed = getUnprocessedCount();
|
||||
|
||||
template.executeAsync(this);
|
||||
}
|
||||
|
@ -234,7 +236,7 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
|
|||
btnNotice.setLabel(labelN + " : " + noOfNotice);
|
||||
btnRequest.setLabel(labelR + " : " + noOfRequest);
|
||||
btnWorkflow.setLabel(labelW + " : " + noOfWorkflow);
|
||||
if (isShowUnprocessed) btnUnprocessed.setLabel(labelU + " : " + noOfUnprocessed);
|
||||
if (isShowUnprocessed()) btnUnprocessed.setLabel(labelU + " : " + noOfUnprocessed);
|
||||
}
|
||||
|
||||
public void onEvent(Event event)
|
||||
|
|
|
@ -79,6 +79,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
|
||||
private int noOfWorkflow;
|
||||
|
||||
private int noOfUnprocessed;
|
||||
|
||||
private Tabpanel homeTab;
|
||||
|
||||
private DashboardController dashboardController, sideController;
|
||||
|
@ -223,6 +225,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
noOfNotice = DPActivities.getNoticeCount();
|
||||
noOfRequest = DPActivities.getRequestCount();
|
||||
noOfWorkflow = DPActivities.getWorkflowCount();
|
||||
noOfUnprocessed = DPActivities.getUnprocessedCount();
|
||||
|
||||
template.executeAsync(this);
|
||||
}
|
||||
|
@ -265,12 +268,14 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
|||
}
|
||||
|
||||
public void updateUI() {
|
||||
int total = noOfNotice + noOfRequest + noOfWorkflow;
|
||||
int total = noOfNotice + noOfRequest + noOfWorkflow + noOfUnprocessed;
|
||||
windowContainer.setTabTitle(0, Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Home"))
|
||||
+ " (" + total + ")",
|
||||
Msg.translate(Env.getCtx(), "AD_Note_ID") + " : " + noOfNotice
|
||||
+ ", " + Msg.translate(Env.getCtx(), "R_Request_ID") + " : " + noOfRequest
|
||||
+ ", " + Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : " + noOfWorkflow);
|
||||
+ ", " + Util.cleanAmp(Msg.getMsg (Env.getCtx(), "WorkflowActivities")) + " : " + noOfWorkflow
|
||||
+ (noOfUnprocessed>0 ? ", " + Msg.getMsg (Env.getCtx(), "UnprocessedDocs") + " : " + noOfUnprocessed : "")
|
||||
);
|
||||
}
|
||||
|
||||
private void autoHideMenu() {
|
||||
|
|
|
@ -79,6 +79,8 @@ public class NavBar2Desktop extends TabbedDesktop implements MenuListener, Seria
|
|||
|
||||
private int noOfWorkflow;
|
||||
|
||||
private int noOfUnprocessed;
|
||||
|
||||
private Tabpanel homeTab;
|
||||
|
||||
private DashboardController dashboardController, sideController;
|
||||
|
@ -254,6 +256,7 @@ public class NavBar2Desktop extends TabbedDesktop implements MenuListener, Seria
|
|||
noOfNotice = DPActivities.getNoticeCount();
|
||||
noOfRequest = DPActivities.getRequestCount();
|
||||
noOfWorkflow = DPActivities.getWorkflowCount();
|
||||
noOfUnprocessed = DPActivities.getUnprocessedCount();
|
||||
|
||||
template.executeAsync(this);
|
||||
}
|
||||
|
@ -293,11 +296,13 @@ public class NavBar2Desktop extends TabbedDesktop implements MenuListener, Seria
|
|||
}
|
||||
|
||||
public void updateUI() {
|
||||
int total = noOfNotice + noOfRequest + noOfWorkflow;
|
||||
int total = noOfNotice + noOfRequest + noOfWorkflow + noOfUnprocessed;
|
||||
shortcutPanel.setLabel(1, "Activities (" + total + ")");
|
||||
shortcutPanel.setTooltiptext(1, Msg.translate(Env.getCtx(), "AD_Note_ID") + " : " + noOfNotice
|
||||
+ ", " + Msg.translate(Env.getCtx(), "R_Request_ID") + " : " + noOfRequest
|
||||
+ ", " + Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : " + noOfWorkflow);
|
||||
+ ", " + Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : " + noOfWorkflow
|
||||
+ (noOfUnprocessed>0 ? ", " + Msg.getMsg (Env.getCtx(), "UnprocessedDocs") + " : " + noOfUnprocessed : "")
|
||||
);
|
||||
}
|
||||
|
||||
private void autoHideMenu() {
|
||||
|
|
|
@ -89,6 +89,8 @@ public class NavBarDesktop extends TabbedDesktop implements MenuListener, Serial
|
|||
|
||||
private int noOfWorkflow;
|
||||
|
||||
private int noOfUnprocessed;
|
||||
|
||||
private Tabpanel homeTab;
|
||||
|
||||
private DashboardController dashboardController;
|
||||
|
@ -268,6 +270,7 @@ public class NavBarDesktop extends TabbedDesktop implements MenuListener, Serial
|
|||
noOfNotice = DPActivities.getNoticeCount();
|
||||
noOfRequest = DPActivities.getRequestCount();
|
||||
noOfWorkflow = DPActivities.getWorkflowCount();
|
||||
noOfUnprocessed = DPActivities.getUnprocessedCount();
|
||||
|
||||
template.executeAsync(this);
|
||||
}
|
||||
|
@ -302,11 +305,13 @@ public class NavBarDesktop extends TabbedDesktop implements MenuListener, Serial
|
|||
}
|
||||
|
||||
public void updateUI() {
|
||||
int total = noOfNotice + noOfRequest + noOfWorkflow;
|
||||
int total = noOfNotice + noOfRequest + noOfWorkflow + noOfUnprocessed;
|
||||
navigationPanel.setLabel(2, "Activities (" + total + ")");
|
||||
navigationPanel.setTooltiptext(2, Msg.translate(Env.getCtx(), "AD_Note_ID") + " : " + noOfNotice
|
||||
+ ", " + Msg.translate(Env.getCtx(), "R_Request_ID") + " : " + noOfRequest
|
||||
+ ", " + Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : " + noOfWorkflow);
|
||||
+ ", " + Msg.getMsg (Env.getCtx(), "WorkflowActivities") + " : " + noOfWorkflow
|
||||
+ (noOfUnprocessed>0 ? ", " + Msg.getMsg (Env.getCtx(), "UnprocessedDocs") + " : " + noOfUnprocessed : "")
|
||||
);
|
||||
}
|
||||
|
||||
private void autoHideMenu() {
|
||||
|
|
Loading…
Reference in New Issue