]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/EmailMan/tpls/config.tpl
Release 6.2.2
[Github/sugarcrm.git] / modules / EmailMan / tpls / config.tpl
1 <!--
2 /*********************************************************************************
3  * SugarCRM Community Edition 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%" >
174                             <input type="password" id="mail_smtppass" name="mail_smtppass" size="25" maxlength="64" tabindex='1'>
175                             <a href="javascript:void(0)" id='mail_smtppass_link' onClick="SUGAR.util.setEmailPasswordEdit('mail_smtppass')" style="display: none">{$APP.LBL_CHANGE_PASSWORD}</a>
176                             </td>
177                             <td width="20%">&nbsp;</td>
178                             <td width="30%">&nbsp;</td>
179                        </tr>
180                                                 <tr id="mail_allow_user">
181                                                      <td width="20%" scope="row">
182                                                                         {$MOD.LBL_ALLOW_DEFAULT_SELECTION}&nbsp;
183                                                                         <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">
184                                                         </td>
185                                                     <td width="30%">
186                                                              <input type='hidden' name='notify_allow_default_outbound' value='0'>
187                                                              <input name='notify_allow_default_outbound' value="2" tabindex='1' class="checkbox" type="checkbox" {$notify_allow_default_outbound_on}>
188                                                         </td>
189                                                         <td width="20%">&nbsp;</td>
190                                                         <td width="30%">&nbsp;</td>
191                                                 </tr>
192                                         </table>
193                                  </div>
194                         </td>
195                 </tr>
196                 <tr><td colspan="4">&nbsp;</tr>
197                 <tr>
198                     <td width="15%"><input type="button" class="button" value="{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}" onclick="testOutboundSettings();">&nbsp;</td>
199                     <td width="15%">&nbsp;</td>
200             <td width="40%">&nbsp;</td>
201                     <td width="40%">&nbsp;</td>
202                 </tr>           
203 </table>
204 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
205         <tr>
206                 <th align="left" scope="row" colspan="4">
207                         <h4>{$MOD.LBL_NOTIFY_TITLE}</h4>
208                 </th>
209     </tr>
210     <tr>
211         <td width="20%" scope="row" valign='top'>
212            {$MOD.LBL_NOTIFY_ON}:&nbsp;
213                 <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">
214         </td>
215         <td width="30%"  valign='top'>
216                 <input type='hidden' name='notify_on' value='0'><input name="notify_on" tabindex='1' value="1" class="checkbox" type="checkbox" {$notify_on}>
217         </td>
218         <td scope="row" width="17%"></td>
219         <td></td>
220     </tr>
221      <tr>
222         <td width="20%" scope="row" valign='top'>
223            {$MOD.LBL_EMAIL_DEFAULT_DELETE_ATTACHMENTS}:&nbsp;
224         </td>
225         <td width="30%"  valign='top'>
226                 <input type='checkbox' name='email_default_delete_attachments' value="1" {$DEFAULT_EMAIL_DELETE_ATTACHMENTS}>
227         </td>
228         <td scope="row" width="20%">
229            {$MOD.LBL_NOTIFY_SEND_FROM_ASSIGNING_USER}:
230            <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">
231         </td>
232         <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>
233     </tr>
234 </table>
235 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
236                         <tr>
237                                 <th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_SECURITY_TITLE}</h4></th>
238                         </tr>
239                         <tr>
240                                 <td align="left" scope="row" colspan="4">
241                                         {$MOD.LBL_SECURITY_DESC}
242                                 </td>
243                         </tr>
244                         <tr>
245                                 <td valign="middle" valign="top" scope="row" colspan="3">
246                                         {$MOD.LBL_SECURITY_OUTLOOK_DEFAULTS}
247                                 </td>
248                                 <td width="10%" NOWRAP valign="top" >
249                                         <input type="checkbox" value="1" name="set_outlook_defaults" id="set_outlook_defaults" onclick="setOutlookDefaults();">&nbsp;
250                                         {literal}
251                                         <script type="text/javascript" language="Javascript">
252                                         <!--
253                                                 function toggleAllSecurityOptions() {
254                                                         document.getElementById('set_outlook_defaults').checked = false;
255
256                                                         var check = false;
257
258                                                         if(document.getElementById('toggle_all').checked == true) {
259                                                                 check = true;
260                                                         }
261                                                         document.getElementById('applet').checked = check;
262                                                         document.getElementById('base').checked = check;
263                                                         document.getElementById('embed').checked = check;
264                                                         document.getElementById('form').checked = check;
265                                                         document.getElementById('frame').checked = check;
266                                                         document.getElementById('frameset').checked = check;
267                                                         document.getElementById('iframe').checked = check;
268                                                         document.getElementById('import').checked = check;
269                                                         document.getElementById('layer').checked = check;
270                                                         document.getElementById('link').checked = check;
271                                                         document.getElementById('object').checked = check;
272                                                         document.getElementById('style').checked = check;
273                                                         document.getElementById('xmp').checked = check;
274                                                 }
275
276                                                 function setOutlookDefaults() {
277                                                         document.getElementById('toggle_all').checked = false;
278
279                                                         document.getElementById('applet').checked = true;
280                                                         document.getElementById('base').checked = true;
281                                                         document.getElementById('embed').checked = true;
282                                                         document.getElementById('form').checked = true;
283                                                         document.getElementById('frame').checked = true;
284                                                         document.getElementById('frameset').checked = true;
285                                                         document.getElementById('iframe').checked = true;
286                                                         document.getElementById('import').checked = true;
287                                                         document.getElementById('layer').checked = true;
288                                                         document.getElementById('link').checked = true;
289                                                         document.getElementById('object').checked = true;
290                                                         document.getElementById('style').checked = false;
291                                                         document.getElementById('xmp').checked = true;
292                                                 }
293                     -->
294                                         </script>
295                                         {/literal}
296                                 </td>
297                         </tr>
298                         <tr>
299                                 <td valign="middle" valign="top" scope="row" colspan="3">
300                                         {$MOD.LBL_SECURITY_TOGGLE_ALL}
301                                 </td>
302                                 <td width="10%" NOWRAP valign="top" >
303                                         <input type="checkbox" value="1" name="toggle_all" id="toggle_all" onclick="toggleAllSecurityOptions();">&nbsp;
304                                 </td>
305                         </tr>
306                         <tr>
307                                 <td width="10%" valign="middle" scope="row">
308                                         {$MOD.LBL_SECURITY_APPLET}
309                                 </td>
310                                 <td width="40%" NOWRAP valign="middle" >
311                                         <input type="checkbox" value="1" name="applet" id="applet" {$appletChecked}>&nbsp; &lt;applet&gt;
312                                 </td>
313                                 <td width="10%" valign="middle" scope="row">
314                                         {$MOD.LBL_SECURITY_BASE}
315                                 </td>
316                                 <td width="40%" NOWRAP valign="middle" >
317                                         <input type="checkbox" value="1" name="base" id="base" {$baseChecked}>&nbsp; &lt;base&gt;
318                                 </td>
319                         </tr>
320                         <tr>
321                                 <td width="10%" valign="middle" scope="row">
322                                         {$MOD.LBL_SECURITY_EMBED}
323                                 </td>
324                                 <td width="40%" NOWRAP valign="middle" >
325                                         <input type="checkbox" value="1" name="embed" id="embed" {$embedChecked}>&nbsp; &lt;embed&gt;
326                                 </td>
327                                 <td width="10%" valign="middle" scope="row">
328                                         {$MOD.LBL_SECURITY_FORM}
329                                 </td>
330                                 <td width="40%" NOWRAP valign="middle" >
331                                         <input type="checkbox" value="1" name="form" id="form" {$formChecked}>&nbsp; &lt;form&gt;
332                                 </td>
333                         </tr>
334                         <tr>
335                                 <td width="10%" valign="middle" scope="row">
336                                         {$MOD.LBL_SECURITY_FRAME}
337                                 </td>
338                                 <td width="40%" NOWRAP valign="middle" >
339                                         <input type="checkbox" value="1" name="frame" id="frame" {$frameChecked}>&nbsp; &lt;frame&gt;
340                                 </td>
341                                 <td width="10%" valign="middle" scope="row">
342                                         {$MOD.LBL_SECURITY_FRAMESET}
343                                 </td>
344                                 <td width="40%" NOWRAP valign="middle" >
345                                         <input type="checkbox" value="1" name="frameset" id="frameset" {$framesetChecked}>&nbsp; &lt;frameset&gt;
346                                 </td>
347                         </tr>
348                         <tr>
349                                 <td width="10%" valign="middle" scope="row">
350                                         {$MOD.LBL_SECURITY_IFRAME}
351                                 </td>
352                                 <td width="40%" NOWRAP valign="middle" >
353                                         <input type="checkbox" value="1" name="iframe" id="iframe" {$iframeChecked}>&nbsp; &lt;iframe&gt;
354                                 </td>
355                                 <td width="10%" valign="middle" scope="row">
356                                         {$MOD.LBL_SECURITY_IMPORT}
357                                 </td>
358                                 <td width="40%" NOWRAP valign="middle" >
359                                         <input type="checkbox" value="1" name="import" id="import" {$importChecked}>&nbsp; &lt;import&gt;
360                                 </td>
361                         </tr>
362                         <tr>
363                                 <td width="10%" valign="middle" scope="row">
364                                         {$MOD.LBL_SECURITY_LAYER}
365                                 </td>
366                                 <td width="40%" NOWRAP valign="middle" >
367                                         <input type="checkbox" value="1" name="layer" id="layer" {$layerChecked}>&nbsp; &lt;layer&gt;
368                                 </td>
369                                 <td width="10%" valign="middle" scope="row">
370                                         {$MOD.LBL_SECURITY_LINK}
371                                 </td>
372                                 <td width="40%" NOWRAP valign="middle" >
373                                         <input type="checkbox" value="1" name="link" id="link" {$linkChecked}>&nbsp; &lt;link&gt;
374                                 </td>
375                         </tr>
376                         <tr>
377                                 <td width="10%" valign="middle" scope="row">
378                                         {$MOD.LBL_SECURITY_OBJECT}
379                                 </td>
380                                 <td width="40%" NOWRAP valign="middle" >
381                                         <input type="checkbox" value="1" name="object" id="object" {$objectChecked}>&nbsp; &lt;object&gt;
382                                 </td>
383                                 <td width="10%" valign="middle" scope="row">
384                                         {$MOD.LBL_SECURITY_STYLE}
385                                 </td>
386                                 <td width="40%" NOWRAP valign="middle" >
387                                         <input type="checkbox" value="1" name="style" id="style" {$styleChecked}>&nbsp; &lt;style&gt;
388                                 </td>
389                         </tr>
390                         <tr>
391                                 <td width="10%" valign="middle" scope="row">
392                                         {$MOD.LBL_SECURITY_XMP}
393                                 </td>
394                                 <td width="40%" NOWRAP valign="middle" >
395                                         <input type="checkbox" value="1" name="xmp" id="xmp" {$xmpChecked}>&nbsp; &lt;xmp&gt;
396                                 </td>
397                                 <td scope="row">&nbsp;</td>
398                                 <td>&nbsp;</td>
399                 </tr>
400 </table>
401 </td>
402 </tr>
403 </table>
404 <div id="testOutboundDialog" class="yui-hidden">
405     <div id="testOutbound">
406                 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
407                         <tr>
408                                 <td scope="row">
409                                         {$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}
410                                         <span class="required">
411                                                 {$APP.LBL_REQUIRED_SYMBOL}
412                                         </span>
413                                 </td>
414                                 <td >
415                                         <input type="text" id="outboundtest_from_address" name="outboundtest_from_address" size="35" maxlength="64" value="{$CURRENT_USER_EMAIL}">
416                                 </td>
417                         </tr>
418                         <tr>
419                                 <td scope="row" colspan="2">
420                                         <input type="button" class="button" value="   {$APP.LBL_EMAIL_SEND}   " onclick="javascript:sendTestEmail();">&nbsp;
421                                         <input type="button" class="button" value="   {$APP.LBL_CANCEL_BUTTON_LABEL}   " onclick="javascript:EmailMan.testOutboundDialog.hide();">&nbsp;
422                                 </td>
423                         </tr>
424
425                 </table>
426         </div>
427 </div>
428
429 <div style="padding-top:2px;">
430                         <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} ">
431                         <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} ">
432 </div>
433
434         </form>
435 {$JAVASCRIPT}
436 {literal}
437 <script type="text/javascript">
438 <!--
439 var loader = new YAHOO.util.YUILoader({
440     require : ["element","sugarwidgets"],
441     loadOptional: true,
442     skin: { base: 'blank', defaultSkin: '' },
443     allowRollup: true,
444     base: "include/javascript/yui/build/"
445 });
446 loader.addModule({
447     name :"sugarwidgets",
448     type : "js",
449     fullpath: "include/javascript/sugarwidgets/SugarYUIWidgets.js",
450     varName: "YAHOO.SUGAR",
451     requires: ["datatable", "dragdrop", "treeview", "tabview"]
452 });
453 loader.insert();
454
455 EmailMan = {};
456
457 function testOutboundSettings() {
458         if (document.getElementById('mail_sendtype').value == 'sendmail') {
459                 testOutboundSettingsDialog();
460                 return;
461         }
462         var errorMessage = '';
463         var isError = false;
464         var fromAddress = document.getElementById("outboundtest_from_address").value;
465     var errorMessage = '';
466     var isError = false;
467     var smtpServer = document.getElementById('mail_smtpserver').value;
468     var smtpPort = document.getElementById('mail_smtpport').value;
469     var smtpssl  = document.getElementById('mail_smtpssl').value;
470     var mailsmtpauthreq = document.getElementById('mail_smtpauth_req');
471     if(trim(smtpServer) == '') {
472         isError = true;
473         errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPSERVER}{literal}" + "<br/>";
474     }
475     if(trim(smtpPort) == '') {
476         isError = true;
477         errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPPORT}{literal}" + "<br/>";
478     }
479     if(mailsmtpauthreq.checked) {
480         if(trim(document.getElementById('mail_smtpuser').value) == '') {
481             isError = true;
482             errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPUSER}{literal}" + "<br/>";
483         }
484     }
485     if(isError) {
486         overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
487         return false;
488     }
489
490     testOutboundSettingsDialog();
491
492 }
493
494 function sendTestEmail()
495 {
496     var toAddress = document.getElementById("outboundtest_from_address").value;
497     var fromAddress = document.getElementById("notify_fromaddress").value;
498     if (trim(toAddress) == "")
499     {
500         overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
501         return;
502     }
503     else if (!isValidEmail(toAddress)) {
504         overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
505         return;
506     }
507     if (trim(fromAddress) == "")
508     {
509         overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_ADDR}{literal}", 'alert');
510         return;
511     }
512     else if (!isValidEmail(fromAddress)) {
513         overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_ADDR}{literal}", 'alert');
514         return;
515     }
516     //Hide the email address window and show a message notifying the user that the test email is being sent.
517     EmailMan.testOutboundDialog.hide();
518     overlay("{/literal}{$APP.LBL_EMAIL_PERFORMING_TASK}{literal}", "{/literal}{$APP.LBL_EMAIL_ONE_MOMENT}{literal}", 'alert');
519
520     var callbackOutboundTest = {
521         success : function(o) {
522                 hideOverlay();
523                 overlay("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}", "{/literal}{$APP.LBL_EMAIL_TEST_NOTIFICATION_SENT}{literal}", 'alert');
524         }
525     };
526     var smtpServer = document.getElementById('mail_smtpserver').value;
527     var smtpPort = document.getElementById('mail_smtpport').value;
528     var smtpssl  = document.getElementById('mail_smtpssl').value;
529     var mailsmtpauthreq = document.getElementById('mail_smtpauth_req');
530     var mail_sendtype = document.getElementById('mail_sendtype').value;
531         var postDataString = 'mail_name=system&mail_sendtype=' + mail_sendtype + '&mail_smtpserver=' + smtpServer + "&mail_smtpport=" + smtpPort + "&mail_smtpssl=" + smtpssl +
532                               "&mail_smtpauth_req=" + mailsmtpauthreq.checked + "&mail_smtpuser=" + trim(document.getElementById('mail_smtpuser').value) +
533                               "&mail_smtppass=" + trim(document.getElementById('mail_smtppass').value) + "&outboundtest_to_address=" + encodeURIComponent(toAddress) + "&outboundtest_from_address=" + fromAddress;
534
535         YAHOO.util.Connect.asyncRequest("POST", "index.php?action=testOutboundEmail&module=EmailMan&to_pdf=true&sugar_body_only=true", callbackOutboundTest, postDataString);
536 }
537 function testOutboundSettingsDialog() {
538         // lazy load dialogue
539         if(!EmailMan.testOutboundDialog) {
540                 EmailMan.testOutboundDialog = new YAHOO.widget.Dialog("testOutboundDialog", {
541                 modal:true,
542                                 visible:true,
543                 fixedcenter:true,
544                 constraintoviewport: true,
545                 width   : 600,
546                 shadow  : false
547             });
548             EmailMan.testOutboundDialog.setHeader("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}");
549             YAHOO.util.Dom.removeClass("testOutboundDialog", "yui-hidden");
550         } // end lazy load
551
552         EmailMan.testOutboundDialog.render();
553         EmailMan.testOutboundDialog.show();
554 } // fn
555
556 function overlay(reqtitle, body, type) {
557     var config = { };
558     config.type = type;
559     config.title = reqtitle;
560     config.msg = body;
561     YAHOO.SUGAR.MessageBox.show(config);
562 }
563
564 function hideOverlay() {
565         YAHOO.SUGAR.MessageBox.hide();
566 }
567
568 function notify_setrequired(f) {
569
570         document.getElementById("smtp_settings").style.display = (f.mail_sendtype.value == "SMTP") ? "inline" : "none";
571         document.getElementById("smtp_settings").style.visibility = (f.mail_sendtype.value == "SMTP") ? "visible" : "hidden";
572         document.getElementById("smtp_auth1").style.display = (document.getElementById('mail_smtpauth_req').checked) ? "" : "none";
573         document.getElementById("smtp_auth1").style.visibility = (document.getElementById('mail_smtpauth_req').checked) ? "visible" : "hidden";
574         document.getElementById("smtp_auth2").style.display = (document.getElementById('mail_smtpauth_req').checked) ? "" : "none";
575         document.getElementById("smtp_auth2").style.visibility = (document.getElementById('mail_smtpauth_req').checked) ? "visible" : "hidden";
576         if( document.getElementById('mail_smtpauth_req').checked)
577            YAHOO.util.Dom.removeClass('mail_allow_user', "yui-hidden");
578         else
579            YAHOO.util.Dom.addClass("mail_allow_user", "yui-hidden");
580
581         return true;
582 }
583
584 function setDefaultSMTPPort() 
585 {
586     useSSLPort = !document.getElementById("mail_smtpssl").options[0].selected;
587     
588     if ( useSSLPort && document.getElementById("mail_smtpport").value == '25' ) {
589         document.getElementById("mail_smtpport").value = '465';
590     }
591     if ( !useSSLPort && document.getElementById("mail_smtpport").value == '465' ) {
592         document.getElementById("mail_smtpport").value = '25';
593     }
594         
595 }
596
597 /**
598 *  If the outlook options are all set on page load then enable the outlook field so that the user has an indication
599 *  that that filter has been applied.
600 */
601 function setOutlookDefault()
602 {
603     var shouldToggle = true;
604     var aCheckFields = ['applet','base', 'embed','form','frame','frameset', 'iframe','import','layer','link', 'object', 'xmp'];
605
606     for(var i=0;i<aCheckFields.length;i++)
607     {
608         var tmpName = aCheckFields[i];
609
610         if( ! document.getElementById(tmpName).checked )
611         {
612             shouldToggle = false;
613             break;
614         }
615     }
616
617     if(shouldToggle && !document.getElementById('style').checked)
618         document.getElementById('set_outlook_defaults').checked = true;
619
620 }
621 YAHOO.util.Event.onDOMReady(setOutlookDefault);
622 notify_setrequired(document.ConfigureSettings);
623
624 function changeEmailScreenDisplay(smtptype, clear)
625 {
626     if(clear) {
627             document.getElementById("mail_smtpserver").value = '';
628             document.getElementById("mail_smtpport").value = '25';
629             document.getElementById("mail_smtpauth_req").checked = true;
630             document.getElementById("mailsettings1").style.display = '';
631             document.getElementById("mailsettings2").style.display = '';
632             document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPPASS}{literal}';
633             document.getElementById("mail_smtpport_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPPORT}{literal}';
634             document.getElementById("mail_smtpserver_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPSERVER}{literal}';
635             document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_MAIL_SMTPUSER}{literal}';
636     }
637
638     switch (smtptype) {
639     case "yahoomail":
640         document.getElementById("mail_smtpserver").value = 'plus.smtp.mail.yahoo.com';
641         document.getElementById("mail_smtpport").value = '465';
642         document.getElementById("mail_smtpauth_req").checked = true;
643         var ssl = document.getElementById("mail_smtpssl");
644         for(var j=0;j<ssl.options.length;j++) {
645             if(ssl.options[j].text == 'SSL') {
646                 ssl.options[j].selected = true;
647                 break;
648             }
649         }
650         document.getElementById("mailsettings1").style.display = 'none';
651         document.getElementById("mailsettings2").style.display = 'none';
652         document.getElementById("mail_smtppass_label").innerHTML =
653         document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_YAHOOMAIL_SMTPPASS}{literal}';
654         document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_YAHOOMAIL_SMTPUSER}{literal}';
655         break;
656     case "gmail":
657         document.getElementById("mail_smtpserver").value = 'smtp.gmail.com';
658         document.getElementById("mail_smtpport").value = '587';
659         document.getElementById("mail_smtpauth_req").checked = true;
660         var ssl = document.getElementById("mail_smtpssl");
661         for(var j=0;j<ssl.options.length;j++) {
662             if(ssl.options[j].text == 'TLS') {
663                 ssl.options[j].selected = true;
664                 break;
665             }
666         }
667         document.getElementById("mailsettings1").style.display = 'none';
668         document.getElementById("mailsettings2").style.display = 'none';
669         document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_GMAIL_SMTPPASS}{literal}';
670         document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_GMAIL_SMTPUSER}{literal}';
671         break;
672     case "exchange":
673         if ( document.getElementById("mail_smtpserver").value == 'plus.smtp.mail.yahoo.com'
674                 || document.getElementById("mail_smtpserver").value == 'smtp.gmail.com' ) {
675             document.getElementById("mail_smtpserver").value = '';
676         }
677         //document.getElementById("mail_smtpport").value = '25';
678         //document.getElementById("mail_smtpauth_req").checked = true; bug 40998
679         document.getElementById("mailsettings1").style.display = '';
680         document.getElementById("mailsettings2").style.display = '';
681         document.getElementById("mail_smtppass_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPPASS}{literal}';
682         document.getElementById("mail_smtpport_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPPORT}{literal}';
683         document.getElementById("mail_smtpserver_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPSERVER}{literal}';
684         document.getElementById("mail_smtpuser_label").innerHTML = '{/literal}{$MOD.LBL_EXCHANGE_SMTPUSER}{literal}';
685         break;
686     }
687     setDefaultSMTPPort();
688     notify_setrequired(document.ConfigureSettings);
689 }
690 var oButtonGroup = new YAHOO.widget.ButtonGroup("smtpButtonGroup");
691 oButtonGroup.subscribe('checkedButtonChange', function(e)
692 {
693     changeEmailScreenDisplay(e.newValue.get('value'), true);
694     document.getElementById('smtp_settings').style.display = '';
695     document.getElementById('EditView').mail_smtptype.value = e.newValue.get('value');
696 });
697 YAHOO.widget.Button.addHiddenFieldsToForm(document.ConfigureSettings);
698 if(window.addEventListener){
699     window.addEventListener("load", function() { SUGAR.util.setEmailPasswordDisplay('mail_smtppass', {/literal}{$mail_haspass}{literal}); }, false);
700 }else{
701     window.attachEvent("onload", function() { SUGAR.util.setEmailPasswordDisplay('mail_smtppass', {/literal}{$mail_haspass}{literal}); });
702 }
703 {/literal}{if !empty($mail_smtptype)}{literal}
704 changeEmailScreenDisplay("{/literal}{$mail_smtptype}{literal}", false);
705 {/literal}{/if}{literal}
706 -->
707 </script>
708 {/literal}