Disable Money Cost Bar in company view to avoid performance issues
FEA: ItEr76S17MoneyCostMonitoringSystem
This commit is contained in:
parent
9f0be7c949
commit
120534e6ff
4 changed files with 15 additions and 28 deletions
|
|
@ -383,6 +383,11 @@ public class Planner extends HtmlMacroComponent {
|
|||
Button showAllResources = (Button) getFellow("showAllResources");
|
||||
showAllResources.setVisible(false);
|
||||
}
|
||||
if (!configuration.isMoneyCostBarEnabled()) {
|
||||
Button showMoneyCostBarButton = (Button) getFellow("showMoneyCostBar");
|
||||
showMoneyCostBarButton.setVisible(false);
|
||||
}
|
||||
|
||||
listZoomLevels.setSelectedIndex(getZoomLevel().ordinal());
|
||||
|
||||
this.visibleChart = configuration.isExpandPlanningViewCharts();
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ import org.libreplan.business.orders.entities.Order;
|
|||
import org.libreplan.business.orders.entities.OrderElement;
|
||||
import org.libreplan.business.orders.entities.OrderLineGroup;
|
||||
import org.libreplan.business.planner.entities.IMoneyCostCalculator;
|
||||
import org.libreplan.business.planner.entities.MoneyCostCalculator;
|
||||
import org.libreplan.business.qualityforms.daos.IQualityFormDAO;
|
||||
import org.libreplan.business.qualityforms.entities.QualityForm;
|
||||
import org.libreplan.business.requirements.entities.DirectCriterionRequirement;
|
||||
|
|
@ -685,10 +684,6 @@ public class OrderModel extends IntegrationEntityModel implements IOrderModel {
|
|||
result.append(_("Progress") + ": ").append(getEstimatedAdvance(order)).append("% , ");
|
||||
result.append(_("Hours invested") + ": ")
|
||||
.append(getHoursAdvancePercentage(order)).append("%\n");
|
||||
result.append(
|
||||
_("Budget: {0}€, Consumed: {1}€ ({2}%)", getBudget(order),
|
||||
getMoneyCost(order), getMoneyCostBarPercentage(order)
|
||||
.multiply(new BigDecimal(100)))).append("\n");
|
||||
|
||||
if (!getDescription(order).equals("")) {
|
||||
result.append(" , " + _("Description") + ": "
|
||||
|
|
@ -724,19 +719,6 @@ public class OrderModel extends IntegrationEntityModel implements IOrderModel {
|
|||
return result.multiply(new BigDecimal(100));
|
||||
}
|
||||
|
||||
private BigDecimal getMoneyCostBarPercentage(Order order) {
|
||||
return MoneyCostCalculator.getMoneyCostProportion(getMoneyCost(order),
|
||||
getBudget(order));
|
||||
}
|
||||
|
||||
private BigDecimal getBudget(Order order) {
|
||||
return order.getBudget();
|
||||
}
|
||||
|
||||
private BigDecimal getMoneyCost(Order order) {
|
||||
return moneyCostCalculator.getMoneyCost(order);
|
||||
}
|
||||
|
||||
private String buildLabelsText(Order order) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
Set<Label> labels = order.getLabels();
|
||||
|
|
|
|||
|
|
@ -1010,16 +1010,18 @@ public class TaskElementAdapter {
|
|||
.append(getHoursAdvancePercentage().multiply(
|
||||
new BigDecimal(100))).append("% <br/>");
|
||||
|
||||
result.append(
|
||||
_("Budget: {0}€, Consumed: {1}€ ({2}%)",
|
||||
getBudget(),
|
||||
getMoneyCost(),
|
||||
getMoneyCostBarPercentage().multiply(
|
||||
new BigDecimal(100)))).append("<br/>");
|
||||
|
||||
if (taskElement.getOrderElement() instanceof Order) {
|
||||
result.append(_("State") + ": ").append(getOrderState());
|
||||
} else {
|
||||
result.append(
|
||||
_("Budget: {0}€, Consumed: {1}€ ({2}%)",
|
||||
getBudget(),
|
||||
getMoneyCost(),
|
||||
getMoneyCostBarPercentage().multiply(
|
||||
new BigDecimal(100)))).append(
|
||||
"<br/>");
|
||||
}
|
||||
|
||||
String labels = buildLabelsText();
|
||||
if (!labels.equals("")) {
|
||||
result.append("<div class='tooltip-labels'>" + _("Labels")
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
package org.libreplan.web.planner.company;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.libreplan.web.I18nHelper._;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -96,13 +95,11 @@ import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
|||
import org.zkoss.ganttz.util.Emitter;
|
||||
import org.zkoss.ganttz.util.Emitter.IEmissionListener;
|
||||
import org.zkoss.ganttz.util.Interval;
|
||||
import org.zkoss.zk.au.out.AuInsertAfter;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.WrongValueException;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
import org.zkoss.zk.ui.util.Clients;
|
||||
import org.zkoss.zul.Checkbox;
|
||||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Div;
|
||||
|
|
@ -569,6 +566,7 @@ public class CompanyPlanningModel implements ICompanyPlanningModel {
|
|||
configuration.setRenamingTasksEnabled(false);
|
||||
configuration.setTreeEditable(false);
|
||||
configuration.setShowAllResourcesEnabled(false);
|
||||
configuration.setMoneyCostBarEnabled(false);
|
||||
}
|
||||
|
||||
private void addAdditionalCommands(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue