]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Emails/javascript/composeEmailTemplate.js
Release 6.4.0
[Github/sugarcrm.git] / modules / Emails / javascript / composeEmailTemplate.js
1 /*********************************************************************************
2  * SugarCRM Community Edition is a customer relationship management program developed by
3  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
4  * 
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Affero General Public License version 3 as published by the
7  * Free Software Foundation with the addition of the following permission added
8  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
9  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
10  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
11  * 
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
15  * details.
16  * 
17  * You should have received a copy of the GNU Affero General Public License along with
18  * this program; if not, see http://www.gnu.org/licenses or write to the Free
19  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301 USA.
21  * 
22  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
23  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
24  * 
25  * The interactive user interfaces in modified source and object code versions
26  * of this program must display Appropriate Legal Notices, as required under
27  * Section 5 of the GNU Affero General Public License version 3.
28  * 
29  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
30  * these Appropriate Legal Notices must retain the display of the "Powered by
31  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
32  * technical reasons, the Appropriate Legal Notices must display the words
33  * "Powered by SugarCRM".
34  ********************************************************************************/
35
36 SUGAR.email2.templates['compose'] = '<div id="composeLayout{idx}" class="ylayout-inactive-content"></div>' +
37 '<div id="composeOverFrame{idx}" style="height:100%;width:100%">' +
38 '       <form id="emailCompose{idx}" name="ComposeEditView{idx}" action="index.php" method="POST">' +
39 '               <input type="hidden" id="email_id{idx}" name="email_id" value="">' +
40 '               <input type="hidden" id="uid{idx}" name="uid" value="">' +
41 '               <input type="hidden" id="ieId{idx}" name="ieId" value="">' +
42 '               <input type="hidden" id="mbox{idx}" name="mbox" value="">' +
43 '               <input type="hidden" id="type{idx}" name="type" value="">' +
44 '               <input type="hidden" id="composeLayoutId" name="composeLayoutId" value="shouldNotSeeMe">' +
45 '               <input type="hidden" id="composeType" name="composeType">' +
46 '               <input type="hidden" id="fromAccount" name="fromAccount">' +
47 '               <input type="hidden" id="sendSubject" name="sendSubject">' +
48 '               <input type="hidden" id="sendDescription" name="sendDescription">' +
49 '               <input type="hidden" id="sendTo" name="sendTo">' +
50 '               <input type="hidden" id="sendBcc" name="sendBcc">' +
51 '               <input type="hidden" id="sendCc" name="sendCc">' +
52 '               <input type="hidden" id="setEditor" name="setEditor">' +
53 '               <input type="hidden" id="saveToSugar" name="saveToSugar">' +
54 '               <input type="hidden" id="parent_id" name="parent_id">' +
55 '               <input type="hidden" id="parent_type" name="parent_type">' +
56 '               <input type="hidden" id="attachments" name="attachments">' +
57 '               <input type="hidden" id="documents" name="documents">' +
58 '               <input type="hidden" id="outbound_email{idx}" name="outbound_email">' +
59 '               <input type="hidden" id="templateAttachments" name="templateAttachments">' +
60 '               <input type="hidden" id="templateAttachmentsRemove{idx}" name="templateAttachmentsRemove">' +
61 '               <table id="composeHeaderTable{idx}" cellpadding="0" cellspacing="0" border="0" width="100%" class="list">' +
62 '                       <tr>' +
63 '                               <th><table cellpadding="0" cellspacing="0" border="0"><tbody><tr ><td style="padding: 0px !important;margin:0px; !important" >' +
64 '                                       <button type="button" class="button" onclick="SUGAR.email2.composeLayout.sendEmail({idx}, false);"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_send.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_SEND}</button>' +
65 '                                       <button type="button" class="button" onclick="SUGAR.email2.composeLayout.saveDraft({idx}, false);"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_save.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_SAVE_DRAFT}</button>' +
66 '                                       <button type="button" class="button" onclick="SUGAR.email2.composeLayout.showAttachmentPanel({idx}, false);"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_attach.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_ATTACHMENT}</button>' +
67 '                                       <button type="button" class="button" onclick="SUGAR.email2.composeLayout.showOptionsPanel({idx}, false);"><img src="index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=icon_email_options.gif" align="absmiddle" border="0"> {app_strings.LBL_EMAIL_OPTIONS}</button>' +
68 '</td><td style="padding: 0px !important;margin:0px; !important">&nbsp;&nbsp;{mod_strings.LBL_EMAIL_RELATE}:&nbsp;&nbsp;<select class="select" id="data_parent_type{idx}" onchange="document.getElementById(\'data_parent_name{idx}\').value=\'\';document.getElementById(\'data_parent_id{idx}\').value=\'\'; SUGAR.email2.composeLayout.enableQuickSearchRelate(\'{idx}\');" name="data_parent_type{idx}">{linkbeans_options}</select>' + 
69 '&nbsp;</td><td style="padding: 0px !important;margin:0px; !important"><input id="data_parent_id{idx}" name="data_parent_id{idx}" type="hidden" value="">' +
70 '<input class="sqsEnabled" id="data_parent_name{idx}" name="data_parent_name{idx}" type="text" value="">&nbsp;<button type="button" class="button" onclick="SUGAR.email2.composeLayout.callopenpopupForEmail2({idx});"><img src="index.php?entryPoint=getImage&themeName=default&imageName=id-ff-select.png" align="absmiddle" border="0"></button>' +
71 '                       </td></tr></tbody></table></th>'     +
72 '                       </tr>' +
73 '                       <tr>' +
74 '                               <td>' +
75 '                                       <div style="margin:5px;">' +
76 '                                       <table cellpadding="4" cellspacing="0" border="0" width="100%">' +
77 '                                               <tr>' +
78 '                                                       <td class="emailUILabel" NOWRAP >' +
79 '                                                               <label for="addressFrom{idx}">{app_strings.LBL_EMAIL_FROM}:</label>' +
80 '                                                       </td>' +
81 '                                                       <td class="emailUIField" NOWRAP>' +
82 '                                                               <div>' +
83 '                                                                       &nbsp;&nbsp;<select style="width: 500px;" class="ac_input" id="addressFrom{idx}" name="addressFrom{idx}"></select>' +
84 '                                                               </div>' +
85 '                                                       </td>' +
86 '                                               </tr>' +
87 '                                               <tr>' +
88 '                                                       <td class="emailUILabel" NOWRAP>' +
89 '                                                               <button class="button" type="button" onclick="SUGAR.email2.addressBook.selectContactsDialogue(\'addressTO{idx}\')">' + 
90 '                                   {app_strings.LBL_EMAIL_TO}:' +
91 '                               </button>' + 
92 '                                                       </td>' +
93 '                                                       <td class="emailUIField" NOWRAP>' +
94 '                                                               <div class="ac_autocomplete">' +
95 '                                                                       &nbsp;&nbsp;<input class="ac_input" type="text" size="96" id="addressTO{idx}" title="{app_strings.LBL_EMAIL_TO}" name="addressTO{idx}" onkeyup="SE.composeLayout.showAddressDetails(this);">' +
96 '                                                                       <span class="rolloverEmail"> <a id="MoreaddressTO{idx}" href="#" style="display: none;">+<span id="DetailaddressTO{idx}">&nbsp;</span></a> </span>' +
97 '                                                                       <div class="ac_container" id="addressToAC{idx}"></div>' +
98 '                                                               </div>' +
99 '                                                       </td>' +
100 '                                               </tr>' +
101 '                                               <tr id="add_addr_options_tr{idx}">' +
102 '                                                       <td class="emailUILabel" NOWRAP>&nbsp;</td><td class="emailUIField" valign="top" NOWRAP>&nbsp;&nbsp;<span id="cc_span{idx}"><a href="#" onclick="SE.composeLayout.showHiddenAddress(\'cc\',\'{idx}\');">{mod_strings.LBL_ADD_CC}</a></span><span id="bcc_cc_sep{idx}">&nbsp;{mod_strings.LBL_ADD_CC_BCC_SEP}&nbsp;</span><span id="bcc_span{idx}"><a href="#" onclick="SE.composeLayout.showHiddenAddress(\'bcc\',\'{idx}\');">{mod_strings.LBL_ADD_BCC}</a></span></td>'+
103 '                                               </tr>'+
104 '                                               <tr class="yui-hidden" id="cc_tr{idx}">' +
105 '                                                       <td class="emailUILabel" NOWRAP>' +
106 '                               <button class="button" type="button" onclick="SUGAR.email2.addressBook.selectContactsDialogue(\'addressCC{idx}\')">' + 
107 '                                                               {app_strings.LBL_EMAIL_CC}:' +
108 '                               </button>' + 
109 '                                                       </td>' +
110 '                                                       <td class="emailUIField" NOWRAP>' +
111 '                                                               <div class="ac_autocomplete">' +
112 '                                                                       &nbsp;&nbsp;<input class="ac_input" type="text" size="96" id="addressCC{idx}" name="addressCC{idx}"   title="{app_strings.LBL_EMAIL_CC}" onkeyup="SE.composeLayout.showAddressDetails(this);">' +
113 '                                                                       <span class="rolloverEmail"> <a id="MoreaddressCC{idx}" href="#"  style="display: none;">+<span id="DetailaddressCC{idx}">&nbsp;</span></a> </span>' + 
114 '                                                                       <div class="ac_container" id="addressCcAC{idx}"></div>' +
115 '                                                               </div>' +
116 '                                                       </td>' +
117 '                                               </tr>' +
118 '                                               <tr class="yui-hidden" id="bcc_tr{idx}">' +
119 '                                                       <td class="emailUILabel" NOWRAP>' +
120 '                               <button class="button" type="button" onclick="SUGAR.email2.addressBook.selectContactsDialogue(\'addressBCC{idx}\')">' + 
121 '                               {app_strings.LBL_EMAIL_BCC}:' +
122 '                               </button>' + 
123 '                                                       </td>' +
124 '                                                       <td class="emailUIField" NOWRAP>' +
125 '                                                               <div class="ac_autocomplete">' +
126 '                                                                       &nbsp;&nbsp;<input class="ac_input" type="text" size="96" id="addressBCC{idx}" name="addressBCC{idx}" title="{app_strings.LBL_EMAIL_BCC}" onkeyup="SE.composeLayout.showAddressDetails(this);">' +
127 '                                                                       <span class="rolloverEmail"> <a id="MoreaddressBCC{idx}" href="#" style="display: none;">+<span id="DetailaddressBCC{idx}">&nbsp;</span></a> </span>' +
128 '                                                                       <div class="ac_container" id="addressBccAC{idx}"></div>' +
129 '                                                               </div>' +
130 '                                                       </td>' +
131 '                                               </tr>' +
132 '                                               <tr>' +
133 '                                                       <td class="emailUILabel" NOWRAP width="1%">' +
134 '                                                               <label for="emailSubject{idx}">{app_strings.LBL_EMAIL_SUBJECT}:</label>' +
135 '                                                       </td>' +
136 '                                                       <td class="emailUIField" NOWRAP width="99%">' +
137 '                                                               <div class="ac_autocomplete">' +
138 '                                                                       &nbsp;&nbsp;<input class="ac_input" type="text" size="96" id="emailSubject{idx}" name="subject{idx}" value="">' +
139 '                                                               </div>' +
140 '                                                       </td>' +
141 '                                               </tr>' +
142 '                                       </table>' +
143 '                                       </div>' +
144 '                               </td>'   +
145 '                       </tr>' +
146 '               </table>' +
147 '               <textarea id="htmleditor{idx}" name="htmleditor{idx}" style="width:100%; height: 100px;"></textarea>' +
148 '               <div id="divAttachments{idx}" class="ylayout-inactive-content">' +
149 '                       <div style="padding:5px;">' +
150 '                               <table cellpadding="2" cellspacing="0" border="0">' +
151 '                                       <tr>' +
152 '                                               <th>' +
153 '                                                       <b>{app_strings.LBL_EMAIL_ATTACHMENTS}</b>' +
154 '                                                       <br />' +
155 '                                                       &nbsp;' +
156 '                                               </th>' +
157 '                                       </tr>' +
158 '                                       <tr>' +
159 '                                               <td>' +
160 '                                                       <input type="button" name="add_file_button" onclick="SUGAR.email2.composeLayout.addFileField();" value="{mod_strings.LBL_ADD_FILE}" class="button" />' +
161 '                                                       <div id="addedFiles{idx}" name="addedFiles{idx}"></div>' +
162 '                                               </td>' +
163 '                                       </tr>' +
164 '                                       <tr>' +
165 '                                               <td>' +
166 '                                                       &nbsp;' +
167 '                                                       <br />' +
168 '                                                       &nbsp;' +
169 '                                               </td>' +
170 '                                       </tr>' +
171 '                                       <tr>' +
172 '                                               <th>' +
173 '                                                       <b>{app_strings.LBL_EMAIL_ATTACHMENTS2}</b>' +
174 '                                                       <br />' +
175 '                                                       &nbsp;' +
176 '                                               </th>' +
177 '                                       </tr>' +
178 '                                       <tr>' +
179 '                                               <td>' +
180 '                                                       <input type="button" name="add_document_button" onclick="SUGAR.email2.composeLayout.addDocumentField({idx});" value="{mod_strings.LBL_ADD_DOCUMENT}" class="button" />' +
181 '                                                       <div id="addedDocuments{idx}"></div>' + //<input name="document{idx}0" id="document{idx}0" type="hidden" /><input name="documentId{idx}0" id="documentId{idx}0" type="hidden" /><input name="documentName{idx}0" id="documentName{idx}0" disabled size="30" type="text" /><input type="button" id="documentSelect{idx}0" onclick="SUGAR.email2.selectDocument({idx}0, this);" class="button" value="{app_strings.LBL_EMAIL_SELECT}" /><input type="button" id="documentRemove{idx}0" onclick="SUGAR.email2.deleteDocumentField({idx}0, this);" class="button" value="{app_strings.LBL_EMAIL_REMOVE}" /><br /></div>' +
182 '                                               </td>' +
183 '                                       </tr>' +
184 '                                       <tr>' +
185 '                                               <td>' +
186 '                                                       &nbsp;' +
187 '                                                       <br />' +
188 '                                                       &nbsp;' +
189 '                                               </td>' +
190 '                                       </tr>' +
191 '                                       <tr>' +
192 '                                               <th>' +
193 '                                                       <div id="templateAttachmentsTitle{idx}" style="display:none"><b>{app_strings.LBL_EMAIL_ATTACHMENTS3}</b></div>' +
194 '                                                       <br />' +
195 '                                                       &nbsp;' +
196 '                                               </th>' +
197 '                                       </tr>' +
198 '                                       <tr>' +
199 '                                               <td>' +
200 '                                                       <div id="addedTemplateAttachments{idx}"></div>' +
201 '                                               </td>' +
202 '                                       </tr>' +
203 '                               </table>' +
204 '                       </div>' +
205 '               </div>' +
206 '       </form>' +
207 '               <div id="divOptions{idx}" class="ylayout-inactive-content"' +
208 '             <div style="padding:5px;">' +
209 '                       <form name="composeOptionsForm{idx}" id="composeOptionsForm{idx}">' + 
210 '                               <table border="0" width="100%">' +
211 '                                       <tr>' +
212 '                                               <td NOWRAP style="padding:2px;">' +
213 '                                                       <b>{app_strings.LBL_EMAIL_TEMPLATES}:</b>' +
214 '                                               </td>' +
215 '                                       </tr>' +
216 '                                       <tr>' +
217 '                                               <td NOWRAP style="padding:2px;">' +
218 '                                                       <select name="email_template{idx}" id="email_template{idx}"  onchange="SUGAR.email2.composeLayout.applyEmailTemplate(\'{idx}\', this.options[this.selectedIndex].value);"></select>' +
219 '                                               </td>' +
220 '                                       </tr>' +
221 '                               </table>' +
222 '                               <br />' +
223 '                               <table border="0" width="100%">' +
224 '                                       <tr>' +
225 '                                               <td NOWRAP style="padding:2px;">' +
226 '                                                       <b>{app_strings.LBL_EMAIL_SIGNATURES}:</b>' +
227 '                                               </td>' +
228 '                                       </tr>' +
229 '                                       <tr>' +
230 '                                               <td NOWRAP style="padding:2px;">' +
231 '                                                       <select name="signatures{idx}" id="signatures{idx}" onchange="SUGAR.email2.composeLayout.setSignature(\'{idx}\');"></select>' +
232 '                                               </td>' +
233 '                                       </tr>' +
234 '                               </table>' +
235 '                               <table border="0" width="100%">' +
236 '                                       <tr>' +
237 '                                               <td NOWRAP style="padding:2px;">' +
238 '                                                       <input type="checkbox" id="setEditor{idx}" name="setEditor{idx}" value="1" onclick="SUGAR.email2.composeLayout.renderTinyMCEToolBar(\'{idx}\', this.checked);"/>&nbsp;' +
239 '                                                       <b>{mod_strings.LBL_SEND_IN_PLAIN_TEXT}</b>' +
240 '                                               </td>' +
241 '                                       </tr>' +
242 '                               </table>' +
243 '         </form>' +
244 '                       </div> ' +
245 '               </div>' +
246 '</div>';