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