2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
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.
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
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
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.
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.
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 ********************************************************************************/
40 <script type="text/javascript" language="Javascript">
43 <script type="text/javascript" src="include/jsolait/init.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
44 <script type="text/javascript" src="include/javascript/jsclass_base.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
45 <script type="text/javascript" src="include/javascript/jsclass_async.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
46 <script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
47 <script type="text/javascript" src="modules/Documents/documents.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
50 <form action="index.php" method="post" id="EditView" name="EditView" enctype="multipart/form-data">
51 <input type="hidden" name="module" value="Emails" />
52 <input type="hidden" name="action" value="Save" />
53 <input type="hidden" name="contact_id" value="{CONTACT_ID}" />
54 <input type="hidden" name="user_id" value="{USER_ID}" />
55 <input type="hidden" name="return_module" value="{RETURN_MODULE}" />
56 <input type="hidden" name="return_id" value="{RETURN_ID}" />
57 <input type="hidden" name="send" value="" />
58 <input type="hidden" name="type" value="out" />
59 <input type="hidden" name="record" value="{ID}" />
60 <input type="hidden" name="return_action" value="{RETURN_ACTION}" />
61 <input type="hidden" name="inbound_email_id" value="{INBOUND_EMAIL_ID}" />
62 <input type="hidden" name="assigned_user_id" value="{ASSIGNED_USER_ID}" />
63 <input type="hidden" name="object_type" value="{OBJECT_TYPE}" />
64 <input type="hidden" name="object_id" value="{OBJECT_ID}" />
65 <input type="hidden" name="group" value="{GROUP}" />
66 <input type="hidden" name="origType" value="{TYPE}" />
68 <table width="100%" cellpadding="0" cellspacing="0" border="0">
71 <input type="submit" name="button" id="SAVE_HEADER" class="button primary" {disable_send} title="{MOD.LBL_SEND_BUTTON_TITLE}" accesskey="{MOD.LBL_SEND_BUTTON_KEY}" value=" {MOD.LBL_SEND_BUTTON_LABEL} " onclick="prepSave();this.form.action.value='Save';this.form.send.value='1';this.form.type.value='out';return fill_form('out', '{MOD.ERR_NOT_ADDRESSED}');" />
72 <input type="submit" name="button" class="button" title="{MOD.LBL_SAVE_AS_DRAFT_BUTTON_TITLE}" accesskey="{MOD.LBL_SAVE_AS_DRAFT_BUTTON_KEY}" value=" {MOD.LBL_SAVE_AS_DRAFT_BUTTON_LABEL} " onclick="this.form.action.value='Save';this.form.send.value='0';this.form.type.value='draft';fill_form('draft', '{MOD.ERR_NOT_ADDRESSED}');" />
73 <input type="submit" name="button" class="button" title="{APP.LBL_CANCEL_BUTTON_TITLE}" accesskey="{APP.LBL_CANCEL_BUTTON_KEY}" value=" {APP.LBL_CANCEL_BUTTON_LABEL} " onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'; {MYINBOX}" />
75 <td align="right" nowrap>
82 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
85 <table width="100%" border="0" cellspacing="0" cellpadding="0">
87 <!-- BEGIN: open_source_1 -->
96 <!-- END: open_source_1 -->
101 <td scope="row" valign="top" align="right">
103 <select tabindex='2' name='parent_type' onchange=" document.EditView.parent_name.value='';
105 checkParentType(document.EditView.parent_type.value, document.EditView.change_parent);">
106 {TYPE_OPTIONS}</select>
111 <input id='parent_id' name='parent_id' type="hidden" value='{PARENT_ID}'>
112 <input class="sqsEnabled" id='parent_name' name='parent_name' tabindex='2' type='text' value="{PARENT_NAME}">
113 {CHANGE_PARENT_BUTTON}
120 {APP.LBL_ASSIGNED_TO}
125 <input class="sqsEnabled" tabindex='1' id="assigned_user_name" name='assigned_user_name' type="text" value="{ASSIGNED_USER_NAME}">
126 <input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{ASSIGNED_USER_ID}" />
127 <input title="{APP.LBL_SELECT_BUTTON_TITLE}" accesskey="{APP.LBL_SELECT_BUTTON_KEY}" type="button" tabindex='1' class="button" value='{APP.LBL_SELECT_BUTTON_LABEL}' name="btn1" onclick='open_popup("Users", 600, 400, "", true, false, {encoded_users_popup_request_data});' />
153 {MOD.LBL_NOTE_SEMICOLON}
165 <td colspan="4" nowrap="NOWRAP">
167 <table cellspacing="0" cellpadding="0" border="0">
170 <textarea id="to_addrs_field" name='to_addrs' tabindex='3' cols="80" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{TO_ADDRS}">{TO_ADDRS}</textarea>
171 <input type="hidden" id="to_addrs_ids" name="to_addrs_ids" value="{TO_ADDRS_IDS}" />
172 <input type="hidden" id="to_addrs_emails" name="to_addrs_emails" value="{TO_ADDRS_EMAILS}" />
173 <input type="hidden" id="to_addrs_names" name="to_addrs_names" value="{TO_ADDRS_NAMES}" />
175 <td style="padding-left: 4px;">
176 {CHANGE_TO_ADDRS_BUTTON}
189 <td colspan="4" nowrap="NOWRAP">
191 <table cellspacing="0" cellpadding="0" border="0">
194 <textarea id="cc_addrs_field" name='cc_addrs' tabindex='3' cols="80" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{CC_ADDRS}">{CC_ADDRS}</textarea>
195 <input type="hidden" id="cc_addrs_ids" name="cc_addrs_ids" value="{CC_ADDRS_IDS}" />
196 <input type="hidden" id="cc_addrs_emails" name="cc_addrs_emails" value="{CC_ADDRS_EMAILS}" />
197 <input type="hidden" id="cc_addrs_names" name="cc_addrs_names" value="{CC_ADDRS_NAMES}" />
199 <td style="padding-left: 4px;">
200 {CHANGE_CC_ADDRS_BUTTON}
213 <td colspan="4" nowrap="NOWRAP">
214 <table cellspacing="0" cellpadding="0" border="0">
217 <textarea id="bcc_addrs_field" name='bcc_addrs' tabindex='3' cols="80" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{BCC_ADDRS}">{BCC_ADDRS}</textarea>
218 <input type="hidden" id="bcc_addrs_ids" name="bcc_addrs_ids" value="{BCC_ADDRS_IDS}" />
219 <input type="hidden" id="bcc_addrs_emails" name="bcc_addrs_emails" value="{BCC_ADDRS_EMAILS}" />
220 <input type="hidden" id="bcc_addrs_names" name="bcc_addrs_names" value="{BCC_ADDRS_NAMES}" />
222 <td style="padding-left: 4px;">
223 {CHANGE_BCC_ADDRS_BUTTON}
235 <td colspan="4" nowrap="NOWRAP">
237 <table cellspacing="0" cellpadding="0" border="0">
240 <textarea id="from_addr_field" name='from_addr' tabindex='3' cols="80" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" value="{FROM_ADDR}">{FROM_ADDR}</textarea> {FROM_ADDR_GROUP}
241 <input type="hidden" id="from_addr_email" name="from_addr_email" />
242 <input type="hidden" id="from_addr_name" name="from_addr_name" />
262 <textarea name='name' tabindex='4' cols="100" rows="1" style="height: 1.6.em; overflow-y:auto; font-family:sans-serif,monospace; font-size:inherit;" id="subjectfield">{NAME}</textarea>
267 <td valign="top" scope="row">
270 <!-- BEGIN: htmlarea -->
273 <div id="editor_select">
274 <input id="setEditor" name="setEditor" value="1" {EMAIL_EDITOR_OPTION} type="checkbox" onclick="toggle_textonly();">
275 {MOD.LBL_EMAIL_EDITOR_OPTION}
279 <td scope="row" valign="top">
281 {MOD.LBL_USE_TEMPLATE}
284 <td nowrap width="1">
286 <select tabindex='2' name='email_template' onchange="fill_email(this.options[this.selectedIndex].value);">
287 {EMAIL_TEMPLATE_OPTIONS}
293 <td valign="top" scope="row">
300 <textarea id="description_html" onblur="">{DESCRIPTION_HTML}</textarea>
302 <div id="alt_text_div">
303 <input id="toggle_textarea_elem" onclick="toggle_textarea();" type="checkbox" name="toggle_html">
304 {MOD.LBL_EDIT_ALT_TEXT}
306 <div id="text_div" style="display: none;">
307 <textarea tabindex='5' id="description" name='description' cols="100" rows="20">{DESCRIPTION}</textarea>
311 <!-- END: htmlarea -->
314 <td valign="top" scope="row">
315 {MOD.LBL_ATTACHMENTS}
318 {ATTACHMENTS_JAVASCRIPT} {ATTACHMENTS}
319 <div id="template_attachments">
321 <div id="uploads_div">
322 <div style="display: none" id="file0">
323 <input id='email_attachment0' name='email_attachment0' tabindex='0' size='40' type='file' />
324 <input type="button" onclick="deleteFile('0');" class="button" value="{APP.LBL_REMOVE}" />
326 <div style="display: none" id="file1">
327 <input id='email_attachment1' name='email_attachment1' tabindex='0' size='40' type='file' />
328 <input type="button" onclick="deleteFile('1');" class="button" value="{APP.LBL_REMOVE}" />
330 <div style="display: none" id="file2">
331 <input id='email_attachment2' name='email_attachment2' tabindex='0' size='40' type='file' />
332 <input type="button" onclick="deleteFile('2');" class="button" value="{APP.LBL_REMOVE}" />
334 <div style="display: none" id="file3">
335 <input id='email_attachment3' name='email_attachment3' tabindex='0' size='40' type='file' />
336 <input type="button" onclick="deleteFile('3');" class="button" value="{APP.LBL_REMOVE}" />
338 <div style="display: none" id="file4">
339 <input id='email_attachment4' name='email_attachment4' tabindex='0' size='40' type='file' />
340 <input type="button" onclick="deleteFile('4');" class="button" value="{APP.LBL_REMOVE}" />
342 <div style="display: none" id="file5">
343 <input id='email_attachment5' name='email_attachment5' tabindex='0' size='40' type='file' />
344 <input type="button" onclick="deleteFile('5');" class="button" value="{APP.LBL_REMOVE}" />
346 <div style="display: none" id="file6">
347 <input id='email_attachment6' name='email_attachment6' tabindex='0' size='40' type='file' />
348 <input type="button" onclick="deleteFile('6');" class="button" value="{APP.LBL_REMOVE}" />
350 <div style="display: none" id="file7">
351 <input id='email_attachment7' name='email_attachment7' tabindex='0' size='40' type='file' />
352 <input type="button" onclick="deleteFile('7');" class="button" value="{APP.LBL_REMOVE}" />
354 <div style="display: none" id="file8">
355 <input id='email_attachment8' name='email_attachment8' tabindex='0' size='40' type='file' />
356 <input type="button" onclick="deleteFile('8');" class="button" value="{APP.LBL_REMOVE}" />
358 <div style="display: none" id="file9">
359 <input id='email_attachment9' name='email_attachment9' tabindex='0' size='40' type='file' />
360 <input type="button" onclick="deleteFile('9');" class="button" value="{APP.LBL_REMOVE}" />
362 <div style="display: none" id="document0">
363 <input name='documentId0' id='documentId0' tabindex='0' type='hidden' />
364 <input name='documentName0' id='documentName0' disabled size='40' type='text' />
365 <input type="button" onclick="selectDocument('0');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('0');" class="button" value="{APP.LBL_REMOVE}" />
367 <div style="display: none" id="document1">
368 <input name='documentId1' id='documentId1' tabindex='1' type='hidden' />
369 <input name='documentName1' id='documentName1' disabled size='40' type='text' />
370 <input type="button" onclick="selectDocument('1');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('1');" class="button" value="{APP.LBL_REMOVE}" />
372 <div style="display: none" id="document2">
373 <input name='documentId2' id='documentId2' tabindex='2' type='hidden' />
374 <input name='documentName2' id='documentName2' disabled size='40' type='text' />
375 <input type="button" onclick="selectDocument('2');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('2');" class="button" value="{APP.LBL_REMOVE}" />
377 <div style="display: none" id="document3">
378 <input name='documentId3' id='documentId3' tabindex='3' type='hidden' />
379 <input name='documentName3' id='documentName3' disabled size='40' type='text' />
380 <input type="button" onclick="selectDocument('3');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('3');" class="button" value="{APP.LBL_REMOVE}" />
382 <div style="display: none" id="document4">
383 <input name='documentId4' id='documentId4' tabindex='4' type='hidden' />
384 <input name='documentName4' id='documentName4' disabled size='40' type='text' />
385 <input type="button" onclick="selectDocument('4');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('4');" class="button" value="{APP.LBL_REMOVE}" />
387 <div style="display: none" id="document5">
388 <input name='documentId5' id='documentId5' tabindex='5' type='hidden' />
389 <input name='documentName5' id='documentName5' disabled size='40' type='text' />
390 <input type="button" onclick="selectDocument('5');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('5');" class="button" value="{APP.LBL_REMOVE}" />
392 <div style="display: none" id="document6">
393 <input name='documentId6' id='documentId6' tabindex='6' type='hidden' />
394 <input name='documentName6' id='documentName6' disabled size='40' type='text' />
395 <input type="button" onclick="selectDocument('6');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('6');" class="button" value="{APP.LBL_REMOVE}" />
397 <div style="display: none" id="document7">
398 <input name='documentId7' id='documentId7' tabindex='7' type='hidden' />
399 <input name='documentName7' id='documentName7' disabled size='40' type='text' />
400 <input type="button" onclick="selectDocument('7');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('7');" class="button" value="{APP.LBL_REMOVE}" />
402 <div style="display: none" id="document8">
403 <input name='documentId8' id='documentId8' tabindex='8' type='hidden' />
404 <input name='documentName8' id='documentName8' disabled size='40' type='text' />
405 <input type="button" onclick="selectDocument('8');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('8');" class="button" value="{APP.LBL_REMOVE}" />
407 <div style="display: none" id="document9">
408 <input name='documentId9' id='documentId9' tabindex='9' type='hidden' />
409 <input name='documentName9' id='documentName9' disabled size='40' type='text' />
410 <input type="button" onclick="selectDocument('9');" class="button" value="{APP.LBL_SELECT_BUTTON_LABEL}" /><input type="button" onclick="deleteDocument('9');" class="button" value="{APP.LBL_REMOVE}" />
413 <input type="button" name="add_file_button" onclick="addFile();" value="{MOD.LBL_ADD_FILE}" class="button" />
414 <input type="button" name="add_document_button" onclick="addDocument();" value="{MOD.LBL_ADD_DOCUMENT}" class="button" />
423 <script type="text/javascript" language="Javascript">
424 var old_load=window.onload; window.onload = function() {
428 // cn: bug 5845 - use Group Inbox From info
429 if(window.switchEmail) {