File: /home/nexper/public_html/67.225.167.226/public_html/crm/modules/InboundEmail/EditView.html
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description:
* Created On: Oct 17, 2005
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): Chris Nojima
********************************************************************************/
-->
<!-- BEGIN: main -->
<p>
{MODULE_TITLE}
</p>
{ERROR_STRING}
{ROLLOVER}
<script type='text/javascript' src='include/javascript/sugar_grp_overlib.js'></script>
<form action="index.php" method="post" name="EditView" id="form">
<input type="hidden" name="module" value="{MODULE}">
<input type="hidden" name="record" value="{ID}">
<input type="hidden" name="isDuplicate" value=false>
<input type="hidden" name="action">
<input type="hidden" name="group_id" value="new">
<input type="hidden" name="return_module">
<input type="hidden" name="return_action">
<input type="hidden" name="return_id">
<input type="hidden" name="personal" value="{PERSONAL}">
<input type="hidden" name="searchField" value="">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-bottom: 2px;">
<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}>
<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} ">
<input title="{MOD.LBL_TEST_BUTTON_TITLE}"
type='button'
accessKey="{MOD.LBL_TEST_BUTTON_KEY}"
class="button"
onClick='ie_test_open_popup_with_submit("InboundEmail", "Popup", "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);'
name="button" value=" {MOD.LBL_TEST_SETTINGS} " {IE_DISABLED}>
</td>
<td align="right" width="20%" NOWRAP><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
<td align='right'>{ADMIN_EDIT}</td>
</tr>
</table>
<table width="100%" border=0 cellspacing="{GRIDLINE}" cellpadding="0" class="tabForm">
<tr>
<th align="left" class="dataLabel" colspan="4"><h4 class="dataLabel">{MOD.LBL_BASIC}</h4></th>
</tr>
<tr>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>{MOD.LBL_NAME}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
<td valign="top" class="dataField" width="35%">
<slot><input name='name' tabindex='10' size='30' maxlength='255' type="text" value="{NAME}" {IE_DISABLED}></slot></td>
<td valign="top" class="dataLabel">
<slot>{MOD.LBL_STATUS}: </slot></td>
<td valign="top" class="dataField" width="35%"><slot>
<select name='status' tabindex='60' {IE_DISABLED}>{STATUS}</select></slot></td>
</tr>
<tr>
<td valign="top" class="dataLabel">
<slot>{MOD.LBL_SERVER_URL}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
<td valign="top" class="dataField" width="35%">
<slot><input name='server_url' tabindex='20' size='30' maxlength='100' type="text" value="{SERVER_URL}" {IE_DISABLED}></slot></td>
<td valign="top" class="dataLabel">
<slot>{MOD.LBL_LOGIN}:
<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
<td valign="top" class="dataField" width="35%">
<slot><input name='email_user' tabindex='70' size='30' maxlength='100' type="text" value="{USER}" autocomplete="off" {IE_DISABLED}></slot></td>
</tr>
<tr>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>{MOD.LBL_SERVER_TYPE}:
<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
<td valign="top" class="dataField" width="35%">
<slot>
<select name='protocol' id="protocol" tabindex='30' onchange="toggle_monitored_folder(this); setPortDefault();" {IE_DISABLED}>{PROTOCOL}</select></slot></td>
<td valign="top" class="dataLabel">
<slot>{MOD.LBL_PASSWORD}:
<span class="required">{APP.LBL_REQUIRED_SYMBOL} </slot></td>
<td valign="top" class="dataField" width="35%">
<slot><input name='email_password' tabindex='80' size='30' maxlength='100' type="password" value="{PASSWORD}" autocomplete="off" {IE_DISABLED}></span></slot></td>
</tr>
<tr>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>{MOD.LBL_PORT}:
<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
<td valign="top" class="dataField" width="35%">
<slot>
<input name='port' id='port' tabindex="40" value="{PORT}" size='10' {IE_DISABLED}>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot><span id="label_inbox" >{MOD.LBL_MAILBOX}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></span> </slot></td>
<td valign="top" class="dataField" width="35%">
<slot><input id="mailbox" name='mailbox' tabindex='90' size='30' maxlength='500' type="text" value="{MAILBOX}">
<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);' value="{MOD.LBL_SELECT}">
</slot></td>
</tr>
<tr>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<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="themes/default/images/help.gif"></span></span></slot>
</td>
<td valign="top" class="dataField" width="35%">
<slot>
<input name='ssl' id='ssl' tabindex='45' {CERT} value='1' type='checkbox' {SSL} onClick="setPortDefault();" {IE_DISABLED}>
</slot>
</td>
<td id="trashFolderRow" valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>{MOD.LBL_TRASH_FOLDER}:
<span name="trashRequiredSpan" id="trashRequiredSpan" class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
<td id="trashFolderRow1" valign="top" class="dataField" width="35%">
<slot>
<input name='trashFolder' id='trashFolder' tabindex="92" value="{TRASHFOLDER}" size='30' maxlength='100' type="text">
<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");' value="{MOD.LBL_SELECT}">
</tr>
<tr id="sentFolderRow">
<td valign="top" class="dataLabel">
<slot> </slot></td>
<td valign="top" class="dataField" width="35%"><slot>
</slot></td>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>{MOD.LBL_SENT_FOLDER}:</slot></td>
<td valign="top" class="dataField" width="35%">
<slot><input id="sentFolder" name='sentFolder' tabindex='95' size='30' maxlength='100' type="text" value="{SENTFOLDER}">
<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");' value="{MOD.LBL_SELECT}">
</slot>
</td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="{GRIDLINE}" cellpadding="0" class="tabForm">
<tr>
<th align="left" class="dataLabel" colspan="4"><h4 class="dataLabel">{MOD.LBL_EMAIL_OPTIONS}</h4></th>
</tr>
<tr>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>
</slot></td>
<td valign="top" class="dataField" width="35%">
<slot>
</slot></td>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>{MOD.LBL_FROM_NAME}:<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
<td valign="top" class="dataField" width="35%">
<slot><input tabindex="300" name="from_name" id="from_name" value="{FROM_NAME}" {IE_DISABLED}> </slot></td>
</tr>
<tr>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot><span style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_ASSIGN_TO_GROUP_FOLDER}: <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="themes/default/images/help.gif"></span></span></slot>
</td>
<td valign="top" class="dataField" width="15%" NOWRAP>
<slot>
<select tabindex='221' onchange="show_edit_group_folder_link(this);" style="{CREATE_GROUP_FOLDER_STYLE}" id="group_folder_id" name='group_folder_id'>{GROUP_FOLDER_OPTIONS}</select>
</slot>
<input type="button" style="{CREATE_GROUP_FOLDER_STYLE}" class="button" onclick="javascript:open_group_folder_form()" value="{MOD.LBL_CREATE_TEMPLATE}" {IE_DISABLED}>
<input type="button" style="{EDIT_GROUP_FOLDER_STYLE}" class="button" name='edit_group' id='edit_group' value="{MOD.LBL_EDIT_TEMPLATE}" onclick="javascript:edit_group_folder_form()">
</td>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>{MOD.LBL_FROM_ADDR}:<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> </slot></td>
<td valign="top" class="dataField" width="35%">
<slot><input tabindex="310" id="from_addr" name="from_addr" value="{FROM_ADDR}" {IE_DISABLED}> </slot></td>
</tr>
<tr>
<td valign="top" class="dataLabel">
<slot>{MOD.LBL_MAILBOX_TYPE}: <span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_POSSIBLE_ACTION_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );"> <img src="themes/default/images/help.gif"></span></slot></td>
<td valign="top" class="dataField" width="35%"><slot>
<select id='mailbox_type' name='mailbox_type' onchange="showCreateCaseRow();" tabindex='231' {IE_DISABLED}>{MAILBOX_TYPE}</select></slot></td>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
{MOD.LBL_REPLY_TO_NAME}:
</td>
<td valign="top" class="dataField" width="35%">
<input tabindex="320" name="reply_to_name" value="{REPLY_TO_NAME}" {IE_DISABLED}>
</td>
</tr>
<tr id="createCaseRow" style="{CREATE_CASE_ROW_STYLE}">
<td valign="top" class="dataLabel">
<slot>{MOD.LBL_DISTRIBUTION_METHOD}: </slot></td>
<td valign="top" class="dataField" width="35%"><slot>
<select name='distrib_method' tabindex='241'>{DISTRIBUTION_METHOD}</select></slot></td>
<td valign="top" class="dataLabel">
<slot> </slot></td>
<td valign="top" class="dataField" width="35%"><slot>
</slot></td>
</tr>
<tr id="createCaseRow1" style="{CREATE_CASE_ROW_STYLE}">
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>{MOD.LBL_CREATE_CASE_REPLY_TEMPLATE}: </slot></td>
<td colspan="3" valign="top" class="dataField" width="35%">
<slot>
<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>
<input type="button" class="button" onclick="javascript:open_email_template_form('create_case_template_id')" value="{MOD.LBL_CREATE_TEMPLATE}" {IE_DISABLED}>
<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}">
</slot>
</td>
</tr>
<tr>
<td valign="top" class="dataLabel">
<slot> </slot></td>
<td valign="top" class="dataField" width="35%"><slot>
</slot></td>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
{MOD.LBL_REPLY_TO_ADDR}:
</td>
<td valign="top" class="dataField" width="35%">
<input tabindex="340" name="reply_to_addr" value="{REPLY_TO_ADDR}" {IE_DISABLED}>
</td>
</tr>
<tr>
<td valign="top" class="dataLabel" width="15%" NOWRAP>
<slot>{MOD.LBL_AUTOREPLY}: </slot></td>
<td colspan="3" valign="top" class="dataField" width="35%">
<slot>
<select tabindex='251' id="template_id" name='template_id' onchange="show_edit_template_link(this, 'edit_template');" {IE_DISABLED}>{EMAIL_TEMPLATE_OPTIONS}</select>
<input type="button" class="button" onclick="javascript:open_email_template_form('template_id')" value="{MOD.LBL_CREATE_TEMPLATE}" {IE_DISABLED}>
<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}">
</slot>
</td>
</tr>
<tr>
<td valign="top" class="dataLabel" width="18%" NOWRAP>
<slot>{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="themes/default/images/help.gif"></span</slot></td>
<td valign="top" class="dataField" width="35%">
<slot><input tabindex="270" name="filter_domain" value="{FILTER_DOMAIN}" {IE_DISABLED}></slot></td>
<td valign="top" class="dataLabel">
<slot> </slot></td>
<td valign="top" class="dataField" width="35%"><slot>
</slot></td>
</tr>
<tr id = "leaveMessagesOnMailServerRow" style="{LEAVEMESSAGESONMAILSERVER_STYLE}">
<td valign="top" class="dataLabel" width='20%'>
<slot>{MOD.LBL_MARK_READ}:</slot></td>
<td valign="top" class="dataField" width='30%'>
<select name='leaveMessagesOnMailServer' tabindex='253'>{LEAVEMESSAGESONMAILSERVER}</select></slot></td>
<td valign="top" class="dataLabel">
<slot> </slot></td>
<td valign="top" class="dataField" width="35%"><slot>
</slot></td>
</tr>
</table>
<br>
</form>
<form action="index.php" method="post" name="testSettingsView" id="testSettingsView">
<input type="hidden" name="module" value="" />
<input type="hidden" name="action" />
<input type="hidden" name="target1"/>
<input type="hidden" name="server_url" value="" />
<input type="hidden" name="email_user" value="" />
<input type="hidden" name="protocol" value="" />
<input type="hidden" name="port" value="" />
<input type="hidden" name="email_password" value="" />
<input type="hidden" name="mailbox" value="" />
<input type="hidden" name="ssl" value="" />
<input type="hidden" name="personal" value="" />
<input type="hidden" name="to_pdf" value="1">
<input type="hidden" name="searchField" value="">
</form>
<script type="text/javascript" lang="Javascript" src="modules/InboundEmail/InboundEmail.js"></script>
<script type="text/javascript">
var fieldToSetValue = '';
function checkformdata() {
return (check_form('EditView') && checkOtherFields() && checkTrashFolder() && checkTeamInfo() && checkGroupFolderForCreateCase());
}
function checkOtherFields() {
var from_name = document.getElementById('from_name').value;
var from_addr = document.getElementById('from_addr').value;
if (trim(from_name) == '' || trim(from_addr) == '') {
requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
invalidTxt = SUGAR.language.get('app_strings', 'ERR_INVALID_VALUE');
if (trim(from_name) == '') {
add_error_style('EditView', 'from_name', requiredTxt + " From Name");
} // if
if (trim(from_addr) == '') {
add_error_style('EditView', 'from_addr', requiredTxt + " From Address");
} // if
return false;
} else {
return true;
} // else
} // fn
function checkTrashFolder() {
var maliBoxType = document.getElementById('mailbox_type');
if(maliBoxType.options[maliBoxType.selectedIndex].value == 'bounce') {
return true;
}
var field1=document.getElementById('protocol');
if (field1.value == 'imap') {
var trashFolderValue = document.getElementById("trashFolder").value;
if (trim(trashFolderValue).length <= 0) {
requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
invalidTxt = SUGAR.language.get('app_strings', 'ERR_INVALID_VALUE');
add_error_style('EditView', 'trashFolder', requiredTxt + " Trash Folder");
return false;
} else {
return true;
}
} else {
return true;
} // else
} // fn
function checkGroupFolderForCreateCase() {
var maliBoxType = document.getElementById('mailbox_type');
var group_folder_id = document.getElementById('group_folder_id');
if (maliBoxType.options[maliBoxType.selectedIndex].value == 'createcase' && (group_folder_id.selectedIndex == 0)) {
requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
alert(requiredTxt + ": Assign To Group Folder");
return false;
} else {
return true;
} // else
} // fn
function checkTeamInfo() {
return true;
} // fn
function showCreateCaseRow() {
var createCaseRow = document.getElementById('createCaseRow');
var createCaseRow1 = document.getElementById('createCaseRow1');
var maliBoxType = document.getElementById('mailbox_type');
var group_folder_id= document.getElementById('group_folder_id');
if (maliBoxType.options[maliBoxType.selectedIndex].value == 'createcase' && (group_folder_id.selectedIndex != 0)) {
createCaseRow.style.display = '';
createCaseRow1.style.display = '';
} else {
createCaseRow.style.display = 'none';
createCaseRow1.style.display = 'none';
possibleActionChange();
} // else
} // fn
function possibleActionChange() {
var maliBoxType = document.getElementById('mailbox_type');
var trashRequiredSpan = document.getElementById('trashRequiredSpan');
if(maliBoxType.options[maliBoxType.selectedIndex].value == 'bounce') {
trashRequiredSpan.style.display = 'none';
trashRequiredSpan.style.display = 'none';
} else {
trashRequiredSpan.style.display = '';
trashRequiredSpan.style.display = '';
} // else
}
function show_edit_template_link(field, editTemplate) {
var field1=document.getElementById(editTemplate);
if (field.selectedIndex == 0) {
field1.style.visibility="hidden";
}
else {
field1.style.visibility="visible";
}
}
function refresh_email_template_list(template_id, template_name) {
var field=document.getElementById(fieldToSetValue);
var bfound=0;
for (var i=0; i < field.options.length; i++) {
if (field.options[i].value == template_id) {
if (field.options[i].selected==false) {
field.options[i].selected=true;
}
field.options[i].text = template_name;
bfound=1;
}
}
//add item to selection list.
if (bfound == 0) {
var newElement=document.createElement('option');
newElement.text=template_name;
newElement.value=template_id;
field.options.add(newElement);
newElement.selected=true;
}
//enable the edit button.
var editButtonName = 'edit_template';
if (fieldToSetValue == 'create_case_template_id') {
editButtonName = 'create_case_edit_template';
} // if
var field1=document.getElementById(editButtonName);
field1.style.visibility="visible";
var applyListToTemplateField = 'template_id';
if (fieldToSetValue == 'template_id') {
applyListToTemplateField = 'create_case_template_id';
} // if
var field=document.getElementById(applyListToTemplateField);
if (bfound == 1) {
for (var i=0; i < field.options.length; i++) {
if (field.options[i].value == template_id) {
field.options[i].text = template_name;
} // if
} // for
} else {
var newElement=document.createElement('option');
newElement.text=template_name;
newElement.value=template_id;
field.options.add(newElement);
} // else
}
function open_email_template_form(fieldToSet) {
fieldToSetValue = fieldToSet;
URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
windowName = 'email_template';
windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
win = window.open(URL, windowName, windowFeatures);
if(window.focus)
{
// put the focus on the popup if the browser supports the focus() method
win.focus();
}
}
function edit_email_template_form(templateField) {
fieldToSetValue = templateField;
var field=document.getElementById(templateField);
URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
if (field.options[field.selectedIndex].value != 'undefined') {
URL+="&record="+field.options[field.selectedIndex].value;
}
windowName = 'email_template';
windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
win = window.open(URL, windowName, windowFeatures);
if(window.focus)
{
// put the focus on the popup if the browser supports the focus() method
win.focus();
}
}
function open_group_folder_form() {
URL="index.php?module=InboundEmail&action=EditGroupFolder&target=Popup&to_pdf=1";
windowName = 'popup_window';
windowFeatures = 'width=400' + ',height=300' + ',resizable=1,scrollbars=1';
win = window.open(URL, windowName, windowFeatures);
if(window.focus)
{
// put the focus on the popup if the browser supports the focus() method
win.focus();
}
}
function edit_group_folder_form() {
URL="index.php?module=InboundEmail&action=EditGroupFolder&target=Popup&to_pdf=1";
var field=document.getElementById('group_folder_id');
if (field.options[field.selectedIndex].value != 'undefined') {
URL+="&record="+field.options[field.selectedIndex].value;
}
windowName = 'popup_window';
windowFeatures = 'width=400' + ',height=300' + ',resizable=1,scrollbars=1';
win = window.open(URL, windowName, windowFeatures);
if(window.focus)
{
// put the focus on the popup if the browser supports the focus() method
win.focus();
}
}
function refresh_group_folder_list(groupFolder_id, groupFolder_name) {
var field=document.getElementById('group_folder_id');
var bfound=0;
for (var i=0; i < field.options.length; i++) {
if (field.options[i].value == groupFolder_id) {
if (field.options[i].selected==false) {
field.options[i].selected=true;
}
field.options[i].text = groupFolder_name;
bfound=1;
}
}
//add item to selection list.
if (bfound == 0) {
var newElement=document.createElement('option');
newElement.text=groupFolder_name;
newElement.value=groupFolder_id;
field.options.add(newElement);
newElement.selected=true;
}
//enable the edit button.
var field1=document.getElementById('edit_group');
field1.style.visibility="visible";
showCreateCaseRow();
showHideLeaveMessagesOnMailServer();
}
function show_edit_group_folder_link(field) {
var field1=document.getElementById('edit_group');
var leaveMessagesOnMailServerRow=document.getElementById('leaveMessagesOnMailServerRow');
if (field.selectedIndex == 0) {
leaveMessagesOnMailServerRow.style.display="none";
}
else {
field1.style.visibility="visible";
leaveMessagesOnMailServerRow.style.display='';
}
showCreateCaseRow();
showHideLeaveMessagesOnMailServer();
}
function showHideLeaveMessagesOnMailServer() {
var field=document.getElementById('group_folder_id');
if (field.selectedIndex == 0) {
leaveMessagesOnMailServerRow.style.display="none";
}
else {
leaveMessagesOnMailServerRow.style.display='';
}
} // fn
toggle_monitored_folder(document.getElementById('protocol'));
setPortDefault();
possibleActionChange();
</script>
{JAVASCRIPT}
<!-- END: main -->