mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
styling on compose toolbar; add print button on compose window; some codecleanup; some control regarding the compose actions on vfs-file-selector, infolog and tracker creation
This commit is contained in:
parent
78855fa7b7
commit
cd5d52d811
@ -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','
|
||||
<button class="menuButton" type="button" onclick="fm_compose_displayVfsSelector();" title="'.htmlspecialchars(lang('filemanager')).'">
|
||||
<img src="'.common::image('filemanager','navbar').'" height="18">
|
||||
</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'];
|
||||
|
@ -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"] ='<input style="width:12px; height:12px; border: none; margin: 1px;" class="{row_css_class}" type="checkbox" id="msgSelectInput" name="msg[]" value="'.$message_uid.'"
|
||||
// onclick="toggleFolderRadio(this, refreshTimeOut)">';
|
||||
|
||||
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"] = "<nobr><a href=\"#\" onclick=\"fm_handleComposeClick(false,'".$GLOBALS['egw']->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)."</a></nobr>";
|
||||
$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"] = "<nobr><a href=\"#\" onclick=\"fm_handleComposeClick(false,'".$GLOBALS['egw']->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)."</a></nobr>";
|
||||
*/
|
||||
$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;
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -11,15 +11,21 @@
|
||||
</menulist>
|
||||
<textbox class="mail-index_quotaDisplayNone" readonly="true" id="composeID"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<button label="Send" id="button[send]"/> <buttononly value="saveAsDraft" id="button[saveAsDraft]" image="fileexport" onclick="app.mail.saveAsDraft"/>
|
||||
<vfs-select id="selectFromVFSForCompose" onchange="app.mail.vfsUploadForCompose"/>
|
||||
<file statustext="Select file to attach to message" multiple='true' progress='mailUploadProgress' onFinish="app.mail.uploadForCompose" id="uploadForCompose" drop_target ="mailUploadSection"/>
|
||||
<description value="Save:"/>
|
||||
<image class="et2_button_icon" label="Save as infolog on send" src="infolog/navbar" no_lang="1"/>
|
||||
<hbox class="et2_toolbar ui-widget-header ui-corner-all mail-compose_toolbar">
|
||||
<button class="et2_button ui-button mail-compose_button" label="Send" id="button[send]"/>
|
||||
<buttononly class="et2_button ui-button" value="saveAsDraft" id="button[saveAsDraft]" image="fileexport" onclick="app.mail.saveAsDraft"/>
|
||||
<buttononly class="et2_button ui-button" value="saveAsDraftAndPrint" id="button[saveAsDraftAndPrint]" image="print" onclick="app.mail.saveAsDraftAndPrint"/>
|
||||
<vfs-select class="$cont[vfsNotAvailable]" id="selectFromVFSForCompose" onchange="app.mail.vfsUploadForCompose"/>
|
||||
<file class="mail-compose_fileselector" statustext="Select file to attach to message" multiple='true' progress='mailUploadProgress' onFinish="app.mail.uploadForCompose" id="uploadForCompose" drop_target ="mailUploadSection"/>
|
||||
<description class="$cont[noSaveAsAvailable]" value="Save:"/>
|
||||
<hbox class="$cont[noInfologAvailable]">
|
||||
<image class="et2_button ui-button et2_button_icon" label="Save as infolog on send" src="infolog/navbar" no_lang="1"/>
|
||||
<checkbox statustext="check to save as infolog on send" id="to_infolog" options="$cont[to_infolog]"/>
|
||||
<image class="et2_button_icon" label="Save as tracker on send" src="tracker/navbar" no_lang="1"/>
|
||||
</hbox>
|
||||
<hbox class="$cont[noTrackerAvailable]">
|
||||
<image class="et2_button ui-button et2_button_icon" label="Save as tracker on send" src="tracker/navbar" no_lang="1"/>
|
||||
<checkbox statustext="check to save as trackerentry on send" id="to_tracker" options="$cont[to_tracker]"/>
|
||||
</hbox>
|
||||
<description value="Recieve notification"/>
|
||||
<checkbox statustext="check to recieve a notification when the message is read (note: not all clients support this and/or the reciever may not authorize the notification)" id="disposition" options="$cont[disposition]"/>
|
||||
<description value="Priority"/>
|
||||
|
Loading…
Reference in New Issue
Block a user