2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
38 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
41 <link rel="SHORTCUT ICON" href="{$FAVICON_URL}">
42 <meta http-equiv="Content-Type" content="text/html; charset={$APP.LBL_CHARSET}">
43 <title>{$MOD.LBL_WIZARD_TITLE}</title>
45 <script type='text/javascript'>
46 function disableReturnSubmission(e) {
47 var key = window.event ? window.event.keyCode : e.which;
56 <body class="yui-skin-sam">
59 <table style="width:auto;height:600px;" align="center"><tr><td align="center">
61 <form id="UserWizard" name="UserWizard" enctype='multipart/form-data' method="POST" action="index.php" onkeypress="return disableReturnSubmission(event);">
62 <input type='hidden' name='action' value='SaveUserWizard'/>
63 <input type='hidden' name='module' value='Users'/>
64 <span class='error'>{$error.main}</span>
66 <script type="text/javascript" src="{sugar_getjspath file='cache/include/javascript/sugar_grp_yui_widgets.js'}"></script>
67 <script type="text/javascript" src="{sugar_getjspath file='modules/Emails/javascript/vars.js'}"></script>
68 <script type="text/javascript" src="{sugar_getjspath file='cache/include/javascript/sugar_grp_emails.js'}"></script>
69 <script type="text/javascript" src="{sugar_getjspath file='modules/Users/User.js'}"></script>
71 <div class="dashletPanelMenu wizard">
76 <div id="welcome" class="screen">
77 <table width="100%" border="0" cellspacing="0" cellpadding="0">
80 <div class="edit view">
81 <table width="100%" border="0" cellspacing="0" cellpadding="0">
83 <th align="left" scope="row" colspan="4"><h2>{$MOD.LBL_WIZARD_WELCOME_TITLE}</h2></th>
88 {if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
89 <p> {$MOD.LBL_WIZARD_WELCOME}</p>
91 <p> {$MOD.LBL_WIZARD_WELCOME_NOSMTP}</p>
94 <div class="userWizWelcome"><img src='include/images/sugar_wizard_welcome.jpg' border='0' alt='{$MOD.LBL_WIZARD_WELCOME_TAB}' width='765px' height='325px'></div>
102 <div class="nav-buttons">
103 <input title="{$MOD.LBL_WIZARD_NEXT_BUTTON}"
104 class="button primary" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_NEXT_BUTTON} "
105 onclick="SugarWizard.changeScreen('personalinfo',false);" id="next_tab_personalinfo" />
109 <div id="personalinfo" class="screen">
110 <table width="100%" border="0" cellspacing="0" cellpadding="0">
113 <div class="edit view">
114 <table width="100%" border="0" cellspacing="0" cellpadding="0">
116 <th align="left" scope="row" colspan="4"><h2><slot>{$MOD.LBL_WIZARD_PERSONALINFO}</slot></h2></th>
119 <td align="left" scope="row" colspan="4"><i>{$MOD.LBL_WIZARD_PERSONALINFO_DESC}</i></td>
122 <td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_FIRST_NAME}:</slot></td>
123 <td width="33%"><slot><input id='first_name' name='first_name' tabindex='1' size='25' maxlength='25' type="text" value="{$FIRST_NAME}"></slot></td>
124 <td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_LAST_NAME}: <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
125 <td width="33%"><slot><input id='last_name' name='last_name' tabindex='2' size='25' maxlength='25' type="text" value="{$LAST_NAME}"></slot></td>
128 <td scope="row" width="17%">
129 {$MOD.LBL_EMAIL}: {if $REQUIRED_EMAIL_ADDRESS}<span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span>{/if}
131 <td width="33%"><slot><input name='email1' tabindex='3' size='30' maxlength='100' value='{$EMAIL1}' id='email1' /></slot></td>
132 <td scope="row" nowrap="nowrap"><slot> </slot></td>
133 <td><slot> </slot></td>
136 <td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_OFFICE_PHONE}:</slot></td>
137 <td width="33%" ><slot><input name='phone_work' type="text" tabindex='4' size='20' maxlength='25' value='{$PHONE_WORK}'></slot></td>
138 <td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_MESSENGER_TYPE}:</slot></td>
139 <td ><slot>{$MESSENGER_TYPE_OPTIONS}</slot></td>
142 <td scope="row"><slot>{$MOD.LBL_MOBILE_PHONE}:</slot></td>
143 <td ><slot><input name='phone_mobile' type="text" tabindex='6' size='20' maxlength='25' value='{$PHONE_MOBILE}'></slot></td>
144 <td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_MESSENGER_ID}:</slot></td>
145 <td ><slot><input name='messenger_id' type="text" tabindex='6' size='30' maxlength='100' value='{$MESSENGER_ID}'></slot></td>
148 <td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_PRIMARY_ADDRESS}:</slot></td>
149 <td width="33%" ><slot><textarea name='address_street' rows="2" tabindex='8' cols="30">{$ADDRESS_STREET}</textarea></slot></td>
150 <td scope="row" nowrap="nowrap"><slot> </slot></td>
151 <td><slot> </slot></td>
154 <td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_CITY}:</slot></td>
155 <td width="33%" ><slot><input name='address_city' tabindex='8' size='15' maxlength='100' value='{$ADDRESS_CITY}'></slot></td>
156 <td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_STATE}:</slot></td>
157 <td><slot><input name='address_state' tabindex='9' size='15' maxlength='100' value='{$ADDRESS_STATE}'></slot></td>
160 <td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_POSTAL_CODE}:</slot></td>
161 <td><slot><input name='address_postalcode' tabindex='9' size='10' maxlength='20' value='{$ADDRESS_POSTALCODE}'></slot></td>
162 <td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_COUNTRY}:</slot></td>
163 <td><slot><input name='address_country' tabindex='10' size='10' maxlength='20' value='{$ADDRESS_COUNTRY}'></slot></td>
170 <div class="nav-buttons">
172 <input title="{$MOD.LBL_BACK}"
173 onclick="document.location.href='index.php?module=Configurator&action=AdminWizard&page=smtp';" class="button"
174 type="button" name="cancel" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} " id="wizard_cancel"/>
176 <input title="{$MOD.LBL_WIZARD_BACK_BUTTON}"
177 class="button" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} "
178 onclick="SugarWizard.changeScreen('welcome',true);" id="previous_tab_welcome" />
180 <input title="{$MOD.LBL_WIZARD_NEXT_BUTTON}"
181 class="button primary" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_NEXT_BUTTON} "
182 onclick="SugarWizard.changeScreen('locale',false);" id="next_tab_locale" />
186 <div id="locale" class="screen">
187 <table width="100%" border="0" cellspacing="0" cellpadding="0">
190 <div class="edit view">
191 <table width="100%" border="0" cellspacing="0" cellpadding="0">
193 <th width="100%" align="left" scope="row" colspan="4">
194 <h2><slot>{$MOD.LBL_WIZARD_LOCALE}</slot></h2></th>
197 <td align="left" scope="row" colspan="4"><i>{$MOD.LBL_WIZARD_LOCALE_DESC}</i></td>
200 <td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_TIMEZONE}:</slot> {sugar_help text=$MOD.LBL_TIMEZONE_TEXT }</td>
201 <td colspan="3"><slot><select tabindex='14' name='timezone'>{html_options options=$TIMEZONEOPTIONS selected=$TIMEZONE_CURRENT}</select></slot></td>
204 <td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_DATE_FORMAT}:</slot> {sugar_help text=$MOD.LBL_DATE_FORMAT_TEXT }</td>
205 <td width="33%"><slot><select tabindex='14' name='dateformat'>{$DATEOPTIONS}</select></slot></td>
206 <td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_TIME_FORMAT}:</slot> {sugar_help text=$MOD.LBL_TIME_FORMAT_TEXT }</td>
207 <td ><slot><select tabindex='14' name='timeformat'>{$TIMEOPTIONS}</select></slot></td>
211 <td colspan="4"><hr /></td>
214 <td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_CURRENCY}:</slot> {sugar_help text=$MOD.LBL_CURRENCY_TEXT }</td>
216 <select tabindex='14' id='currency_select' name='currency' onchange='setSymbolValue(this.selectedIndex);setSigDigits();'>{$CURRENCY}</select>
217 <input type="hidden" id="symbol" value="">
219 <td width="17%" scope="row" nowrap="nowrap"></td>
223 <td width="17%" scope="row" nowrap="nowrap"><slot>
224 {$MOD.LBL_CURRENCY_SIG_DIGITS}:
227 <select id='sigDigits' onchange='setSigDigits(this.value);' name='default_currency_significant_digits'>{$sigDigits}</select>
229 <td width="17%" scope="row" nowrap="nowrap"><slot>
230 <i>{$MOD.LBL_LOCALE_EXAMPLE_NAME_FORMAT}:</i>
233 <input type="text" disabled id="sigDigitsExample" name="sigDigitsExample">
237 <td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_DECIMAL_SEP}:</slot> {sugar_help text=$MOD.LBL_DECIMAL_SEP_TEXT }</td>
239 <input tabindex='14' name='dec_sep' id='default_decimal_seperator'
240 type='text' maxlength='1' size='1' value='{$DEC_SEP}'
241 onkeydown='setSigDigits();' onkeyup='setSigDigits();'>
243 <td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_NUMBER_GROUPING_SEP}:</slot> {sugar_help text=$MOD.LBL_NUMBER_GROUPING_SEP_TEXT }</td>
244 <td><input tabindex='14' name='num_grp_sep' id='default_number_grouping_seperator'
245 type='text' maxlength='1' size='1' value='{$NUM_GRP_SEP}'
246 onkeydown='setSigDigits();' onkeyup='setSigDigits();'></td>
249 <td colspan="4"><hr /></td>
252 {capture name=SMARTY_LOCALE_NAME_FORMAT_DESC} {$MOD.LBL_LOCALE_NAME_FORMAT_DESC}<br />{$MOD.LBL_LOCALE_NAME_FORMAT_DESC_2}{/capture}
253 <td nowrap="nowrap" scope="row" valign="top">{$MOD.LBL_LOCALE_DEFAULT_NAME_FORMAT}: {sugar_help text=$smarty.capture.SMARTY_LOCALE_NAME_FORMAT_DESC }</td>
255 <input onkeyup="setPreview();" onkeydown="setPreview();" id="default_locale_name_format" type="text" tabindex='14' name="default_locale_name_format" value="{$default_locale_name_format}">
257 <td nowrap="nowrap" scope="row" valign="top"><i>{$MOD.LBL_LOCALE_EXAMPLE_NAME_FORMAT}:</i> </td>
258 <td valign="top"><input tabindex='14' name="no_value" id="nameTarget" value="" style="border: none;" disabled size="30"></td>
265 <div class="nav-buttons">
266 <input title="{$MOD.LBL_WIZARD_BACK_BUTTON}"
267 class="button" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} "
268 onclick="SugarWizard.changeScreen('personalinfo',true);" id="previous_tab_personalinfo" />
269 <input title="{$MOD.LBL_WIZARD_NEXT_BUTTON}"
270 class="button primary" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_NEXT_BUTTON} "
271 {if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
272 onclick="SugarWizard.changeScreen('smtp',false);" id="next_tab_smtp" />
274 onclick="SugarWizard.changeScreen('finish',false);" id="next_tab_finish" />
278 {if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
279 <div id="smtp" class="screen">
280 <table width="100%" border="0" cellspacing="0" cellpadding="0">
283 <div class="edit view">
284 <table width="100%" border="0" cellspacing="0" cellpadding="0">
286 <th align="left" scope="row" colspan="4">
287 <h2>{$MOD.LBL_WIZARD_SMTP}</h2>
291 <td align="left" scope="row" colspan="4"><i>{$MOD.LBL_WIZARD_SMTP_DESC}</i></td>
294 <td width="20%" scope="row"><span id="mail_smtpserver_label">{$MOD.LBL_EMAIL_PROVIDER}</span></td>
295 <td width="30%" ><slot>{$mail_smtpdisplay}<input id='mail_smtpserver' name='mail_smtpserver' type="hidden" value='{$mail_smtpserver}' /></slot></td>
296 <td scope="row"> </td>
299 {if !empty($mail_smtpauth_req)}
301 <td width="20%" scope="row" nowrap="nowrap"><span id="mail_smtpuser_label">{$MOD.LBL_MAIL_SMTPUSER}</span></td>
302 <td width="30%" ><slot><input type="text" id="mail_smtpuser" name="mail_smtpuser" size="25" maxlength="64" value="{$mail_smtpuser}" tabindex='1' ></slot></td>
303 <td scope="row"> </td>
307 <td width="20%" scope="row" nowrap="nowrap"><span id="mail_smtppass_label">{$MOD.LBL_MAIL_SMTPPASS}</span></td>
308 <td width="30%" ><slot><input type="password" id="mail_smtppass" name="mail_smtppass" size="25" maxlength="64" value="{$mail_smtppass}" tabindex='1'></slot></td>
309 <td scope="row"> </td>
314 <td width="17%" scope="row"><input type="button" class="button" value="{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}" onclick="startOutBoundEmailSettingsTest();"></td>
315 <td width="33%" > </td>
316 <td width="17%" scope="row"> </td>
317 <td width="33%" > </td>
323 <div class="nav-buttons">
324 <input title="{$MOD.LBL_WIZARD_BACK_BUTTON}"
325 class="button" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} "
326 onclick="SugarWizard.changeScreen('locale',true);" id="previous_tab_locale" />
327 <input title="{$MOD.LBL_WIZARD_NEXT_BUTTON}"
328 class="button primary" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_NEXT_BUTTON} "
329 onclick="SugarWizard.changeScreen('finish',false);" id="next_tab_finish" />
333 <div id="finish" class="screen">
334 <table width="100%" border="0" cellspacing="0" cellpadding="0">
337 <div class="edit view">
338 <table width="100%" border="0" cellspacing="0" cellpadding="0">
340 <th align="left" scope="row" colspan="4"><h2>{$MOD.LBL_WIZARD_FINISH_TITLE}</h2></th>
344 <h3>{$MOD.LBL_WIZARD_FINISH1}</h3>
346 <table cellpadding=0 cellspacing=0><input id='whatnext' name='whatnext' type="hidden" value='finish' />
348 <tr><td><img src=include/images/start.png style="margin-right: 5px;"></td><td><a onclick='document.UserWizard.whatnext.value="finish";document.UserWizard.submit()' href="#" ><b> {$MOD.LBL_WIZARD_FINISH2} </b></a><br> {$MOD.LBL_WIZARD_FINISH2DESC}</td></tr>
349 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
350 <tr><td><img src=include/images/import.png style="margin-right: 5px;"></td><td><a onclick='document.UserWizard.whatnext.value="import";document.UserWizard.submit()' href="#" ><b> {$MOD.LBL_WIZARD_FINISH3} </b></a><br> {$MOD.LBL_WIZARD_FINISH4}</td></tr>
351 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
352 <tr><td><img src=include/images/create_users.png style="margin-right: 5px;"></td><td><a onclick='document.UserWizard.whatnext.value="users";document.UserWizard.submit()' href="#" ><b> {$MOD.LBL_WIZARD_FINISH5} </b></a><br>{$MOD.LBL_WIZARD_FINISH6}</td></tr>
353 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
354 <tr><td><img src=include/images/settings.png style="margin-right: 5px;"></td><td><a onclick='document.UserWizard.whatnext.value="settings";document.UserWizard.submit()' href="#" ><b> {$MOD.LBL_WIZARD_FINISH7} </b></a><br>{$MOD.LBL_WIZARD_FINISH8}</td></tr>
355 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
356 <tr><td><img src=include/images/configure.png style="margin-right: 5px;"></td><td><a onclick='document.UserWizard.whatnext.value="studio";document.UserWizard.submit()' href="#" ><b> {$MOD.LBL_WIZARD_FINISH9} </b></a><br>{$MOD.LBL_WIZARD_FINISH10}</td></tr>
357 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
358 <tr><td><img src=include/images/university.png style="margin-right: 5px;"></td><td><a href="http://www.sugarcrm.com/university" target="_blank"><b> {$MOD.LBL_WIZARD_FINISH11} </b></a></b><br>{$MOD.LBL_WIZARD_FINISH12}</td></tr>
359 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
361 <tr><td><img src=include/images/university2.png style="margin-right: 5px;"></td><td><a href="http://www.sugarcrm.com/university" target="_blank"><b> {$MOD.LBL_WIZARD_FINISH11} </b></a></b><br>{$MOD.LBL_WIZARD_FINISH12}</td></tr>
362 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
363 <tr><td><img src=include/images/docs.png style="margin-right: 5px;"></td><td><a href="http://docs.sugarcrm.com/" target="_blank"><b> {$MOD.LBL_WIZARD_FINISH14} </b></a></b><br>{$MOD.LBL_WIZARD_FINISH15}</td></tr>
364 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
365 <tr><td><img src=include/images/kb.png style="margin-right: 5px;"></td><td><a href="http://kb.sugarcrm.com/" target="_blank"><b> {$MOD.LBL_WIZARD_FINISH16} </b></a></b><br>{$MOD.LBL_WIZARD_FINISH17}</td></tr>
366 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
367 <tr><td><img src=include/images/forums.png style="margin-right: 5px;"></td><td><a href="http://www.sugarcrm.com/forums" target="_blank"><b> {$MOD.LBL_WIZARD_FINISH18} </b></a></b><br>{$MOD.LBL_WIZARD_FINISH19}</td></tr>
368 <tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
378 <div class="nav-buttons">
379 <input title="{$MOD.LBL_WIZARD_BACK_BUTTON}"
380 class="button" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} "
381 {if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
382 onclick="SugarWizard.changeScreen('smtp',true);" id="previous_tab_smtp" />
384 onclick="SugarWizard.changeScreen('locale',true);" id="previous_tab_locale" />
386 <input title="{$MOD.LBL_WIZARD_FINISH_BUTTON}" class="button primary"
387 type="submit" name="save" value=" {$MOD.LBL_WIZARD_FINISH_BUTTON} " />
399 <script type='text/javascript'>
401 var SugarWizard = new function()
403 this.currentScreen = 'welcome';
405 this.handleKeyStroke = function(e)
407 // get the key pressed
410 key = window.event.keyCode;
418 primaryButton = YAHOO.util.Selector.query('input.primary',SugarWizard.currentScreen,true);
419 primaryButton.click();
424 this.changeScreen = function(screen,skipCheck)
428 var form = document.getElementById('UserWizard');
431 switch(this.currentScreen) {
433 if ( document.getElementById('last_name').value == '' ) {
434 add_error_style('UserWizard',form.last_name.name,
435 '{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS} {$MOD.LBL_LAST_NAME}{literal}' );
439 {if $REQUIRED_EMAIL_ADDRESS}
441 if ( document.getElementById('email1').value == '' ) {
442 add_error_style('UserWizard',form.email1.name,
443 '{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS} {$MOD.LBL_EMAIL}{literal}' );
455 document.getElementById(this.currentScreen).style.display = 'none';
456 document.getElementById(screen).style.display = 'block';
458 this.currentScreen = screen;
463 SugarWizard.changeScreen('personalinfo');
465 SugarWizard.changeScreen('welcome');
468 document.onkeypress = SugarWizard.handleKeyStroke;
470 var mail_smtpport = '{/literal}{$MAIL_SMTPPORT}{literal}';
471 var mail_smtpssl = '{/literal}{$MAIL_SMTPSSL}{literal}';
475 function startOutBoundEmailSettingsTest()
477 var loader = new YAHOO.util.YUILoader({
478 require : ["element","sugarwidgets"],
480 skin: { base: 'blank', defaultSkin: '' },
481 onSuccess: testOutboundSettings,
483 base: "include/javascript/yui/build/"
486 name :"sugarwidgets",
488 fullpath: "include/javascript/sugarwidgets/SugarYUIWidgets.js",
489 varName: "YAHOO.SUGAR",
490 requires: ["datatable", "dragdrop", "treeview", "tabview"]
496 function testOutboundSettings()
498 var errorMessage = '';
500 var fromAddress = document.getElementById("outboundtest_from_address").value;
501 var errorMessage = '';
503 var smtpServer = document.getElementById('mail_smtpserver').value;
505 var mailsmtpauthreq = document.getElementById('mail_smtpauth_req');
506 if(trim(smtpServer) == '' || trim(mail_smtpport) == '')
509 errorMessage += "{/literal}{$MOD.LBL_MISSING_DEFAULT_OUTBOUND_SMTP_SETTINGS}{literal}" + "<br/>";
510 overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
514 if(document.getElementById('mail_smtpuser') && trim(document.getElementById('mail_smtpuser').value) == '')
517 errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPUSER}{literal}" + "<br/>";
520 if(document.getElementById('mail_smtppass') && trim(document.getElementById('mail_smtppass').value) == '')
523 errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPPASS}{literal}" + "<br/>";
527 overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
531 testOutboundSettingsDialog();
534 function sendTestEmail()
536 var fromAddress = document.getElementById("outboundtest_from_address").value;
538 if (trim(fromAddress) == "")
540 overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{{/literal}$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
543 else if (!isValidEmail(fromAddress)) {
544 overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
548 //Hide the email address window and show a message notifying the user that the test email is being sent.
549 EmailMan.testOutboundDialog.hide();
550 overlay("{/literal}{$APP.LBL_EMAIL_PERFORMING_TASK}{literal}", "{/literal}{$APP.LBL_EMAIL_ONE_MOMENT}{literal}", 'alert');
552 var callbackOutboundTest = {
553 success : function(o) {
555 overlay("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}", "{/literal}{$APP.LBL_EMAIL_TEST_NOTIFICATION_SENT}{literal}", 'alert');
558 var smtpServer = document.getElementById('mail_smtpserver').value;
559 if(document.getElementById('mail_smtpuser') && document.getElementById('mail_smtppass'))
561 var postDataString = 'mail_sendtype=SMTP&mail_smtpserver=' + smtpServer + "&mail_smtpport=" + mail_smtpport + "&mail_smtpssl=" + mail_smtpssl + "&mail_smtpauth_req=true&mail_smtpuser=" + trim(document.getElementById('mail_smtpuser').value) + "&mail_smtppass=" + trim(document.getElementById('mail_smtppass').value) + "&outboundtest_from_address=" + fromAddress;
565 var postDataString = 'mail_sendtype=SMTP&mail_smtpserver=' + smtpServer + "&mail_smtpport=" + mail_smtpport + "&mail_smtpssl=" + mail_smtpssl + "&outboundtest_from_address=" + fromAddress;
567 YAHOO.util.Connect.asyncRequest("POST", "index.php?action=testOutboundEmail&module=EmailMan&to_pdf=true&sugar_body_only=true", callbackOutboundTest, postDataString);
569 function testOutboundSettingsDialog() {
570 // lazy load dialogue
571 if(!EmailMan.testOutboundDialog) {
572 EmailMan.testOutboundDialog = new YAHOO.widget.Dialog("testOutboundDialog", {
576 constraintoviewport: true,
580 EmailMan.testOutboundDialog.setHeader("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}");
581 YAHOO.util.Dom.removeClass("testOutboundDialog", "yui-hidden");
584 EmailMan.testOutboundDialog.render();
585 EmailMan.testOutboundDialog.show();
588 function overlay(reqtitle, body, type) {
591 config.title = reqtitle;
593 YAHOO.SUGAR.MessageBox.show(config);
596 function hideOverlay() {
597 YAHOO.SUGAR.MessageBox.hide();
604 <script type="text/javascript" language="Javascript">
609 setSymbolValue(document.getElementById('currency_select').selectedIndex);
616 <div id="testOutboundDialog" class="yui-hidden">
617 <div id="testOutbound">
619 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
622 {$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}
623 <span class="required">
624 {$APP.LBL_REQUIRED_SYMBOL}
628 <input type="text" id="outboundtest_from_address" name="outboundtest_from_address" size="35" maxlength="64" value="">
632 <td scope="row" colspan="2">
633 <input type="button" class="button" value=" {$APP.LBL_EMAIL_SEND} " onclick="javascript:sendTestEmail();">
634 <input type="button" class="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " onclick="javascript:EmailMan.testOutboundDialog.hide();">