Improve printing options for invoices reducing global styles

This commit is contained in:
Manuel Cillero 2017-09-03 18:15:21 +02:00
parent 42355f66e6
commit 8809632f15
19 changed files with 19 additions and 72 deletions

View file

@ -1,39 +0,0 @@
/* CSS Attributes used when viewing SuiteDesk nodes */
dt.print_html {
background: transparent url(images/html.png) no-repeat top left;
}
dt.print_pdf {
background: transparent url(images/pdf.png) no-repeat top left;
}
div.stormfields, div.field, div.stormbody {
width: 70%;
}
div.stormfields div.label, div.stormbody div.label, div.field div.field-label-inline-first {
float: left;
width: 150px;
text-align: right;
clear: left;
font-weight: bold;
}
div.stormlinks {
float:right;
width: 30%;
}
div.stormbody div.value p {
clear: left;
margin: 1.2em;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
}
table#attachments {
float: left;
}

View file

@ -30,8 +30,6 @@ function theme_stormdok_list($header, $doks) {
}
function theme_stormdok_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$l_pos = 1; // Used to increase the link position number (see issue 814820)

View file

@ -47,8 +47,6 @@ function theme_stormevent_list($header, $events) {
}
function theme_stormevent_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$l_pos = 1; // Used to increase the link position number (see issue 814820)

View file

@ -70,8 +70,6 @@ function theme_stormexpense_list($header, $expenses, $totals) {
}
function theme_stormexpense_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$l_pos = 1; // Used to increase the link position number (see issue 814820)

View file

@ -22,8 +22,6 @@ function theme_stormidea_list($header, $ideas) {
}
function theme_stormidea_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$l_pos = 1; // Used to increase the link position number (see issue 814820)

View file

@ -175,8 +175,8 @@ function theme_storminvoice_list($header, $invoices, $itemsperpage, $totals_topa
* The node object that contains the invoice.
*/
function theme_storminvoice_view($node, $teaser = FALSE, $page = FALSE) {
// Add generic SuiteDesk node CSS
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
global $language;
// Adds CSS for SuiteDesk Invoice node view
drupal_add_css(drupal_get_path('module', 'storminvoice') . '/storminvoice-nodeview.css');
@ -191,13 +191,13 @@ function theme_storminvoice_view($node, $teaser = FALSE, $page = FALSE) {
// Bodge fix to keep html and pdf invoices working. Without language, menu items default to /storm
if (!$node->language) {
$node->language = 'en';
$node->language = $language->language;
}
$node->content['links']['print']['html'] = array(
'#prefix' => '<dt class="stormcomponent print_html">',
'#suffix' => '</dt>',
'#value' => l(t('Print HTML'), 'invoice/report/'. $node->nid .'/html/'. $node->language),
'#value' => l(t('Print HTML'), 'invoice/report/'. $node->nid .'/html/'. $node->language, array('attributes' => array('onclick' => 'window.open(this.href); return false', 'rel' => 'nofollow'))),
'#weight' => $l_pos++,
);
@ -207,7 +207,7 @@ function theme_storminvoice_view($node, $teaser = FALSE, $page = FALSE) {
$node->content['links']['print']['pdf'] = array(
'#prefix' => '<dt class="stormcomponent print_pdf">',
'#suffix' => '</dt>',
'#value' => l(t('Print PDF'), 'invoice/report/'. $node->nid .'/pdf/'. $node->language),
'#value' => l(t('Print PDF'), 'invoice/report/'. $node->nid .'/pdf/'. $node->language, array('attributes' => array('onclick' => 'window.open(this.href); return false', 'rel' => 'nofollow'))),
'#weight' => $l_pos++,
);
$node->content['links']['print']['email'] = array(
@ -415,6 +415,7 @@ function theme_storminvoice_view($node, $teaser = FALSE, $page = FALSE) {
$organization = node_load($node->organization_nid);
$myorg = node_load(variable_get('storm_organization_nid', 0));
/*
if (isset($myorg->orglanguage)) {
if ($myorg->orglanguage != $organization->orglanguage) {
$language = $organization->orglanguage .','. $myorg->orglanguage;
@ -423,7 +424,7 @@ function theme_storminvoice_view($node, $teaser = FALSE, $page = FALSE) {
$language = $myorg->orglanguage;
}
}
*/
if (isset($myorg->currency)) {
$currencies = storm_attributes_bydomain('Currency');
$node->content['group5']['currency'] = array(
@ -481,7 +482,7 @@ function theme_storminvoice_report_pdf($node, $language, $output = 'screen') {
drupal_goto('node/'. $node->nid);
}
require_once($tcpdf_dir .'/config/lang/eng.php');
# require_once($tcpdf_dir .'/config/lang/eng.php');
require_once($tcpdf_dir .'/tcpdf.php');
$languages = explode(',', $language);
$language = $languages[0];

View file

@ -28,8 +28,6 @@ function theme_stormnote_list($header, $notes) {
}
function theme_stormnote_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$l_pos = 1; // Used to increase the link position number (see issue 814820)

View file

@ -24,8 +24,6 @@ function theme_stormorganization_list($header, $organizations) {
}
function theme_stormorganization_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$l_pos = 1; // Used to increase the link position number (see issue 814820)

View file

@ -22,8 +22,6 @@ function theme_stormperson_list($header, $people) {
}
function theme_stormperson_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$node->content['links'] = array(

View file

@ -30,8 +30,6 @@ function theme_stormproject_list($header, $projects) {
}
function theme_stormproject_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$l_pos = 1; // Used to increase the link position number (see issue 814820)

View file

@ -91,8 +91,6 @@ function theme_stormtask_list($header, $tasks) {
}
function theme_stormtask_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$l_pos = 1; // Used to increase the link position number (see issue 814820)

View file

@ -10,8 +10,6 @@
* Theme function for the SuiteDesk Team node view
*/
function theme_stormteam_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$type = node_get_types('type', $node);

View file

@ -32,8 +32,6 @@ function theme_stormticket_list($header, $tickets) {
}
function theme_stormticket_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$node->content['links'] = array(

View file

@ -27,8 +27,6 @@ function theme_stormtimetracking_list($header, $timetrackings, $billing_duration
}
function theme_stormtimetracking_view($node, $teaser = FALSE, $page = FALSE) {
drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module');
$node = node_prepare($node, $teaser);
$l_pos = 1; // Used to increase the link position number (see issue 814820)

View file

@ -1588,6 +1588,16 @@ table.formgroup_access .description {
margin-top: .75em;
}
/*
* "SuiteDesk Invoice" node.
*/
dt.print_html {
background: transparent url(../images/html.png) no-repeat top left;
}
dt.print_pdf {
background: transparent url(../images/pdf.png) no-repeat top left;
}
/*
* "SuiteDesk Organization" node form.
*/

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

@ -1,6 +1,6 @@
name = SuiteDesk Theme
description = SuiteDesk Theme Zen.
version = 0.2.53
version = 0.2.54
screenshot = screenshot.png
@ -49,7 +49,6 @@ stylesheets[all][] = modules/system/defaults.css
stylesheets[all][] = modules/system/system.css
stylesheets[all][] = modules/system/system-menus.css
stylesheets[all][] = modules/user/user.css
stylesheets[all][] = modules/storm/storm-node.css
stylesheets[all][] = modules/print/css/printlinks.css