Add Dashboard tab to left main menu.
Add mock up of pipeline window.
This commit is contained in:
parent
ffca70fbea
commit
ea497bf8b9
8 changed files with 164 additions and 8 deletions
|
|
@ -0,0 +1,21 @@
|
|||
package org.libreplan.web.dashboard;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.util.GenericForwardComposer;
|
||||
|
||||
/**
|
||||
* Created
|
||||
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
|
||||
* on 20.11.15.
|
||||
*/
|
||||
|
||||
@org.springframework.stereotype.Component
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
public class DashboardControllerGlobal extends GenericForwardComposer {
|
||||
@Override
|
||||
public void doAfterCompose(Component component) throws Exception {
|
||||
super.doAfterCompose(component);
|
||||
}
|
||||
}
|
||||
|
|
@ -21,12 +21,15 @@ package org.libreplan.web.email;
|
|||
|
||||
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.libreplan.business.common.exceptions.ValidationException;
|
||||
import org.libreplan.business.orders.entities.Order;
|
||||
import org.libreplan.business.settings.entities.Language;
|
||||
|
||||
import org.libreplan.business.email.entities.EmailTemplateEnum;
|
||||
import org.libreplan.web.common.IMessagesForUser;
|
||||
import org.libreplan.web.common.Level;
|
||||
import org.libreplan.web.common.MessagesForUser;
|
||||
import org.libreplan.web.orders.IOrderModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
|
||||
|
||||
|
|
@ -177,4 +180,10 @@ public class EmailTemplateController extends GenericForwardComposer{
|
|||
private void getContentDataBySelectedTemplate(){
|
||||
contentsTextbox.setValue( emailTemplateModel.getContentBySelectedTemplate( getSelectedEmailTemplateEnum().ordinal(), getSelectedLanguage().ordinal() ) );
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private IOrderModel orderModel;
|
||||
public List<Order> getOrder(){
|
||||
return orderModel.getOrders();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import org.libreplan.business.orders.entities.Order;
|
|||
import org.libreplan.business.planner.entities.TaskElement;
|
||||
import org.libreplan.business.resources.daos.IResourcesSearcher;
|
||||
import org.libreplan.web.dashboard.DashboardController;
|
||||
import org.libreplan.web.dashboard.DashboardControllerGlobal;
|
||||
import org.libreplan.web.planner.order.OrderPlanningController;
|
||||
import org.libreplan.web.planner.order.PlanningStateCreator;
|
||||
import org.libreplan.web.planner.order.PlanningStateCreator.PlanningState;
|
||||
|
|
@ -55,17 +56,19 @@ public class DashboardTabCreator {
|
|||
public static ITab create(Mode mode,
|
||||
PlanningStateCreator planningStateCreator,
|
||||
DashboardController dashboardController,
|
||||
DashboardControllerGlobal dashboardControllerGlobal,
|
||||
OrderPlanningController orderPlanningController,
|
||||
Component breadcrumbs,
|
||||
IResourcesSearcher resourcesSearcher) {
|
||||
return new DashboardTabCreator(mode, planningStateCreator,
|
||||
dashboardController, orderPlanningController, breadcrumbs,
|
||||
resourcesSearcher).build();
|
||||
dashboardController, dashboardControllerGlobal, orderPlanningController,
|
||||
breadcrumbs, resourcesSearcher).build();
|
||||
}
|
||||
|
||||
private final PlanningStateCreator planningStateCreator;
|
||||
private final Mode mode;
|
||||
private final DashboardController dashboardController;
|
||||
private final DashboardControllerGlobal dashboardControllerGlobal;
|
||||
private final OrderPlanningController orderPlanningController;
|
||||
private final Component breadcrumbs;
|
||||
private final IResourcesSearcher resourcesSearcher;
|
||||
|
|
@ -73,12 +76,14 @@ public class DashboardTabCreator {
|
|||
private DashboardTabCreator(Mode mode,
|
||||
PlanningStateCreator planningStateCreator,
|
||||
DashboardController dashboardController,
|
||||
DashboardControllerGlobal dashboardControllerGlobal,
|
||||
OrderPlanningController orderPlanningController,
|
||||
Component breadcrumbs,
|
||||
IResourcesSearcher resourcesSearcher) {
|
||||
this.mode = mode;
|
||||
this.planningStateCreator = planningStateCreator;
|
||||
this.dashboardController = dashboardController;
|
||||
this.dashboardControllerGlobal = dashboardControllerGlobal;
|
||||
this.orderPlanningController = orderPlanningController;
|
||||
this.breadcrumbs = breadcrumbs;
|
||||
this.resourcesSearcher = resourcesSearcher;
|
||||
|
|
@ -86,7 +91,7 @@ public class DashboardTabCreator {
|
|||
|
||||
private ITab build() {
|
||||
return TabOnModeType.forMode(mode)
|
||||
.forType(ModeType.GLOBAL, createDashboardTab())
|
||||
.forType(ModeType.GLOBAL, createDashboardGlobalTab())
|
||||
.forType(ModeType.ORDER, createDashboardTab())
|
||||
.create();
|
||||
}
|
||||
|
|
@ -129,6 +134,34 @@ public class DashboardTabCreator {
|
|||
}
|
||||
};
|
||||
}
|
||||
private ITab createDashboardGlobalTab(){
|
||||
IComponentCreator componentCreator = new IComponentCreator() {
|
||||
|
||||
@Override
|
||||
public org.zkoss.zk.ui.Component create(
|
||||
org.zkoss.zk.ui.Component parent) {
|
||||
Map<String, Object> arguments = new HashMap<String, Object>();
|
||||
arguments.put("dashboardControllerGlobal", dashboardControllerGlobal);
|
||||
return Executions.createComponents(
|
||||
"/dashboard/_dashboardforglobal.zul", parent,
|
||||
arguments);
|
||||
}
|
||||
|
||||
};
|
||||
return new CreatedOnDemandTab(_("Dashboard"), "global-dashboard",
|
||||
componentCreator) {
|
||||
|
||||
@Override
|
||||
protected void afterShowAction() {
|
||||
breadcrumbs.getChildren().clear();
|
||||
breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
|
||||
breadcrumbs.appendChild(new Label(getSchedulingLabel()));
|
||||
breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));
|
||||
breadcrumbs.appendChild(new Label(_("Dashboard")));
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private List<TaskElement> getCriticalPath(final Order order, final Desktop desktop) {
|
||||
CriticalPathBuilder builder = CriticalPathBuilder.create(
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import org.libreplan.web.common.ConfirmCloseUtil;
|
|||
import org.libreplan.web.common.entrypoints.EntryPointsHandler;
|
||||
import org.libreplan.web.common.entrypoints.URLHandlerRegistry;
|
||||
import org.libreplan.web.dashboard.DashboardController;
|
||||
import org.libreplan.web.dashboard.DashboardControllerGlobal;
|
||||
import org.libreplan.web.limitingresources.LimitingResourcesController;
|
||||
import org.libreplan.web.montecarlo.MonteCarloController;
|
||||
import org.libreplan.web.orders.OrderCRUDController;
|
||||
|
|
@ -186,6 +187,9 @@ public class MultipleTabsPlannerController implements Composer,
|
|||
@Autowired
|
||||
private DashboardController dashboardController;
|
||||
|
||||
@Autowired
|
||||
private DashboardControllerGlobal dashboardControllerGlobal;
|
||||
|
||||
private org.zkoss.zk.ui.Component breadcrumbs;
|
||||
|
||||
@Autowired
|
||||
|
|
@ -296,7 +300,7 @@ public class MultipleTabsPlannerController implements Composer,
|
|||
}, parameters);
|
||||
|
||||
dashboardTab = DashboardTabCreator.create(mode, planningStateCreator,
|
||||
dashboardController, orderPlanningController, breadcrumbs,
|
||||
dashboardController, dashboardControllerGlobal, orderPlanningController, breadcrumbs,
|
||||
resourcesSearcher);
|
||||
|
||||
final boolean isMontecarloVisible = isMonteCarloVisible();
|
||||
|
|
@ -324,7 +328,7 @@ public class MultipleTabsPlannerController implements Composer,
|
|||
resourceLoadTab, typeChanged));
|
||||
}
|
||||
tabsConfiguration.add(visibleOnlyAtOrderMode(advancedAllocationTab))
|
||||
.add(visibleOnlyAtOrderMode(dashboardTab));
|
||||
.add(tabWithNameReloading(dashboardTab, typeChanged));
|
||||
|
||||
if (isMontecarloVisible) {
|
||||
tabsConfiguration.add(visibleOnlyAtOrderMode(monteCarloTab));
|
||||
|
|
|
|||
|
|
@ -999,7 +999,7 @@ span.z-dottree-line {
|
|||
}
|
||||
|
||||
span.perspective, span.perspective-active {
|
||||
margin: 0 2px;
|
||||
margin: 4px 2px;
|
||||
}
|
||||
|
||||
.perspectives-label {
|
||||
|
|
@ -1060,10 +1060,19 @@ span.perspective, span.perspective-active {
|
|||
.perspective-active.montecarlo-simulation .z-button-cm {
|
||||
background-image: url(../img/ico_montecarlo-simulation.png);
|
||||
}
|
||||
.perspective.order-dashboard .z-button-cm,
|
||||
.perspective-active.order-dashboard .z-button-cm {
|
||||
.perspective.global-dashboard .z-button-cm{
|
||||
background-image: url(../img/ico_global-dashboard.png);
|
||||
}
|
||||
.perspective-active.global-dashboard .z-button-cm{
|
||||
background-image: url(../img/ico_global-dashboard.png);
|
||||
}
|
||||
.perspective.order-dashboard .z-button-cm{
|
||||
background-image: url(../img/ico_order-dashboard.png);
|
||||
}
|
||||
.perspective-active.order-dashboard .z-button-cm{
|
||||
background-image: url(../img/ico_order-dashboard.png);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.perspectives-column {
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -0,0 +1,66 @@
|
|||
<!--
|
||||
This file is part of LibrePlan
|
||||
|
||||
Copyright (C) 2015 LibrePlan
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?taglib uri="/WEB-INF/tld/i18n.tld" prefix="i18n"?>
|
||||
|
||||
<zk>
|
||||
<div height="100%" style="overflow:visible">
|
||||
<div height="30px" sclass="toolbar-box" />
|
||||
|
||||
<window self="@{define(content)}" vflex="1">
|
||||
<tabbox width="100%">
|
||||
<tabs>
|
||||
<tab label="${i18n:_('Pipeline')}"/>
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<tabpanel>
|
||||
<grid>
|
||||
<columns>
|
||||
<column label="${i18n:_('PRE-SALES')}"/>
|
||||
<column label="${i18n:_('OFFERED')}"/>
|
||||
<column label="${i18n:_('OUTSOURCED')}"/>
|
||||
<column label="${i18n:_('ACCEPTED')}"/>
|
||||
<column label="${i18n:_('STARTED')}"/>
|
||||
<column label="${i18n:_('ON HOLD')}"/>
|
||||
<column label="${i18n:_('FINISHED')}"/>
|
||||
<column label="${i18n:_('CANCELLED')}"/>
|
||||
<column label="${i18n:_('STORED')}"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="Project 1"/>
|
||||
<label value="Project 2"/>
|
||||
<label value="Project 3"/>
|
||||
<label value="Project 4"/>
|
||||
<label value="Project 5"/>
|
||||
<label value="Project 6"/>
|
||||
<label value="Project 7"/>
|
||||
<label value="Project 8"/>
|
||||
<label value="Project 9"/>
|
||||
</row>
|
||||
</rows>
|
||||
|
||||
</grid>
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</window>
|
||||
|
||||
</div>
|
||||
</zk>
|
||||
|
|
@ -130,5 +130,19 @@
|
|||
</tabbox>
|
||||
<button onClick="emailTemplateController.save()" autodisable="self" label="${i18n:_('Save')}" sclass="save-button global-action"/>
|
||||
<button onClick="emailTemplateController.cancel()" label="${i18n:_('Cancel')}" sclass="cancel-button global-action"/>
|
||||
|
||||
<grid style="margin:20px">
|
||||
<columns>
|
||||
<column>
|
||||
<label value="Subject"/>
|
||||
</column>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="@{emailTemplateController.order}"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
</window>
|
||||
</zk>
|
||||
Loading…
Add table
Reference in a new issue