From 38b65820809a5c982b5611b67fcc67ef60365fc0 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Wed, 9 Sep 2015 14:48:14 +0000 Subject: [PATCH] Finishing touch to the "Printer friendly version" of the details page. SVN:trunk[3743] --- application/cmdbabstract.class.inc.php | 6 ------ application/itopwebpage.class.inc.php | 4 +++- application/utils.inc.php | 2 ++ core/displayablegraph.class.inc.php | 13 +++++++++++-- css/light-grey.css | 5 +++++ css/light-grey.scss | 3 +++ css/print.css | 7 +++++-- dictionaries/de.dictionary.itop.ui.php | 2 ++ dictionaries/dictionary.itop.ui.php | 4 ++-- dictionaries/es_cr.dictionary.itop.ui.php | 1 + dictionaries/fr.dictionary.itop.ui.php | 6 +++--- 11 files changed, 37 insertions(+), 16 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 18f20d668..53740d2c6 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -183,12 +183,6 @@ EOF { $aIcons[] = ''; } - if (!$oPage->IsPrintableVersion()) - { - $sPrintableUrl = ApplicationContext::MakeObjectUrl(get_class($this), $this->GetKey()).'&printable=1'; - //$sPrintModeIcon = ''; - $aIcons[] = ''; - } // Master data sources $bSynchronized = false; diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index 739cba9b5..42983427e 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -776,9 +776,11 @@ EOF if ($this->IsPrintableVersion()) { $sHtml .= "
"; - $sHtml .= '

'.Dict::S('UI:ExplainPrintable').'

'; + $sHtml .= '

'.Dict::Format('UI:ExplainPrintable', '').'

'; $sHtml .= "
"; $sHtml .= ''; + $sHtml .= ' '; + $sHtml .= ''; $sHtml .= "
"; } diff --git a/application/utils.inc.php b/application/utils.inc.php index 4d7aa7038..d21819450 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -832,6 +832,8 @@ class utils new URLPopupMenuItem('UI:Menu:EMail', Dict::S('UI:Menu:EMail'), "mailto:?subject=".urlencode($oObj->GetRawName())."&body=".urlencode($sUrl).' '), // Add an extra space to make it work in Outlook new JSPopupMenuItem('UI:Menu:CSVExport', Dict::S('UI:Menu:CSVExport'), "ExportListDlg('$sOQL', '', 'csv', ".json_encode(Dict::S('UI:Menu:CSVExport')).")"), new JSPopupMenuItem('UI:Menu:ExportXLSX', Dict::S('ExcelExporter:ExportMenu'), "ExportListDlg('$sOQL', '', 'xlsx', ".json_encode(Dict::S('ExcelExporter:ExportMenu')).")"), + new SeparatorPopupMenuItem(), + new URLPopupMenuItem('UI:Menu:PrintableVersion', Dict::S('UI:Menu:PrintableVersion'), $sUrl.'&printable=1', '_blank'), ); break; diff --git a/core/displayablegraph.class.inc.php b/core/displayablegraph.class.inc.php index a83a17c2a..df8b0eaa9 100644 --- a/core/displayablegraph.class.inc.php +++ b/core/displayablegraph.class.inc.php @@ -1297,9 +1297,17 @@ class DisplayableGraph extends SimpleGraph } $oP->add("
\n"); $oP->add("
\n"); - $oP->add_ready_script( + if (!$oP->IsPrintableVersion()) + { + $oP->add_ready_script( <<add_ready_script( +<<IsPrintableVersion()) { // Optimize for printing on A4/Letter vertically - $sStyle = 'max-width: 17cm; margin-left:auto; margin-right:auto;'; + $sStyle = 'margin-left:auto; margin-right:auto;'; + $oP->add_ready_script("$('.simple-graph').width(18/2.54*96).resizable({ stop: function() { $(window).trigger('resized'); }});"); // Default width about 18 cm, since most browsers assume 96 dpi } $oP->add('
'); $aParams = array( diff --git a/css/light-grey.css b/css/light-grey.css index ee5bd12a1..3931031d2 100644 --- a/css/light-grey.css +++ b/css/light-grey.css @@ -2054,6 +2054,11 @@ div.explain-printable { } +h2.printable-tab-title { + border-bottom: 2px solid; +} + + .strikethrough { text-decoration: line-through; } diff --git a/css/light-grey.scss b/css/light-grey.scss index 66dbabfcc..eb35e2441 100644 --- a/css/light-grey.scss +++ b/css/light-grey.scss @@ -1516,6 +1516,9 @@ div.explain-printable { .printable-version fieldset.strikethrough span { display: none; } +h2.printable-tab-title { + border-bottom: 2px solid; +} .strikethrough { text-decoration: line-through; } diff --git a/css/print.css b/css/print.css index 0af33aae6..25ba6860e 100644 --- a/css/print.css +++ b/css/print.css @@ -14,7 +14,6 @@ div.itop-tab { border: #ccc 1px solid; margin-top: 1em; padding-bottom:1em; } #combodo_logo { display:none; } div.graph_config { display:none; } h2.printable-tab-title { - border-bottom: 2px solid; page-break-after: avoid; } div#tabbedContent_0 { border:none; } @@ -22,4 +21,8 @@ p a, .ui-widget-content td a, p a:hover, .ui-widget-content td a:hover { padding-left: 0; background: transparent; } -body { margin:none; } \ No newline at end of file +body { margin:none; } +.printable-tab { + -webkit-region-break-inside: avoid; + page-break-inside: avoid; +} \ No newline at end of file diff --git a/dictionaries/de.dictionary.itop.ui.php b/dictionaries/de.dictionary.itop.ui.php index 235c1f92c..cfcf96d64 100644 --- a/dictionaries/de.dictionary.itop.ui.php +++ b/dictionaries/de.dictionary.itop.ui.php @@ -781,6 +781,7 @@ Wenn Aktionen mit Trigger verknüpft sind, bekommt jede Aktion eine Auftragsnumm 'UI:RelationOption:GroupingThreshold' => 'Grouping threshold~~', 'UI:Relation:AdditionalContextInfo' => 'Additional context info~~', 'UI:Relation:NoneSelected' => 'Nichts~~', + 'UI:Relation:Zoom' => 'Zoom', 'UI:Relation:ExportAsDocument' => 'Export as Document...~~', 'UI:Relation:DrillDown' => 'Details...~~', 'UI:Relation:PDFExportOptions' => 'PDF Export Options~~', @@ -1023,6 +1024,7 @@ Wenn Aktionen mit Trigger verknüpft sind, bekommt jede Aktion eine Auftragsnumm 'UI:Menu:KillConcurrentLock' => 'Sperre für simultane Änderungen löschen! ', 'UI:Menu:ExportPDF' => 'Als PDF exportieren... ', + 'UI:Menu:PrintableVersion' => 'Druckversion', 'Class:UserInternal' => 'Interner Benutzer', 'Class:UserInternal+' => 'Benutzer, der innerhalb iTop definiert wird', 'UI:Button:Rename' => 'Umbenennen... ', diff --git a/dictionaries/dictionary.itop.ui.php b/dictionaries/dictionary.itop.ui.php index 3c13f62bb..2ec2691a5 100644 --- a/dictionaries/dictionary.itop.ui.php +++ b/dictionaries/dictionary.itop.ui.php @@ -1080,9 +1080,8 @@ When associated with a trigger, each action is given an "order" number, specifyi 'UI:OrderByHint_Values' => 'Sort order: %1$s', 'UI:Menu:AddToDashboard' => 'Add To Dashboard...', 'UI:Button:Refresh' => 'Refresh', - 'UI:Button:PrintableVersion' => 'Printable version', 'UI:Button:GoPrint' => 'Print...', - 'UI:ExplainPrintable' => 'Click onto the chapters or items that you want to exclude from the print. This header and other tuning controls will not be printed. It is highly recommended to use the "print preview" feature provided by your browser, before proceeding.', + 'UI:ExplainPrintable' => 'Click onto the %1$s icon to hide items from the print.
Use the "print preview" feature of your browser to preview before printing.
Note: this header and the other tuning controls will not be printed.', 'UI:ConfigureThisList' => 'Configure This List...', 'UI:ListConfigurationTitle' => 'List Configuration', @@ -1293,5 +1292,6 @@ When associated with a trigger, each action is given an "order" number, specifyi 'UI:Menu:KillConcurrentLock' => 'Kill the Concurrent Modification Lock !', 'UI:Menu:ExportPDF' => 'Export as PDF...', + 'UI:Menu:PrintableVersion' => 'Printer friendly version', )); ?> diff --git a/dictionaries/es_cr.dictionary.itop.ui.php b/dictionaries/es_cr.dictionary.itop.ui.php index 9484c1cd9..446c1d05f 100644 --- a/dictionaries/es_cr.dictionary.itop.ui.php +++ b/dictionaries/es_cr.dictionary.itop.ui.php @@ -1426,5 +1426,6 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array( 'UI:ConcurrentLockKilled' => 'The lock preventing modifications on the current object has been deleted.~~', 'UI:Menu:KillConcurrentLock' => 'Kill the Concurrent Modification Lock !~~', 'UI:Menu:ExportPDF' => 'Export as PDF...~~', + 'UI:Menu:PrintableVersion' => 'Versión imprimible', )); ?> \ No newline at end of file diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index 0d7f12ae3..d5a2be922 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -924,10 +924,9 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé 'UI:OrderByHint_Values' => 'Ordre de tri: %1$s', 'UI:Menu:AddToDashboard' => 'Ajouter au Tableau de Bord...', 'UI:Button:Refresh' => 'Rafraîchir', - 'UI:Button:PrintableVersion' => 'Version imprimable', 'UI:Button:GoPrint' => 'Imprimer...', - 'UI:ExplainPrintable' => 'Cliquez sur les chapitres ou les éléments que vous voulez exclure de l\'impression. Cet en-tête, ainsi que les éléments de contrôle qui pourraient apparaitre dans cette page, ne seront pas imprimés. Il est recommandé d\'utiliser la fonction "Aperçu avant impression" de votre navigateur pour voir le rendu exact avant de lancer l\'impression.', - + 'UI:ExplainPrintable' => 'Cliquez sur les icones %1$s pour cacher des éléments lors de l\'impression.
Utilisez la fonction "Aperçu avant impression" de votre navigateur pour prévisualiser avant d\'imprimer.
Note: cet en-tête ainsi que les icones %1$s ne seront pas imprimés.', + 'UI:ConfigureThisList' => 'Configurer Cette Liste...', 'UI:ListConfigurationTitle' => 'Configuration de la liste', 'UI:ColumnsAndSortOrder' => 'Colonnes et ordre de tri:', @@ -1135,4 +1134,5 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé 'UI:Menu:KillConcurrentLock' => 'Supprimer le verrouillage !', 'UI:Menu:ExportPDF' => 'Exporter en PDF...', + 'UI:Menu:PrintableVersion' => 'Version imprimable', )); \ No newline at end of file