diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php
index 05b8ef7125..d6238f6e62 100644
--- a/mail/inc/class.mail_compose.inc.php
+++ b/mail/inc/class.mail_compose.inc.php
@@ -357,7 +357,6 @@ class mail_compose
if (!$remove) $_content['attachments'][] = $att;
}
}
-$CAtFStart = array2string($_content);
// someone clicked something like send, or saveAsDraft
$buttonClicked = false;
if ($_content['button']['send'])
@@ -389,7 +388,7 @@ $CAtFStart = array2string($_content);
egw_framework::refresh_opener(lang('Message send failed: %1',$message),'mail');
}
}
- if ($_content['button']['saveAsDraft'])
+ if ($_content['button']['saveAsDraft']||$_content['button']['saveAsDraftAndPrint'])
{
$buttonClicked = $suppressSigOnTop = true;
$savedOK = true;
@@ -405,20 +404,6 @@ $CAtFStart = array2string($_content);
egw_framework::message(lang('Message saved successfully.'),'mail');
}
}
- // form was submitted either by clicking a button or by changing one of the triggering selectboxes
- // identity and signatureID; this might trigger that the signature in mail body may have to be altered
- if (
- (!empty($composeCache['identity']) && !empty($_content['identity']) && $_content['identity'] != $composeCache['identity']) ||
- (!empty($composeCache['signatureID']) && !empty($_content['signatureID']) && $_content['signatureID'] != $composeCache['signatureID'])
- )
- {
- $buttonClicked = true;
- }
- // all values are empty for a new compose window
- if ($buttonClicked = true)
- {
- $suppressSigOnTop = true;
- }
$insertSigOnTop = false;
$content = (is_array($_content)?$_content:array());
// user might have switched desired mimetype, so we should convert
@@ -455,6 +440,21 @@ $CAtFStart = array2string($_content);
$content['is_plain'] = false;
}
$content['body'] = ($content['body'] ? $content['body'] : $content['mail_'.($content['mimeType'] == 'html'?'html':'plain').'text']);
+ // form was submitted either by clicking a button or by changing one of the triggering selectboxes
+ // identity and signatureID; this might trigger that the signature in mail body may have to be altered
+ if ( !empty($content['body']) &&
+ (!empty($composeCache['identity']) && !empty($_content['identity']) && $_content['identity'] != $composeCache['identity']) ||
+ (!empty($composeCache['signatureID']) && !empty($_content['signatureID']) && $_content['signatureID'] != $composeCache['signatureID'])
+ )
+ {
+ $buttonClicked = true;
+ }
+ // all values are empty for a new compose window
+ if ($buttonClicked = true)
+ {
+ $suppressSigOnTop = true;
+ }
+
$alwaysAttachVCardAtCompose = false; // we use this to eliminate double attachments, if users VCard is already present/attached
if ( isset($GLOBALS['egw_info']['apps']['stylite']) && (isset($this->preferencesArray['attachVCardAtCompose']) &&
$this->preferencesArray['attachVCardAtCompose']))
@@ -766,13 +766,6 @@ $CAtFStart = array2string($_content);
/*
- if ($GLOBALS['egw_info']['user']['apps']['addressbook']) {
- $this->t->set_var("link_addressbook",egw::link('/index.php',array(
- 'menuaction' => 'addressbook.addressbook_ui.emailpopup',
- )));
- } else {
- $this->t->set_var("link_addressbook",'');
- }
$this->t->set_var("focusElement",$_focusElement);
$linkData = array
@@ -786,26 +779,6 @@ $CAtFStart = array2string($_content);
'menuaction' => 'felamimail.uicompose.fileSelector',
'composeid' => $this->composeID
);
- $this->t->set_var('file_selector_url',egw::link('/index.php',$linkData));
-
- $this->t->set_var('vfs_selector_url',egw::link('/index.php',array(
- 'menuaction' => 'filemanager.filemanager_select.select',
- 'mode' => 'open-multiple',
- 'method' => 'felamimail.uicompose.vfsSelector',
- 'id' => $this->composeID,
- 'label' => lang('Attach'),
- )));
- if ($GLOBALS['egw_info']['user']['apps']['filemanager'])
- {
- $this->t->set_var('vfs_attach_button','
- ');
- }
- else
- {
- $this->t->set_var('vfs_attach_button','');
- }
$linkData = array
(
'menuaction' => 'felamimail.uicompose.action',
@@ -1127,6 +1100,26 @@ if (is_array($content['attachments']))error_log(__METHOD__.__LINE__.'before merg
$preserv['attachments'] = $content['attachments'];
if (is_array($content['attachments']))error_log(__METHOD__.__LINE__.' Attachments:'.array2string($content['attachments']));
+ // if no filemanager -> no vfsFileSelector
+ if (!$GLOBALS['egw_info']['user']['apps']['filemanager'])
+ {
+ $content['vfsNotAvailable'] = "mail-index_quotaDisplayNone";
+ }
+ // if no infolog -> no save as infolog
+ if (!$GLOBALS['egw_info']['user']['apps']['infolog'])
+ {
+ $content['noInfologAvailable'] = "mail-index_quotaDisplayNone";
+ }
+ // if no tracker -> no save as tracker
+ if (!$GLOBALS['egw_info']['user']['apps']['tracker'])
+ {
+ $content['noTrackerAvailable'] = "mail-index_quotaDisplayNone";
+ }
+ if (!$GLOBALS['egw_info']['user']['apps']['infolog'] && !$GLOBALS['egw_info']['user']['apps']['tracker'])
+ {
+ $content['noSaveAsAvailable'] = "mail-index_quotaDisplayNone";
+ }
+ // composeID to detect if we have changes to certain content
$preserv['composeID'] = $content['composeID'] = $this->composeID;
//error_log(__METHOD__.__LINE__.' ComposeID:'.$preserv['composeID']);
$preserv['is_html'] = $content['is_html'];
diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php
index e3cbf078e9..0c18443aee 100644
--- a/mail/inc/class.mail_ui.inc.php
+++ b/mail/inc/class.mail_ui.inc.php
@@ -1349,12 +1349,6 @@ unset($query['actions']);
}
//error_log(__METHOD__.array2string($css_styles));
- //if (in_array("check", $cols))
- // don't overwrite check with "false" as this forces the grid to
- // deselect the row - sending "0" doesn't do that
- //if (in_array("check", $cols)) $data["check"] = $previewMessage == $header['uid'] ? true : 0;// $row_selected; //TODO:checkbox true or false
- //$data["check"] ='';
if (in_array("subject", $cols))
{
@@ -1374,7 +1368,6 @@ unset($query['actions']);
// make the subject shorter if it is to long
$fullSubject = $header['subject'];
$subject = $header['subject'];
- #$this->t->set_var('attachments', $header['attachment']);
} else {
$subject = @htmlspecialchars('('. lang('no subject') .')', ENT_QUOTES, $this->charset);
}
@@ -1462,12 +1455,6 @@ unset($query['actions']);
} else {
$senderAddress = $header['to_address'];
}
- $linkData = array
- (
- 'menuaction' => 'mail.mail_compose.compose',
- 'send_to' => base64_encode($senderAddress)
- );
- $windowName = 'compose_'.$header['uid'];
// sent or drafts or template folder means foldertype > 0, use to address instead of from
$header2add = $header['to_address'];//mail_bo::htmlentities($header['to_address'],$this->charset);
@@ -1482,7 +1469,6 @@ unset($query['actions']);
$sender_name = $header['to_address'];
$full_address = $header['to_address'];
}
- //$data["toaddress"] = "link('/index.php',$linkData)."', '".$windowName."', this); return false;\" title=\"".@htmlspecialchars($full_address, ENT_QUOTES | ENT_IGNORE, $this->charset,false)."\">".@htmlspecialchars($sender_name, ENT_QUOTES | ENT_IGNORE, $this->charset,false)."";
$data["toaddress"] = $full_address;
}
@@ -1509,16 +1495,6 @@ unset($query['actions']);
} else {
$senderAddress = $header['sender_address'];
}
- /*
- $linkData = array
- (
- 'menuaction' => 'mail.mail_compose.compose',
- 'send_to' => base64_encode($senderAddress)
- );
- $windowName = 'compose_'.$header['uid'];
-
- $data["fromaddress"] = "link('/index.php',$linkData)."', '".$windowName."', this); return false;\" title=\"".@htmlspecialchars($full_address, ENT_QUOTES | ENT_IGNORE, $this->charset,false)."\">".@htmlspecialchars($sender_name, ENT_QUOTES | ENT_IGNORE, $this->charset,false)."";
- */
$data["fromaddress"] = $full_address;
}
if (in_array("date", $cols))
@@ -1533,16 +1509,6 @@ unset($query['actions']);
if (in_array("size", $cols))
$data["size"] = $header['size']; /// size
-
- /*
- //TODO: url_add_to_addressbook isn't in any of the templates.
- //If you want to use it, you need to adopt syntax to the new addressbook (popup)
- $this->t->set_var('url_add_to_addressbook',$GLOBALS['egw']->link('/index.php',$linkData));
- */
- //$this->t->set_var('msg_icon_sm',$msg_icon_sm);
-
- //$this->t->set_var('phpgw_images',EGW_IMAGES);
- //$result["data"] = $data;
$data["class"] = implode(' ', $css_styles);
$data['attachmentsPresent'] = $imageTag;
$data['attachmentsBlock'] = $imageHTMLBlock;
diff --git a/mail/js/app.js b/mail/js/app.js
index f2f72f5cc9..8cddeac8b0 100644
--- a/mail/js/app.js
+++ b/mail/js/app.js
@@ -1437,6 +1437,11 @@ app.mail = AppJS.extend(
this.et2_obj.submit();
},
+ saveAsDraftAndPrint: function(_egw, _widget, _window)
+ {
+ this.et2_obj.submit();
+ },
+
sieve_editRules_radiobtn: function()
{
console.log("hi i am radiobtn");
diff --git a/mail/templates/default/app.css b/mail/templates/default/app.css
index 9837117da0..ad90ee0c6f 100644
--- a/mail/templates/default/app.css
+++ b/mail/templates/default/app.css
@@ -342,6 +342,7 @@ input[type=button] {
#mail-index_button\[mailcreate\] {
width: 99%;
text-align: left;
+ font-weight: bold;
padding-left: 25px;
background-image: url(images/write_mail.png) !important;
background-position: left;
@@ -350,7 +351,10 @@ input[type=button] {
#mail-compose_button\[send\] {
text-align: left;
- padding-left: 25px;
+ font-weight: bold;
+ padding-left: 30px;
+ width: 80px;
+ margin: 0px !important;
background-image: url(images/mail_send.png) !important;
background-position: left;
background-repeat: no-repeat;
@@ -361,6 +365,25 @@ input[type=button] {
position: relative;
margin-top: 3px;
}
+#mail-compose_fileselector {
+ width: 245px !important;
+}
+#mail-compose_toolbar {
+ padding: 0px !important;
+}
+#mail-compose_toolbar > button {
+ padding: .2em .4em;
+}
+#mail-compose_toolbar > img {
+ width: 16px;
+ padding: 0px;
+ height: 16px !important;
+}
+#mail-compose_toolbar > button > span > img {
+ width: 16px;
+ padding: 0px;
+ height: 16px !important;
+}
#mail-display_toolbar {
padding: 0px;
}
diff --git a/mail/templates/default/compose.xet b/mail/templates/default/compose.xet
index 9d9aa387c7..3057516bf6 100644
--- a/mail/templates/default/compose.xet
+++ b/mail/templates/default/compose.xet
@@ -11,15 +11,21 @@
-
-
-
-
-
-
-
-
-
+