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