diff --git a/NEWS b/NEWS index 6df7a028c..b4726756e 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,8 @@ - added support for limiting LDAP queries with the SOGoLDAPQueryLimit and the SOGoLDAPSizeLimit settings; - fixed a bug where folders starting with digits would not be displayed; -- improved IE7 and Safari support: priority menus, attendees selector. +- improved IE7 and Safari support: priority menus, attendees selector; +- added the ability to print messages from the mailer toolbar; 0.9.0-20070713 -------------- diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index e00c4c37a..f253e9c39 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -128,3 +128,6 @@ "Operation failed" = "Operation failed"; "quotasFormat" = "Quotas: %{0} used on %{1} Kb; %{2}%"; + +"Please select a message to print." = "Please select a message to print."; +"Please select only one message to print." = "Please select only one message to print."; diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index eb928182f..1c6046843 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -178,3 +178,6 @@ "Operation failed" = "L'opération a échoué."; "quotasFormat" = "Quotas: %{0} Ko utilisés sur %{1}; %{2}%"; + +"Please select a message to print." = "Veuillez sélectionner un message à imprimer."; +"Please select only one message to print." = "Veuillez ne sélectionner qu'un seul message à imprimer."; diff --git a/UI/MailerUI/Toolbars/SOGoMailObject.toolbar b/UI/MailerUI/Toolbars/SOGoMailObject.toolbar index a54ae3a0d..8df3661db 100644 --- a/UI/MailerUI/Toolbars/SOGoMailObject.toolbar +++ b/UI/MailerUI/Toolbars/SOGoMailObject.toolbar @@ -53,6 +53,7 @@ ), ( { link = "#"; + onclick = "return onPrintCurrentMessage(event);"; cssClass = "tbicon_print"; image = "tb-mail-print-flat-24x24.png"; label = "Print"; }, diff --git a/UI/WebServerResources/MailerUI.css b/UI/WebServerResources/MailerUI.css index 4d19b7efe..e4ecc8977 100644 --- a/UI/WebServerResources/MailerUI.css +++ b/UI/WebServerResources/MailerUI.css @@ -182,7 +182,7 @@ TABLE.titletable padding-left: 6px; } -TABLE.titletable td.titlecell SELECT +TABLE.titletable TD.titlecell SELECT { display: -moz-popup; border-top: 1px solid #fff; @@ -222,7 +222,7 @@ span.mailer_datefield white-space: nowrap; } -td.mailer_readmailsubject +TD.mailer_readmailsubject { background-image: url(message-mail-read.png) !important; background-repeat: no-repeat !important; @@ -230,7 +230,7 @@ td.mailer_readmailsubject padding-left: 20px !important; } -td.mailer_unreadmailsubject +TD.mailer_unreadmailsubject { background-image: url(message-mail.png) !important; background-repeat: no-repeat !important; @@ -239,13 +239,13 @@ td.mailer_unreadmailsubject font-weight: bold !important; } -td.mailer_readmailsubject a +TD.mailer_readmailsubject a { color: black; text-decoration: none; } -td.mailer_unreadmailsubject a +TD.mailer_unreadmailsubject a { color: black; text-decoration: none; @@ -326,7 +326,7 @@ DIV.mailer_mailcontent bottom: 0px; } -td.mailer_fieldname +TD.mailer_fieldname { white-space: nowrap; padding: 0 1em; @@ -336,16 +336,17 @@ td.mailer_fieldname width: 6em; } -td.mailer_fieldvalue +TD.mailer_fieldvalue { + vertical-align: top; } -td.mailer_subjectfieldvalue +TD.mailer_subjectfieldvalue { font-weight: bold; } -td.mailer_fieldvalue a +TD.mailer_fieldvalue a { text-decoration: underline; vertical-align: top; @@ -405,7 +406,7 @@ div#attachment_upload padding: 4px; } -td.attachment_uplabel +TD.attachment_uplabel { width: 15%; text-align: left; @@ -499,8 +500,8 @@ TABLE#messageList TD.messageFlagColumn TD#subjectHeader, TABLE#messageList TD.tbtv_subject_headercell, -TABLE#messageList td.mailer_unreadmailsubject, -TABLE#messageList td.mailer_readmailsubject +TABLE#messageList TD.mailer_unreadmailsubject, +TABLE#messageList TD.mailer_readmailsubject { width: 40%; min-width: 40%; } @@ -545,3 +546,49 @@ DIV#rightDragHandle right: 0px; height: 5px; } + +@media print +{ + DIV#leftPanel, + DIV#verticalDragHandle, + DIV#filterPanel, + DIV#mailboxContent, + DIV.dragHandle + { display: none; } + + DIV#rightPanel + { position: static; + overflow: visible; + margin: 0px; } + + DIV#messageContent + { position: static; + border: 0px; + margin: 0px; + overflow: visible; } + + TABLE.mailer_fieldtable + { border: 0px; + font-family: serif; + height: auto; + overflow: visible; } + + TD.mailer_fieldname + { text-align: left; + width: auto; } + + TD.mailer_fieldvalue + { white-space: normal; } + + TD.mailer_fieldvalue A + { text-decoration: none; + white-space: nowrap; + color: #000; } + + A:visited + { color: #00f; } + + DIV.mailer_mailcontent + { position: static; + overflow: visible; } +} diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index dba1bfe48..c390268af 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -320,6 +320,20 @@ function onMenuDeleteMessage(event) { preventDefault(event); } +function onPrintCurrentMessage(event) { + var rowIds = $("messageList").getSelectedRowsId(); + if (rowIds.length == 0) { + window.alert(labels["Please select a message to print."].decodeEntities()); + } + else if (rowIds.length > 1) { + window.alert(labels["Please select only one message to print."].decodeEntities()); + } + else + window.print(); + + preventDefault(event); +} + function onMailboxTreeItemClick(event) { var topNode = $("mailboxTree"); var mailbox = this.parentNode.getAttribute("dataname"); diff --git a/UI/WebServerResources/UIxMailPopupView.js b/UI/WebServerResources/UIxMailPopupView.js new file mode 100644 index 000000000..14f04fecf --- /dev/null +++ b/UI/WebServerResources/UIxMailPopupView.js @@ -0,0 +1,5 @@ +function onPrintCurrentMessage(event) { + window.print(); + + preventDefault(event); +} diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index e1a0f2d36..908ef54d4 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -690,3 +690,19 @@ INPUT.checkBox -moz-border-left-colors: #000 #fff; -moz-border-bottom-colors: #000 #fff; -moz-border-right-colors: #000 #fff; } + +@media print +{ + BODY + { position: static; + font-size: 25%; + height: auto; + overflow: visible; } + + DIV#logConsole, + DIV#linkBanner, + DIV#toolbar, + DIV.menu, + DIV.tabsContainer + { display: none; } +}