mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
* Api - When printing lists ask for print orientation and size columns to fit
This commit is contained in:
parent
be7e9c123f
commit
9253e5230a
@ -2140,6 +2140,31 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_
|
||||
return;
|
||||
}
|
||||
|
||||
// Set CSS for orientation
|
||||
this.div.addClass(value.orientation);
|
||||
this.egw().set_preference(app,pref+'_orientation',value.orientation);
|
||||
|
||||
|
||||
// Try to tell browser about orientation
|
||||
var css = '@page { size: '+ value.orientation + '; }',
|
||||
head = document.head || document.getElementsByTagName('head')[0],
|
||||
style = document.createElement('style');
|
||||
|
||||
style.type = 'text/css';
|
||||
style.media = 'print';
|
||||
|
||||
if (style.styleSheet){
|
||||
style.styleSheet.cssText = css;
|
||||
} else {
|
||||
style.appendChild(document.createTextNode(css));
|
||||
}
|
||||
|
||||
head.appendChild(style);
|
||||
this.orientation_style = style;
|
||||
|
||||
// Trigger resize, so we can fit on a page
|
||||
this.dynheight.outerNode.css('max-width',this.div.css('max-width'));
|
||||
|
||||
// Handle columns
|
||||
this.set_columns(value.columns);
|
||||
this.egw().set_preference(app,pref,value.columns);
|
||||
@ -2257,7 +2282,8 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_
|
||||
value: {
|
||||
content: {
|
||||
row_count: Math.min(100,total),
|
||||
columns: this.egw().preference(pref,app) || columns_selected
|
||||
columns: this.egw().preference(pref,app) || columns_selected,
|
||||
orientation: this.egw().preference(pref+'_orientation',app)
|
||||
},
|
||||
sel_options: {
|
||||
columns: columns
|
||||
@ -2274,7 +2300,9 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_
|
||||
*/
|
||||
afterPrint: function() {
|
||||
|
||||
this.div.removeClass('print');
|
||||
this.div.removeClass('print landscape portrait');
|
||||
jQuery(this.orientation_style).remove();
|
||||
delete this.orientation_style;
|
||||
|
||||
// Put scrollbar back
|
||||
jQuery('.egwGridView_scrollarea',this.div).css('overflow-y','');
|
||||
|
@ -262,7 +262,7 @@ class Etemplate extends Etemplate\Widget\Template
|
||||
echo $GLOBALS['egw']->framework->header();
|
||||
if ($output_mode != 2 && !$GLOBALS['egw_info']['flags']['nonavbar'])
|
||||
{
|
||||
parse_navbar();
|
||||
$GLOBALS['egw']->framework->navbar();
|
||||
}
|
||||
else // mark popups as such, by enclosing everything in div#popupMainDiv
|
||||
{
|
||||
|
@ -556,9 +556,13 @@ for printing
|
||||
.et2_nextmatch.print > div {
|
||||
height: auto !important;
|
||||
}
|
||||
.et2_nextmatch.print {
|
||||
.et2_nextmatch.print.landscape {
|
||||
/* This is fairly arbitrary, but makes it fit in Chrome and Firefox*/
|
||||
max-width: 700pt !important;
|
||||
max-width: 710pt !important;
|
||||
}
|
||||
.et2_nextmatch.print.portrait {
|
||||
/* This is fairly arbitrary, but makes it fit in Chrome and Firefox*/
|
||||
max-width: 570pt !important;
|
||||
}
|
||||
/**
|
||||
* Diff widget
|
||||
|
@ -7,6 +7,7 @@
|
||||
<description value="Columns to print"/>
|
||||
<select id="columns" rows="8" selected_first="false"/>
|
||||
<integer id="row_count" label="How many rows to print"/>
|
||||
<checkbox id="orientation" toggle_on="Portrait" toggle_off="Landscape" selected_value="portrait" unselected_value="landscape"/>
|
||||
</vbox>
|
||||
</template>
|
||||
</overlay>
|
Loading…
Reference in New Issue
Block a user