ItEr43S10SoporteImpresionMultiplesPaxinasItEr42S15: Enabled real parameters for labels and resources

This commit is contained in:
Lorenzo Tilve 2010-01-18 00:20:39 +01:00 committed by Javier Moran Rua
parent 7f35b06128
commit df0a01da00
4 changed files with 64 additions and 304 deletions

View file

@ -388,12 +388,20 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
Radiogroup layout = (Radiogroup) parent.getFellow("print_layout");
Checkbox expanded = (Checkbox) parent.getFellow("print_expanded");
Checkbox resources = (Checkbox) parent.getFellow("print_resources");
Checkbox labels = (Checkbox) parent.getFellow("print_labels");
if (layout.getSelectedIndex() == 2) {
parameters.put("extension", ".png");
}
if (expanded.isChecked() == true) {
parameters.put("expanded", "all");
}
if (labels.isChecked() == true) {
parameters.put("labels", "all");
}
if (resources.isChecked() == true) {
parameters.put("resources", "all");
}
parameters.put("zoom", planner.getZoomLevel().toString());
return parameters;
}

View file

@ -146,7 +146,8 @@ public class CutyPrint {
captureString += " --delay=1000 ";
String generatedCSSFile = createCSSFile(absolutePath
+ "/planner/css/printlabels.css", plannerWidth);
+ "/planner/css/print.css", plannerWidth, parameters
.get("labels"), parameters.get("resources"));
// Relative user styles
captureString += "--user-styles=" + generatedCSSFile;
@ -155,7 +156,6 @@ public class CutyPrint {
captureString += " --out=" + absolutePath + filename;
try {
// CutyCapt command execution
LOG.debug(captureString);
@ -193,7 +193,8 @@ public class CutyPrint {
}
}
private static String createCSSFile(String srFile, int width) {
private static String createCSSFile(String srFile, int width,
String labels, String resources) {
File generatedCSS = null;
try {
generatedCSS = File.createTempFile("print", ".css");
@ -209,8 +210,14 @@ public class CutyPrint {
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
String body = "body { width: " + width + "px; } \n";
out.write(body.getBytes());
String includeCSSLines = "body { width: " + width + "px; } \n";
if ((labels != null) && (labels.equals("all"))) {
includeCSSLines = ".task-labels { display: inline !important;} ";
}
if ((resources != null) && (resources.equals("all"))) {
includeCSSLines = ".task-resources { display: inline !important;} ";
}
out.write(includeCSSLines.getBytes());
in.close();
out.close();
LOG.debug(_("Generated CSS:") + generatedCSS.getAbsolutePath());

View file

@ -1,72 +1,58 @@
/****
Base stylesheet used for printing, to which
height, with and label parameters had to be added
as CutyCapt does not allow to use @import directive
*******/
/* Print CSS used for CutyCapt capture requests */
body .mainmenu, body .user-area, body .help-link {
display: none !important;
}
body .perspectives-column {
display: none;
}
body .main-area {
margin-left: -90px;
margin-top: -28px;
}
.toolbar-box {
display: none;
height: 0px !important;
}
body .z-border-layout {
background-color: #FFFFFF;
}
.plannerlayout .leftpanelcontainer,
.plannerlayout .rightpanellayout .z-center-body {
overflow: hidden !important;
}
body {
width: 2600px;
}
/* ----- Height dependent styles ----- */
/* ------ Hide non printable elements ------ */
body div.scheduling-graphics {
height: 0px !important;
display: none;
display: none !important;
}
/* Dynamically set heights */
body div.main-layout {
height: 1800px !important;
body .perspectives-column {
display: none !important;
}
body div.plannerlayout {
height: 1790px !important;
body .mainmenu, body .user-area, body .help-link {
display: none !important;
}
body div#timetracker {
height: 1730px !important;
body .footer {
display: none !important;
}
body div#scroll_container {
height: 1710px !important;
/* ------ Remove scrolls ------ */
.leftpanelcontainer {
overflow: hidden !important;
}
/* Hide possible Javascript execution exceptions */
.rightpanellayout .z-center-body {
overflow: hidden !important;
}
#ganttpanel_scroller_x, #ganttpanel_scroller_y {
overflow: hidden !important;
}
.main-area, .orderslayout-area, .orderelements-tab, #timetrackedtable,
.plannerlayout .taskspanelgap #timetracker, .leftpanelcontainer {
overflow: hidden !important;
}
/* ------ Reposition main-area ------ */
body .main-area {
margin-left: 0;
margin-top: -32px;
}
/* ------ Hide possible Javascript execution exceptions ------ */
#zk_err_1 {
display: none;
}
/* Hide more stuff */
a.ruta, .toolbar-box {
display: none;
}
/* Hack for hiding breadcrumbs part in printed diagrams */
a.ruta,
.ruta tr td,
.ruta tr td+td,
.ruta tr td+td+td {
@ -74,171 +60,26 @@ a.ruta, .toolbar-box {
}
.ruta tr td+td+td+td+td+td {
font-size: 18px;
font-size: 20px;
display: inline !important;
}
/* ------ Dynamically set heights ------ */
@media screen {
body .mainmenu, body .user-area, body .help-link {
display: none !important;
}
body .perspectives-column {
display: none;
}
body .main-area {
margin-left: -90px;
margin-top: -28px;
}
.toolbar-box {
display: none;
height: 0px !important;
}
body .z-border-layout {
background-color: #FFFFFF;
}
.plannerlayout .leftpanelcontainer,
.plannerlayout .rightpanellayout .z-center-body {
overflow: hidden !important;
}
body {
width: 2600px;
}
/* ----- Height dependent styles ----- */
body div.scheduling-graphics {
height: 0px !important;
display: none;
}
/* Dynamically set heights */
body div.main-layout {
height: 1800px !important;
height: 1200px !important;
}
body div.plannerlayout {
height: 1790px !important;
height: 1190px !important;
}
body div#timetracker {
height: 1730px !important;
height: 1130px !important;
}
body div#scroll_container {
height: 1710px !important;
height: 1110px !important;
}
/* Hide possible Javascript execution exceptions */
#zk_err_1 {
display: none;
}
/* Hide more stuff */
a.ruta, .toolbar-box {
display: none;
}
/* Hack for hiding breadcrumbs part in printed diagrams */
.ruta tr td,
.ruta tr td+td,
.ruta tr td+td+td {
display:none;
}
.ruta tr td+td+td+td+td+td {
font-size: 18px;
display: inline !important;
}
}
@media print {
body .mainmenu, body .user-area, body .help-link {
display: none !important;
}
body .perspectives-column {
display: none;
}
body .main-area {
margin-left: -90px;
margin-top: -28px;
}
.toolbar-box {
display: none;
height: 0px !important;
}
body .z-border-layout {
background-color: #FFFFFF;
}
.plannerlayout .leftpanelcontainer,
.plannerlayout .rightpanellayout .z-center-body {
overflow: hidden !important;
}
body {
width: 2600px;
}
/* ----- Height dependent styles ----- */
body div.scheduling-graphics {
height: 0px !important;
display: none;
}
/* Dynamically set heights */
body div.main-layout {
height: 1800px !important;
}
body div.plannerlayout {
height: 1790px !important;
}
body div#timetracker {
height: 1730px !important;
}
body div#scroll_container {
height: 1710px !important;
}
/* Hide possible Javascript execution exceptions */
#zk_err_1 {
display: none;
}
/* Hide more stuff */
a.ruta, .toolbar-box {
display: none;
}
/* Hack for hiding breadcrumbs part in printed diagrams */
.ruta tr td,
.ruta tr td+td,
.ruta tr td+td+td {
display:none;
}
.ruta tr td+td+td+td+td+td {
font-size: 18px;
display: inline !important;
}
}
/* ------ Calculated body width added via CutyPrint CSS generator ------ */

View file

@ -1,96 +0,0 @@
/* optional */
.task-labels {
display: inline !important;
}
.task-resources {
display: inline !important;
}
/****
Redundant, but @import or passing several
CSS files does not work with CutyCapt
--- print.css ----
*******/
/* ------ Hide non printable elements ------ */
body div.scheduling-graphics {
height: 0px !important;
display: none !important;
}
body .perspectives-column {
display: none !important;
}
body .mainmenu, body .user-area, body .help-link {
display: none !important;
}
body .footer {
display: none !important;
}
/* ------ Remove scrolls ------ */
.leftpanelcontainer {
overflow: hidden !important;
}
.rightpanellayout .z-center-body {
overflow: hidden !important;
}
#ganttpanel_scroller_x, #ganttpanel_scroller_y {
overflow: hidden !important;
}
.main-area, .orderslayout-area, .orderelements-tab, #timetrackedtable,
.plannerlayout .taskspanelgap #timetracker, .leftpanelcontainer {
overflow: hidden !important;
}
/* ------ Reposition main-area ------ */
body .main-area {
margin-left: 0;
margin-top: -32px;
}
/* ------ Hide possible Javascript execution exceptions ------ */
#zk_err_1 {
display: none;
}
/* Hack for hiding breadcrumbs part in printed diagrams */
a.ruta,
.ruta tr td,
.ruta tr td+td,
.ruta tr td+td+td {
display:none;
}
.ruta tr td+td+td+td+td+td {
font-size: 20px;
display: inline !important;
}
/* ------ Dynamically set heights ------ */
body {
width: 5000px;
}
body div.main-layout {
height: 1100px !important;
}
body div.plannerlayout {
height: 1090px !important;
}
body div#timetracker {
height: 1030px !important;
}
body div#scroll_container {
height: 1010px !important;
}