]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/InboundEmail/EditView.html
Release 6.5.0
[Github/sugarcrm.git] / modules / InboundEmail / EditView.html
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  * Description:
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  ********************************************************************************/
44 -->
45 <div id="testSettingsDiv"></div>
46 <div id="selectFoldersDiv"></div>
47 <!-- BEGIN: main -->
48 {MODULE_TITLE}
49 {ERROR_STRING}
50 <script type='text/javascript' src='cache/include/javascript/sugar_grp_overlib.js?v={VERSION_MARK}'></script>
51
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="origin_id" value="{ORIGIN_ID}">
56         <input type="hidden" name="isDuplicate" value=false>
57         <input type="hidden" name="action">
58         <input type="hidden" name="group_id" value="{GROUP_ID}">
59         <input type="hidden" name="return_module">
60         <input type="hidden" name="return_action">
61         <input type="hidden" name="return_id">
62         <input type="hidden" name="personal" value="{PERSONAL}">
63         <input type="hidden" name="searchField" value="">
64         <input type="hidden" id="mailbox_type" name="mailbox_type" value="{MAILBOX_TYPE}">
65
66         <table width="100%" cellpadding="0" cellspacing="0" border="0">
67                 <tr>
68                         <td>
69                                 <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" id="button" value="  {APP.LBL_SAVE_BUTTON_LABEL}  " {IE_DISABLED}>
70                                 <input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" id="emailCancel" onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'; if(this.form.record.value == '' && this.form.origin_id.value != '') this.form.record.value=this.form.origin_id.value;" type="submit" name="button" value="  {APP.LBL_CANCEL_BUTTON_LABEL}  ">
71                                 <input title="{MOD.LBL_TEST_BUTTON_TITLE}"
72                                         type='button'
73                                         class="button"
74                                         id="emailTestSettings"
75                                         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", this.form.origin_id.value?this.form.origin_id.value:this.form.record.value);'
76                                         name="button" value="  {MOD.LBL_TEST_SETTINGS}  " {IE_DISABLED}>
77                         </td>
78                         <td align="right" width="20%" NOWRAP><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
79                         <td align='right'>{ADMIN_EDIT}</td>
80                 </tr>
81         </table>
82
83     <div class="edit view">
84         <table width="100%" border=0 cellspacing="{GRIDLINE}" cellpadding="0">
85                 <tr>
86                       <th align="left" scope="row" colspan="1"><h4>{MOD.LBL_BASIC}</h4></th>
87                 </tr>
88                 <tr>
89                 <td>&nbsp;</td>
90                 <td style="vertical-align:bottom;"><a href="javascript:void(0);" id="prefill_gmail_defaults_link" onclick="javascript:prefillGmailDefaults();">{APP.LBL_EMAIL_ACCOUNTS_GMAIL_DEFAULTS}</a>&nbsp;</td>
91                 </tr>
92                 <tr>
93                         <td valign="top" scope="row" width="15%" NOWRAP>
94                                 <slot>{MOD.LBL_NAME}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
95                         <td valign="top"  width="35%">
96                                 <slot><input name='name' id='name' tabindex='10' size='30' maxlength='255' type="text" value="{NAME}" {IE_DISABLED}></slot></td>
97                         <td valign="top" scope="row">
98                                 <slot>{MOD.LBL_STATUS}:&nbsp;</slot></td>
99                         <td valign="top"  width="35%"><slot>
100                                 <select name='status' tabindex='60' {IE_DISABLED}>{STATUS}</select></slot></td>
101                 </tr>
102                 <tr>
103                         <td valign="top" scope="row">
104                                         <slot>{MOD.LBL_SERVER_URL}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
105                         <td valign="top"  width="35%">
106                                 <slot><input id='server_url' name='server_url' tabindex='20' size='30' maxlength='100' type="text" value="{SERVER_URL}" {IE_DISABLED}></slot></td>
107                         <td valign="top" scope="row">
108                                 <slot>{MOD.LBL_LOGIN}:
109                                 <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
110                         <td valign="top"  width="35%">
111                                 <slot><input name='email_user' id='email_user' tabindex='70' size='30' maxlength='100' type="text" value="{USER}" autocomplete="off" {IE_DISABLED}></slot></td>
112                 </tr>
113                 <tr>
114                         <td valign="top" scope="row" width="15%" NOWRAP>
115                                 <slot>{MOD.LBL_SERVER_TYPE}:
116                                 <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
117                         <td valign="top"  width="35%">
118                                 <slot>
119                                 <select name='protocol' id="protocol" tabindex='30' onchange="toggle_monitored_folder(this); setPortDefault();" {IE_DISABLED}>{PROTOCOL}</select></slot></td>
120                         <td valign="top" scope="row">
121                                 <slot>{MOD.LBL_PASSWORD}:
122                                 <span class="required">{EMAIL_PASS_REQ_SYMB}&nbsp;</slot></td>
123                         <td valign="top"  width="35%">
124                                 <slot>
125                                 <input name='email_password' id="email_password" tabindex='80' size='30' maxlength='100' type="password" autocomplete="off" {IE_DISABLED}>
126                                 <a href="javascript:void(0)" id='email_password_link' onClick="SUGAR.util.setEmailPasswordEdit('email_password')" style="display: none">{APP.LBL_CHANGE_PASSWORD}</a>
127                                 </slot></td>
128                 </tr>
129                 <tr>
130                         <td valign="top" scope="row" width="15%" NOWRAP>
131                                 <slot>{MOD.LBL_PORT}:
132                                 <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
133                         <td valign="top"  width="35%">
134                                 <slot>
135                                 <input name='port' id='port' tabindex="40" value="{PORT}" size='10' {IE_DISABLED}>
136                         <td valign="top" scope="row" width="15%" NOWRAP>
137                                 <slot><span id="label_inbox" >{MOD.LBL_MAILBOX}: <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></span>&nbsp;</slot></td>
138                         <td valign="top"  width="35%">
139                                 <slot><input id="mailbox" name='mailbox' tabindex='90' size='30' maxlength='500' type="text" value="{MAILBOX}">
140                                         <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}">
141                                 </slot></td>
142                 </tr>
143                 <tr>
144                         <td valign="top" scope="row" width="15%" NOWRAP>
145                                 <slot><span>{MOD.LBL_SSL}:&nbsp;<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' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></span></slot>
146                         </td>
147                         <td valign="top"  width="35%">
148                                 <slot>
149                                 <input name='ssl' id='ssl' tabindex='45' {CERT} value='1' type='checkbox' {SSL} onClick="setPortDefault();" {IE_DISABLED}>
150                                 </slot>
151                         </td>
152                         <td id="trashFolderRow" valign="top" scope="row" width="15%" NOWRAP>
153                                 <slot>{MOD.LBL_TRASH_FOLDER}:
154                                 <span name="trashRequiredSpan" id="trashRequiredSpan" class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
155                         <td id="trashFolderRow1" valign="top"  width="35%">
156                                 <slot>
157                                 <input name='trashFolder' id='trashFolder' tabindex="92" value="{TRASHFOLDER}" size='30' maxlength='100' type="text">
158                                 <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}">
159                 </tr>
160                 <tr id="sentFolderRow">
161                         <td valign="top" scope="row">
162                                 <slot>&nbsp;</slot></td>
163                         <td valign="top"  width="35%"><slot>
164                                 &nbsp;</slot></td>
165                         <td valign="top" scope="row" width="15%" NOWRAP>
166                                 <slot>{MOD.LBL_SENT_FOLDER}:</slot></td>
167                         <td valign="top"  width="35%">
168                                 <slot><input id="sentFolder" name='sentFolder' tabindex='95' size='30' maxlength='100' type="text" value="{SENTFOLDER}">
169                                         <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}">
170                                 </slot>
171                         </td>
172                 </tr>
173         </table>
174         </div>
175     <div class="edit view">
176         <table width="100%" border="0" cellspacing="{GRIDLINE}" cellpadding="0">
177                 <tr>
178                 <th align="left" scope="row" colspan="4"><h4>{EMAIL_OPTIONS}</h4></th>
179                 </tr>
180                 <tr>
181                         <td valign="top" scope="row" width="15%" NOWRAP>
182                                 <slot>
183                                 &nbsp;</slot></td>
184
185                         <td valign="top"  width="35%">
186                                 <slot>
187                                 &nbsp;</slot></td>
188                         <td valign="top" scope="row" width="15%" NOWRAP>
189                                 <slot>{MOD.LBL_FROM_NAME}:<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>&nbsp;</slot></td>
190                         <td valign="top"  width="35%">
191                                 <slot><input tabindex="300" name="from_name" id="from_name" value="{FROM_NAME}" {IE_DISABLED}>&nbsp;</slot></td>
192                 </tr>
193                 <tr>
194                         <td valign="top" scope="row" width="15%" NOWRAP>
195                         <slot><span style="{AUTO_IMPORT_STYLE}">{MOD.LBL_ENABLE_AUTO_IMPORT}:&nbsp;<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' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></span></slot>&nbsp;
196                         </td>
197                         <td valign="top"  width="15%" NOWRAP>
198                          <input name='is_auto_import' style="{AUTO_IMPORT_STYLE}" id='is_auto_import' onclick="showWarningsIfChaningAutoImport();"tabindex='45' type='checkbox' {IS_AUTO_IMPORT}>
199                         </td>
200                         <td valign="top" scope="row" width="15%" NOWRAP>
201                                 <slot>{MOD.LBL_FROM_ADDR}:<span class="required">{APP.LBL_REQUIRED_SYMBOL}</span><span valign="bottom" onmouseout="return nd();" onmouseover="return overlib('{MOD.LBL_FROM_ADDR_DESC}', FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
202                         <td valign="top"  width="35%">
203                                 <slot><input tabindex="310" name="from_addr" id="from_addr" value="{FROM_ADDR}" {IE_DISABLED}></slot></td>
204                 </tr>
205                 <tr>
206                         <td valign="top" scope="row">
207                                 <slot style="{MAILBOX_TYPE_STYLE}">{MOD.LBL_CREATE_CASE}:&nbsp;<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' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
208                         <td valign="top"  width="35%"><slot style="{MAILBOX_TYPE_STYLE}">
209                              <input name='is_create_case' id='is_create_case' onclick="showCreateCaseRow();"tabindex='45' type='checkbox' {IS_CREATE_CASE} {IE_DISABLED}></slot></td>
210                         <td valign="top" scope="row" width="15%" NOWRAP>
211                                 {MOD.LBL_REPLY_TO_NAME}:&nbsp;
212                         </td>
213                         <td valign="top"  width="35%">
214                                 <input tabindex="320" name="reply_to_name" value="{REPLY_TO_NAME}" {IE_DISABLED}>
215                         </td>
216                 </tr>
217                 <tr id="createCaseRow" style="{CREATE_CASE_ROW_STYLE}">
218                         <td valign="top" scope="row">
219                                 <slot>{MOD.LBL_DISTRIBUTION_METHOD}:&nbsp;</slot></td>
220                         <td valign="top"  width="35%"><slot>
221                                 <select name='distrib_method' tabindex='241'>{DISTRIBUTION_METHOD}</select></slot></td>
222                         <td valign="top" scope="row">
223                                 <slot>&nbsp;</slot></td>
224                         <td valign="top"  width="35%"><slot>
225                                 &nbsp;</slot></td>
226                 </tr>
227                 <tr id="createCaseRow1" style="{CREATE_CASE_ROW_STYLE}">
228                         <td valign="top" scope="row" width="15%" NOWRAP >
229                                 <slot>{MOD.LBL_CREATE_CASE_REPLY_TEMPLATE}:&nbsp;<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' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
230                         <td colspan="3" valign="top"  width="35%">
231                                 <slot>
232                                         <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>
233                                         <input type="button" class="button" onclick="javascript:open_email_template_form('create_case_template_id')" value="{MOD.LBL_CREATE_TEMPLATE}" {IE_DISABLED}>
234                                         <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                                 </slot>
236                         </td>
237                 </tr>
238                 <tr>
239                         <td valign="top" scope="row">
240                                 <slot>&nbsp;</slot></td>
241                         <td valign="top"  width="35%"><slot>
242                                 &nbsp;</slot></td>
243                         <td valign="top" scope="row" width="15%" NOWRAP>
244                                 {MOD.LBL_REPLY_TO_ADDR}:&nbsp;
245                         </td>
246                         <td valign="top"  width="35%">
247                                 <input tabindex="340" name="reply_to_addr" value="{REPLY_TO_ADDR}" {IE_DISABLED}>&nbsp;
248                         </td>
249                 </tr>
250                 <tr style="MAILBOX_TYPE_STYLE">
251                         <td valign="top" scope="row">
252                                 <slot>&nbsp;</slot></td>
253                         <td valign="top"  width="35%"><slot>
254                                 &nbsp;</slot></td>
255                         <td valign="top" scope="row" width="15%" >
256                          <slot style="{MAILBOX_TYPE_STYLE}">{MOD.LBL_ALLOW_OUTBOUND_GROUP_USAGE}:&nbsp;
257                                 <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' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span>
258                         </slot>
259                   </td>
260                         <td valign="top"  width="35%">
261                          <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>
262                         </td>
263                 </tr>
264                 <tr>
265                         <td valign="top" scope="row" width="15%" NOWRAP>
266                                 <slot style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_AUTOREPLY}:&nbsp;<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' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
267                         <td colspan="3" valign="top"  width="35%">
268                                 <slot style="{CREATE_GROUP_FOLDER_STYLE}">
269                                         <select tabindex='251' id="template_id" name='template_id' onchange="show_edit_template_link(this, 'edit_template');" {IE_DISABLED}>{EMAIL_TEMPLATE_OPTIONS}</select>
270                                         <input type="button" class="button" onclick="javascript:open_email_template_form('template_id')" value="{MOD.LBL_CREATE_TEMPLATE}" {IE_DISABLED}>
271                                         <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                                 </slot>
273                         </td>
274                 </tr>
275                 <tr>
276                         <td valign="top" scope="row" width="18%" NOWRAP>
277                                 <slot style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_FILTER_DOMAIN}:&nbsp;<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' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></slot></td>
278                         <td valign="top"  width="35%">
279                                 <slot style="{CREATE_GROUP_FOLDER_STYLE}"><input tabindex="270" name="filter_domain" value="{FILTER_DOMAIN}" {IE_DISABLED}></slot></td>
280                         <td valign="top" scope="row">
281                                 <slot><span style="{CREATE_GROUP_FOLDER_STYLE}">{MOD.LBL_MAX_AUTO_REPLIES}:&nbsp;<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' );">&nbsp;<img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=helpInline.gif"></span></span></slot></td>
282                         <td valign="top"  width="35%">
283                                 <slot><input tabindex="271" style="{CREATE_GROUP_FOLDER_STYLE}" name="email_num_autoreplies_24_hours" value="{EMAIL_NUM_AUTOREPLIES_24_HOURS}"></slot></td>
284                 </tr>
285                 <tr id = "leaveMessagesOnMailServerRow" style="{LEAVEMESSAGESONMAILSERVER_STYLE}">
286                         <td valign="top" scope="row" width='20%'>
287                                 <slot>{MOD.LBL_MARK_READ}:</slot></td>
288                         <td valign="top"  width='30%'>
289                                 <select name='leaveMessagesOnMailServer' tabindex='253'>{LEAVEMESSAGESONMAILSERVER}</select></td>
290                         <td valign="top" scope="row">
291                                 <slot>&nbsp;</slot></td>
292                         <td valign="top"  width="35%"><slot>
293                                 &nbsp;</slot></td>
294                 </tr>
295         </table>
296         </div>
297
298
299 </form>
300
301 <script type="text/javascript" lang="Javascript" src="modules/InboundEmail/InboundEmail.js?v={VERSION_MARK}"></script>
302 <script type="text/javascript">
303
304 var fieldToSetValue = '';
305 function checkformdata() {
306         return (check_form('EditView') && checkOtherFields() && checkTrashFolder() );
307 }
308
309 function prefillGmailDefaults(){
310
311         document.getElementById('server_url').value = "imap.gmail.com";
312         document.getElementById('ssl').checked = true;
313         document.getElementById('protocol').value = "imap";
314
315         toggle_monitored_folder(document.getElementById('protocol'));
316         setPortDefault();
317 }
318 function checkOtherFields() {
319         var from_name = document.getElementById('from_name').value;
320         var from_addr = document.getElementById('from_addr').value;
321         if (trim(from_name) == '' || trim(from_addr) == '') {
322             requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
323             invalidTxt = SUGAR.language.get('app_strings', 'ERR_INVALID_VALUE');
324             if (trim(from_name) == '') {
325                 add_error_style('EditView',  'from_name', requiredTxt +         " From Name");
326             } // if
327             if (trim(from_addr) == '') {
328                 add_error_style('EditView',  'from_addr', requiredTxt +         " From Address");
329             } // if
330                 return false;
331         } else {
332                 return true;
333         } // else
334 } // fn
335
336
337 function checkTrashFolder() 
338 {
339         if (document.getElementById('protocol').value == 'imap' && document.getElementById('mailbox_type').value != 'bounce') {
340                 var trashFolderValue = document.getElementById("trashFolder").value;
341                 if (trim(trashFolderValue).length <= 0) {
342                     requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
343                     invalidTxt = SUGAR.language.get('app_strings', 'ERR_INVALID_VALUE');
344                     add_error_style('EditView',  'trashFolder', requiredTxt +   " Trash Folder");
345                         return false;
346                 } else {
347                         return true;
348                 }
349         } else {
350                 return true;
351         } // else
352 } // fn
353
354 function showCreateCaseRow() {
355         var createCaseRow = document.getElementById('createCaseRow');
356         var createCaseRow1 = document.getElementById('createCaseRow1');
357         var isCreateCase = document.getElementById('is_create_case').checked;
358         var autoImportEl = document.getElementById('is_auto_import');
359
360         if (isCreateCase) {
361                 createCaseRow.style.display = '';
362                 createCaseRow1.style.display = '';
363                 autoImportEl.checked = true;
364         } else {
365                 createCaseRow.style.display = 'none';
366                 createCaseRow1.style.display = 'none';
367                 possibleActionChange();
368         } // else
369 } // fn
370
371 function possibleActionChange() {
372         var mailBoxType = document.getElementById('mailbox_type');
373         var trashRequiredSpan = document.getElementById('trashRequiredSpan');
374         if(mailBoxType.value == 'bounce') {
375
376                 trashRequiredSpan.style.display = 'none';
377                 trashRequiredSpan.style.display = 'none';
378         } else {
379                 trashRequiredSpan.style.display = '';
380                 trashRequiredSpan.style.display = '';
381         } // else
382 }
383
384 function show_edit_template_link(field, editTemplate) {
385         var field1=document.getElementById(editTemplate);
386         if (field.selectedIndex == 0) {
387                 field1.style.visibility="hidden";
388         }
389         else {
390                 field1.style.visibility="visible";
391         }
392 }
393
394 function refresh_email_template_list(template_id, template_name) {
395         var field=document.getElementById(fieldToSetValue);
396         var bfound=0;
397         for (var i=0; i < field.options.length; i++) {
398                         if (field.options[i].value == template_id) {
399                                 if (field.options[i].selected==false) {
400                                         field.options[i].selected=true;
401                                 }
402                                 field.options[i].text = template_name;
403                                 bfound=1;
404                         }
405         }
406         //add item to selection list.
407         if (bfound == 0) {
408                 var newElement=document.createElement('option');
409                 newElement.text=template_name;
410                 newElement.value=template_id;
411                 field.options.add(newElement);
412                 newElement.selected=true;
413         }
414
415         //enable the edit button.
416         var editButtonName = 'edit_template';
417         if (fieldToSetValue == 'create_case_template_id') {
418                 editButtonName = 'create_case_edit_template';
419         } // if
420         var field1=document.getElementById(editButtonName);
421         field1.style.visibility="visible";
422
423         var applyListToTemplateField = 'template_id';
424         if (fieldToSetValue == 'template_id') {
425                 applyListToTemplateField = 'create_case_template_id';
426         } // if
427         var field=document.getElementById(applyListToTemplateField);
428         if (bfound == 1) {
429                 for (var i=0; i < field.options.length; i++) {
430                         if (field.options[i].value == template_id) {
431                                 field.options[i].text = template_name;
432                         } // if
433                 } // for
434
435         } else {
436                 var newElement=document.createElement('option');
437                 newElement.text=template_name;
438                 newElement.value=template_id;
439                 field.options.add(newElement);
440         } // else
441 }
442
443
444 function open_email_template_form(fieldToSet) {
445         fieldToSetValue = fieldToSet;
446         URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
447         windowName = 'email_template';
448         windowFeatures = 'width=800' + ',height=600'    + ',resizable=1,scrollbars=1';
449
450         win = window.open(URL, windowName, windowFeatures);
451         if(window.focus)
452         {
453                 // put the focus on the popup if the browser supports the focus() method
454                 win.focus();
455         }
456 }
457 function edit_email_template_form(templateField) {
458         fieldToSetValue = templateField;
459         var field=document.getElementById(templateField);
460         URL="index.php?module=EmailTemplates&action=EditView&inboundEmail=true&show_js=1";
461         if (field.options[field.selectedIndex].value != 'undefined') {
462                 URL+="&record="+field.options[field.selectedIndex].value;
463         }
464         windowName = 'email_template';
465         windowFeatures = 'width=800' + ',height=600'    + ',resizable=1,scrollbars=1';
466
467         win = window.open(URL, windowName, windowFeatures);
468         if(window.focus)
469         {
470                 // put the focus on the popup if the browser supports the focus() method
471                 win.focus();
472         }
473 }
474 function open_group_folder_form() {
475         URL="index.php?module=InboundEmail&action=EditGroupFolder&target=Popup&to_pdf=1";
476         windowName = 'group_folder_popup_window';
477         windowFeatures = 'width=400' + ',height=300'    + ',resizable=1,scrollbars=1';
478
479         win = window.open(URL, windowName, windowFeatures);
480         if(window.focus)
481         {
482                 // put the focus on the popup if the browser supports the focus() method
483                 win.focus();
484         }
485
486 }
487 function edit_group_folder_form() {
488         URL="index.php?module=InboundEmail&action=EditGroupFolder&target=Popup&to_pdf=1";
489         var field=document.getElementById('group_folder_id');
490         if (field.options[field.selectedIndex].value != 'undefined') {
491                 URL+="&record="+field.options[field.selectedIndex].value;
492         }
493         windowName = 'edit_group_folder_popup_window';
494         windowFeatures = 'width=400' + ',height=300'    + ',resizable=1,scrollbars=1';
495
496         win = window.open(URL, windowName, windowFeatures);
497         if(window.focus)
498         {
499                 // put the focus on the popup if the browser supports the focus() method
500                 win.focus();
501         }
502
503 }
504 function refresh_group_folder_list(groupFolder_id, groupFolder_name) {
505         var field=document.getElementById('group_folder_id');
506         var bfound=0;
507         for (var i=0; i < field.options.length; i++) {
508                         if (field.options[i].value == groupFolder_id) {
509                                 if (field.options[i].selected==false) {
510                                         field.options[i].selected=true;
511                                 }
512                                 field.options[i].text = groupFolder_name;
513                                 bfound=1;
514                         }
515         }
516         //add item to selection list.
517         if (bfound == 0) {
518                 var newElement=document.createElement('option');
519                 newElement.text=groupFolder_name;
520                 newElement.value=groupFolder_id;
521                 field.options.add(newElement);
522                 newElement.selected=true;
523         }
524         //enable the edit button.
525         var field1=document.getElementById('edit_group');
526         field1.style.visibility="visible";
527         showCreateCaseRow();
528         showHideLeaveMessagesOnMailServer();
529 }
530
531 function show_edit_group_folder_link(field) {
532
533         var field1=document.getElementById('edit_group');
534         if (field.selectedIndex == 0) {
535         }
536         else {
537                 field1.style.visibility="visible";
538         }
539         showCreateCaseRow();
540         showHideLeaveMessagesOnMailServer();
541 }
542
543 function showHideLeaveMessagesOnMailServer() {
544         var field=document.getElementById('group_folder_id');
545         var leaveMessagesOnMailServerRow = document.getElementById('leaveMessagesOnMailServerRow');
546         if (field.selectedIndex == 0) {
547                 leaveMessagesOnMailServerRow.style.display="none";
548         }
549         else {
550                 leaveMessagesOnMailServerRow.style.display='';
551         }
552
553 } // fn
554
555 function showWarningsIfChaningAutoImport() {
556
557     var isAutoImportOn = document.getElementById('is_auto_import').checked;
558     var isCreateCase = document.getElementById('is_create_case').checked
559     var record = document.forms['EditView'].record.value;
560     //Alert if changing for an existing record only.
561     if(record != '')
562         alert(warningForAutoChange);
563     //If the user has create case enabled then auto import must be on.
564     if( !isAutoImportOn && isCreateCase)
565     {
566         document.getElementById('is_auto_import').checked = true;
567         alert(warningForAutoChangeWithCreateCase);
568     }
569 }
570 toggle_monitored_folder(document.getElementById('protocol'));
571 setPortDefault();
572 possibleActionChange();
573
574 var warningForAutoChange = '{MOD.LBL_WARNING_CHANGING_AUTO_IMPORT}';
575 var warningForAutoChangeWithCreateCase = '{MOD.LBL_WARNING_CHANGING_AUTO_IMPORT_WITH_CREATE_CASE}';
576 if(window.addEventListener){
577     window.addEventListener("load", function() { SUGAR.util.setEmailPasswordDisplay('email_password', {HAS_PASSWORD},'EditView'); }, false);
578 }else{
579     window.attachEvent("onload", function() { SUGAR.util.setEmailPasswordDisplay('email_password', {HAS_PASSWORD},'EditView'); });
580 }
581 </script>
582 {JAVASCRIPT}
583 <!-- END: main -->