2 /*********************************************************************************
3 * SugarCRM is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
37 /*********************************************************************************
39 * Created On: Oct 17, 2005
40 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
41 * All Rights Reserved.
42 * Contributor(s): Chris Nojima
43 ********************************************************************************/
45 <div id="testSettingsDiv"></div>
46 <div id="selectFoldersDiv"></div>
50 <script type='text/javascript' src='include/javascript/sugar_grp_overlib.js'></script>
52 <form action="index.php" method="post" name="EditView" id="EditView">
53 <input type="hidden" name="module" value="{MODULE}">
54 <input type="hidden" name="record" value="{ID}">
55 <input type="hidden" name="isDuplicate" value=false>
56 <input type="hidden" name="action">
57 <input type="hidden" name="group_id" value="{GROUP_ID}">
58 <input type="hidden" name="return_module">
59 <input type="hidden" name="return_action">
60 <input type="hidden" name="return_id">
61 <input type="hidden" name="personal" value="{PERSONAL}">
62 <input type="hidden" name="searchField" value="">
63 <input type="hidden" id="mailbox_type" name="mailbox_type" value="{MAILBOX_TYPE}">
65 <table width="100%" cellpadding="0" cellspacing="0" border="0">
68 <input title="{APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save'; {CHOOSER_SCRIPT} this.form.return_id.value='{RETURN_ID}'; return checkformdata()" type="submit" name="button" value=" {APP.LBL_SAVE_BUTTON_LABEL} " {IE_DISABLED}>
69 <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}'; this.form.record.value='{RETURN_ID}'" type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
70 <input title="{MOD.LBL_TEST_BUTTON_TITLE}"
72 accessKey="{MOD.LBL_TEST_BUTTON_KEY}"
74 onClick='ie_test_open_popup_with_submit("InboundEmail", "Popup", "Popup", 400, 300, trim(this.form.server_url.value), this.form.protocol.value, trim(this.form.port.value), trim(this.form.email_user.value), Rot13.write(this.form.email_password.value), trim(this.form.mailbox.value), this.form.ssl.checked, this.form.personal.value, "EditView");'
75 name="button" value=" {MOD.LBL_TEST_SETTINGS} " {IE_DISABLED}>
77 <td align="right" width="20%" NOWRAP><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
78 <td align='right'>{ADMIN_EDIT}</td>
82 <div class="edit view">
83 <table width="100%" border=0 cellspacing="{GRIDLINE}" cellpadding="0">
85 <th align="left" scope="row" colspan="1"><h4>{MOD.LBL_BASIC}</h4></th>
89 <td style="vertical-align:bottom;"><a href="javascript:void(0);" onclick="javascript:prefillGmailDefaults();">{APP.LBL_EMAIL_ACCOUNTS_GMAIL_DEFAULTS}</a> </td>
92 <td valign="top" scope="row" width="15%" NOWRAP>
93 <slot>{MOD.LBL_NAME}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
94 <td valign="top" width="35%">
95 <slot><input name='name' tabindex='10' size='30' maxlength='255' type="text" value="{NAME}" {IE_DISABLED}></slot></td>
96 <td valign="top" scope="row">
97 <slot>{MOD.LBL_STATUS}: </slot></td>
98 <td valign="top" width="35%"><slot>
99 <select name='status' tabindex='60' {IE_DISABLED}>{STATUS}</select></slot></td>
102 <td valign="top" scope="row">
103 <slot>{MOD.LBL_SERVER_URL}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
104 <td valign="top" width="35%">
105 <slot><input id='server_url' name='server_url' tabindex='20' size='30' maxlength='100' type="text" value="{SERVER_URL}" {IE_DISABLED}></slot></td>
106 <td valign="top" scope="row">
107 <slot>{MOD.LBL_LOGIN}:
108 <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
109 <td valign="top" width="35%">
110 <slot><input name='email_user' tabindex='70' size='30' maxlength='100' type="text" value="{USER}" autocomplete="off" {IE_DISABLED}></slot></td>
113 <td valign="top" scope="row" width="15%" NOWRAP>
114 <slot>{MOD.LBL_SERVER_TYPE}:
115 <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
116 <td valign="top" width="35%">
118 <select name='protocol' id="protocol" tabindex='30' onchange="toggle_monitored_folder(this); setPortDefault();" {IE_DISABLED}>{PROTOCOL}</select></slot></td>
119 <td valign="top" scope="row">
120 <slot>{MOD.LBL_PASSWORD}:
121 <span class="required">{APP.LBL_REQUIRED_SYMBOL} </slot></td>
122 <td valign="top" width="35%">
123 <slot><input name='email_password' tabindex='80' size='30' maxlength='100' type="password" value="{PASSWORD}" autocomplete="off" {IE_DISABLED}></slot></td>
126 <td valign="top" scope="row" width="15%" NOWRAP>
127 <slot>{MOD.LBL_PORT}:
128 <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
129 <td valign="top" width="35%">
131 <input name='port' id='port' tabindex="40" value="{PORT}" size='10' {IE_DISABLED}>
132 <td valign="top" scope="row" width="15%" NOWRAP>
133 <slot><span id="label_inbox" >{MOD.LBL_MAILBOX}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></span> </slot></td>
134 <td valign="top" width="35%">
135 <slot><input id="mailbox" name='mailbox' tabindex='90' size='30' maxlength='500' type="text" value="{MAILBOX}">
136 <input type="button" id="subscribeFolderButton" style="display:none;" class="button" onclick='javascript:getFoldersListForInboundAccount("InboundEmail", "ShowInboundFoldersList", "Popup", 400, 300, this.form.server_url.value, this.form.protocol.value, this.form.port.value, this.form.email_user.value, Rot13.write(this.form.email_password.value), this.form.mailbox.value, this.form.ssl.checked, this.form.personal.value, this.form.searchField.value, "EditView");' value="{MOD.LBL_SELECT}">
140 <td valign="top" scope="row" width="15%" NOWRAP>
141 <slot><span>{MOD.LBL_SSL}: <span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_SSL_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></span></slot>
143 <td valign="top" width="35%">
145 <input name='ssl' id='ssl' tabindex='45' {CERT} value='1' type='checkbox' {SSL} onClick="setPortDefault();" {IE_DISABLED}>
148 <td id="trashFolderRow" valign="top" scope="row" width="15%" NOWRAP>
149 <slot>{MOD.LBL_TRASH_FOLDER}:
150 <span name="trashRequiredSpan" id="trashRequiredSpan" class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
151 <td id="trashFolderRow1" valign="top" width="35%">
153 <input name='trashFolder' id='trashFolder' tabindex="92" value="{TRASHFOLDER}" size='30' maxlength='100' type="text">
154 <input type="button" id="trashFolderButton" class="button" onclick='javascript:getFoldersListForInboundAccount("InboundEmail", "ShowInboundFoldersList", "Popup", 400, 300, this.form.server_url.value, this.form.protocol.value, this.form.port.value, this.form.email_user.value, Rot13.write(this.form.email_password.value), this.form.trashFolder.value, this.form.ssl.checked, this.form.personal.value, "trash", "EditView");' value="{MOD.LBL_SELECT}">
156 <tr id="sentFolderRow">
157 <td valign="top" scope="row">
158 <slot> </slot></td>
159 <td valign="top" width="35%"><slot>
161 <td valign="top" scope="row" width="15%" NOWRAP>
162 <slot>{MOD.LBL_SENT_FOLDER}:</slot></td>
163 <td valign="top" width="35%">
164 <slot><input id="sentFolder" name='sentFolder' tabindex='95' size='30' maxlength='100' type="text" value="{SENTFOLDER}">
165 <input type="button" id="sentFolderButton" class="button" onclick='javascript:getFoldersListForInboundAccount("InboundEmail", "ShowInboundFoldersList", "Popup", 400, 300, this.form.server_url.value, this.form.protocol.value, this.form.port.value, this.form.email_user.value, Rot13.write(this.form.email_password.value), this.form.sentFolder.value, this.form.ssl.checked, this.form.personal.value, "sent", "EditView");' value="{MOD.LBL_SELECT}">
171 <div class="edit view">
172 <table width="100%" border="0" cellspacing="{GRIDLINE}" cellpadding="0">
174 <th align="left" scope="row" colspan="4"><h4>{EMAIL_OPTIONS}</h4></th>
177 <td valign="top" scope="row" width="15%" NOWRAP>
181 <td valign="top" width="35%">
184 <td valign="top" scope="row" width="15%" NOWRAP>
185 <slot>{MOD.LBL_FROM_NAME}:<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
186 <td valign="top" width="35%">
187 <slot><input tabindex="300" name="from_name" id="from_name" value="{FROM_NAME}" {IE_DISABLED}> </slot></td>
190 <td valign="top" scope="row" width="15%" NOWRAP>
191 <slot><span style="{AUTO_IMPORT_STYLE}">{MOD.LBL_ENABLE_AUTO_IMPORT}: <span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_ASSIGN_TO_GROUP_FOLDER_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></span></slot>
193 <td valign="top" width="15%" NOWRAP>
194 <input name='is_auto_import' style="{AUTO_IMPORT_STYLE}" id='is_auto_import' onclick="showWarningsIfChaningAutoImport();"tabindex='45' type='checkbox' {IS_AUTO_IMPORT}>
196 <td valign="top" scope="row" width="15%" NOWRAP>
197 <slot>{MOD.LBL_FROM_ADDR}:<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
198 <td valign="top" width="35%">
199 <slot><input tabindex="310" name="from_addr" id="from_addr" value="{FROM_ADDR}" {IE_DISABLED}></slot></td>
202 <td valign="top" scope="row">
203 <slot style="{MAILBOX_TYPE_STYLE}">{MOD.LBL_CREATE_CASE}: <span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_CREATE_CASE_HELP}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
204 <td valign="top" width="35%"><slot style="{MAILBOX_TYPE_STYLE}">
205 <input name='is_create_case' id='is_create_case' onclick="showCreateCaseRow();"tabindex='45' type='checkbox' {IS_CREATE_CASE} {IE_DISABLED}></slot></td>
206 <td valign="top" scope="row" width="15%" NOWRAP>
207 {MOD.LBL_REPLY_TO_NAME}:
209 <td valign="top" width="35%">
210 <input tabindex="320" name="reply_to_name" value="{REPLY_TO_NAME}" {IE_DISABLED}>
213 <tr id="createCaseRow" style="{CREATE_CASE_ROW_STYLE}">
214 <td valign="top" scope="row">
215 <slot>{MOD.LBL_DISTRIBUTION_METHOD}: </slot></td>
216 <td valign="top" width="35%"><slot>
217 <select name='distrib_method' tabindex='241'>{DISTRIBUTION_METHOD}</select></slot></td>
218 <td valign="top" scope="row">
219 <slot> </slot></td>
220 <td valign="top" width="35%"><slot>
223 <tr id="createCaseRow1" style="{CREATE_CASE_ROW_STYLE}">
224 <td valign="top" scope="row" width="15%" NOWRAP >
225 <slot>{MOD.LBL_CREATE_CASE_REPLY_TEMPLATE}: <span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_CREATE_CASE_REPLY_TEMPLATE_HELP}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
226 <td colspan="3" valign="top" width="35%">
228 <select tabindex='330' id="create_case_template_id" name='create_case_template_id' onchange="show_edit_template_link(this, 'create_case_edit_template');" {IE_DISABLED}>{CREATE_CASE_EMAIL_TEMPLATE_OPTIONS}</select>
229 <input type="button" class="button" onclick="javascript:open_email_template_form('create_case_template_id')" value="{MOD.LBL_CREATE_TEMPLATE}" {IE_DISABLED}>
230 <input type="button" class="button" name='create_case_edit_template' id='create_case_edit_template' style="{CREATE_CASE_EDIT_TEMPLATE}" onclick="javascript:edit_email_template_form('create_case_template_id')" value="{MOD.LBL_EDIT_TEMPLATE}">
235 <td valign="top" scope="row">
236 <slot> </slot></td>
237 <td valign="top" width="35%"><slot>
239 <td valign="top" scope="row" width="15%" NOWRAP>
240 {MOD.LBL_REPLY_TO_ADDR}:
242 <td valign="top" width="35%">
243 <input tabindex="340" name="reply_to_addr" value="{REPLY_TO_ADDR}" {IE_DISABLED}>
246 <tr style="MAILBOX_TYPE_STYLE">
247 <td valign="top" scope="row">
248 <slot> </slot></td>
249 <td valign="top" width="35%"><slot>
251 <td valign="top" scope="row" width="15%" >
252 <slot style="{MAILBOX_TYPE_STYLE}">{MOD.LBL_ALLOW_OUTBOUND_GROUP_USAGE}:
253 <span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_ALLOW_OUTBOUND_GROUP_USAGE_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span>
256 <td valign="top" width="35%">
257 <slot style="{MAILBOX_TYPE_STYLE}"><input name='allow_outbound_group_usage' id='allow_outbound_group_usage' tabindex='45' value='1' type='checkbox' {ALLOW_OUTBOUND_USAGE} ></slot>
261 <td valign="top" scope="row" width="15%" NOWRAP>
262 <slot style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_AUTOREPLY}: <span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_AUTOREPLY_HELP}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
263 <td colspan="3" valign="top" width="35%">
264 <slot style="{CREATE_GROUP_FOLDER_STYLE}">
265 <select tabindex='251' id="template_id" name='template_id' onchange="show_edit_template_link(this, 'edit_template');" {IE_DISABLED}>{EMAIL_TEMPLATE_OPTIONS}</select>
266 <input type="button" class="button" onclick="javascript:open_email_template_form('template_id')" value="{MOD.LBL_CREATE_TEMPLATE}" {IE_DISABLED}>
267 <input type="button" value="{MOD.LBL_EDIT_TEMPLATE}" class="button" onclick="javascript:edit_email_template_form('template_id')" name='edit_template' id='edit_template' style="{EDIT_TEMPLATE}">
272 <td valign="top" scope="row" width="18%" NOWRAP>
273 <slot style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_FILTER_DOMAIN}: <span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_FILTER_DOMAIN_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
274 <td valign="top" width="35%">
275 <slot style="{CREATE_GROUP_FOLDER_STYLE}"><input tabindex="270" name="filter_domain" value="{FILTER_DOMAIN}" {IE_DISABLED}></slot></td>
276 <td valign="top" scope="row">
277 <slot><span style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_MAX_AUTO_REPLIES}: <span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_MAX_AUTO_REPLIES_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></span></slot></td>
278 <td valign="top" width="35%">
279 <slot><input tabindex="271" style="{CREATE_GROUP_FOLDER_STYLE}" name="email_num_autoreplies_24_hours" value="{EMAIL_NUM_AUTOREPLIES_24_HOURS}"></slot></td>
281 <tr id = "leaveMessagesOnMailServerRow" style="{LEAVEMESSAGESONMAILSERVER_STYLE}">
282 <td valign="top" scope="row" width='20%'>
283 <slot>{MOD.LBL_MARK_READ}:</slot></td>
284 <td valign="top" width='30%'>
285 <select name='leaveMessagesOnMailServer' tabindex='253'>{LEAVEMESSAGESONMAILSERVER}</select></td>
286 <td valign="top" scope="row">
287 <slot> </slot></td>
288 <td valign="top" width="35%"><slot>
297 <script type="text/javascript" lang="Javascript" src="modules/InboundEmail/InboundEmail.js"></script>
298 <script type="text/javascript">
300 var fieldToSetValue = '';
301 function checkformdata() {
302 return (check_form('EditView') && checkOtherFields() && checkTrashFolder() );
305 function prefillGmailDefaults(){
307 document.getElementById('server_url').value = "imap.gmail.com";
308 document.getElementById('ssl').checked = true;
309 document.getElementById('protocol').value = "imap";
311 toggle_monitored_folder(document.getElementById('protocol'));
314 function checkOtherFields() {
315 var from_name = document.getElementById('from_name').value;
316 var from_addr = document.getElementById('from_addr').value;
317 if (trim(from_name) == '' || trim(from_addr) == '') {
318 requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
319 invalidTxt = SUGAR.language.get('app_strings', 'ERR_INVALID_VALUE');
320 if (trim(from_name) == '') {
321 add_error_style('EditView', 'from_name', requiredTxt + " From Name");
323 if (trim(from_addr) == '') {
324 add_error_style('EditView', 'from_addr', requiredTxt + " From Address");
333 function checkTrashFolder() {
334 var field1=document.getElementById('protocol');
335 if (field1.value == 'imap') {
336 var trashFolderValue = document.getElementById("trashFolder").value;
337 if (trim(trashFolderValue).length <= 0) {
338 requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
339 invalidTxt = SUGAR.language.get('app_strings', 'ERR_INVALID_VALUE');
340 add_error_style('EditView', 'trashFolder', requiredTxt + " Trash Folder");
350 function showCreateCaseRow() {
351 var createCaseRow = document.getElementById('createCaseRow');
352 var createCaseRow1 = document.getElementById('createCaseRow1');
353 var isCreateCase = document.getElementById('is_create_case').checked;
354 var autoImportEl = document.getElementById('is_auto_import');
357 createCaseRow.style.display = '';
358 createCaseRow1.style.display = '';
359 autoImportEl.checked = true;
361 createCaseRow.style.display = 'none';
362 createCaseRow1.style.display = 'none';
363 possibleActionChange();
367 function possibleActionChange() {
368 var maliBoxType = document.getElementById('mailbox_type');
369 var trashRequiredSpan = document.getElementById('trashRequiredSpan');
370 if(maliBoxType.value == 'bounce') {
372 trashRequiredSpan.style.display = 'none';
373 trashRequiredSpan.style.display = 'none';
375 trashRequiredSpan.style.display = '';
376 trashRequiredSpan.style.display = '';
380 function show_edit_template_link(field, editTemplate) {
381 var field1=document.getElementById(editTemplate);
382 if (field.selectedIndex == 0) {
383 field1.style.visibility="hidden";
386 field1.style.visibility="visible";
390 function refresh_email_template_list(template_id, template_name) {
391 var field=document.getElementById(fieldToSetValue);
393 for (var i=0; i < field.options.length; i++) {
394 if (field.options[i].value == template_id) {
395 if (field.options[i].selected==false) {
396 field.options[i].selected=true;
398 field.options[i].text = template_name;
402 //add item to selection list.
404 var newElement=document.createElement('option');
405 newElement.text=template_name;
406 newElement.value=template_id;
407 field.options.add(newElement);
408 newElement.selected=true;
411 //enable the edit button.
412 var editButtonName = 'edit_template';
413 if (fieldToSetValue == 'create_case_template_id') {
414 editButtonName = 'create_case_edit_template';
416 var field1=document.getElementById(editButtonName);
417 field1.style.visibility="visible";
419 var applyListToTemplateField = 'template_id';
420 if (fieldToSetValue == 'template_id') {
421 applyListToTemplateField = 'create_case_template_id';
423 var field=document.getElementById(applyListToTemplateField);
425 for (var i=0; i < field.options.length; i++) {
426 if (field.options[i].value == template_id) {
427 field.options[i].text = template_name;
432 var newElement=document.createElement('option');
433 newElement.text=template_name;
434 newElement.value=template_id;
435 field.options.add(newElement);
440 function open_email_template_form(fieldToSet) {
441 fieldToSetValue = fieldToSet;
442 URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
443 windowName = 'email_template';
444 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
446 win = window.open(URL, windowName, windowFeatures);
449 // put the focus on the popup if the browser supports the focus() method
453 function edit_email_template_form(templateField) {
454 fieldToSetValue = templateField;
455 var field=document.getElementById(templateField);
456 URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
457 if (field.options[field.selectedIndex].value != 'undefined') {
458 URL+="&record="+field.options[field.selectedIndex].value;
460 windowName = 'email_template';
461 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
463 win = window.open(URL, windowName, windowFeatures);
466 // put the focus on the popup if the browser supports the focus() method
470 function open_group_folder_form() {
471 URL="index.php?module=InboundEmail&action=EditGroupFolder&target=Popup&to_pdf=1";
472 windowName = 'group_folder_popup_window';
473 windowFeatures = 'width=400' + ',height=300' + ',resizable=1,scrollbars=1';
475 win = window.open(URL, windowName, windowFeatures);
478 // put the focus on the popup if the browser supports the focus() method
483 function edit_group_folder_form() {
484 URL="index.php?module=InboundEmail&action=EditGroupFolder&target=Popup&to_pdf=1";
485 var field=document.getElementById('group_folder_id');
486 if (field.options[field.selectedIndex].value != 'undefined') {
487 URL+="&record="+field.options[field.selectedIndex].value;
489 windowName = 'edit_group_folder_popup_window';
490 windowFeatures = 'width=400' + ',height=300' + ',resizable=1,scrollbars=1';
492 win = window.open(URL, windowName, windowFeatures);
495 // put the focus on the popup if the browser supports the focus() method
500 function refresh_group_folder_list(groupFolder_id, groupFolder_name) {
501 var field=document.getElementById('group_folder_id');
503 for (var i=0; i < field.options.length; i++) {
504 if (field.options[i].value == groupFolder_id) {
505 if (field.options[i].selected==false) {
506 field.options[i].selected=true;
508 field.options[i].text = groupFolder_name;
512 //add item to selection list.
514 var newElement=document.createElement('option');
515 newElement.text=groupFolder_name;
516 newElement.value=groupFolder_id;
517 field.options.add(newElement);
518 newElement.selected=true;
520 //enable the edit button.
521 var field1=document.getElementById('edit_group');
522 field1.style.visibility="visible";
524 showHideLeaveMessagesOnMailServer();
527 function show_edit_group_folder_link(field) {
529 var field1=document.getElementById('edit_group');
530 if (field.selectedIndex == 0) {
533 field1.style.visibility="visible";
536 showHideLeaveMessagesOnMailServer();
539 function showHideLeaveMessagesOnMailServer() {
540 var field=document.getElementById('group_folder_id');
541 var leaveMessagesOnMailServerRow = document.getElementById('leaveMessagesOnMailServerRow');
542 if (field.selectedIndex == 0) {
543 leaveMessagesOnMailServerRow.style.display="none";
546 leaveMessagesOnMailServerRow.style.display='';
551 function showWarningsIfChaningAutoImport() {
553 var isAutoImportOn = document.getElementById('is_auto_import').checked;
554 var isCreateCase = document.getElementById('is_create_case').checked
555 var record = document.forms['EditView'].record.value;
556 //Alert if changing for an existing record only.
558 alert(warningForAutoChange);
559 //If the user has create case enabled then auto import must be on.
560 if( !isAutoImportOn && isCreateCase)
562 document.getElementById('is_auto_import').checked = true;
563 alert(warningForAutoChangeWithCreateCase);
566 toggle_monitored_folder(document.getElementById('protocol'));
568 possibleActionChange();
570 var warningForAutoChange = '{MOD.LBL_WARNING_CHANGING_AUTO_IMPORT}';
571 var warningForAutoChangeWithCreateCase = '{MOD.LBL_WARNING_CHANGING_AUTO_IMPORT_WITH_CREATE_CASE}';