]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/EmailMan/tpls/config.tpl
Release 6.2.0beta4
[Github/sugarcrm.git] / modules / EmailMan / tpls / config.tpl
1 <!--
2 /*********************************************************************************
3  * SugarCRM is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
5  * 
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.
12  * 
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
16  * details.
17  * 
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
21  * 02110-1301 USA.
22  * 
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.
25  * 
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.
29  * 
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  ********************************************************************************/
36
37 /*********************************************************************************
38
39  ********************************************************************************/
40 -->
41
42 <!-- BEGIN: main -->
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>
46 {literal}
47 <script type="text/javascript" >
48 <!--
49 function change_state(radiobutton) {
50
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}';
54         } else {
55                 radiobutton.form['massemailer_tracking_entities_location'].disabled=false;
56                 radiobutton.form['massemailer_tracking_entities_location'].value=null;
57         }
58 }
59 -->
60 </script>
61 {/literal}
62 {$ROLLOVER}
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" />
69
70 <table width="100%" cellpadding="0" cellspacing="0" border="0">
71         <tr>
72
73                 <td>
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} ">
76                 </td>
77                 <td align="right" nowrap>
78                         <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span> {$APP.NTC_REQUIRED}
79                 </td>
80         </tr>
81 </table>
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>
84                 </tr>
85                 <tr>
86                         <td align="left" scope="row" colspan="4">
87                                         {$MOD.LBL_OUTGOING_SECTION_HELP}
88                                         <br />&nbsp;
89                         </td>
90            </tr>
91                 <tr class="{$OUTBOUND_TYPE_CLASS}">
92                         <td width="20%" scope="row">{$MOD.LBL_MAIL_SENDTYPE}</td>
93                         <td width="30%">
94                                 <select id="mail_sendtype" name="mail_sendtype" onChange="notify_setrequired(document.ConfigureSettings); SUGAR.user.showHideGmailDefaultLink(this);" tabindex="1">{$mail_sendtype_options}</select>
95                         </td>
96                         <td scope="row">&nbsp;</td>
97                         <td >&nbsp;</td>
98                 </tr>
99                 <tr>
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>
102         </tr>
103                 <tr>
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>
106         </tr>
107                 <tr>
108             <td align="left" scope="row" colspan="4">{$MOD.LBL_CHOOSE_EMAIL_PROVIDER}</td>
109         </tr>
110         <tr>
111             <td colspan="4">
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                                 &nbsp;&nbsp;&nbsp;&nbsp;{$APP.LBL_SMTPTYPE_GMAIL}&nbsp;&nbsp;&nbsp;&nbsp;
117                             </button>
118                         </span>
119                     </span>
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                                 &nbsp;&nbsp;&nbsp;&nbsp;{$APP.LBL_SMTPTYPE_YAHOO}&nbsp;&nbsp;&nbsp;&nbsp;
124                             </button>
125                         </span>
126                     </span>
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                                 &nbsp;&nbsp;&nbsp;&nbsp;{$APP.LBL_SMTPTYPE_EXCHANGE}&nbsp;&nbsp;&nbsp;&nbsp;
131                             </button>
132                         </span>
133                     </span>
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                                 &nbsp;&nbsp;&nbsp;&nbsp;{$APP.LBL_TABGROUP_OTHER}&nbsp;&nbsp;&nbsp;&nbsp;
138                             </button>
139                         </span>
140                     </span>
141                 </div>
142             </td>
143         </tr>
144                 <tr>
145                         <td colspan="4">
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>
153                                                 </tr>
154                                                 <tr id="mailsettings2">
155                                                 <td scope="row"><span id='mail_smtpauth_req_label'>{$MOD.LBL_MAIL_SMTPAUTH_REQ}</span></td>
156                                                         <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}>
159                                                         </td>
160                                                     <td width="15%" scope="row"><span id="mail_smtpssl_label">{$APP.LBL_EMAIL_SMTP_SSL_OR_TLS}</span></td>
161                                                 <td width="35%" >
162                                                         <select id="mail_smtpssl" name="mail_smtpssl" tabindex="501" onchange="setDefaultSMTPPort();" >{$MAIL_SSL_OPTIONS}</select>
163                                                 </td>
164                                                 </tr>
165                                                 <tr id="smtp_auth1">
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%">&nbsp;</td>
169                             <td width="30%">&nbsp;</td>
170                        </tr>
171                        <tr id="smtp_auth2">
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%">&nbsp;</td>
175                             <td width="30%">&nbsp;</td>
176                        </tr>
177                                                 <tr id="mail_allow_user">
178                                                      <td width="20%" scope="row">
179                                                                         {$MOD.LBL_ALLOW_DEFAULT_SELECTION}&nbsp;
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">
181                                                         </td>
182                                                     <td width="30%">
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}>
185                                                         </td>
186                                                         <td width="20%">&nbsp;</td>
187                                                         <td width="30%">&nbsp;</td>
188                                                 </tr>
189                                         </table>
190                                  </div>
191                         </td>
192                 </tr>
193                 <tr><td colspan="4">&nbsp;</tr>
194                 <tr>
195                     <td width="15%"><input type="button" class="button" value="{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}" onclick="testOutboundSettings();">&nbsp;</td>
196                     <td width="15%">&nbsp;</td>
197             <td width="40%">&nbsp;</td>
198                     <td width="40%">&nbsp;</td>
199                 </tr>           
200 </table>
201 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
202         <tr>
203                 <th align="left" scope="row" colspan="4">
204                         <h4>{$MOD.LBL_NOTIFY_TITLE}</h4>
205                 </th>
206     </tr>
207     <tr>
208         <td width="20%" scope="row" valign='top'>
209            {$MOD.LBL_NOTIFY_ON}:&nbsp;
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">
211         </td>
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}>
214         </td>
215         <td scope="row" width="17%"></td>
216         <td></td>
217     </tr>
218      <tr>
219         <td width="20%" scope="row" valign='top'>
220            {$MOD.LBL_EMAIL_DEFAULT_DELETE_ATTACHMENTS}:&nbsp;
221         </td>
222         <td width="30%"  valign='top'>
223                 <input type='checkbox' name='email_default_delete_attachments' value="1" {$DEFAULT_EMAIL_DELETE_ATTACHMENTS}>
224         </td>
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">
228         </td>
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>
230     </tr>
231 </table>
232 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
233                         <tr>
234                                 <th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_SECURITY_TITLE}</h4></th>
235                         </tr>
236                         <tr>
237                                 <td align="left" scope="row" colspan="4">
238                                         {$MOD.LBL_SECURITY_DESC}
239                                 </td>
240                         </tr>
241                         <tr>
242                                 <td valign="middle" valign="top" scope="row" colspan="3">
243                                         {$MOD.LBL_SECURITY_OUTLOOK_DEFAULTS}
244                                 </td>
245                                 <td width="10%" NOWRAP valign="top" >
246                                         <input type="checkbox" value="1" name="set_outlook_defaults" id="set_outlook_defaults" onclick="setOutlookDefaults();">&nbsp;
247                                         {literal}
248                                         <script type="text/javascript" language="Javascript">
249                                         <!--
250                                                 function toggleAllSecurityOptions() {
251                                                         document.getElementById('set_outlook_defaults').checked = false;
252
253                                                         var check = false;
254
255                                                         if(document.getElementById('toggle_all').checked == true) {
256                                                                 check = true;
257                                                         }
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;
271                                                 }
272
273                                                 function setOutlookDefaults() {
274                                                         document.getElementById('toggle_all').checked = false;
275
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;
289                                                 }
290                     -->
291                                         </script>
292                                         {/literal}
293                                 </td>
294                         </tr>
295                         <tr>
296                                 <td valign="middle" valign="top" scope="row" colspan="3">
297                                         {$MOD.LBL_SECURITY_TOGGLE_ALL}
298                                 </td>
299                                 <td width="10%" NOWRAP valign="top" >
300                                         <input type="checkbox" value="1" name="toggle_all" id="toggle_all" onclick="toggleAllSecurityOptions();">&nbsp;
301                                 </td>
302                         </tr>
303                         <tr>
304                                 <td width="10%" valign="middle" scope="row">
305                                         {$MOD.LBL_SECURITY_APPLET}
306                                 </td>
307                                 <td width="40%" NOWRAP valign="middle" >
308                                         <input type="checkbox" value="1" name="applet" id="applet" {$appletChecked}>&nbsp; &lt;applet&gt;
309                                 </td>
310                                 <td width="10%" valign="middle" scope="row">
311                                         {$MOD.LBL_SECURITY_BASE}
312                                 </td>
313                                 <td width="40%" NOWRAP valign="middle" >
314                                         <input type="checkbox" value="1" name="base" id="base" {$baseChecked}>&nbsp; &lt;base&gt;
315                                 </td>
316                         </tr>
317                         <tr>
318                                 <td width="10%" valign="middle" scope="row">
319                                         {$MOD.LBL_SECURITY_EMBED}
320                                 </td>
321                                 <td width="40%" NOWRAP valign="middle" >
322                                         <input type="checkbox" value="1" name="embed" id="embed" {$embedChecked}>&nbsp; &lt;embed&gt;
323                                 </td>
324                                 <td width="10%" valign="middle" scope="row">
325                                         {$MOD.LBL_SECURITY_FORM}
326                                 </td>
327                                 <td width="40%" NOWRAP valign="middle" >
328                                         <input type="checkbox" value="1" name="form" id="form" {$formChecked}>&nbsp; &lt;form&gt;
329                                 </td>
330                         </tr>
331                         <tr>
332                                 <td width="10%" valign="middle" scope="row">
333                                         {$MOD.LBL_SECURITY_FRAME}
334                                 </td>
335                                 <td width="40%" NOWRAP valign="middle" >
336                                         <input type="checkbox" value="1" name="frame" id="frame" {$frameChecked}>&nbsp; &lt;frame&gt;
337                                 </td>
338                                 <td width="10%" valign="middle" scope="row">
339                                         {$MOD.LBL_SECURITY_FRAMESET}
340                                 </td>
341                                 <td width="40%" NOWRAP valign="middle" >
342                                         <input type="checkbox" value="1" name="frameset" id="frameset" {$framesetChecked}>&nbsp; &lt;frameset&gt;
343                                 </td>
344                         </tr>
345                         <tr>
346                                 <td width="10%" valign="middle" scope="row">
347                                         {$MOD.LBL_SECURITY_IFRAME}
348                                 </td>
349                                 <td width="40%" NOWRAP valign="middle" >
350                                         <input type="checkbox" value="1" name="iframe" id="iframe" {$iframeChecked}>&nbsp; &lt;iframe&gt;
351                                 </td>
352                                 <td width="10%" valign="middle" scope="row">
353                                         {$MOD.LBL_SECURITY_IMPORT}
354                                 </td>
355                                 <td width="40%" NOWRAP valign="middle" >
356                                         <input type="checkbox" value="1" name="import" id="import" {$importChecked}>&nbsp; &lt;import&gt;
357                                 </td>
358                         </tr>
359                         <tr>
360                                 <td width="10%" valign="middle" scope="row">
361                                         {$MOD.LBL_SECURITY_LAYER}
362                                 </td>
363                                 <td width="40%" NOWRAP valign="middle" >
364                                         <input type="checkbox" value="1" name="layer" id="layer" {$layerChecked}>&nbsp; &lt;layer&gt;
365                                 </td>
366                                 <td width="10%" valign="middle" scope="row">
367                                         {$MOD.LBL_SECURITY_LINK}
368                                 </td>
369                                 <td width="40%" NOWRAP valign="middle" >
370                                         <input type="checkbox" value="1" name="link" id="link" {$linkChecked}>&nbsp; &lt;link&gt;
371                                 </td>
372                         </tr>
373                         <tr>
374                                 <td width="10%" valign="middle" scope="row">
375                                         {$MOD.LBL_SECURITY_OBJECT}
376                                 </td>
377                                 <td width="40%" NOWRAP valign="middle" >
378                                         <input type="checkbox" value="1" name="object" id="object" {$objectChecked}>&nbsp; &lt;object&gt;
379                                 </td>
380                                 <td width="10%" valign="middle" scope="row">
381                                         {$MOD.LBL_SECURITY_STYLE}
382                                 </td>
383                                 <td width="40%" NOWRAP valign="middle" >
384                                         <input type="checkbox" value="1" name="style" id="style" {$styleChecked}>&nbsp; &lt;style&gt;
385                                 </td>
386                         </tr>
387                         <tr>
388                                 <td width="10%" valign="middle" scope="row">
389                                         {$MOD.LBL_SECURITY_XMP}
390                                 </td>
391                                 <td width="40%" NOWRAP valign="middle" >
392                                         <input type="checkbox" value="1" name="xmp" id="xmp" {$xmpChecked}>&nbsp; &lt;xmp&gt;
393                                 </td>
394                                 <td scope="row">&nbsp;</td>
395                                 <td>&nbsp;</td>
396                 </tr>
397 </table>
398 </td>
399 </tr>
400 </table>
401 <div id="testOutboundDialog" class="yui-hidden">
402     <div id="testOutbound">
403                 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
404                         <tr>
405                                 <td scope="row">
406                                         {$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}
407                                         <span class="required">
408                                                 {$APP.LBL_REQUIRED_SYMBOL}
409                                         </span>
410                                 </td>
411                                 <td >
412                                         <input type="text" id="outboundtest_from_address" name="outboundtest_from_address" size="35" maxlength="64" value="{$CURRENT_USER_EMAIL}">
413                                 </td>
414                         </tr>
415                         <tr>
416                                 <td scope="row" colspan="2">
417                                         <input type="button" class="button" value="   {$APP.LBL_EMAIL_SEND}   " onclick="javascript:sendTestEmail();">&nbsp;
418                                         <input type="button" class="button" value="   {$APP.LBL_CANCEL_BUTTON_LABEL}   " onclick="javascript:EmailMan.testOutboundDialog.hide();">&nbsp;
419                                 </td>
420                         </tr>
421
422                 </table>
423         </div>
424 </div>
425
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} ">
429 </div>
430
431         </form>
432 {$JAVASCRIPT}
433 {literal}
434 <script type="text/javascript">
435 <!--
436 var loader = new YAHOO.util.YUILoader({
437     require : ["element","sugarwidgets"],
438     loadOptional: true,
439     skin: { base: 'blank', defaultSkin: '' },
440     allowRollup: true,
441     base: "include/javascript/yui/build/"
442 });
443 loader.addModule({
444     name :"sugarwidgets",
445     type : "js",
446     fullpath: "include/javascript/sugarwidgets/SugarYUIWidgets.js",
447     varName: "YAHOO.SUGAR",
448     requires: ["datatable", "dragdrop", "treeview", "tabview"]
449 });
450 loader.insert();
451
452 EmailMan = {};
453
454 function testOutboundSettings() {
455         if (document.getElementById('mail_sendtype').value == 'sendmail') {
456                 testOutboundSettingsDialog();
457                 return;
458         }
459         var errorMessage = '';
460         var isError = false;
461         var fromAddress = document.getElementById("outboundtest_from_address").value;
462     var errorMessage = '';
463     var isError = false;
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) == '') {
469         isError = true;
470         errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPSERVER}{literal}" + "<br/>";
471     }
472     if(trim(smtpPort) == '') {
473         isError = true;
474         errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPPORT}{literal}" + "<br/>";
475     }
476     if(mailsmtpauthreq.checked) {
477         if(trim(document.getElementById('mail_smtpuser').value) == '') {
478             isError = true;
479             errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPUSER}{literal}" + "<br/>";
480         }
481     }
482     if(isError) {
483         overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
484         return false;
485     }
486
487     testOutboundSettingsDialog();
488
489 }
490
491 function sendTestEmail()
492 {
493     var toAddress = document.getElementById("outboundtest_from_address").value;
494     var fromAddress = document.getElementById("notify_fromaddress").value;
495     if (trim(toAddress) == "")
496     {
497         overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
498         return;
499     }
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');
502         return;
503     }
504     if (trim(fromAddress) == "")
505     {
506         overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_ADDR}{literal}", 'alert');
507         return;
508     }
509     else if (!isValidEmail(fromAddress)) {
510         overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_ADDR}{literal}", 'alert');
511         return;
512     }
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');
516
517     var callbackOutboundTest = {
518         success : function(o) {
519                 hideOverlay();
520                 overlay("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}", "{/literal}{$APP.LBL_EMAIL_TEST_NOTIFICATION_SENT}{literal}", 'alert');
521         }
522     };
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;
531
532         YAHOO.util.Connect.asyncRequest("POST", "index.php?action=testOutboundEmail&module=EmailMan&to_pdf=true&sugar_body_only=true", callbackOutboundTest, postDataString);
533 }
534 function testOutboundSettingsDialog() {
535         // lazy load dialogue
536         if(!EmailMan.testOutboundDialog) {
537                 EmailMan.testOutboundDialog = new YAHOO.widget.Dialog("testOutboundDialog", {
538                 modal:true,
539                                 visible:true,
540                 fixedcenter:true,
541                 constraintoviewport: true,
542                 width   : 600,
543                 shadow  : false
544             });
545             EmailMan.testOutboundDialog.setHeader("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}");
546             YAHOO.util.Dom.removeClass("testOutboundDialog", "yui-hidden");
547         } // end lazy load
548
549         EmailMan.testOutboundDialog.render();
550         EmailMan.testOutboundDialog.show();
551 } // fn
552
553 function overlay(reqtitle, body, type) {
554     var config = { };
555     config.type = type;
556     config.title = reqtitle;
557     config.msg = body;
558     YAHOO.SUGAR.MessageBox.show(config);
559 }
560
561 function hideOverlay() {
562         YAHOO.SUGAR.MessageBox.hide();
563 }
564
565 function notify_setrequired(f) {
566
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");
575         else
576            YAHOO.util.Dom.addClass("mail_allow_user", "yui-hidden");
577
578         return true;
579 }
580
581 function setDefaultSMTPPort() 
582 {
583     useSSLPort = !document.getElementById("mail_smtpssl").options[0].selected;
584     
585     if ( useSSLPort && document.getElementById("mail_smtpport").value == '25' ) {
586         document.getElementById("mail_smtpport").value = '465';
587     }
588     if ( !useSSLPort && document.getElementById("mail_smtpport").value == '465' ) {
589         document.getElementById("mail_smtpport").value = '25';
590     }
591         
592 }
593
594 /**
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.
597 */
598 function setOutlookDefault()
599 {
600     var shouldToggle = true;
601     var aCheckFields = ['applet','base', 'embed','form','frame','frameset', 'iframe','import','layer','link', 'object', 'xmp'];
602
603     for(var i=0;i<aCheckFields.length;i++)
604     {
605         var tmpName = aCheckFields[i];
606
607         if( ! document.getElementById(tmpName).checked )
608         {
609             shouldToggle = false;
610             break;
611         }
612     }
613
614     if(shouldToggle && !document.getElementById('style').checked)
615         document.getElementById('set_outlook_defaults').checked = true;
616
617 }
618 YAHOO.util.Event.onDOMReady(setOutlookDefault);
619 notify_setrequired(document.ConfigureSettings);
620
621 function changeEmailScreenDisplay(smtptype, clear)
622 {
623     if(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}';
633     }
634
635     switch (smtptype) {
636     case "yahoomail":
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;
644                 break;
645             }
646         }
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}';
652         break;
653     case "gmail":
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;
661                 break;
662             }
663         }
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}';
668         break;
669     case "exchange":
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 = '';
673         }
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}';
682         break;
683     }
684     setDefaultSMTPPort();
685     notify_setrequired(document.ConfigureSettings);
686 }
687 var oButtonGroup = new YAHOO.widget.ButtonGroup("smtpButtonGroup");
688 oButtonGroup.subscribe('checkedButtonChange', function(e)
689 {
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');
693 });
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}
698 -->
699 </script>
700 {/literal}