fix addressbook email popup; still todo: rightclick action

This commit is contained in:
Klaus Leithoff 2013-07-17 14:53:24 +00:00
parent 9af953e2b1
commit 88f866aec9
3 changed files with 24 additions and 29 deletions

View File

@ -675,23 +675,13 @@ class addressbook_ui extends addressbook_bo
{
if (strpos($GLOBALS['egw_info']['flags']['java_script'],'addEmail') === false)
{
if ($_GET['compat']) // 1.2 felamimail or old email
{
$handler = "if (opener.document.doit[to].value != '')
{
opener.document.doit[to].value += ',';
}
opener.document.doit[to].value += email";
}
else // 1.3+ felamimail
{
$handler = 'opener.addEmail(to,email)';
}
$handler = 'opener.addEmail(to,email)';
$GLOBALS['egw_info']['flags']['java_script'].= "
<script>
window.egw_LAB.wait(function() {
window.focus();
function addEmail(email)
window.addEmail = function(email)
{
var to = 'to';
splitter = email.indexOf(' <');
@ -711,7 +701,8 @@ class addressbook_ui extends addressbook_bo
}
}
$handler;
}
};
});
</script>
";
}
@ -2262,7 +2253,7 @@ class addressbook_ui extends addressbook_bo
$do_email = strpos($_SERVER['HTTP_REFERER'],'emailpopup') !== false;
}
$GLOBALS['egw_info']['flags']['include_xajax'] = true;
$GLOBALS['egw_info']['flags']['java_script'] .= "<script>window.focus()</script>";
$GLOBALS['egw_info']['flags']['java_script'] .= "<script>window.egw_LAB.wait(function() {window.focus();});</script>";
$GLOBALS['egw_info']['etemplate']['advanced_search'] = true;
// initialize etemplate arrays
@ -2357,6 +2348,7 @@ class addressbook_ui extends addressbook_bo
list($width,$height) = explode('x',egw_link::get_registry('felamimail','add_popup'));
return '<script LANGUAGE="JavaScript">
window.egw_LAB.wait(function() {
function adb_mail_vcard(_action, _elems)
{
var link = "'.egw::link('/index.php',array('menuaction' => 'felamimail.uicompose.compose')).'";
@ -2414,6 +2406,7 @@ class addressbook_ui extends addressbook_bo
}
}
});
</script>';
}

File diff suppressed because one or more lines are too long

View File

@ -2,17 +2,17 @@
<!-- $Id$ -->
<overlay>
<template id="addressbook.email.left" template="" lang="" group="0" version="1.5.001">
<hbox class="bold" cols="1" no_lang="1" rows="1">
<radio cols="1" statustext="where to add the email address" label="To" id="to" no_lang="1" rows="1" options="to" class="bold"/>
<radio cols="1" statustext="where to add the email address" label="Cc" id="to" no_lang="1" rows="1" options="cc" class="bold"/>
<radio cols="1" statustext="where to add the email address" label="Bcc" id="to" no_lang="1" rows="1" options="bcc" class="bold"/>
<hbox no_lang="1" class="bold">
<radio statustext="where to add the email address" label="To" id="to" no_lang="1" options="to" class="bold"/>
<radio statustext="where to add the email address" label="Cc" id="to" no_lang="1" options="cc" class="bold"/>
<radio statustext="where to add the email address" label="Bcc" id="to" no_lang="1" options="bcc" class="bold"/>
</hbox>
<hbox class="bold" no_lang="1">
<hbox no_lang="1" class="bold">
<radio statustext="preferred type of email address to add for distribution lists" label="Business email" id="email_type" no_lang="1" options="email" class="bold"/>
<radio statustext="preferred type of email address to add for distribution lists" label="Home email" id="email_type" no_lang="1" options="email_home" class="bold"/>
</hbox>
</template>
<template id="addressbook.email.rows" template="" lang="" group="0" version="1.9.002">
<template id="addressbook.email.rows" template="" lang="" group="0" version="1.9.003">
<grid width="100%">
<columns>
<column/>
@ -53,7 +53,7 @@
<description value=" " id="${row}[n_given]" no_lang="1"/>
<description id="${row}[n_family]" no_lang="1" class="leftPad5"/>
</hbox>
<hbox options="0,0" orient="0">
<hbox options="0,0">
<description id="${row}[n_family]" no_lang="1"/>
<description value=" " id="${row}[n_given]" no_lang="1" class="leftPad5"/>
</hbox>
@ -63,12 +63,12 @@
<description value=" " id="${row}[n_given]" no_lang="1" class="leftPad5"/>
</hbox>
<box no_lang="1" options="0,0" class="emailCol">
<description id="${row}[email]" no_lang="1" href="&quot;javascript:var nfn='$row_cont[n_fn]';nfn=nfn.replace(/" activate_links="|@/g" for="'');addEmail(nfn+' &lt;$row_cont[email]&gt;');&quot;" extra_link_title=",,$row_cont[email]"/>
<description id="${row}[email]" no_lang="1" href="&quot;javascript:var nfn='$row_cont[n_fn]';nfn=nfn.replace(/" activate_links="|@/g" for="'');this.addEmail(nfn+' &lt;$row_cont[email]&gt;');&quot;" extra_link_title=",,$row_cont[email]"/>
</box>
<box no_lang="1" options="0,0" class="emailCol">
<description id="${row}[email_home]" no_lang="1" href="&quot;javascript:var nfn='$row_cont[n_fn]';nfn=nfn.replace(/" activate_links="|@/g" for="'');addEmail(nfn+' &lt;$row_cont[email_home]&gt;');&quot;" extra_link_title=",,$row_cont[email_home]"/>
<description id="${row}[email_home]" no_lang="1" href="&quot;javascript:var nfn='$row_cont[n_fn]';nfn=nfn.replace(/" activate_links="|@/g" for="'');this.addEmail(nfn+' &lt;$row_cont[email_home]&gt;');&quot;" extra_link_title=",,$row_cont[email_home]"/>
</box>
<hbox options="0" class="noPrint" orient="0">
<hbox options="0" class="noPrint">
<button label="Edit" id="edit[$row_cont[id]]" onclick="window.open(egw::link('/index.php','menuaction=addressbook.addressbook_ui.edit&amp;contact_id=$row_cont[id]'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;" image="edit"/>
<button statustext="Delete this contact" label="Delete" id="delete[$row_cont[id]]" onclick="return confirm('Delete this contact');" image="delete"/>
<checkbox align="right" statustext="Select multiple contacts for a further action" id="checked[]" options="$row_cont[id]"/>
@ -82,18 +82,20 @@
<columns>
<column/>
<column/>
<column/>
</columns>
<rows>
<row disabled="!@msg">
<description align="center" id="msg" no_lang="1" span="all" class="redItalic"/>
<description/>
<description/>
</row>
<row disabled="1">
<template id="addressbook.email.left"/>
<description align="right"/>
</row>
<row>
<nextmatch id="nm" options="addressbook.email.rows" span="all"/>
<nextmatch id="nm" template="addressbook.email.rows" span="all"/>
</row>
<row class="noPrint">
<button statustext="Add a new contact" label="Add" id="add" onclick="window.open(egw::link('/index.php','menuaction=addressbook.uicontacts.edit'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;"/>