adds an option for adding the reported hours to the printout.
FEA : ItEr64S04AdvancesVisualization
This commit is contained in:
parent
35b833383a
commit
128979defb
6 changed files with 43 additions and 2 deletions
|
|
@ -235,6 +235,9 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
}
|
||||
result = container;
|
||||
}
|
||||
result
|
||||
.setShowingReportedHours(planner
|
||||
.areShownReportedHoursByDefault());
|
||||
result.setShowingAdvances(planner.areShownAdvancesByDefault());
|
||||
mapper.register(topInsertionPosition, result, data, parent);
|
||||
return result;
|
||||
|
|
@ -479,6 +482,8 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
Checkbox resources = (Checkbox) parent.getFellow("print_resources");
|
||||
Checkbox labels = (Checkbox) parent.getFellow("print_labels");
|
||||
Checkbox advances = (Checkbox) parent.getFellow("print_advances");
|
||||
Checkbox reportedHours = (Checkbox) parent
|
||||
.getFellow("print_reported_hours");
|
||||
|
||||
if (layout.getSelectedIndex() == 2) {
|
||||
parameters.put("extension", ".png");
|
||||
|
|
@ -492,6 +497,9 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
if (advances.isChecked() == true) {
|
||||
parameters.put("advances", "all");
|
||||
}
|
||||
if (reportedHours.isChecked() == true) {
|
||||
parameters.put("reportedHours", "all");
|
||||
}
|
||||
if (resources.isChecked() == true) {
|
||||
parameters.put("resources", "all");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,6 +114,15 @@ public class Planner extends HtmlMacroComponent {
|
|||
return toLowercaseSet(values).contains("all");
|
||||
}
|
||||
|
||||
public static boolean guessShowReportedHoursByDefault(
|
||||
Map<String, String[]> queryURLParameters) {
|
||||
String[] values = queryURLParameters.get("reportedHours");
|
||||
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) {
|
||||
|
|
@ -525,6 +534,8 @@ public class Planner extends HtmlMacroComponent {
|
|||
|
||||
private boolean shownAdvanceByDefault = false;
|
||||
|
||||
private boolean shownReportedHoursByDefault = false;
|
||||
|
||||
private FilterAndParentExpandedPredicates predicate;
|
||||
|
||||
private boolean visibleChart;
|
||||
|
|
@ -656,6 +667,15 @@ public class Planner extends HtmlMacroComponent {
|
|||
this.shownAdvanceByDefault = shownAdvanceByDefault;
|
||||
}
|
||||
|
||||
public void setAreShownReportedHoursByDefault(
|
||||
boolean shownReportedHoursByDefault) {
|
||||
this.shownReportedHoursByDefault = shownReportedHoursByDefault;
|
||||
}
|
||||
|
||||
public boolean areShownReportedHoursByDefault() {
|
||||
return shownReportedHoursByDefault;
|
||||
}
|
||||
|
||||
public void expandAll() {
|
||||
Button expandAllButton = (Button) getFellow("expandAll");
|
||||
if (disabilityConfiguration.isExpandAllEnabled()) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ 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;
|
||||
|
|
@ -119,6 +120,8 @@ public class CompanyPlanningController implements Composer {
|
|||
planner.setAreShownAdvancesByDefault(Planner
|
||||
.guessShowAdvancesByDefault(parameters));
|
||||
|
||||
planner.setAreShownReportedHoursByDefault(Planner
|
||||
.guessShowReportedHoursByDefault(parameters));
|
||||
|
||||
orderFilter = (Vbox) planner.getFellow("orderFilter");
|
||||
// Configuration of the order filter
|
||||
|
|
|
|||
|
|
@ -172,6 +172,9 @@ public class OrderPlanningController implements Composer {
|
|||
planner.setAreShownAdvancesByDefault(Planner
|
||||
.guessShowAdvancesByDefault(parameters));
|
||||
|
||||
planner.setAreShownReportedHoursByDefault(Planner
|
||||
.guessShowReportedHoursByDefault(parameters));
|
||||
|
||||
orderElementFilter = (Vbox) planner.getFellow("orderElementFilter");
|
||||
// Configuration of the order filter
|
||||
org.zkoss.zk.ui.Component filterComponent = Executions
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@ public class CutyPrint {
|
|||
plannerWidth,
|
||||
planner, parameters
|
||||
.get("advances"),
|
||||
parameters.get("reportedHours"),
|
||||
parameters.get("labels"),
|
||||
parameters.get("resources"),
|
||||
expanded,
|
||||
|
|
@ -300,7 +301,8 @@ public class CutyPrint {
|
|||
}
|
||||
|
||||
private static String createCSSFile(String srFile, int width,
|
||||
Planner planner, String advances, String labels, String resources,
|
||||
Planner planner, String advances, String reportedHours,
|
||||
String labels, String resources,
|
||||
boolean expanded,
|
||||
int minimumWidthForTaskNameColumn) {
|
||||
File generatedCSS = null;
|
||||
|
|
@ -323,9 +325,12 @@ public class CutyPrint {
|
|||
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 ((reportedHours != null) && (reportedHours.equals("all"))) {
|
||||
includeCSSLines += " .completion { display: inline !important;} \n";
|
||||
}
|
||||
|
||||
|
||||
if ((resources != null) && (resources.equals("all"))) {
|
||||
includeCSSLines += " .task-resources { display: inline !important;} \n";
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@
|
|||
label="${i18n:_('Shrink to fit page width')}" checked="true" disabled="true" visible="false"/>
|
||||
<checkbox id="print_advances"
|
||||
label="${i18n:_('Show all advances')}" checked="true"/>
|
||||
<checkbox id="print_reported_hours"
|
||||
label="${i18n:_('Show all reported hours')}" checked="true"/>
|
||||
</vbox>
|
||||
</panelchildren>
|
||||
</panel>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue