2 /*********************************************************************************
3 * SugarCRM is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
37 /*********************************************************************************
39 ********************************************************************************/
43 <script type="text/javascript" src="{sugar_getjspath file='modules/Users/User.js'}"></script>
44 <script type='text/javascript' src="{sugar_getjspath file='include/javascript/sugar_grp_overlib.js'}"></script>
45 <script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}"></script>
47 <script type="text/javascript" >
49 function change_state(radiobutton) {
51 if (radiobutton.value == '1') {
52 radiobutton.form['massemailer_tracking_entities_location'].disabled=true;
53 radiobutton.form['massemailer_tracking_entities_location'].value='{/literal}{$MOD.TRACKING_ENTRIES_LOCATION_DEFAULT_VALUE}{literal}';
55 radiobutton.form['massemailer_tracking_entities_location'].disabled=false;
56 radiobutton.form['massemailer_tracking_entities_location'].value=null;
63 <form name="ConfigureSettings" id="EditView" method="POST" >
64 <input type="hidden" name="module" value="EmailMan">
65 <input type="hidden" name="action">
66 <input type="hidden" name="return_module" value="{$RETURN_MODULE}">
67 <input type="hidden" name="return_action" value="{$RETURN_ACTION}">
68 <input type="hidden" name="source_form" value="config" />
70 <table width="100%" cellpadding="0" cellspacing="0" border="0">
74 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary" onclick="this.form.action.value='Save';return verify_data(this);" type="submit" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} ">
75 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{$RETURN_ACTION}'; this.form.module.value='{$RETURN_MODULE}';" type="submit" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} ">
77 <td align="right" nowrap>
78 <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span> {$APP.NTC_REQUIRED}
82 <table width="100%" border="1" cellspacing="0" cellpadding="0" class="edit view">
83 <tr><th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_EMAIL_OUTBOUND_CONFIGURATION}</h4></th>
86 <td align="left" scope="row" colspan="4">
87 {$MOD.LBL_OUTGOING_SECTION_HELP}
91 <tr class="{$OUTBOUND_TYPE_CLASS}">
92 <td width="20%" scope="row">{$MOD.LBL_MAIL_SENDTYPE}</td>
94 <select id="mail_sendtype" name="mail_sendtype" onChange="notify_setrequired(document.ConfigureSettings); SUGAR.user.showHideGmailDefaultLink(this);" tabindex="1">{$mail_sendtype_options}</select>
96 <td scope="row"> </td>
100 <td width="20%" scope="row">{$MOD.LBL_NOTIFY_FROMNAME} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
101 <td width="30%" > <input id='notify_fromname' name='notify_fromname' tabindex='1' size='25' maxlength='128' type="text" value="{$notify_fromname}"></td>
104 <td width="20%" scope="row">{$MOD.LBL_NOTIFY_FROMADDRESS} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
105 <td width="30%"><input id='notify_fromaddress' name='notify_fromaddress' tabindex='1' size='25' maxlength='128' type="text" value="{$notify_fromaddress}"></td>
108 <td align="left" scope="row" colspan="4">{$MOD.LBL_CHOOSE_EMAIL_PROVIDER}</td>
112 <div id="smtpButtonGroup" class="yui-buttongroup">
113 <span id="gmail" class="yui-button yui-radio-button{if $mail_smtptype == 'gmail'} yui-button-checked{/if}">
114 <span class="first-child">
115 <button type="button" name="mail_smtptype" value="gmail">
116 {$APP.LBL_SMTPTYPE_GMAIL}
120 <span id="yahoomail" class="yui-button yui-radio-button{if $mail_smtptype == 'yahoomail'} yui-button-checked{/if}">
121 <span class="first-child">
122 <button type="button" name="mail_smtptype" value="yahoomail">
123 {$APP.LBL_SMTPTYPE_YAHOO}
127 <span id="exchange" class="yui-button yui-radio-button{if $mail_smtptype == 'exchange'} yui-button-checked{/if}">
128 <span class="first-child">
129 <button type="button" name="mail_smtptype" value="exchange">
130 {$APP.LBL_SMTPTYPE_EXCHANGE}
134 <span id="other" class="yui-button yui-radio-button{if $mail_smtptype == 'other' || empty($mail_smtptype)} yui-button-checked{/if}">
135 <span class="first-child">
136 <button type="button" name="mail_smtptype" value="other">
137 {$APP.LBL_TABGROUP_OTHER}
146 <div id="smtp_settings">
147 <table width="100%" cellpadding="0" cellspacing="0">
148 <tr id="mailsettings1">
149 <td width="20%" scope="row"><span id="mail_smtpserver_label">{$MOD.LBL_MAIL_SMTPSERVER}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
150 <td width="30%" ><input type="text" id="mail_smtpserver" name="mail_smtpserver" tabindex="1" size="25" maxlength="64" value="{$mail_smtpserver}"></td>
151 <td width="20%" scope="row"><span id="mail_smtpport_label">{$MOD.LBL_MAIL_SMTPPORT}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
152 <td width="30%" ><input type="text" id="mail_smtpport" name="mail_smtpport" tabindex="1" size="5" maxlength="5" value="{$mail_smtpport}"></td>
154 <tr id="mailsettings2">
155 <td scope="row"><span id='mail_smtpauth_req_label'>{$MOD.LBL_MAIL_SMTPAUTH_REQ}</span></td>
157 <input id='mail_smtpauth_req' name='mail_smtpauth_req' type="checkbox" class="checkbox" value="1" tabindex='1'
158 onclick="notify_setrequired(document.ConfigureSettings);" {$mail_smtpauth_req}>
160 <td width="15%" scope="row"><span id="mail_smtpssl_label">{$APP.LBL_EMAIL_SMTP_SSL_OR_TLS}</span></td>
162 <select id="mail_smtpssl" name="mail_smtpssl" tabindex="501" onchange="setDefaultSMTPPort();" >{$MAIL_SSL_OPTIONS}</select>
166 <td width="20%" scope="row"><span id="mail_smtpuser_label">{$MOD.LBL_MAIL_SMTPUSER}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
167 <td width="30%" ><input type="text" id="mail_smtpuser" name="mail_smtpuser" size="25" maxlength="64" value="{$mail_smtpuser}" tabindex='1' ></td>
168 <td width="20%"> </td>
169 <td width="30%"> </td>
172 <td width="20%" scope="row"><span id="mail_smtppass_label">{$MOD.LBL_MAIL_SMTPPASS}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
173 <td width="30%" ><input type="password" id="mail_smtppass" name="mail_smtppass" size="25" maxlength="64" tabindex='1'></td>
174 <td width="20%"> </td>
175 <td width="30%"> </td>
177 <tr id="mail_allow_user">
178 <td width="20%" scope="row">
179 {$MOD.LBL_ALLOW_DEFAULT_SELECTION}
180 <img border="0" onmouseout="return nd();" onmouseover="return overlib('{$MOD.LBL_ALLOW_DEFAULT_SELECTION_HELP}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass', WIDTH, -1, NOFOLLOW, 'ol_nofollow')" src="index.php?entryPoint=getImage&themeName={$THEME}&imageName=helpInline.gif">
183 <input type='hidden' name='notify_allow_default_outbound' value='0'>
184 <input name='notify_allow_default_outbound' value="2" tabindex='1' class="checkbox" type="checkbox" {$notify_allow_default_outbound_on}>
186 <td width="20%"> </td>
187 <td width="30%"> </td>
193 <tr><td colspan="4"> </tr>
195 <td width="15%"><input type="button" class="button" value="{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}" onclick="testOutboundSettings();"> </td>
196 <td width="15%"> </td>
197 <td width="40%"> </td>
198 <td width="40%"> </td>
201 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
203 <th align="left" scope="row" colspan="4">
204 <h4>{$MOD.LBL_NOTIFY_TITLE}</h4>
208 <td width="20%" scope="row" valign='top'>
209 {$MOD.LBL_NOTIFY_ON}:
210 <img border="0" onmouseout="return nd();" onmouseover="return overlib('{$MOD.LBL_NOTIFICATION_ON_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass', WIDTH, -1, NOFOLLOW, 'ol_nofollow')" src="index.php?entryPoint=getImage&themeName={$THEME}&imageName=helpInline.gif">
212 <td width="30%" valign='top'>
213 <input type='hidden' name='notify_on' value='0'><input name="notify_on" tabindex='1' value="1" class="checkbox" type="checkbox" {$notify_on}>
215 <td scope="row" width="17%"></td>
219 <td width="20%" scope="row" valign='top'>
220 {$MOD.LBL_EMAIL_DEFAULT_DELETE_ATTACHMENTS}:
222 <td width="30%" valign='top'>
223 <input type='checkbox' name='email_default_delete_attachments' value="1" {$DEFAULT_EMAIL_DELETE_ATTACHMENTS}>
225 <td scope="row" width="20%">
226 {$MOD.LBL_NOTIFY_SEND_FROM_ASSIGNING_USER}:
227 <img border="0" onmouseout="return nd();" onmouseover="return overlib('{$MOD.LBL_FROM_ADDRESS_HELP}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass')" src="index.php?entryPoint=getImage&themeName={$THEME}&imageName=helpInline.gif">
229 <td width="30%" valign='top'><input type='hidden' name='notify_send_from_assigning_user' value='0'><input name='notify_send_from_assigning_user' value="2" tabindex='1' class="checkbox" type="checkbox" {$notify_send_from_assigning_user}></td>
232 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
234 <th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_SECURITY_TITLE}</h4></th>
237 <td align="left" scope="row" colspan="4">
238 {$MOD.LBL_SECURITY_DESC}
242 <td valign="middle" valign="top" scope="row" colspan="3">
243 {$MOD.LBL_SECURITY_OUTLOOK_DEFAULTS}
245 <td width="10%" NOWRAP valign="top" >
246 <input type="checkbox" value="1" name="set_outlook_defaults" id="set_outlook_defaults" onclick="setOutlookDefaults();">
248 <script type="text/javascript" language="Javascript">
250 function toggleAllSecurityOptions() {
251 document.getElementById('set_outlook_defaults').checked = false;
255 if(document.getElementById('toggle_all').checked == true) {
258 document.getElementById('applet').checked = check;
259 document.getElementById('base').checked = check;
260 document.getElementById('embed').checked = check;
261 document.getElementById('form').checked = check;
262 document.getElementById('frame').checked = check;
263 document.getElementById('frameset').checked = check;
264 document.getElementById('iframe').checked = check;
265 document.getElementById('import').checked = check;
266 document.getElementById('layer').checked = check;
267 document.getElementById('link').checked = check;
268 document.getElementById('object').checked = check;
269 document.getElementById('style').checked = check;
270 document.getElementById('xmp').checked = check;
273 function setOutlookDefaults() {
274 document.getElementById('toggle_all').checked = false;
276 document.getElementById('applet').checked = true;
277 document.getElementById('base').checked = true;
278 document.getElementById('embed').checked = true;
279 document.getElementById('form').checked = true;
280 document.getElementById('frame').checked = true;
281 document.getElementById('frameset').checked = true;
282 document.getElementById('iframe').checked = true;
283 document.getElementById('import').checked = true;
284 document.getElementById('layer').checked = true;
285 document.getElementById('link').checked = true;
286 document.getElementById('object').checked = true;
287 document.getElementById('style').checked = false;
288 document.getElementById('xmp').checked = true;
296 <td valign="middle" valign="top" scope="row" colspan="3">
297 {$MOD.LBL_SECURITY_TOGGLE_ALL}
299 <td width="10%" NOWRAP valign="top" >
300 <input type="checkbox" value="1" name="toggle_all" id="toggle_all" onclick="toggleAllSecurityOptions();">
304 <td width="10%" valign="middle" scope="row">
305 {$MOD.LBL_SECURITY_APPLET}
307 <td width="40%" NOWRAP valign="middle" >
308 <input type="checkbox" value="1" name="applet" id="applet" {$appletChecked}> <applet>
310 <td width="10%" valign="middle" scope="row">
311 {$MOD.LBL_SECURITY_BASE}
313 <td width="40%" NOWRAP valign="middle" >
314 <input type="checkbox" value="1" name="base" id="base" {$baseChecked}> <base>
318 <td width="10%" valign="middle" scope="row">
319 {$MOD.LBL_SECURITY_EMBED}
321 <td width="40%" NOWRAP valign="middle" >
322 <input type="checkbox" value="1" name="embed" id="embed" {$embedChecked}> <embed>
324 <td width="10%" valign="middle" scope="row">
325 {$MOD.LBL_SECURITY_FORM}
327 <td width="40%" NOWRAP valign="middle" >
328 <input type="checkbox" value="1" name="form" id="form" {$formChecked}> <form>
332 <td width="10%" valign="middle" scope="row">
333 {$MOD.LBL_SECURITY_FRAME}
335 <td width="40%" NOWRAP valign="middle" >
336 <input type="checkbox" value="1" name="frame" id="frame" {$frameChecked}> <frame>
338 <td width="10%" valign="middle" scope="row">
339 {$MOD.LBL_SECURITY_FRAMESET}
341 <td width="40%" NOWRAP valign="middle" >
342 <input type="checkbox" value="1" name="frameset" id="frameset" {$framesetChecked}> <frameset>
346 <td width="10%" valign="middle" scope="row">
347 {$MOD.LBL_SECURITY_IFRAME}
349 <td width="40%" NOWRAP valign="middle" >
350 <input type="checkbox" value="1" name="iframe" id="iframe" {$iframeChecked}> <iframe>
352 <td width="10%" valign="middle" scope="row">
353 {$MOD.LBL_SECURITY_IMPORT}
355 <td width="40%" NOWRAP valign="middle" >
356 <input type="checkbox" value="1" name="import" id="import" {$importChecked}> <import>
360 <td width="10%" valign="middle" scope="row">
361 {$MOD.LBL_SECURITY_LAYER}
363 <td width="40%" NOWRAP valign="middle" >
364 <input type="checkbox" value="1" name="layer" id="layer" {$layerChecked}> <layer>
366 <td width="10%" valign="middle" scope="row">
367 {$MOD.LBL_SECURITY_LINK}
369 <td width="40%" NOWRAP valign="middle" >
370 <input type="checkbox" value="1" name="link" id="link" {$linkChecked}> <link>
374 <td width="10%" valign="middle" scope="row">
375 {$MOD.LBL_SECURITY_OBJECT}
377 <td width="40%" NOWRAP valign="middle" >
378 <input type="checkbox" value="1" name="object" id="object" {$objectChecked}> <object>
380 <td width="10%" valign="middle" scope="row">
381 {$MOD.LBL_SECURITY_STYLE}
383 <td width="40%" NOWRAP valign="middle" >
384 <input type="checkbox" value="1" name="style" id="style" {$styleChecked}> <style>
388 <td width="10%" valign="middle" scope="row">
389 {$MOD.LBL_SECURITY_XMP}
391 <td width="40%" NOWRAP valign="middle" >
392 <input type="checkbox" value="1" name="xmp" id="xmp" {$xmpChecked}> <xmp>
394 <td scope="row"> </td>
401 <div id="testOutboundDialog" class="yui-hidden">
402 <div id="testOutbound">
403 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
406 {$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}
407 <span class="required">
408 {$APP.LBL_REQUIRED_SYMBOL}
412 <input type="text" id="outboundtest_from_address" name="outboundtest_from_address" size="35" maxlength="64" value="{$CURRENT_USER_EMAIL}">
416 <td scope="row" colspan="2">
417 <input type="button" class="button" value=" {$APP.LBL_EMAIL_SEND} " onclick="javascript:sendTestEmail();">
418 <input type="button" class="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " onclick="javascript:EmailMan.testOutboundDialog.hide();">
426 <div style="padding-top:2px;">
427 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button primary" onclick="this.form.action.value='Save';return verify_data(this);" type="submit" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} ">
428 <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" class="button" onclick="this.form.action.value='{$RETURN_ACTION}'; this.form.module.value='{$RETURN_MODULE}';" type="submit" name="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} ">
434 <script type="text/javascript">
436 var loader = new YAHOO.util.YUILoader({
437 require : ["element","sugarwidgets"],
439 skin: { base: 'blank', defaultSkin: '' },
441 base: "include/javascript/yui/build/"
444 name :"sugarwidgets",
446 fullpath: "include/javascript/sugarwidgets/SugarYUIWidgets.js",
447 varName: "YAHOO.SUGAR",
448 requires: ["datatable", "dragdrop", "treeview", "tabview"]
454 function testOutboundSettings() {
455 if (document.getElementById('mail_sendtype').value == 'sendmail') {
456 testOutboundSettingsDialog();
459 var errorMessage = '';
461 var fromAddress = document.getElementById("outboundtest_from_address").value;
462 var errorMessage = '';
464 var smtpServer = document.getElementById('mail_smtpserver').value;
465 var smtpPort = document.getElementById('mail_smtpport').value;
466 var smtpssl = document.getElementById('mail_smtpssl').value;
467 var mailsmtpauthreq = document.getElementById('mail_smtpauth_req');
468 if(trim(smtpServer) == '') {
470 errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPSERVER}{literal}" + "<br/>";
472 if(trim(smtpPort) == '') {
474 errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPPORT}{literal}" + "<br/>";
476 if(mailsmtpauthreq.checked) {
477 if(trim(document.getElementById('mail_smtpuser').value) == '') {
479 errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPUSER}{literal}" + "<br/>";
483 overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
487 testOutboundSettingsDialog();
491 function sendTestEmail()
493 var toAddress = document.getElementById("outboundtest_from_address").value;
494 var fromAddress = document.getElementById("notify_fromaddress").value;
495 if (trim(toAddress) == "")
497 overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
500 else if (!isValidEmail(toAddress)) {
501 overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
504 if (trim(fromAddress) == "")
506 overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_ADDR}{literal}", 'alert');
509 else if (!isValidEmail(fromAddress)) {
510 overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_ADDR}{literal}", 'alert');
513 //Hide the email address window and show a message notifying the user that the test email is being sent.
514 EmailMan.testOutboundDialog.hide();
515 overlay("{/literal}{$APP.LBL_EMAIL_PERFORMING_TASK}{literal}", "{/literal}{$APP.LBL_EMAIL_ONE_MOMENT}{literal}", 'alert');
517 var callbackOutboundTest = {
518 success : function(o) {
520 overlay("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}", "{/literal}{$APP.LBL_EMAIL_TEST_NOTIFICATION_SENT}{literal}", 'alert');
523 var smtpServer = document.getElementById('mail_smtpserver').value;
524 var smtpPort = document.getElementById('mail_smtpport').value;
525 var smtpssl = document.getElementById('mail_smtpssl').value;
526 var mailsmtpauthreq = document.getElementById('mail_smtpauth_req');
527 var mail_sendtype = document.getElementById('mail_sendtype').value;
528 var postDataString = 'mail_name=system&mail_sendtype=' + mail_sendtype + '&mail_smtpserver=' + smtpServer + "&mail_smtpport=" + smtpPort + "&mail_smtpssl=" + smtpssl +
529 "&mail_smtpauth_req=" + mailsmtpauthreq.checked + "&mail_smtpuser=" + trim(document.getElementById('mail_smtpuser').value) +
530 "&mail_smtppass=" + trim(document.getElementById('mail_smtppass').value) + "&outboundtest_to_address=" + toAddress + "&outboundtest_from_address=" + fromAddress;
532 YAHOO.util.Connect.asyncRequest("POST", "index.php?action=testOutboundEmail&module=EmailMan&to_pdf=true&sugar_body_only=true", callbackOutboundTest, postDataString);
534 function testOutboundSettingsDialog() {
535 // lazy load dialogue
536 if(!EmailMan.testOutboundDialog) {
537 EmailMan.testOutboundDialog = new YAHOO.widget.Dialog("testOutboundDialog", {
541 constraintoviewport: true,
545 EmailMan.testOutboundDialog.setHeader("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}");
546 YAHOO.util.Dom.removeClass("testOutboundDialog", "yui-hidden");
549 EmailMan.testOutboundDialog.render();
550 EmailMan.testOutboundDialog.show();
553 function overlay(reqtitle, body, type) {
556 config.title = reqtitle;
558 YAHOO.SUGAR.MessageBox.show(config);
561 function hideOverlay() {
562 YAHOO.SUGAR.MessageBox.hide();
565 function notify_setrequired(f) {
567 document.getElementById("smtp_settings").style.display = (f.mail_sendtype.value == "SMTP") ? "inline" : "none";
568 document.getElementById("smtp_settings").style.visibility = (f.mail_sendtype.value == "SMTP") ? "visible" : "hidden";
569 document.getElementById("smtp_auth1").style.display = (document.getElementById('mail_smtpauth_req').checked) ? "" : "none";
570 document.getElementById("smtp_auth1").style.visibility = (document.getElementById('mail_smtpauth_req').checked) ? "visible" : "hidden";
571 document.getElementById("smtp_auth2").style.display = (document.getElementById('mail_smtpauth_req').checked) ? "" : "none";
572 document.getElementById("smtp_auth2").style.visibility = (document.getElementById('mail_smtpauth_req').checked) ? "visible" : "hidden";
573 if( document.getElementById('mail_smtpauth_req').checked)
574 YAHOO.util.Dom.removeClass('mail_allow_user', "yui-hidden");
576 YAHOO.util.Dom.addClass("mail_allow_user", "yui-hidden");
581 function setDefaultSMTPPort()
583 useSSLPort = !document.getElementById("mail_smtpssl").options[0].selected;
585 if ( useSSLPort && document.getElementById("mail_smtpport").value == '25' ) {
586 document.getElementById("mail_smtpport").value = '465';
588 if ( !useSSLPort && document.getElementById("mail_smtpport").value == '465' ) {
589 document.getElementById("mail_smtpport").value = '25';
595 * If the outlook options are all set on page load then enable the outlook field so that the user has an indication
596 * that that filter has been applied.
598 function setOutlookDefault()
600 var shouldToggle = true;
601 var aCheckFields = ['applet','base', 'embed','form','frame','frameset', 'iframe','import','layer','link', 'object', 'xmp'];
603 for(var i=0;i<aCheckFields.length;i++)
605 var tmpName = aCheckFields[i];
607 if( ! document.getElementById(tmpName).checked )
609 shouldToggle = false;
614 if(shouldToggle && !document.getElementById('style').checked)
615 document.getElementById('set_outlook_defaults').checked = true;
618 YAHOO.util.Event.onDOMReady(setOutlookDefault);
619 notify_setrequired(document.ConfigureSettings);
621 function changeEmailScreenDisplay(smtptype, clear)
624 document.getElementById("mail_smtpserver").value = '';
625 document.getElementById("mail_smtpport").value = '25';
626 document.getElementById("mail_smtpauth_req").checked = true;
627 document.getElementById("mailsettings1").style.display = '';
628 document.getElementById("mailsettings2").style.display = '';
629 document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPPASS}{literal}';
630 document.getElementById("mail_smtpport_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPPORT}{literal}';
631 document.getElementById("mail_smtpserver_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPSERVER}{literal}';
632 document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPUSER}{literal}';
637 document.getElementById("mail_smtpserver").value = 'plus.smtp.mail.yahoo.com';
638 document.getElementById("mail_smtpport").value = '465';
639 document.getElementById("mail_smtpauth_req").checked = true;
640 var ssl = document.getElementById("mail_smtpssl");
641 for(var j=0;j<ssl.options.length;j++) {
642 if(ssl.options[j].text == 'SSL') {
643 ssl.options[j].selected = true;
647 document.getElementById("mailsettings1").style.display = 'none';
648 document.getElementById("mailsettings2").style.display = 'none';
649 document.getElementById("mail_smtppass_label").innerHTML =
650 document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_YAHOOMAIL_SMTPPASS}{literal}';
651 document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_YAHOOMAIL_SMTPUSER}{literal}';
654 document.getElementById("mail_smtpserver").value = 'smtp.gmail.com';
655 document.getElementById("mail_smtpport").value = '587';
656 document.getElementById("mail_smtpauth_req").checked = true;
657 var ssl = document.getElementById("mail_smtpssl");
658 for(var j=0;j<ssl.options.length;j++) {
659 if(ssl.options[j].text == 'TLS') {
660 ssl.options[j].selected = true;
664 document.getElementById("mailsettings1").style.display = 'none';
665 document.getElementById("mailsettings2").style.display = 'none';
666 document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_GMAIL_SMTPPASS}{literal}';
667 document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_GMAIL_SMTPUSER}{literal}';
670 if ( document.getElementById("mail_smtpserver").value == 'plus.smtp.mail.yahoo.com'
671 || document.getElementById("mail_smtpserver").value == 'smtp.gmail.com' ) {
672 document.getElementById("mail_smtpserver").value = '';
674 //document.getElementById("mail_smtpport").value = '25';
675 //document.getElementById("mail_smtpauth_req").checked = true; bug 40998
676 document.getElementById("mailsettings1").style.display = '';
677 document.getElementById("mailsettings2").style.display = '';
678 document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPPASS}{literal}';
679 document.getElementById("mail_smtpport_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPPORT}{literal}';
680 document.getElementById("mail_smtpserver_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPSERVER}{literal}';
681 document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPUSER}{literal}';
684 setDefaultSMTPPort();
685 notify_setrequired(document.ConfigureSettings);
687 var oButtonGroup = new YAHOO.widget.ButtonGroup("smtpButtonGroup");
688 oButtonGroup.subscribe('checkedButtonChange', function(e)
690 changeEmailScreenDisplay(e.newValue.get('value'), true);
691 document.getElementById('smtp_settings').style.display = '';
692 document.getElementById('EditView').mail_smtptype.value = e.newValue.get('value');
694 YAHOO.widget.Button.addHiddenFieldsToForm(document.ConfigureSettings);
695 {/literal}{if !empty($mail_smtptype)}{literal}
696 changeEmailScreenDisplay("{/literal}{$mail_smtptype}{literal}", false);
697 {/literal}{/if}{literal}