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/javascript/jsclass_base.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
44 <script type="text/javascript" src="include/javascript/jsclass_async.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
45 <script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
46 <script type="text/javascript" src="modules/Documents/documents.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
49 <form action="index.php" method="post" id="EditView" name="EditView" enctype="multipart/form-data">
50 <input type="hidden" name="module" value="Emails" />
51 <input type="hidden" name="action" value="Save" />
52 <input type="hidden" name="contact_id" value="{CONTACT_ID}" />
53 <input type="hidden" name="user_id" value="{USER_ID}" />
54 <input type="hidden" name="return_module" value="{RETURN_MODULE}" />
55 <input type="hidden" name="return_id" value="{RETURN_ID}" />
56 <input type="hidden" name="send" value="" />
57 <input type="hidden" name="type" value="out" />
58 <input type="hidden" name="record" value="{ID}" />
59 <input type="hidden" name="return_action" value="{RETURN_ACTION}" />
60 <input type="hidden" name="inbound_email_id" value="{INBOUND_EMAIL_ID}" />
61 <input type="hidden" name="assigned_user_id" value="{ASSIGNED_USER_ID}" />
62 <input type="hidden" name="object_type" value="{OBJECT_TYPE}" />
63 <input type="hidden" name="object_id" value="{OBJECT_ID}" />
64 <input type="hidden" name="group" value="{GROUP}" />
65 <input type="hidden" name="origType" value="{TYPE}" />
67 <table width="100%" cellpadding="0" cellspacing="0" border="0">
70 <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}');" />
71 <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}');" />
72 <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}" />
74 <td align="right" nowrap>
81 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
84 <table width="100%" border="0" cellspacing="0" cellpadding="0">
86 <!-- BEGIN: open_source_1 -->
95 <!-- END: open_source_1 -->
100 <td scope="row" valign="top" align="right">
102 <select tabindex='2' name='parent_type' onchange=" document.EditView.parent_name.value='';
103 parent_typechangeQS();
104 checkParentType(document.EditView.parent_type.value, document.EditView.change_parent);">
105 {TYPE_OPTIONS}</select>
110 <input id='parent_id' name='parent_id' type="hidden" value='{PARENT_ID}'>
111 <input class="sqsEnabled" id='parent_name' name='parent_name' tabindex='2' type='text' value="{PARENT_NAME}">
112 {CHANGE_PARENT_BUTTON}
119 {APP.LBL_ASSIGNED_TO}
124 <input class="sqsEnabled" tabindex='1' id="assigned_user_name" name='assigned_user_name' type="text" value="{ASSIGNED_USER_NAME}">
125 <input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{ASSIGNED_USER_ID}" />
126 <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});' />
152 {MOD.LBL_NOTE_SEMICOLON}
164 <td colspan="4" nowrap="NOWRAP">
166 <table cellspacing="0" cellpadding="0" border="0">
169 <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>
170 <input type="hidden" id="to_addrs_ids" name="to_addrs_ids" value="{TO_ADDRS_IDS}" />
171 <input type="hidden" id="to_addrs_emails" name="to_addrs_emails" value="{TO_ADDRS_EMAILS}" />
172 <input type="hidden" id="to_addrs_names" name="to_addrs_names" value="{TO_ADDRS_NAMES}" />
174 <td style="padding-left: 4px;">
175 {CHANGE_TO_ADDRS_BUTTON}
188 <td colspan="4" nowrap="NOWRAP">
190 <table cellspacing="0" cellpadding="0" border="0">
193 <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>
194 <input type="hidden" id="cc_addrs_ids" name="cc_addrs_ids" value="{CC_ADDRS_IDS}" />
195 <input type="hidden" id="cc_addrs_emails" name="cc_addrs_emails" value="{CC_ADDRS_EMAILS}" />
196 <input type="hidden" id="cc_addrs_names" name="cc_addrs_names" value="{CC_ADDRS_NAMES}" />
198 <td style="padding-left: 4px;">
199 {CHANGE_CC_ADDRS_BUTTON}
212 <td colspan="4" nowrap="NOWRAP">
213 <table cellspacing="0" cellpadding="0" border="0">
216 <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>
217 <input type="hidden" id="bcc_addrs_ids" name="bcc_addrs_ids" value="{BCC_ADDRS_IDS}" />
218 <input type="hidden" id="bcc_addrs_emails" name="bcc_addrs_emails" value="{BCC_ADDRS_EMAILS}" />
219 <input type="hidden" id="bcc_addrs_names" name="bcc_addrs_names" value="{BCC_ADDRS_NAMES}" />
221 <td style="padding-left: 4px;">
222 {CHANGE_BCC_ADDRS_BUTTON}
234 <td colspan="4" nowrap="NOWRAP">
236 <table cellspacing="0" cellpadding="0" border="0">
239 <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}
240 <input type="hidden" id="from_addr_email" name="from_addr_email" />
241 <input type="hidden" id="from_addr_name" name="from_addr_name" />
261 <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>
266 <td valign="top" scope="row">
269 <!-- BEGIN: htmlarea -->
272 <div id="editor_select">
273 <input id="setEditor" name="setEditor" value="1" {EMAIL_EDITOR_OPTION} type="checkbox" onclick="toggle_textonly();">
274 {MOD.LBL_EMAIL_EDITOR_OPTION}
278 <td scope="row" valign="top">
280 {MOD.LBL_USE_TEMPLATE}
283 <td nowrap width="1">
285 <select tabindex='2' name='email_template' onchange="fill_email(this.options[this.selectedIndex].value);">
286 {EMAIL_TEMPLATE_OPTIONS}
292 <td valign="top" scope="row">
299 <textarea id="description_html" onblur="">{DESCRIPTION_HTML}</textarea>
301 <div id="alt_text_div">
302 <input id="toggle_textarea_elem" onclick="toggle_textarea();" type="checkbox" name="toggle_html">
303 {MOD.LBL_EDIT_ALT_TEXT}
305 <div id="text_div" style="display: none;">
306 <textarea tabindex='5' id="description" name='description' cols="100" rows="20">{DESCRIPTION}</textarea>
310 <!-- END: htmlarea -->
313 <td valign="top" scope="row">
314 {MOD.LBL_ATTACHMENTS}
317 {ATTACHMENTS_JAVASCRIPT} {ATTACHMENTS}
318 <div id="template_attachments">
320 <div id="uploads_div">
321 <div style="display: none" id="file0">
322 <input id='email_attachment0' name='email_attachment0' tabindex='0' size='40' type='file' />
323 <input type="button" onclick="deleteFile('0');" class="button" value="{APP.LBL_REMOVE}" />
325 <div style="display: none" id="file1">
326 <input id='email_attachment1' name='email_attachment1' tabindex='0' size='40' type='file' />
327 <input type="button" onclick="deleteFile('1');" class="button" value="{APP.LBL_REMOVE}" />
329 <div style="display: none" id="file2">
330 <input id='email_attachment2' name='email_attachment2' tabindex='0' size='40' type='file' />
331 <input type="button" onclick="deleteFile('2');" class="button" value="{APP.LBL_REMOVE}" />
333 <div style="display: none" id="file3">
334 <input id='email_attachment3' name='email_attachment3' tabindex='0' size='40' type='file' />
335 <input type="button" onclick="deleteFile('3');" class="button" value="{APP.LBL_REMOVE}" />
337 <div style="display: none" id="file4">
338 <input id='email_attachment4' name='email_attachment4' tabindex='0' size='40' type='file' />
339 <input type="button" onclick="deleteFile('4');" class="button" value="{APP.LBL_REMOVE}" />
341 <div style="display: none" id="file5">
342 <input id='email_attachment5' name='email_attachment5' tabindex='0' size='40' type='file' />
343 <input type="button" onclick="deleteFile('5');" class="button" value="{APP.LBL_REMOVE}" />
345 <div style="display: none" id="file6">
346 <input id='email_attachment6' name='email_attachment6' tabindex='0' size='40' type='file' />
347 <input type="button" onclick="deleteFile('6');" class="button" value="{APP.LBL_REMOVE}" />
349 <div style="display: none" id="file7">
350 <input id='email_attachment7' name='email_attachment7' tabindex='0' size='40' type='file' />
351 <input type="button" onclick="deleteFile('7');" class="button" value="{APP.LBL_REMOVE}" />
353 <div style="display: none" id="file8">
354 <input id='email_attachment8' name='email_attachment8' tabindex='0' size='40' type='file' />
355 <input type="button" onclick="deleteFile('8');" class="button" value="{APP.LBL_REMOVE}" />
357 <div style="display: none" id="file9">
358 <input id='email_attachment9' name='email_attachment9' tabindex='0' size='40' type='file' />
359 <input type="button" onclick="deleteFile('9');" class="button" value="{APP.LBL_REMOVE}" />
361 <div style="display: none" id="document0">
362 <input name='documentId0' id='documentId0' tabindex='0' type='hidden' />
363 <input name='documentName0' id='documentName0' disabled size='40' type='text' />
364 <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}" />
366 <div style="display: none" id="document1">
367 <input name='documentId1' id='documentId1' tabindex='1' type='hidden' />
368 <input name='documentName1' id='documentName1' disabled size='40' type='text' />
369 <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}" />
371 <div style="display: none" id="document2">
372 <input name='documentId2' id='documentId2' tabindex='2' type='hidden' />
373 <input name='documentName2' id='documentName2' disabled size='40' type='text' />
374 <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}" />
376 <div style="display: none" id="document3">
377 <input name='documentId3' id='documentId3' tabindex='3' type='hidden' />
378 <input name='documentName3' id='documentName3' disabled size='40' type='text' />
379 <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}" />
381 <div style="display: none" id="document4">
382 <input name='documentId4' id='documentId4' tabindex='4' type='hidden' />
383 <input name='documentName4' id='documentName4' disabled size='40' type='text' />
384 <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}" />
386 <div style="display: none" id="document5">
387 <input name='documentId5' id='documentId5' tabindex='5' type='hidden' />
388 <input name='documentName5' id='documentName5' disabled size='40' type='text' />
389 <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}" />
391 <div style="display: none" id="document6">
392 <input name='documentId6' id='documentId6' tabindex='6' type='hidden' />
393 <input name='documentName6' id='documentName6' disabled size='40' type='text' />
394 <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}" />
396 <div style="display: none" id="document7">
397 <input name='documentId7' id='documentId7' tabindex='7' type='hidden' />
398 <input name='documentName7' id='documentName7' disabled size='40' type='text' />
399 <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}" />
401 <div style="display: none" id="document8">
402 <input name='documentId8' id='documentId8' tabindex='8' type='hidden' />
403 <input name='documentName8' id='documentName8' disabled size='40' type='text' />
404 <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}" />
406 <div style="display: none" id="document9">
407 <input name='documentId9' id='documentId9' tabindex='9' type='hidden' />
408 <input name='documentName9' id='documentName9' disabled size='40' type='text' />
409 <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}" />
412 <input type="button" name="add_file_button" onclick="addFile();" value="{MOD.LBL_ADD_FILE}" class="button" />
413 <input type="button" name="add_document_button" onclick="addDocument();" value="{MOD.LBL_ADD_DOCUMENT}" class="button" />
422 <script type="text/javascript" language="Javascript">
423 var old_load=window.onload; window.onload = function() {
427 // cn: bug 5845 - use Group Inbox From info
428 if(window.switchEmail) {