]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/EmailMan/tpls/config.tpl
Release 6.5.0
[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-2012 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='cache/include/javascript/sugar_grp_yui_widgets.js'}"></script>
45 {literal}
46 <script type="text/javascript" >
47 <!--
48 function change_state(radiobutton) {
49
50         if (radiobutton.value == '1') {
51                 radiobutton.form['massemailer_tracking_entities_location'].disabled=true;
52                 radiobutton.form['massemailer_tracking_entities_location'].value='{/literal}{$MOD.TRACKING_ENTRIES_LOCATION_DEFAULT_VALUE}{literal}';
53         } else {
54                 radiobutton.form['massemailer_tracking_entities_location'].disabled=false;
55                 radiobutton.form['massemailer_tracking_entities_location'].value=null;
56         }
57 }
58 -->
59 </script>
60 {/literal}
61 {$ROLLOVER}
62 <form name="ConfigureSettings" id="EditView" method="POST" >
63         <input type="hidden" name="module" value="EmailMan">
64         <input type="hidden" name="action">
65         <input type="hidden" name="return_module" value="{$RETURN_MODULE}">
66         <input type="hidden" name="return_action" value="{$RETURN_ACTION}">
67         <input type="hidden" name="source_form" value="config" />
68
69 <table width="100%" cellpadding="0" cellspacing="0" border="0">
70         <tr>
71
72                 <td>
73                         <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" id="btn_save" value=" {$APP.LBL_SAVE_BUTTON_LABEL} ">
74                         <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} ">
75                 </td>
76                 <td align="right" nowrap>
77                         <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span> {$APP.NTC_REQUIRED}
78                 </td>
79         </tr>
80 </table>
81 <table width="100%" border="1" cellspacing="0" cellpadding="0" class="edit view">
82                 <tr><th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_EMAIL_OUTBOUND_CONFIGURATION}</h4></th>
83                 </tr>
84                 <tr>
85                         <td align="left" scope="row" colspan="4">
86                                         {$MOD.LBL_OUTGOING_SECTION_HELP}
87                                         <br />&nbsp;
88                         </td>
89            </tr>
90                 <tr class="{$OUTBOUND_TYPE_CLASS}">
91                         <td width="20%" scope="row">{$MOD.LBL_MAIL_SENDTYPE}</td>
92                         <td width="30%">
93                                 <select id="mail_sendtype" name="mail_sendtype" onChange="notify_setrequired(document.ConfigureSettings); SUGAR.user.showHideGmailDefaultLink(this);" tabindex="1">{$mail_sendtype_options}</select>
94                         </td>
95                         <td scope="row">&nbsp;</td>
96                         <td >&nbsp;</td>
97                 </tr>
98                 <tr>
99             <td width="20%" scope="row">{$MOD.LBL_NOTIFY_FROMNAME} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
100             <td width="30%" > <input id='notify_fromname' name='notify_fromname' tabindex='1' size='25' maxlength='128' type="text" value="{$notify_fromname}"></td>
101         </tr>
102                 <tr>
103                     <td width="20%" scope="row">{$MOD.LBL_NOTIFY_FROMADDRESS} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
104             <td width="30%"><input id='notify_fromaddress' name='notify_fromaddress' tabindex='1' size='25' maxlength='128' type="text" value="{$notify_fromaddress}"></td>
105         </tr>
106                 <tr>
107             <td align="left" scope="row" colspan="4">{$MOD.LBL_CHOOSE_EMAIL_PROVIDER}</td>
108         </tr>
109         <tr>
110             <td colspan="4">
111                 <div id="smtpButtonGroup" class="yui-buttongroup">
112                     <span id="gmail" class="yui-button yui-radio-button{if $mail_smtptype == 'gmail'} yui-button-checked{/if}">
113                         <span class="first-child">
114                             <button type="button" name="mail_smtptype" value="gmail">
115                                 &nbsp;&nbsp;&nbsp;&nbsp;{$APP.LBL_SMTPTYPE_GMAIL}&nbsp;&nbsp;&nbsp;&nbsp;
116                             </button>
117                         </span>
118                     </span>
119                     <span id="yahoomail" class="yui-button yui-radio-button{if $mail_smtptype == 'yahoomail'} yui-button-checked{/if}">
120                         <span class="first-child">
121                             <button type="button" name="mail_smtptype" value="yahoomail">
122                                 &nbsp;&nbsp;&nbsp;&nbsp;{$APP.LBL_SMTPTYPE_YAHOO}&nbsp;&nbsp;&nbsp;&nbsp;
123                             </button>
124                         </span>
125                     </span>
126                     <span id="exchange" class="yui-button yui-radio-button{if $mail_smtptype == 'exchange'} yui-button-checked{/if}">
127                         <span class="first-child">
128                             <button type="button" name="mail_smtptype" value="exchange">
129                                 &nbsp;&nbsp;&nbsp;&nbsp;{$APP.LBL_SMTPTYPE_EXCHANGE}&nbsp;&nbsp;&nbsp;&nbsp;
130                             </button>
131                         </span>
132                     </span>
133                     <span id="other" class="yui-button yui-radio-button{if $mail_smtptype == 'other' || empty($mail_smtptype)} yui-button-checked{/if}">
134                         <span class="first-child">
135                             <button type="button" name="mail_smtptype" value="other">
136                                 &nbsp;&nbsp;&nbsp;&nbsp;{$APP.LBL_SMTPTYPE_OTHER}&nbsp;&nbsp;&nbsp;&nbsp;
137                             </button>
138                         </span>
139                     </span>
140                 </div>
141             </td>
142         </tr>
143                 <tr>
144                         <td colspan="4">
145                              <div id="smtp_settings">
146                                         <table width="100%" cellpadding="0" cellspacing="0">
147                                                 <tr id="mailsettings1">
148                                                         <td width="20%" scope="row"><span id="mail_smtpserver_label">{$MOD.LBL_MAIL_SMTPSERVER}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
149                                                         <td width="30%" ><input type="text" id="mail_smtpserver" name="mail_smtpserver" tabindex="1" size="25" maxlength="64" value="{$mail_smtpserver}"></td>
150                                                         <td width="20%" scope="row"><span id="mail_smtpport_label">{$MOD.LBL_MAIL_SMTPPORT}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
151                                                         <td width="30%" ><input type="text" id="mail_smtpport" name="mail_smtpport" tabindex="1" size="5" maxlength="5" value="{$mail_smtpport}"></td>
152                                                 </tr>
153                                                 <tr id="mailsettings2">
154                                                 <td scope="row"><span id='mail_smtpauth_req_label'>{$MOD.LBL_MAIL_SMTPAUTH_REQ}</span></td>
155                                                         <td >
156                                                                 <input id='mail_smtpauth_req' name='mail_smtpauth_req' type="checkbox" class="checkbox" value="1" tabindex='1'
157                                                                 onclick="notify_setrequired(document.ConfigureSettings);" {$mail_smtpauth_req}>
158                                                         </td>
159                                                     <td width="15%" scope="row"><span id="mail_smtpssl_label">{$APP.LBL_EMAIL_SMTP_SSL_OR_TLS}</span></td>
160                                                 <td width="35%" >
161                                                         <select id="mail_smtpssl" name="mail_smtpssl" tabindex="501" onchange="setDefaultSMTPPort();" >{$MAIL_SSL_OPTIONS}</select>
162                                                 </td>
163                                                 </tr>
164                                                 <tr id="smtp_auth1">
165                             <td width="20%" scope="row"><span id="mail_smtpuser_label">{$MOD.LBL_MAIL_SMTPUSER}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
166                             <td width="30%" ><input type="text" id="mail_smtpuser" name="mail_smtpuser" size="25" maxlength="64" value="{$mail_smtpuser}" tabindex='1' ></td>
167                             <td width="20%">&nbsp;</td>
168                             <td width="30%">&nbsp;</td>
169                        </tr>
170                        <tr id="smtp_auth2">
171                             <td width="20%" scope="row"><span id="mail_smtppass_label">{$MOD.LBL_MAIL_SMTPPASS}</span> <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></td>
172                             <td width="30%" >
173                             <input type="password" id="mail_smtppass" name="mail_smtppass" size="25" maxlength="64" tabindex='1'>
174                             <a href="javascript:void(0)" id='mail_smtppass_link' onClick="SUGAR.util.setEmailPasswordEdit('mail_smtppass')" style="display: none">{$APP.LBL_CHANGE_PASSWORD}</a>
175                             </td>
176                             <td width="20%">&nbsp;</td>
177                             <td width="30%">&nbsp;</td>
178                        </tr>
179                                                 <tr id="mail_allow_user">
180                                                      <td width="20%" scope="row">
181                                                                         {$MOD.LBL_ALLOW_DEFAULT_SELECTION}&nbsp;
182                                                                         <img border="0" class="inlineHelpTip" onclick="return SUGAR.util.showHelpTips(this,'{$MOD.LBL_ALLOW_DEFAULT_SELECTION_HELP}','','','dialogHelpPopup')" src="index.php?entryPoint=getImage&themeName={$THEME}&imageName=helpInline.gif">
183                                                         </td>
184                                                     <td width="30%">
185                                  <input type='hidden' id="notify_allow_default_outbound_hidden_input" name='notify_allow_default_outbound' value='0'>
186                                                              <input id="notify_allow_default_outbound" name='notify_allow_default_outbound' value="2" tabindex='1' class="checkbox" type="checkbox" {$notify_allow_default_outbound_on}>
187                                                         </td>
188                                                         <td width="20%">&nbsp;</td>
189                                                         <td width="30%">&nbsp;</td>
190                                                 </tr>
191                                         </table>
192                                  </div>
193                         </td>
194                 </tr>
195                 <tr><td colspan="4">&nbsp;</tr>
196                 <tr>
197                     <td width="15%"><input type="button" class="button" value="{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}" onclick="testOutboundSettings();">&nbsp;</td>
198                     <td width="15%">&nbsp;</td>
199             <td width="40%">&nbsp;</td>
200                     <td width="40%">&nbsp;</td>
201                 </tr>           
202 </table>
203 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
204         <tr>
205                 <th align="left" scope="row" colspan="4">
206                         <h4>{$MOD.LBL_NOTIFY_TITLE}</h4>
207                 </th>
208     </tr>
209     <tr>
210         <td width="20%" scope="row" valign='top'>
211            {$MOD.LBL_NOTIFY_ON}:&nbsp;
212                 <img border="0" class="inlineHelpTip" onclick="return SUGAR.util.showHelpTips(this,'{$MOD.LBL_NOTIFICATION_ON_DESC}','','','dialogHelpPopup')" src="index.php?entryPoint=getImage&themeName={$THEME}&imageName=helpInline.gif">
213         </td>
214         <td width="30%"  valign='top'>
215                 <input type='hidden' name='notify_on' value='0'><input name="notify_on" tabindex='1' value="1" class="checkbox" type="checkbox" {$notify_on}>
216         </td>
217         <td scope="row" width="17%"></td>
218         <td></td>
219     </tr>
220      <tr>
221         <td width="20%" scope="row" valign='top'>
222            {$MOD.LBL_EMAIL_DEFAULT_DELETE_ATTACHMENTS}:&nbsp;
223         </td>
224         <td width="30%"  valign='top'>
225                 <input type='checkbox' name='email_default_delete_attachments' value="1" {$DEFAULT_EMAIL_DELETE_ATTACHMENTS}>
226         </td>
227         <td scope="row" width="20%">
228            {$MOD.LBL_NOTIFY_SEND_FROM_ASSIGNING_USER}:
229            <img border="0" class="inlineHelpTip" onclick="return SUGAR.util.showHelpTips(this,'{$MOD.LBL_FROM_ADDRESS_HELP}','','','dialogHelpPopup')" src="index.php?entryPoint=getImage&themeName={$THEME}&imageName=helpInline.gif">
230         </td>
231         <td width="30%"  valign='top'><input type='hidden' name='notify_send_from_assigning_user' value='0'><input name='notify_send_from_assigning_user' value="2" tabindex='1' class="checkbox" type="checkbox" {$notify_send_from_assigning_user}></td>
232     </tr>
233 </table>
234 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
235                         <tr>
236                                 <th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_SECURITY_TITLE}</h4></th>
237                         </tr>
238                         <tr>
239                                 <td align="left" scope="row" colspan="4">
240                                         {$MOD.LBL_SECURITY_DESC}
241                                 </td>
242                         </tr>
243                         <tr>
244                                 <td valign="middle" valign="top" scope="row" colspan="3">
245                                         {$MOD.LBL_SECURITY_OUTLOOK_DEFAULTS}
246                                 </td>
247                                 <td width="10%" NOWRAP valign="top" >
248                                         <input type="checkbox" value="1" name="set_outlook_defaults" id="set_outlook_defaults" onclick="setOutlookDefaults();">&nbsp;
249                                         {literal}
250                                         <script type="text/javascript" language="Javascript">
251                                         <!--
252                                                 function toggleAllSecurityOptions() {
253                                                         document.getElementById('set_outlook_defaults').checked = false;
254
255                                                         var check = false;
256
257                                                         if(document.getElementById('toggle_all').checked == true) {
258                                                                 check = true;
259                                                         }
260                                                         document.getElementById('applet').checked = check;
261                                                         document.getElementById('base').checked = check;
262                                                         document.getElementById('embed').checked = check;
263                                                         document.getElementById('form').checked = check;
264                                                         document.getElementById('frame').checked = check;
265                                                         document.getElementById('frameset').checked = check;
266                                                         document.getElementById('iframe').checked = check;
267                                                         document.getElementById('import').checked = check;
268                                                         document.getElementById('layer').checked = check;
269                                                         document.getElementById('link').checked = check;
270                                                         document.getElementById('object').checked = check;
271                                                         document.getElementById('style').checked = check;
272                                                         document.getElementById('xmp').checked = check;
273                                                 }
274
275                                                 function setOutlookDefaults() {
276                                                         document.getElementById('toggle_all').checked = false;
277
278                                                         document.getElementById('applet').checked = true;
279                                                         document.getElementById('base').checked = true;
280                                                         document.getElementById('embed').checked = true;
281                                                         document.getElementById('form').checked = true;
282                                                         document.getElementById('frame').checked = true;
283                                                         document.getElementById('frameset').checked = true;
284                                                         document.getElementById('iframe').checked = true;
285                                                         document.getElementById('import').checked = true;
286                                                         document.getElementById('layer').checked = true;
287                                                         document.getElementById('link').checked = true;
288                                                         document.getElementById('object').checked = true;
289                                                         document.getElementById('style').checked = false;
290                                                         document.getElementById('xmp').checked = true;
291                                                 }
292                     -->
293                                         </script>
294                                         {/literal}
295                                 </td>
296                         </tr>
297                         <tr>
298                                 <td valign="middle" valign="top" scope="row" colspan="3">
299                                         {$MOD.LBL_SECURITY_TOGGLE_ALL}
300                                 </td>
301                                 <td width="10%" NOWRAP valign="top" >
302                                         <input type="checkbox" value="1" name="toggle_all" id="toggle_all" onclick="toggleAllSecurityOptions();">&nbsp;
303                                 </td>
304                         </tr>
305                         <tr>
306                                 <td width="10%" valign="middle" scope="row">
307                                         {$MOD.LBL_SECURITY_APPLET}
308                                 </td>
309                                 <td width="40%" NOWRAP valign="middle" >
310                                         <input type="checkbox" value="1" name="applet" id="applet" {$appletChecked}>&nbsp; &lt;applet&gt;
311                                 </td>
312                                 <td width="10%" valign="middle" scope="row">
313                                         {$MOD.LBL_SECURITY_BASE}
314                                 </td>
315                                 <td width="40%" NOWRAP valign="middle" >
316                                         <input type="checkbox" value="1" name="base" id="base" {$baseChecked}>&nbsp; &lt;base&gt;
317                                 </td>
318                         </tr>
319                         <tr>
320                                 <td width="10%" valign="middle" scope="row">
321                                         {$MOD.LBL_SECURITY_EMBED}
322                                 </td>
323                                 <td width="40%" NOWRAP valign="middle" >
324                                         <input type="checkbox" value="1" name="embed" id="embed" {$embedChecked}>&nbsp; &lt;embed&gt;
325                                 </td>
326                                 <td width="10%" valign="middle" scope="row">
327                                         {$MOD.LBL_SECURITY_FORM}
328                                 </td>
329                                 <td width="40%" NOWRAP valign="middle" >
330                                         <input type="checkbox" value="1" name="form" id="form" {$formChecked}>&nbsp; &lt;form&gt;
331                                 </td>
332                         </tr>
333                         <tr>
334                                 <td width="10%" valign="middle" scope="row">
335                                         {$MOD.LBL_SECURITY_FRAME}
336                                 </td>
337                                 <td width="40%" NOWRAP valign="middle" >
338                                         <input type="checkbox" value="1" name="frame" id="frame" {$frameChecked}>&nbsp; &lt;frame&gt;
339                                 </td>
340                                 <td width="10%" valign="middle" scope="row">
341                                         {$MOD.LBL_SECURITY_FRAMESET}
342                                 </td>
343                                 <td width="40%" NOWRAP valign="middle" >
344                                         <input type="checkbox" value="1" name="frameset" id="frameset" {$framesetChecked}>&nbsp; &lt;frameset&gt;
345                                 </td>
346                         </tr>
347                         <tr>
348                                 <td width="10%" valign="middle" scope="row">
349                                         {$MOD.LBL_SECURITY_IFRAME}
350                                 </td>
351                                 <td width="40%" NOWRAP valign="middle" >
352                                         <input type="checkbox" value="1" name="iframe" id="iframe" {$iframeChecked}>&nbsp; &lt;iframe&gt;
353                                 </td>
354                                 <td width="10%" valign="middle" scope="row">
355                                         {$MOD.LBL_SECURITY_IMPORT}
356                                 </td>
357                                 <td width="40%" NOWRAP valign="middle" >
358                                         <input type="checkbox" value="1" name="import" id="import" {$importChecked}>&nbsp; &lt;import&gt;
359                                 </td>
360                         </tr>
361                         <tr>
362                                 <td width="10%" valign="middle" scope="row">
363                                         {$MOD.LBL_SECURITY_LAYER}
364                                 </td>
365                                 <td width="40%" NOWRAP valign="middle" >
366                                         <input type="checkbox" value="1" name="layer" id="layer" {$layerChecked}>&nbsp; &lt;layer&gt;
367                                 </td>
368                                 <td width="10%" valign="middle" scope="row">
369                                         {$MOD.LBL_SECURITY_LINK}
370                                 </td>
371                                 <td width="40%" NOWRAP valign="middle" >
372                                         <input type="checkbox" value="1" name="link" id="link" {$linkChecked}>&nbsp; &lt;link&gt;
373                                 </td>
374                         </tr>
375                         <tr>
376                                 <td width="10%" valign="middle" scope="row">
377                                         {$MOD.LBL_SECURITY_OBJECT}
378                                 </td>
379                                 <td width="40%" NOWRAP valign="middle" >
380                                         <input type="checkbox" value="1" name="object" id="object" {$objectChecked}>&nbsp; &lt;object&gt;
381                                 </td>
382                                 <td width="10%" valign="middle" scope="row">
383                                         {$MOD.LBL_SECURITY_STYLE}
384                                 </td>
385                                 <td width="40%" NOWRAP valign="middle" >
386                                         <input type="checkbox" value="1" name="style" id="style" {$styleChecked}>&nbsp; &lt;style&gt;
387                                 </td>
388                         </tr>
389                         <tr>
390                                 <td width="10%" valign="middle" scope="row">
391                                         {$MOD.LBL_SECURITY_XMP}
392                                 </td>
393                                 <td width="40%" NOWRAP valign="middle" >
394                                         <input type="checkbox" value="1" name="xmp" id="xmp" {$xmpChecked}>&nbsp; &lt;xmp&gt;
395                                 </td>
396                                 <td scope="row">&nbsp;</td>
397                                 <td>&nbsp;</td>
398                 </tr>
399 </table>
400 </td>
401 </tr>
402 </table>
403 <div id="testOutboundDialog" class="yui-hidden">
404     <div id="testOutbound">
405                 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
406                         <tr>
407                                 <td scope="row">
408                                         {$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}
409                                         <span class="required">
410                                                 {$APP.LBL_REQUIRED_SYMBOL}
411                                         </span>
412                                 </td>
413                                 <td >
414                                         <input type="text" id="outboundtest_from_address" name="outboundtest_from_address" size="35" maxlength="64" value="{$CURRENT_USER_EMAIL}">
415                                 </td>
416                         </tr>
417                         <tr>
418                                 <td scope="row" colspan="2">
419                                         <input type="button" class="button" value="   {$APP.LBL_EMAIL_SEND}   " onclick="javascript:sendTestEmail();">&nbsp;
420                                         <input type="button" class="button" value="   {$APP.LBL_CANCEL_BUTTON_LABEL}   " onclick="javascript:EmailMan.testOutboundDialog.hide();">&nbsp;
421                                 </td>
422                         </tr>
423
424                 </table>
425         </div>
426 </div>
427
428 <div style="padding-top:2px;">
429                         <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} ">
430                         <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} ">
431 </div>
432
433         </form>
434 {$JAVASCRIPT}
435 {literal}
436 <script type="text/javascript">
437 <!--
438 var loader = new YAHOO.util.YUILoader({
439     require : ["element","sugarwidgets"],
440     loadOptional: true,
441     skin: { base: 'blank', defaultSkin: '' },
442     allowRollup: true,
443     base: "include/javascript/yui/build/"
444 });
445 loader.addModule({
446     name :"sugarwidgets",
447     type : "js",
448     fullpath: "include/javascript/sugarwidgets/SugarYUIWidgets.js",
449     varName: "YAHOO.SUGAR",
450     requires: ["datatable", "dragdrop", "treeview", "tabview"]
451 });
452 loader.insert();
453
454 EmailMan = {};
455
456 var first_load = true;
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
532     var from_name = document.getElementById('notify_fromname').value;
533         var postDataString = 'mail_name=system&mail_sendtype=' + mail_sendtype + '&mail_smtpserver=' + smtpServer + "&mail_smtpport=" + smtpPort + "&mail_smtpssl=" + smtpssl +
534                               "&mail_smtpauth_req=" + mailsmtpauthreq.checked + "&mail_smtpuser=" + trim(document.getElementById('mail_smtpuser').value) +
535                               "&mail_smtppass=" + trim(document.getElementById('mail_smtppass').value) + "&outboundtest_to_address=" + encodeURIComponent(toAddress) +
536                           "&outboundtest_from_address=" + fromAddress + "&mail_from_name=" + from_name;
537
538         YAHOO.util.Connect.asyncRequest("POST", "index.php?action=testOutboundEmail&module=EmailMan&to_pdf=true&sugar_body_only=true", callbackOutboundTest, postDataString);
539 }
540 function testOutboundSettingsDialog() {
541         // lazy load dialogue
542         if(!EmailMan.testOutboundDialog) {
543                 EmailMan.testOutboundDialog = new YAHOO.widget.Dialog("testOutboundDialog", {
544                 modal:true,
545                                 visible:true,
546                 fixedcenter:true,
547                 constraintoviewport: true,
548                 width   : 600,
549                 shadow  : false
550             });
551             EmailMan.testOutboundDialog.setHeader("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}");
552             YAHOO.util.Dom.removeClass("testOutboundDialog", "yui-hidden");
553         } // end lazy load
554
555         EmailMan.testOutboundDialog.render();
556         EmailMan.testOutboundDialog.show();
557 } // fn
558
559 function overlay(reqtitle, body, type) {
560     var config = { };
561     config.type = type;
562     config.title = reqtitle;
563     config.msg = body;
564     YAHOO.SUGAR.MessageBox.show(config);
565 }
566
567 function hideOverlay() {
568         YAHOO.SUGAR.MessageBox.hide();
569 }
570
571 function notify_setrequired(f) {
572
573         document.getElementById("smtp_settings").style.display = (f.mail_sendtype.value == "SMTP") ? "inline" : "none";
574         document.getElementById("smtp_settings").style.visibility = (f.mail_sendtype.value == "SMTP") ? "visible" : "hidden";
575         document.getElementById("smtp_auth1").style.display = (document.getElementById('mail_smtpauth_req').checked) ? "" : "none";
576         document.getElementById("smtp_auth1").style.visibility = (document.getElementById('mail_smtpauth_req').checked) ? "visible" : "hidden";
577         document.getElementById("smtp_auth2").style.display = (document.getElementById('mail_smtpauth_req').checked) ? "" : "none";
578         document.getElementById("smtp_auth2").style.visibility = (document.getElementById('mail_smtpauth_req').checked) ? "visible" : "hidden";
579         if( document.getElementById('mail_smtpauth_req').checked)
580            YAHOO.util.Dom.removeClass('mail_allow_user', "yui-hidden");
581         else
582            YAHOO.util.Dom.addClass("mail_allow_user", "yui-hidden");
583
584         return true;
585 }
586
587 function setDefaultSMTPPort() 
588 {
589     if (!first_load)
590     {
591         useSSLPort = !document.getElementById("mail_smtpssl").options[0].selected;
592
593         if ( useSSLPort && document.getElementById("mail_smtpport").value == '25' ) {
594             document.getElementById("mail_smtpport").value = '465';
595         }
596         if ( !useSSLPort && document.getElementById("mail_smtpport").value == '465' ) {
597             document.getElementById("mail_smtpport").value = '25';
598         }
599     }
600     else
601     {
602         first_load = false;
603     }
604 }
605
606 /**
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.
609 */
610 function setOutlookDefault()
611 {
612     var shouldToggle = true;
613     var aCheckFields = ['applet','base', 'embed','form','frame','frameset', 'iframe','import','layer','link', 'object', 'xmp'];
614
615     for(var i=0;i<aCheckFields.length;i++)
616     {
617         var tmpName = aCheckFields[i];
618
619         if( ! document.getElementById(tmpName).checked )
620         {
621             shouldToggle = false;
622             break;
623         }
624     }
625
626     if(shouldToggle && !document.getElementById('style').checked)
627         document.getElementById('set_outlook_defaults').checked = true;
628
629 }
630 YAHOO.util.Event.onDOMReady(setOutlookDefault);
631 notify_setrequired(document.ConfigureSettings);
632
633 function changeEmailScreenDisplay(smtptype, clear)
634 {
635     if(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}';
645     }
646
647     switch (smtptype) {
648     case "yahoomail":
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;
656                 break;
657             }
658         }
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}';
664         break;
665     case "gmail":
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;
673                 break;
674             }
675         }
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}';
680         break;
681     case "exchange":
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 = '';
685         }
686         //document.getElementById("mail_smtpport").value = '25';
687         //document.getElementById("mail_smtpauth_req").checked = true; bug 40998
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}';
694         break;
695     }
696     setDefaultSMTPPort();
697     notify_setrequired(document.ConfigureSettings);
698 }
699 var oButtonGroup = new YAHOO.widget.ButtonGroup("smtpButtonGroup");
700 oButtonGroup.subscribe('checkedButtonChange', function(e)
701 {
702     changeEmailScreenDisplay(e.newValue.get('value'), true);
703     document.getElementById('smtp_settings').style.display = '';
704     document.getElementById('EditView').mail_smtptype.value = e.newValue.get('value');
705 });
706 YAHOO.widget.Button.addHiddenFieldsToForm(document.ConfigureSettings);
707 if(window.addEventListener){
708     window.addEventListener("load", function() { SUGAR.util.setEmailPasswordDisplay('mail_smtppass', {/literal}{$mail_haspass}{literal}); }, false);
709 }else{
710     window.attachEvent("onload", function() { SUGAR.util.setEmailPasswordDisplay('mail_smtppass', {/literal}{$mail_haspass}{literal}); });
711 }
712 {/literal}{if !empty($mail_smtptype)}{literal}
713 changeEmailScreenDisplay("{/literal}{$mail_smtptype}{literal}", false);
714 {/literal}{/if}{literal}
715 -->
716 </script>
717 {/literal}