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" 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">
84 <table width="100%" border="0" cellspacing="0" cellpadding="0">
85 <tr><th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_EMAIL_OUTBOUND_CONFIGURATION}</h4></th>
88 <td align="left" scope="row" colspan="4">
89 {$MOD.LBL_OUTGOING_SECTION_HELP}
93 <tr class="{$OUTBOUND_TYPE_CLASS}">
94 <td width="20%" scope="row">{$MOD.LBL_MAIL_SENDTYPE}</td>
96 <select id="mail_sendtype" name="mail_sendtype" onChange="notify_setrequired(document.ConfigureSettings); SUGAR.user.showHideGmailDefaultLink(this);" tabindex="1">{$mail_sendtype_options}</select>
98 <td scope="row"> </td>
102 <td width="20%" scope="row">{$MOD.LBL_NOTIFY_FROMNAME} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
103 <td width="30%" > <input id='notify_fromname' name='notify_fromname' tabindex='1' size='25' maxlength='128' type="text" value="{$notify_fromname}"></td>
106 <td width="20%" scope="row">{$MOD.LBL_NOTIFY_FROMADDRESS} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
107 <td width="30%"><input id='notify_fromaddress' name='notify_fromaddress' tabindex='1' size='25' maxlength='128' type="text" value="{$notify_fromaddress}"></td>
110 <td align="left" scope="row" colspan="4">{$MOD.LBL_CHOOSE_EMAIL_PROVIDER}</td>
114 <div id="smtpButtonGroup" class="yui-buttongroup">
115 <span id="gmail" class="yui-button yui-radio-button{if $mail_smtptype == 'gmail'} yui-button-checked{/if}">
116 <span class="first-child">
117 <button type="button" name="mail_smtptype" value="gmail">
118 {$APP.LBL_SMTPTYPE_GMAIL}
122 <span id="yahoomail" class="yui-button yui-radio-button{if $mail_smtptype == 'yahoomail'} yui-button-checked{/if}">
123 <span class="first-child">
124 <button type="button" name="mail_smtptype" value="yahoomail">
125 {$APP.LBL_SMTPTYPE_YAHOO}
129 <span id="exchange" class="yui-button yui-radio-button{if $mail_smtptype == 'exchange'} yui-button-checked{/if}">
130 <span class="first-child">
131 <button type="button" name="mail_smtptype" value="exchange">
132 {$APP.LBL_SMTPTYPE_EXCHANGE}
136 <span id="other" class="yui-button yui-radio-button{if $mail_smtptype == 'other' || empty($mail_smtptype)} yui-button-checked{/if}">
137 <span class="first-child">
138 <button type="button" name="mail_smtptype" value="other">
139 {$APP.LBL_TABGROUP_OTHER}
148 <div id="smtp_settings">
149 <table width="100%" cellpadding="0" cellspacing="0">
150 <tr id="mailsettings1">
151 <td width="20%" scope="row"><span id="mail_smtpserver_label">{$MOD.LBL_MAIL_SMTPSERVER}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
152 <td width="30%" ><input type="text" id="mail_smtpserver" name="mail_smtpserver" tabindex="1" size="25" maxlength="64" value="{$mail_smtpserver}"></td>
153 <td width="20%" scope="row"><span id="mail_smtpport_label">{$MOD.LBL_MAIL_SMTPPORT}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
154 <td width="30%" ><input type="text" id="mail_smtpport" name="mail_smtpport" tabindex="1" size="5" maxlength="5" value="{$mail_smtpport}"></td>
156 <tr id="mailsettings2">
157 <td scope="row"><span id='mail_smtpauth_req_label'>{$MOD.LBL_MAIL_SMTPAUTH_REQ}</span></td>
159 <input id='mail_smtpauth_req' name='mail_smtpauth_req' type="checkbox" class="checkbox" value="1" tabindex='1'
160 onclick="notify_setrequired(document.ConfigureSettings);" {$mail_smtpauth_req}>
162 <td width="15%" scope="row"><span id="mail_smtpssl_label">{$APP.LBL_EMAIL_SMTP_SSL_OR_TLS}</span></td>
164 <select id="mail_smtpssl" name="mail_smtpssl" tabindex="501">{$MAIL_SSL_OPTIONS}</select>
168 <td width="20%" scope="row"><span id="mail_smtpuser_label">{$MOD.LBL_MAIL_SMTPUSER}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
169 <td width="30%" ><input type="text" id="mail_smtpuser" name="mail_smtpuser" size="25" maxlength="64" value="{$mail_smtpuser}" tabindex='1' ></td>
170 <td width="20%"> </td>
171 <td width="30%"> </td>
174 <td width="20%" scope="row"><span id="mail_smtppass_label">{$MOD.LBL_MAIL_SMTPPASS}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
175 <td width="30%" ><input type="password" id="mail_smtppass" name="mail_smtppass" size="25" maxlength="64" value="{$mail_smtppass}" tabindex='1'></td>
176 <td width="20%"> </td>
177 <td width="30%"> </td>
179 <tr id="mail_allow_user">
180 <td width="20%" scope="row">
181 {$MOD.LBL_ALLOW_DEFAULT_SELECTION}
182 <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">
185 <input type='hidden' name='notify_allow_default_outbound' value='0'>
186 <input name='notify_allow_default_outbound' value="2" tabindex='1' class="checkbox" type="checkbox" {$notify_allow_default_outbound_on}>
188 <td width="20%"> </td>
189 <td width="30%"> </td>
195 <tr><td colspan="4"> </tr>
197 <td width="15%"><input type="button" class="button" value="{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}" onclick="testOutboundSettings();"> </td>
198 <td width="15%"> </td>
199 <td width="40%"> </td>
200 <td width="40%"> </td>
205 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
208 <table width="100%" border="0" cellspacing="0" cellpadding="0">
210 <th align="left" scope="row" colspan="4">
211 <h4>{$MOD.LBL_NOTIFY_TITLE}</h4>
215 <td width="20%" scope="row" valign='top'>
216 {$MOD.LBL_NOTIFY_ON}:
217 <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">
219 <td width="30%" valign='top'>
220 <input type='hidden' name='notify_on' value='0'><input name="notify_on" tabindex='1' value="1" class="checkbox" type="checkbox" {$notify_on}>
222 <td scope="row" width="17%"></td>
226 <td width="20%" scope="row" valign='top'>
227 {$MOD.LBL_EMAIL_DEFAULT_DELETE_ATTACHMENTS}:
229 <td width="30%" valign='top'>
230 <input type='checkbox' name='email_default_delete_attachments' value="1" {$DEFAULT_EMAIL_DELETE_ATTACHMENTS}>
232 <td scope="row" width="20%">
233 {$MOD.LBL_NOTIFY_SEND_FROM_ASSIGNING_USER}:
234 <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">
236 <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>
239 <td colspan='4' scope="row"> </td>
244 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
246 <table width="100%" border="0" cellspacing="0" cellpadding="0">
248 <th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_SECURITY_TITLE}</h4></th>
251 <td align="left" scope="row" colspan="4">
252 {$MOD.LBL_SECURITY_DESC}
257 <td width="10%" NOWRAP scope="row" valign="top" >
258 <input type="checkbox" value="1" name="set_outlook_defaults" id="set_outlook_defaults" onclick="setOutlookDefaults();">
260 <script type="text/javascript" language="Javascript">
262 function toggleAllSecurityOptions() {
263 document.getElementById('set_outlook_defaults').checked = false;
267 if(document.getElementById('toggle_all').checked == true) {
270 document.getElementById('applet').checked = check;
271 document.getElementById('base').checked = check;
272 document.getElementById('embed').checked = check;
273 document.getElementById('form').checked = check;
274 document.getElementById('frame').checked = check;
275 document.getElementById('frameset').checked = check;
276 document.getElementById('iframe').checked = check;
277 document.getElementById('import').checked = check;
278 document.getElementById('layer').checked = check;
279 document.getElementById('link').checked = check;
280 document.getElementById('object').checked = check;
281 document.getElementById('style').checked = check;
282 document.getElementById('xmp').checked = check;
285 function setOutlookDefaults() {
286 document.getElementById('toggle_all').checked = false;
288 document.getElementById('applet').checked = true;
289 document.getElementById('base').checked = true;
290 document.getElementById('embed').checked = true;
291 document.getElementById('form').checked = true;
292 document.getElementById('frame').checked = true;
293 document.getElementById('frameset').checked = true;
294 document.getElementById('iframe').checked = true;
295 document.getElementById('import').checked = true;
296 document.getElementById('layer').checked = true;
297 document.getElementById('link').checked = true;
298 document.getElementById('object').checked = true;
299 document.getElementById('style').checked = false;
300 document.getElementById('xmp').checked = true;
306 <td valign="middle" valign="top" scope="row" colspan="3">
307 {$MOD.LBL_SECURITY_OUTLOOK_DEFAULTS}
311 <td colspan="4"> </td>
314 <td width="10%" NOWRAP scope="row" valign="top" >
315 <input type="checkbox" value="1" name="toggle_all" id="toggle_all" onclick="toggleAllSecurityOptions();">
317 <td valign="middle" valign="top" scope="row" colspan="3">
318 {$MOD.LBL_SECURITY_TOGGLE_ALL}
322 <td colspan="4"> </td>
325 <td width="10%" NOWRAP scope="row" valign="middle" >
326 <input type="checkbox" value="1" name="applet" id="applet" {$appletChecked}> <applet>
328 <td width="40%" valign="middle" scope="row">
329 {$MOD.LBL_SECURITY_APPLET}
331 <td width="10%" NOWRAP scope="row" valign="middle" >
332 <input type="checkbox" value="1" name="base" id="base" {$baseChecked}> <base>
334 <td width="40%" valign="middle" scope="row">
335 {$MOD.LBL_SECURITY_BASE}
339 <td width="10%" NOWRAP scope="row" valign="middle" >
340 <input type="checkbox" value="1" name="embed" id="embed" {$embedChecked}> <embed>
342 <td width="40%" valign="middle" scope="row">
343 {$MOD.LBL_SECURITY_EMBED}
345 <td width="10%" NOWRAP scope="row" valign="middle" >
346 <input type="checkbox" value="1" name="form" id="form" {$formChecked}> <form>
348 <td width="40%" valign="middle" scope="row">
349 {$MOD.LBL_SECURITY_FORM}
353 <td width="10%" NOWRAP scope="row" valign="middle" >
354 <input type="checkbox" value="1" name="frame" id="frame" {$frameChecked}> <frame>
356 <td width="40%" valign="middle" scope="row">
357 {$MOD.LBL_SECURITY_FRAME}
359 <td width="10%" NOWRAP scope="row" valign="middle" >
360 <input type="checkbox" value="1" name="frameset" id="frameset" {$framesetChecked}> <frameset>
362 <td width="40%" valign="middle" scope="row">
363 {$MOD.LBL_SECURITY_FRAMESET}
367 <td width="10%" NOWRAP scope="row" valign="middle" >
368 <input type="checkbox" value="1" name="iframe" id="iframe" {$iframeChecked}> <iframe>
370 <td width="40%" valign="middle" scope="row">
371 {$MOD.LBL_SECURITY_IFRAME}
373 <td width="10%" NOWRAP scope="row" valign="middle" >
374 <input type="checkbox" value="1" name="import" id="import" {$importChecked}> <import>
376 <td width="40%" valign="middle" scope="row">
377 {$MOD.LBL_SECURITY_IMPORT}
381 <td width="10%" NOWRAP scope="row" valign="middle" >
382 <input type="checkbox" value="1" name="layer" id="layer" {$layerChecked}> <layer>
384 <td width="40%" valign="middle" scope="row">
385 {$MOD.LBL_SECURITY_LAYER}
387 <td width="10%" NOWRAP scope="row" valign="middle" >
388 <input type="checkbox" value="1" name="link" id="link" {$linkChecked}> <link>
390 <td width="40%" valign="middle" scope="row">
391 {$MOD.LBL_SECURITY_LINK}
395 <td width="10%" NOWRAP scope="row" valign="middle" >
396 <input type="checkbox" value="1" name="object" id="object" {$objectChecked}> <object>
398 <td width="40%" valign="middle" scope="row">
399 {$MOD.LBL_SECURITY_OBJECT}
401 <td width="10%" NOWRAP scope="row" valign="middle" >
402 <input type="checkbox" value="1" name="style" id="style" {$styleChecked}> <style>
404 <td width="40%" valign="middle" scope="row">
405 {$MOD.LBL_SECURITY_STYLE}
409 <td width="10%" NOWRAP scope="row" valign="middle" >
410 <input type="checkbox" value="1" name="xmp" id="xmp" {$xmpChecked}> <xmp>
412 <td width="40%" valign="middle" scope="row">
413 {$MOD.LBL_SECURITY_XMP}
423 <div id="testOutboundDialog" class="yui-hidden">
424 <div id="testOutbound">
425 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
428 {$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}
429 <span class="required">
430 {$APP.LBL_REQUIRED_SYMBOL}
434 <input type="text" id="outboundtest_from_address" name="outboundtest_from_address" size="35" maxlength="64" value="{$CURRENT_USER_EMAIL}">
438 <td scope="row" colspan="2">
439 <input type="button" class="button" value=" {$APP.LBL_EMAIL_SEND} " onclick="javascript:sendTestEmail();">
440 <input type="button" class="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " onclick="javascript:EmailMan.testOutboundDialog.hide();">
448 <div style="padding-top:2px;">
449 <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button" onclick="this.form.action.value='Save';return verify_data(this);" type="submit" name="button" value=" {$APP.LBL_SAVE_BUTTON_LABEL} ">
450 <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} ">
456 <script type="text/javascript">
458 var loader = new YAHOO.util.YUILoader({
459 require : ["element","sugarwidgets"],
461 skin: { base: 'blank', defaultSkin: '' },
463 base: "include/javascript/yui/build/"
466 name :"sugarwidgets",
468 fullpath: "include/javascript/sugarwidgets/SugarYUIWidgets.js",
469 varName: "YAHOO.SUGAR",
470 requires: ["datatable", "dragdrop", "treeview", "tabview"]
476 function testOutboundSettings() {
477 if (document.getElementById('mail_sendtype').value == 'sendmail') {
478 testOutboundSettingsDialog();
481 var errorMessage = '';
483 var fromAddress = document.getElementById("outboundtest_from_address").value;
484 var errorMessage = '';
486 var smtpServer = document.getElementById('mail_smtpserver').value;
487 var smtpPort = document.getElementById('mail_smtpport').value;
488 var smtpssl = document.getElementById('mail_smtpssl').value;
489 var mailsmtpauthreq = document.getElementById('mail_smtpauth_req');
490 if(trim(smtpServer) == '') {
492 errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPSERVER}{literal}" + "<br/>";
494 if(trim(smtpPort) == '') {
496 errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPPORT}{literal}" + "<br/>";
498 if(mailsmtpauthreq.checked) {
499 if(trim(document.getElementById('mail_smtpuser').value) == '') {
501 errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPUSER}{literal}" + "<br/>";
503 if(trim(document.getElementById('mail_smtppass').value) == '') {
505 errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPPASS}{literal}" + "<br/>";
509 overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
513 testOutboundSettingsDialog();
517 function sendTestEmail()
519 var toAddress = document.getElementById("outboundtest_from_address").value;
520 var fromAddress = document.getElementById("notify_fromaddress").value;
521 if (trim(toAddress) == "")
523 overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
526 else if (!isValidEmail(toAddress)) {
527 overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
530 if (trim(fromAddress) == "")
532 overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_ADDR}{literal}", 'alert');
535 else if (!isValidEmail(fromAddress)) {
536 overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_ADDR}{literal}", 'alert');
539 //Hide the email address window and show a message notifying the user that the test email is being sent.
540 EmailMan.testOutboundDialog.hide();
541 overlay("{/literal}{$APP.LBL_EMAIL_PERFORMING_TASK}{literal}", "{/literal}{$APP.LBL_EMAIL_ONE_MOMENT}{literal}", 'alert');
543 var callbackOutboundTest = {
544 success : function(o) {
546 overlay("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}", "{/literal}{$APP.LBL_EMAIL_TEST_NOTIFICATION_SENT}{literal}", 'alert');
549 var smtpServer = document.getElementById('mail_smtpserver').value;
550 var smtpPort = document.getElementById('mail_smtpport').value;
551 var smtpssl = document.getElementById('mail_smtpssl').value;
552 var mailsmtpauthreq = document.getElementById('mail_smtpauth_req');
553 var mail_sendtype = document.getElementById('mail_sendtype').value;
554 var postDataString = 'mail_sendtype=' + mail_sendtype + '&mail_smtpserver=' + smtpServer + "&mail_smtpport=" + smtpPort + "&mail_smtpssl=" + smtpssl +
555 "&mail_smtpauth_req=" + mailsmtpauthreq.checked + "&mail_smtpuser=" + trim(document.getElementById('mail_smtpuser').value) +
556 "&mail_smtppass=" + trim(document.getElementById('mail_smtppass').value) + "&outboundtest_to_address=" + toAddress + "&outboundtest_from_address=" + fromAddress;
558 YAHOO.util.Connect.asyncRequest("POST", "index.php?action=testOutboundEmail&module=EmailMan&to_pdf=true&sugar_body_only=true", callbackOutboundTest, postDataString);
560 function testOutboundSettingsDialog() {
561 // lazy load dialogue
562 if(!EmailMan.testOutboundDialog) {
563 EmailMan.testOutboundDialog = new YAHOO.widget.Dialog("testOutboundDialog", {
567 constraintoviewport: true,
571 EmailMan.testOutboundDialog.setHeader("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}");
572 YAHOO.util.Dom.removeClass("testOutboundDialog", "yui-hidden");
575 EmailMan.testOutboundDialog.render();
576 EmailMan.testOutboundDialog.show();
579 function overlay(reqtitle, body, type) {
582 config.title = reqtitle;
584 YAHOO.SUGAR.MessageBox.show(config);
587 function hideOverlay() {
588 YAHOO.SUGAR.MessageBox.hide();
591 function notify_setrequired(f) {
593 document.getElementById("smtp_settings").style.display = (f.mail_sendtype.value == "SMTP") ? "inline" : "none";
594 document.getElementById("smtp_settings").style.visibility = (f.mail_sendtype.value == "SMTP") ? "visible" : "hidden";
595 document.getElementById("smtp_auth1").style.display = (document.getElementById('mail_smtpauth_req').checked) ? "" : "none";
596 document.getElementById("smtp_auth1").style.visibility = (document.getElementById('mail_smtpauth_req').checked) ? "visible" : "hidden";
597 document.getElementById("smtp_auth2").style.display = (document.getElementById('mail_smtpauth_req').checked) ? "" : "none";
598 document.getElementById("smtp_auth2").style.visibility = (document.getElementById('mail_smtpauth_req').checked) ? "visible" : "hidden";
599 if( document.getElementById('mail_smtpauth_req').checked)
600 YAHOO.util.Dom.removeClass('mail_allow_user', "yui-hidden");
602 YAHOO.util.Dom.addClass("mail_allow_user", "yui-hidden");
607 * If the outlook options are all set on page load then enable the outlook field so that the user has an indication
608 * that that filter has been applied.
610 function setOutlookDefault()
612 var shouldToggle = true;
613 var aCheckFields = ['applet','base', 'embed','form','frame','frameset', 'iframe','import','layer','link', 'object', 'xmp'];
615 for(var i=0;i<aCheckFields.length;i++)
617 var tmpName = aCheckFields[i];
619 if( ! document.getElementById(tmpName).checked )
621 shouldToggle = false;
626 if(shouldToggle && !document.getElementById('style').checked)
627 document.getElementById('set_outlook_defaults').checked = true;
630 YAHOO.util.Event.onDOMReady(setOutlookDefault);
631 notify_setrequired(document.ConfigureSettings);
633 function changeEmailScreenDisplay(smtptype, clear)
636 document.getElementById("mail_smtpserver").value = '';
637 document.getElementById("mail_smtpport").value = '25';
638 document.getElementById("mail_smtpauth_req").checked = true;
639 document.getElementById("mailsettings1").style.display = '';
640 document.getElementById("mailsettings2").style.display = '';
641 document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPPASS}{literal}';
642 document.getElementById("mail_smtpport_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPPORT}{literal}';
643 document.getElementById("mail_smtpserver_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPSERVER}{literal}';
644 document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPUSER}{literal}';
649 document.getElementById("mail_smtpserver").value = 'plus.smtp.mail.yahoo.com';
650 document.getElementById("mail_smtpport").value = '465';
651 document.getElementById("mail_smtpauth_req").checked = true;
652 var ssl = document.getElementById("mail_smtpssl");
653 for(var j=0;j<ssl.options.length;j++) {
654 if(ssl.options[j].text == 'SSL') {
655 ssl.options[j].selected = true;
659 document.getElementById("mailsettings1").style.display = 'none';
660 document.getElementById("mailsettings2").style.display = 'none';
661 document.getElementById("mail_smtppass_label").innerHTML =
662 document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_YAHOOMAIL_SMTPPASS}{literal}';
663 document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_YAHOOMAIL_SMTPUSER}{literal}';
666 document.getElementById("mail_smtpserver").value = 'smtp.gmail.com';
667 document.getElementById("mail_smtpport").value = '587';
668 document.getElementById("mail_smtpauth_req").checked = true;
669 var ssl = document.getElementById("mail_smtpssl");
670 for(var j=0;j<ssl.options.length;j++) {
671 if(ssl.options[j].text == 'TLS') {
672 ssl.options[j].selected = true;
676 document.getElementById("mailsettings1").style.display = 'none';
677 document.getElementById("mailsettings2").style.display = 'none';
678 document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_GMAIL_SMTPPASS}{literal}';
679 document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_GMAIL_SMTPUSER}{literal}';
682 if ( document.getElementById("mail_smtpserver").value == 'plus.smtp.mail.yahoo.com'
683 || document.getElementById("mail_smtpserver").value == 'smtp.gmail.com' ) {
684 document.getElementById("mail_smtpserver").value = '';
686 //document.getElementById("mail_smtpport").value = '25';
687 document.getElementById("mail_smtpauth_req").checked = true;
688 document.getElementById("mailsettings1").style.display = '';
689 document.getElementById("mailsettings2").style.display = '';
690 document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPPASS}{literal}';
691 document.getElementById("mail_smtpport_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPPORT}{literal}';
692 document.getElementById("mail_smtpserver_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPSERVER}{literal}';
693 document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPUSER}{literal}';
696 notify_setrequired(document.ConfigureSettings);
698 var oButtonGroup = new YAHOO.widget.ButtonGroup("smtpButtonGroup");
699 oButtonGroup.subscribe('checkedButtonChange', function(e)
701 changeEmailScreenDisplay(e.newValue.get('value'), true);
702 document.getElementById('smtp_settings').style.display = '';
703 document.getElementById('EditView').mail_smtptype.value = e.newValue.get('value');
705 YAHOO.widget.Button.addHiddenFieldsToForm(document.ConfigureSettings);
706 {/literal}{if !empty($mail_smtptype)}{literal}
707 changeEmailScreenDisplay("{/literal}{$mail_smtptype}{literal}", false);
708 {/literal}{/if}{literal}