mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 01:18:20 +01:00
show toolbar in preview area (non functional); add priority, disposition, save to infolog/tracker; some styling for toolbars in display and preview; disabling some actions in toolbar on display; remove testhtmlarea;
This commit is contained in:
parent
54ab073cab
commit
94a8352575
@ -23,7 +23,6 @@ class mail_compose
|
||||
(
|
||||
'action' => True,
|
||||
'compose' => True,
|
||||
'testhtmlarea' => True,
|
||||
'composeFromDraft' => True,
|
||||
'getAttachment' => True,
|
||||
'fileSelector' => True,
|
||||
@ -892,7 +891,7 @@ $CAtFStart = array2string($_content);
|
||||
if (array_search($id_prepend.$iS,$identities)===false)
|
||||
{
|
||||
$identities[$singleIdentity->id] = $id_prepend.$iS;
|
||||
$sel_options['SENDER'][$iS] = $id_prepend.$iS;
|
||||
$sel_options['identity'][$iS] = $id_prepend.$iS;
|
||||
}
|
||||
if(in_array($singleIdentity->id,$defaultIds) && $defaultIdentity==0)
|
||||
{
|
||||
@ -1090,12 +1089,12 @@ $CAtFStart = array2string($_content);
|
||||
$content = array_merge($content,$_content);
|
||||
|
||||
if (!empty($content['folder'])) $sel_options['folder']=$this->ajax_searchFolder(0,true);
|
||||
$content['sender'] = (empty($content['sender'])?($selectedSender?(array)$selectedSender:''):$content['sender']);
|
||||
$content['identity'] = (empty($content['identity'])?($selectedSender?(array)$selectedSender:''):$content['identity']);
|
||||
}
|
||||
else
|
||||
{
|
||||
//error_log(__METHOD__.__LINE__.array2string(array($sel_options['SENDER'],$selectedSender)));
|
||||
$content['sender'] = ($selectedSender?(array)$selectedSender:'');
|
||||
//error_log(__METHOD__.__LINE__.array2string(array($sel_options['identity'],$selectedSender)));
|
||||
$content['identity'] = ($selectedSender?(array)$selectedSender:'');
|
||||
//error_log(__METHOD__.__LINE__.$content['body']);
|
||||
}
|
||||
$content['is_html'] = ($content['mimeType'] == 'html'?true:'');
|
||||
@ -1113,34 +1112,14 @@ if (is_array($content['attachments']))error_log(__METHOD__.__LINE__.' Attachment
|
||||
$preserv['is_plain'] = $content['is_plain'];
|
||||
if (isset($content['mimeType'])) $preserv['mimeType'] = $content['mimeType'];
|
||||
$sel_options['mimeType'] = array("plain"=>"plain","html"=>"html");
|
||||
$sel_options['priority'] = array(1=>"high",2=>"normal",3=>"low");
|
||||
if (!isset($content['priority']) || empty($content['priority'])) $content['priority']=2;
|
||||
if ($content['mimeType']=='html'); $content['rtfEditorFeatures']='simple-withimage';//egw_ckeditor_config::get_ckeditor_config();
|
||||
$etpl = new etemplate_new('mail.compose');
|
||||
|
||||
$etpl->exec('mail.mail_compose.compose',$content,$sel_options,$readonlys,$preserv,2);
|
||||
}
|
||||
|
||||
function testhtmlarea($content=null)
|
||||
{
|
||||
error_log(__METHOD__.__LINE__.array2string($content));
|
||||
if ($content)
|
||||
{
|
||||
$this->content['mimeType'] = 'plain';
|
||||
$content['is_html'] = ($this->content['mimeType'] == 'html'?true:'');
|
||||
$content['is_plain'] = ($this->content['mimeType'] == 'html'?'':true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['body'] = 'bla bla bla';
|
||||
$content['is_html'] = ($this->content['mimeType'] == 'html'?true:'');
|
||||
$content['is_plain'] = ($this->content['mimeType'] == 'html'?'':true);
|
||||
//error_log(__METHOD__.__LINE__.array2string(array($sel_options['SENDER'],$selectedSender)));
|
||||
$content['SENDER'] = ($selectedSender?(array)$selectedSender:'');
|
||||
//error_log(__METHOD__.__LINE__.$content['body']);
|
||||
$content['mail_'.($this->content['mimeType'] == 'html'?'html':'plain').'text'] = $content['body'];
|
||||
}
|
||||
$etpl = new etemplate_new('mail.testhtmlarea');
|
||||
$etpl->exec('mail.mail_compose.testhtmlarea',$content,$sel_options,$readonlys,$preserv,2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pre-fill a new compose based on an existing email
|
||||
*
|
||||
@ -1598,7 +1577,7 @@ if (is_array($content['attachments']))error_log(__METHOD__.__LINE__.' Attachment
|
||||
$userEMailAddresses = $this->preferences->getUserEMailAddresses();
|
||||
|
||||
// get message headers for specified message
|
||||
print "AAAA: $_folder, $_uid, $_partID<br>";
|
||||
//print "AAAA: $_folder, $_uid, $_partID<br>";
|
||||
$headers = $mail_bo->getMessageEnvelope($_uid, $_partID);
|
||||
#$headers = $mail_bo->getMessageHeader($_uid, $_partID);
|
||||
$this->sessionData['uid'] = $_uid;
|
||||
|
@ -753,14 +753,6 @@ class mail_hooks
|
||||
'link'=>false,
|
||||
'icon' => false
|
||||
);
|
||||
/*
|
||||
$file[] = array(
|
||||
'no_lang' => true,
|
||||
'text'=>'<span id="mail-index_buttontesthtmlarea" class="button" />',
|
||||
'link'=>false,
|
||||
'icon' => false
|
||||
);
|
||||
*/
|
||||
$file[] = array(
|
||||
'no_lang' => true,
|
||||
'text'=>'<span id="mail-tree_target" class="dtree" />',
|
||||
|
@ -1233,6 +1233,30 @@ unset($query['actions']);
|
||||
mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"));
|
||||
$dateToday = date("Y-m-d");
|
||||
$rv = array();
|
||||
$actions = self::get_actions();
|
||||
foreach(array('composeasnew','reply','reply_all','forward','flagged','unflagged','delete','print','infolog','tracker','save','header') as $a => $act)
|
||||
{
|
||||
//error_log(__METHOD__.__LINE__.' '.$act.'->'.array2string($actions[$act]));
|
||||
switch ($act)
|
||||
{
|
||||
case 'forward':
|
||||
$actionsenabled[$act]=$actions[$act]['children']['forwardinline'];
|
||||
break;
|
||||
case 'save':
|
||||
$actionsenabled[$act]=$actions[$act]['children']['save2disk'];
|
||||
break;
|
||||
case 'header':
|
||||
$actionsenabled[$act]=$actions['view']['children'][$act];
|
||||
break;
|
||||
case 'flagged':
|
||||
case 'unflagged':
|
||||
$actionsenabled[$act]=$actions['mark']['children'][$act];
|
||||
break;
|
||||
default:
|
||||
if (isset($actions[$act])) $actionsenabled[$act]=$actions[$act];
|
||||
}
|
||||
}
|
||||
|
||||
$i=0;
|
||||
$firstuid = null;
|
||||
foreach((array)$_headers as $header)
|
||||
@ -1522,6 +1546,7 @@ unset($query['actions']);
|
||||
$data["class"] = implode(' ', $css_styles);
|
||||
$data['attachmentsPresent'] = $imageTag;
|
||||
$data['attachmentsBlock'] = $imageHTMLBlock;
|
||||
$data['toolbaractions'] = json_encode($actionsenabled);
|
||||
$rv[] = $data;
|
||||
//error_log(__METHOD__.__LINE__.array2string($result));
|
||||
}
|
||||
@ -1680,8 +1705,13 @@ unset($query['actions']);
|
||||
+ $field_data;
|
||||
}
|
||||
}
|
||||
|
||||
$etpl->setElementAttribute('toolbar','actions', self::get_actions());
|
||||
$actionsenabled = self::get_actions();
|
||||
unset($actionsenabled['mark']['children']['setLabel']);
|
||||
unset($actionsenabled['mark']['children']['unsetLabel']);
|
||||
unset($actionsenabled['mark']['children']['read']);
|
||||
unset($actionsenabled['mark']['children']['unread']);
|
||||
unset($actionsenabled['mark']['children']['undelete']);
|
||||
$etpl->setElementAttribute('toolbar','actions', $actionsenabled);
|
||||
if (empty($subject)) $subject = lang('no subject');
|
||||
$content['msg'] = (is_array($error_msg)?implode("<br>",$error_msg):$error_msg);
|
||||
// Send mail ID so we can use it for actions
|
||||
|
@ -91,7 +91,7 @@ app.mail = AppJS.extend(
|
||||
var subject = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('mail_displaysubject');
|
||||
var body = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('mail_displaybody');
|
||||
body.node.parentNode.style.top=subject.node.offsetTop+40+'px';
|
||||
var app_registry = egw.link_get_registry(this.appname);
|
||||
var app_registry = egw.link_get_registry('mail');//this.appname);
|
||||
//console.log(app_registry);
|
||||
w=870;
|
||||
if (typeof app_registry['view'] != 'undefined' && typeof app_registry['view_popup'] != 'undefined' )
|
||||
@ -411,6 +411,7 @@ app.mail = AppJS.extend(
|
||||
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewSubject').set_value(subject);
|
||||
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewAttachmentArea').set_value((dataElem.data.attachmentsBlock.length>1?dataElem.data.attachmentsBlock:''));
|
||||
if (dataElem.data.attachmentsBlock.length<1) etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewAttachmentArea').set_class('previewAttachmentArea noContent');
|
||||
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('toolbar').set_actions(JSON.parse(dataElem.data.toolbaractions));
|
||||
var IframeHandle = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('messageIFRAME');
|
||||
//console.log(IframeHandle);
|
||||
IframeHandle.set_src(egw.link('/index.php',{menuaction:'mail.mail_ui.loadEmailBody',_messageID:_id}));
|
||||
|
@ -361,11 +361,33 @@ input[type=button] {
|
||||
position: relative;
|
||||
margin-top: 3px;
|
||||
}
|
||||
#mail-display_toolbar {
|
||||
padding: 0px;
|
||||
}
|
||||
#mail-display_toolbar > button > span {
|
||||
padding: .2em .4em;
|
||||
}
|
||||
#mail-display_toolbar > button > span > img {
|
||||
width: 16px;
|
||||
padding: 0px;
|
||||
height: 16px !important;
|
||||
}
|
||||
#mail-index_mailPreviewIcons {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
#mail-index_toolbar {
|
||||
padding: 0px;
|
||||
}
|
||||
#mail-index_toolbar > button > span {
|
||||
padding: .2em .4em;
|
||||
}
|
||||
#mail-index_toolbar > button > span > img {
|
||||
width: 16px;
|
||||
padding: 0px;
|
||||
height: 16px !important;
|
||||
}
|
||||
#mail-index_mailPreviewContainer {
|
||||
position: absolute;
|
||||
border: 1px solid silver;
|
||||
|
@ -6,12 +6,25 @@
|
||||
<vbox class="mailCompose mailComposeHeaderSection" width="100%">
|
||||
<hbox class="mailComposeHeaders" width="99%">
|
||||
<description value="Identity"/>
|
||||
<taglist-email id="sender" width="88%" allowFreeEntries="false" maxSelection="1" autocomplete_url="mail.mail_compose.ajax_searchIdentities" onclick="app.mail.address_click"/>
|
||||
<menulist>
|
||||
<menupopup id="identity" onchange="app.mail.submitOnChange"/>
|
||||
</menulist>
|
||||
</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"/>
|
||||
<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"/>
|
||||
<checkbox statustext="check to save as trackerentry on send" id="to_tracker" options="$cont[to_tracker]"/>
|
||||
<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"/>
|
||||
<menulist>
|
||||
<menupopup id="priority"/>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<hbox class="mailComposeHeaders" width="99%">
|
||||
<description value="To"/>
|
||||
@ -50,7 +63,7 @@
|
||||
</hbox>
|
||||
<groupbox class="mailSignature">
|
||||
<menulist>
|
||||
<menupopup id="signatureID"/>
|
||||
<menupopup id="signatureID" onchange="app.mail.submitOnChange"/>
|
||||
</menulist>
|
||||
<description value="Stationery"/>
|
||||
<menulist>
|
||||
|
@ -66,7 +66,7 @@
|
||||
<html id="previewAttachmentArea"/>
|
||||
</hbox>
|
||||
<hbox id="mailPreviewIcons">
|
||||
<description value="Icons"/>
|
||||
<toolbar id="toolbar"/>
|
||||
</hbox>
|
||||
<box id="mailPreviewContainer">
|
||||
<iframe frameborder="1" id="messageIFRAME" scrolling="auto"/>
|
||||
|
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- $Id$ -->
|
||||
<overlay>
|
||||
<template id="mail.testhtmlarea" template="" lang="" group="0" version="1.9.001">
|
||||
<hbox>
|
||||
<button label="Submit" id="button[apply]"/><button label="Save" id="button[save]"/>
|
||||
</hbox>
|
||||
<vbox class="mailComposeBodySection" width="99%">
|
||||
<hbox disabled="@is_plain" class="mailComposeBody">
|
||||
<htmlarea span="all" name="mail_htmltext" id="mail_htmltext" mode="$cont[rtfEditorFeatures]" height="320px" width="100%" toolbar="true" base_href="$cont[upload_dir]"/>
|
||||
</hbox>
|
||||
<hbox disabled="@is_html" class="mailComposeBody">
|
||||
<textbox multiline="true" rows="15" cols="120" width="99%" span="all" name="mail_plaintext" id="mail_plaintext"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</template>
|
||||
</overlay>
|
Loading…
Reference in New Issue
Block a user