adds an option for adding the advances to the printout.
FEA : ItEr64S04AdvancesVisualization
This commit is contained in:
parent
79ac562d4a
commit
413fb4cede
6 changed files with 50 additions and 7 deletions
|
|
@ -235,6 +235,7 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
}
|
||||
result = container;
|
||||
}
|
||||
result.setShowingAdvances(planner.areShownAdvancesByDefault());
|
||||
mapper.register(topInsertionPosition, result, data, parent);
|
||||
return result;
|
||||
}
|
||||
|
|
@ -463,6 +464,8 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
Checkbox expanded = (Checkbox) parent.getFellow("print_expanded");
|
||||
Checkbox resources = (Checkbox) parent.getFellow("print_resources");
|
||||
Checkbox labels = (Checkbox) parent.getFellow("print_labels");
|
||||
Checkbox advances = (Checkbox) parent.getFellow("print_advances");
|
||||
|
||||
if (layout.getSelectedIndex() == 2) {
|
||||
parameters.put("extension", ".png");
|
||||
}
|
||||
|
|
@ -472,6 +475,9 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
if (labels.isChecked() == true) {
|
||||
parameters.put("labels", "all");
|
||||
}
|
||||
if (advances.isChecked() == true) {
|
||||
parameters.put("advances", "all");
|
||||
}
|
||||
if (resources.isChecked() == true) {
|
||||
parameters.put("resources", "all");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,18 +29,18 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.zkoss.ganttz.adapters.IDisabilityConfiguration;
|
||||
import org.zkoss.ganttz.adapters.IDomainAndBeansMapper;
|
||||
import org.zkoss.ganttz.adapters.PlannerConfiguration;
|
||||
import org.zkoss.ganttz.data.Dependency;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph.GanttZKDiagramGraph;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph.IGraphChangeListener;
|
||||
import org.zkoss.ganttz.data.Position;
|
||||
import org.zkoss.ganttz.data.Task;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph.GanttZKDiagramGraph;
|
||||
import org.zkoss.ganttz.data.GanttDiagramGraph.IGraphChangeListener;
|
||||
import org.zkoss.ganttz.extensions.ICommand;
|
||||
import org.zkoss.ganttz.extensions.ICommandOnTask;
|
||||
import org.zkoss.ganttz.extensions.IContext;
|
||||
|
|
@ -50,9 +50,9 @@ import org.zkoss.ganttz.timetracker.TimeTrackerComponentWithoutColumns;
|
|||
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
||||
import org.zkoss.ganttz.util.ComponentsFinder;
|
||||
import org.zkoss.ganttz.util.LongOperationFeedback;
|
||||
import org.zkoss.ganttz.util.LongOperationFeedback.ILongOperation;
|
||||
import org.zkoss.ganttz.util.OnZKDesktopRegistry;
|
||||
import org.zkoss.ganttz.util.WeakReferencedListeners;
|
||||
import org.zkoss.ganttz.util.LongOperationFeedback.ILongOperation;
|
||||
import org.zkoss.ganttz.util.WeakReferencedListeners.IListenerNotification;
|
||||
import org.zkoss.ganttz.util.script.IScriptsRegister;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
|
|
@ -105,6 +105,15 @@ public class Planner extends HtmlMacroComponent {
|
|||
return toLowercaseSet(values).contains("all");
|
||||
}
|
||||
|
||||
public static boolean guessShowAdvancesByDefault(
|
||||
Map<String, String[]> queryURLParameters) {
|
||||
String[] values = queryURLParameters.get("advances");
|
||||
if (values == null) {
|
||||
return false;
|
||||
}
|
||||
return toLowercaseSet(values).contains("all");
|
||||
}
|
||||
|
||||
private static Set<String> toLowercaseSet(String[] values) {
|
||||
Set<String> result = new HashSet<String>();
|
||||
for (String each : values) {
|
||||
|
|
@ -504,6 +513,8 @@ public class Planner extends HtmlMacroComponent {
|
|||
|
||||
private boolean containersExpandedByDefault = false;
|
||||
|
||||
private boolean shownAdvanceByDefault = false;
|
||||
|
||||
private FilterAndParentExpandedPredicates predicate;
|
||||
|
||||
private boolean visibleChart;
|
||||
|
|
@ -605,6 +616,14 @@ public class Planner extends HtmlMacroComponent {
|
|||
this.containersExpandedByDefault = containersExpandedByDefault;
|
||||
}
|
||||
|
||||
public boolean areShownAdvancesByDefault() {
|
||||
return shownAdvanceByDefault;
|
||||
}
|
||||
|
||||
public void setAreShownAdvancesByDefault(boolean shownAdvanceByDefault) {
|
||||
this.shownAdvanceByDefault = shownAdvanceByDefault;
|
||||
}
|
||||
|
||||
public void expandAll() {
|
||||
Button expandAllButton = (Button) getFellow("expandAll");
|
||||
if (disabilityConfiguration.isExpandAllEnabled()) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.navalplanner.business.common.entities.ProgressType;
|
||||
import org.navalplanner.business.planner.entities.TaskElement;
|
||||
import org.navalplanner.web.common.components.bandboxsearch.BandboxMultipleSearch;
|
||||
import org.navalplanner.web.common.components.finders.FilterPair;
|
||||
|
|
@ -117,6 +116,10 @@ public class CompanyPlanningController implements Composer {
|
|||
|
||||
initializeListboxProgressTypes();
|
||||
|
||||
planner.setAreShownAdvancesByDefault(Planner
|
||||
.guessShowAdvancesByDefault(parameters));
|
||||
|
||||
|
||||
orderFilter = (Vbox) planner.getFellow("orderFilter");
|
||||
// Configuration of the order filter
|
||||
Component filterComponent = Executions.createComponents(
|
||||
|
|
|
|||
|
|
@ -169,6 +169,9 @@ public class OrderPlanningController implements Composer {
|
|||
planner.setAreContainersExpandedByDefault(Planner
|
||||
.guessContainersExpandedByDefault(parameters));
|
||||
|
||||
planner.setAreShownAdvancesByDefault(Planner
|
||||
.guessShowAdvancesByDefault(parameters));
|
||||
|
||||
orderElementFilter = (Vbox) planner.getFellow("orderElementFilter");
|
||||
// Configuration of the order filter
|
||||
org.zkoss.zk.ui.Component filterComponent = Executions
|
||||
|
|
|
|||
|
|
@ -60,10 +60,12 @@ public class CutyPrint {
|
|||
|
||||
private static final String CUTYCAPT_COMMAND = "/usr/bin/CutyCapt ";
|
||||
// Estimated maximum execution time (ms)
|
||||
|
||||
private static final int CUTYCAPT_TIMEOUT = 100000;
|
||||
|
||||
private static final int CAPTURE_DELAY = 10000;
|
||||
|
||||
|
||||
// Taskdetails left padding
|
||||
private static int TASKDETAILS_BASE_WIDTH = 310;
|
||||
|
||||
|
|
@ -183,12 +185,14 @@ public class CutyPrint {
|
|||
captureString += " --min-width=" + plannerWidth;
|
||||
|
||||
// Static width and time delay parameters (FIX)
|
||||
|
||||
captureString += " --delay=" + CAPTURE_DELAY;
|
||||
|
||||
String generatedCSSFile = createCSSFile(
|
||||
absolutePath + "/planner/css/print.css",
|
||||
plannerWidth,
|
||||
planner,
|
||||
planner, parameters
|
||||
.get("advances"),
|
||||
parameters.get("labels"),
|
||||
parameters.get("resources"),
|
||||
expanded,
|
||||
|
|
@ -296,7 +300,8 @@ public class CutyPrint {
|
|||
}
|
||||
|
||||
private static String createCSSFile(String srFile, int width,
|
||||
Planner planner, String labels, String resources, boolean expanded,
|
||||
Planner planner, String advances, String labels, String resources,
|
||||
boolean expanded,
|
||||
int minimumWidthForTaskNameColumn) {
|
||||
File generatedCSS = null;
|
||||
try {
|
||||
|
|
@ -317,6 +322,11 @@ public class CutyPrint {
|
|||
if ((labels != null) && (labels.equals("all"))) {
|
||||
includeCSSLines += " .task-labels { display: inline !important;} \n";
|
||||
}
|
||||
if ((advances != null) && (advances.equals("all"))) {
|
||||
includeCSSLines += " .completion { display: inline !important;} \n";
|
||||
includeCSSLines += " .completion2 { display: inline !important;} \n";
|
||||
}
|
||||
|
||||
if ((resources != null) && (resources.equals("all"))) {
|
||||
includeCSSLines += " .task-resources { display: inline !important;} \n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@
|
|||
label="${i18n:_('Expand all taskgroups')}" checked="true" />
|
||||
<checkbox id="print_shrinked"
|
||||
label="${i18n:_('Shrink to fit page width')}" checked="true" disabled="true" visible="false"/>
|
||||
<checkbox id="print_advances"
|
||||
label="${i18n:_('Show all advances')}" checked="true"/>
|
||||
</vbox>
|
||||
</panelchildren>
|
||||
</panel>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue