From d3ff14468508db5d2e612434a56f66beebab7fef Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 20 Nov 2014 15:05:25 +0000 Subject: [PATCH] first step for a combined account and identity/signature selector --- mail/inc/class.mail_hooks.inc.php | 2 +- mail/js/app.js | 46 ++++-- mail/templates/default/compose.xet | 251 ++++++++++++++--------------- mail/templates/pixelegg/app.css | 83 ++-------- mail/templates/pixelegg/app.less | 25 +-- 5 files changed, 174 insertions(+), 233 deletions(-) diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index 873461b337..6b85b52366 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -533,7 +533,7 @@ class mail_hooks $profileID = $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = $mail_bo->profileID; } catch (Exception $e) { //error_log(__METHOD__."()" . $e->getMessage()); - $profileID = emailadmin_bo::getUserDefaultAccID(); + $profileID = emailadmin_account::get_default_acc_id(); } $preferences =& $mail_bo->mailPreferences; diff --git a/mail/js/app.js b/mail/js/app.js index 11da73c774..227e6b6a08 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -65,7 +65,7 @@ app.classes.mail = AppJS.extend( */ init: function() { this._super.apply(this,arguments); - if (!this.egw.is_popup()) + if (!this.egw.is_popup()) // Turn on client side, persistent cache // egw.data system runs encapsulated below etemplate, so this must be // done before the nextmatch is created. @@ -166,7 +166,7 @@ app.classes.mail = AppJS.extend( case 'mail.display': this.mail_isMainWindow = false; this.mail_display(); - + // Register attachments for drag this.register_for_drag( this.et2.getArrayMgr("content").getEntry('mail_id'), @@ -749,9 +749,9 @@ app.classes.mail = AppJS.extend( var _id = this.mail_fetchCurrentlyFocussed(selected); dataElem = jQuery.extend(dataElem, egw.dataGetUIDdata(_id)); } - + var $preview_iframe = jQuery('#mail-index_mailPreviewContainer'); - + // Re calculate the position of preview iframe according to its visible sibilings var set_prev_iframe_top = function () { @@ -765,12 +765,12 @@ app.classes.mail = AppJS.extend( lastEl = lastEl.prev(); } var offset = iframeTop - (lastEl.offset().top + lastEl.height()) || 130; // fallback to 130 px if can not calculate new top - + // preview iframe parent has position absolute, therefore need to calculate the top via position $preview_iframe.css ('top', $preview_iframe.position().top - offset + 10); }, 50); - } - + }; + if (attachmentArea && typeof _id != 'undefined' && _id !='' && typeof dataElem !== 'undefined') { // If there is content to show recalculate the size @@ -1484,7 +1484,7 @@ app.classes.mail = AppJS.extend( // Tell server egw.json('mail.mail_ui.ajax_deleteMessages',[_msg,(typeof _action == 'undefined'?'no':_action)]) .sendRequest(true); - + if (_msg['all']) this.egw.refresh(this.egw.lang("deleted %1 messages in %2",(_msg['all']?egw.lang('all'):_msg['msg'].length),(displayname?displayname:egw.lang('current folder'))),'mail');//,ids,'delete'); this.egw.message(this.egw.lang("deleted %1 messages in %2",(_msg['all']?egw.lang('all'):_msg['msg'].length),(displayname?displayname:egw.lang('current Folder')))); }, @@ -3632,6 +3632,10 @@ app.classes.mail = AppJS.extend( folder:{ widget:{}, jQClass: '.mailComposeJQueryFolder' + }, + replyto:{ + widget:{}, + jQClass: '.mailComposeJQueryReplyto' }}; for(var widget in widgets) @@ -3672,7 +3676,7 @@ app.classes.mail = AppJS.extend( // Tolerate values base on plain text or html, in order to calculate freespaces var textAreaDelta = textArea.id == "mail_htmltext"?20:40; var delta = content.attachments? 68: textAreaDelta; - + var freeSpace = (bodyH - Math.round(toolbar.height() + toolbar.offset().top) - delta); if (textArea.id != "mail_htmltext") @@ -3699,7 +3703,7 @@ app.classes.mail = AppJS.extend( */ compose_fieldExpander: function(event,widget) { - var expWidgets = {cc:{},bcc:{},folder:{}}; + var expWidgets = {cc:{},bcc:{},folder:{},replyto:{}}; for (var name in expWidgets) { expWidgets[name] = this.et2.getWidgetById(name+'_expander'); @@ -3729,11 +3733,19 @@ app.classes.mail = AppJS.extend( { expWidgets.folder.set_disabled(true); } + break; + case 'replyto_expander': + jQuery(".mailComposeJQueryReplyto").show(); + if (typeof expWidgets.replyto !='undefined') + { + expWidgets.replyto.set_disabled(true); + } + break; } } else if (typeof widget == "undefined") { - var widgets = {cc:{},bcc:{},folder:{}}; + var widgets = {cc:{},bcc:{},folder:{},replyto:{}}; for(var widget in widgets) { @@ -3763,6 +3775,14 @@ app.classes.mail = AppJS.extend( { expWidgets.folder.set_disabled(true); } + break; + case 'replyto': + jQuery(".mailComposeJQueryReplyto").show(); + if (typeof expWidgets.replyto != 'undefiend') + { + expWidgets.replyto.set_disabled(true); + } + break; } } } @@ -3986,11 +4006,11 @@ app.classes.mail = AppJS.extend( } }).draggable('disable'); window.setTimeout(function(){ - + if(dragItem && dragItem.data() && typeof dragItem.data()['uiDraggable'] !== 'undefined') dragItem.draggable('enable'); },100); } - + }, /** diff --git a/mail/templates/default/compose.xet b/mail/templates/default/compose.xet index 195df3a8f2..298c29add1 100644 --- a/mail/templates/default/compose.xet +++ b/mail/templates/default/compose.xet @@ -2,141 +2,134 @@ diff --git a/mail/templates/pixelegg/app.css b/mail/templates/pixelegg/app.css index a7a3b1d063..06dce5310f 100755 --- a/mail/templates/pixelegg/app.css +++ b/mail/templates/pixelegg/app.css @@ -1308,7 +1308,6 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubje /*Von*/ /*An*/ /*Kopie*/ - /*Blindkopie*/ /*Betreff*/ /*HTML Box*/ } @@ -1348,7 +1347,13 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubje height: 30px; } #mail-compose .mailComposeHeaders span#mail-compose_cc_expander, -#mail-compose .mailComposeHeadersSection span#mail-compose_cc_expander { +#mail-compose .mailComposeHeadersSection span#mail-compose_cc_expander, +#mail-compose .mailComposeHeaders span#mail-compose_bcc_expander, +#mail-compose .mailComposeHeadersSection span#mail-compose_bcc_expander, +#mail-compose .mailComposeHeaders span#mail-compose_folder_expander, +#mail-compose .mailComposeHeadersSection span#mail-compose_folder_expander, +#mail-compose .mailComposeHeaders span#mail-compose_replyto_expander, +#mail-compose .mailComposeHeadersSection span#mail-compose_replyto_expander { /*.border_normal;*/ /*.box_shadow_standard_light;*/ /*.rounded (3px);*/ @@ -1368,81 +1373,19 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubje transition-timing-function: linear; background-color: #b4b4b4; float: left; - width: 47px; + width: 55px; margin: 3px; font-size: 8px; margin-left: 12px; } #mail-compose .mailComposeHeaders span#mail-compose_cc_expander:hover, -#mail-compose .mailComposeHeadersSection span#mail-compose_cc_expander:hover { - -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - background-color: #189800; - color: #ffffff; -} -#mail-compose .mailComposeHeaders span#mail-compose_bcc_expander, -#mail-compose .mailComposeHeadersSection span#mail-compose_bcc_expander { - /*.border_normal;*/ - /*.box_shadow_standard_light;*/ - /*.rounded (3px);*/ - color: #000000; - -webkit-appearance: none; - -webkit-transition-property: background-color; - -moz-transition-property: background-color; - -o-transition-property: background-color; - transition-property: background-color; - -webkit-transition-duration: 0.5s; - -moz-transition-duration: 0.5s; - -o-transition-duration: 0.5s; - transition-duration: 0.5s; - -webkit-transition-timing-function: linear; - -moz-transition-timing-function: linear; - -o-transition-timing-function: linear; - transition-timing-function: linear; - background-color: #b4b4b4; - float: left; - width: 47px; - margin: 3px; - font-size: 8px; - margin-left: 12px; -} +#mail-compose .mailComposeHeadersSection span#mail-compose_cc_expander:hover, #mail-compose .mailComposeHeaders span#mail-compose_bcc_expander:hover, -#mail-compose .mailComposeHeadersSection span#mail-compose_bcc_expander:hover { - -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - background-color: #189800; - color: #ffffff; -} -#mail-compose .mailComposeHeaders span#mail-compose_folder_expander, -#mail-compose .mailComposeHeadersSection span#mail-compose_folder_expander { - /*.border_normal;*/ - /*.box_shadow_standard_light;*/ - /*.rounded (3px);*/ - color: #000000; - -webkit-appearance: none; - -webkit-transition-property: background-color; - -moz-transition-property: background-color; - -o-transition-property: background-color; - transition-property: background-color; - -webkit-transition-duration: 0.5s; - -moz-transition-duration: 0.5s; - -o-transition-duration: 0.5s; - transition-duration: 0.5s; - -webkit-transition-timing-function: linear; - -moz-transition-timing-function: linear; - -o-transition-timing-function: linear; - transition-timing-function: linear; - background-color: #b4b4b4; - float: left; - width: 47px; - margin: 3px; - font-size: 8px; - margin-left: 12px; -} +#mail-compose .mailComposeHeadersSection span#mail-compose_bcc_expander:hover, #mail-compose .mailComposeHeaders span#mail-compose_folder_expander:hover, -#mail-compose .mailComposeHeadersSection span#mail-compose_folder_expander:hover { +#mail-compose .mailComposeHeadersSection span#mail-compose_folder_expander:hover, +#mail-compose .mailComposeHeaders span#mail-compose_replyto_expander:hover, +#mail-compose .mailComposeHeadersSection span#mail-compose_replyto_expander:hover { -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); diff --git a/mail/templates/pixelegg/app.less b/mail/templates/pixelegg/app.less index e3337135b2..9dc81ac8fd 100755 --- a/mail/templates/pixelegg/app.less +++ b/mail/templates/pixelegg/app.less @@ -589,29 +589,14 @@ div#mail-index{ /*An*/ /*Kopie*/ - span#mail-compose_cc_expander{ - .Complete_Button_normal; - float: left; - width: 47px; - margin: 3px; - font-size: 8px; - margin-left: 12px; - &:hover {.box_shadow_standard_light_hover; background-color:@color_positive_action; color: @gray_0;} - } + span#mail-compose_cc_expander, /*Blindkopie*/ - span#mail-compose_bcc_expander{ - .Complete_Button_normal; - float: left; - width: 47px; - margin: 3px; - font-size: 8px; - margin-left: 12px; - &:hover {.box_shadow_standard_light_hover; background-color:@color_positive_action;color: @gray_0;} - } - span#mail-compose_folder_expander{ + span#mail-compose_bcc_expander, + span#mail-compose_folder_expander, + span#mail-compose_replyto_expander{ .Complete_Button_normal; float: left; - width: 47px; + width: 55px; margin: 3px; font-size: 8px; margin-left: 12px;