display all Adresses popup

This commit is contained in:
Klaus Leithoff 2013-12-04 09:52:59 +00:00
parent 144da1e76d
commit 2a7b7d9376
3 changed files with 39 additions and 14 deletions

View File

@ -547,17 +547,34 @@ app.classes.mail = AppJS.extend(
mail_showAllAddresses: function(_id) {
var dataElem = {data:{subject:"",fromaddress:"",toaddress:"",additionaltoaddress:"",ccaddress:"",date:"",subject:""}};
dataElem = egw.dataGetUIDdata(_id);
console.log(_id,dataElem);
//console.log(_id,dataElem);
var buttons = [
{text: this.egw.lang("Close"), id:"close"}
];
var allAddresses = [{type:this.egw.lang('from'),address:dataElem.data.fromaddress}];
allAddresses.push({type:this.egw.lang('to'),address:dataElem.data.toaddress})
var parsedTo = [];
if (dataElem.data.additionaltoaddress.length>0) parsedTo=JSON.parse(dataElem.data.additionaltoaddress);
//console.log(_id,parsedTo);
for (i=0;i<parsedTo.length;i++)
{
allAddresses.push({type:'',address:parsedTo[i]});
}
var parsedCC = [];
if (dataElem.data.ccaddress.length>0) parsedCC=JSON.parse(dataElem.data.ccaddress);
//console.log(_id,parsedCC);
for (i=0;i<parsedCC.length;i++)
{
allAddresses.push({type:(i==0?this.egw.lang('cc'):''),address:parsedCC[i]});
}
var dialog = et2_createWidget("dialog",{
// If you use a template, the second parameter will be the value of the template, as if it were submitted.
callback: function(button_id, value) {},
buttons: buttons,
modal: false,
title: dataElem.data.subject,
template:"/egroupware/mail/templates/default/displayAllAdresses.xet",
value: { content: {displayallAdresses:[{type:this.egw.lang('to'),address:JSON.parse(dataElem.data.additionaltoaddress)[0]}]}, sel_options: {}}
value: { content: {displayallAdresses:allAddresses}, sel_options: {}}
});
},

View File

@ -373,6 +373,11 @@ input[type=button] {
position: relative;
background-color: white;
}
.maildisplayAllAdresses {
max-height: 245px !important;
overflow:scroll;
overflow-x:hidden;
}
#mail-compose_fileselector {
width: 245px !important;
}

View File

@ -2,17 +2,20 @@
<!-- $Id$ -->
<overlay>
<template id="mail.displayAllAdresses" template="" lang="" group="0" version="1.9.001">
<grid disabled="@no_griddata" id="displayallAdresses">
<columns>
<column width="10%" />
<column width="80%" />
</columns>
<rows>
<row >
<description id="${row}[type]" />
<url-email align="right" id="${row}[address]" readonly='true'/>
</row>
</rows>
</grid>
<description value="All Adresses:" />
<vbox class="maildisplayAllAdresses">
<grid disabled="@no_griddata" id="displayallAdresses">
<columns>
<column width="10%" />
<column width="80%" />
</columns>
<rows>
<row >
<description id="${row}[type]" />
<url-email align="left" id="${row}[address]" readonly='true'/>
</row>
</rows>
</grid>
</vbox>
</template>
</overlay>