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