2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 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 ********************************************************************************/
37 /*********************************************************************************
39 ********************************************************************************/
43 <form name="EditView" method="POST" action="index.php">
44 <input type="hidden" name="module" value="EmailMarketing">
45 <input type="hidden" name="record" value="{ID}">
46 <input type="hidden" name="action">
47 <input type="hidden" name="campaign_id" value="{CAMPAIGN_ID}">
48 <input type="hidden" name="return_module" value="{RETURN_MODULE}">
49 <input type="hidden" name="return_id" value="{RETURN_ID}">
50 <input type="hidden" name="return_action" value="{RETURN_ACTION}">
51 <table width="100%" cellpadding="0" cellspacing="0" border="0">
54 <input title="{APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save'; return verify_data(this.form,'EditView')" type="submit" name="button" value=" {APP.LBL_SAVE_BUTTON_LABEL} " >
55 <input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'" type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
57 <td align="right" nowrap><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
58 <td align='right'>{ADMIN_EDIT}</td>
63 <div class="edit view">
64 <table width="100%" border="0" cellspacing="0" cellpadding="0">
67 <table width="100%" border="0" cellspacing="0" cellpadding="0">
69 <td width="15%" scope="row"><slot>{MOD.LBL_NAME} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
70 <td width="35%" ><slot><input name='name' {DISABLED} tabindex='1' size='25' maxlength='25' type="text" value="{NAME}"></slot></td>
71 <td scope="row"><slot>{MOD.LBL_STATUS_TEXT} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
72 <td ><slot><select tabindex='2' id='status' name='status'>{STATUS_OPTIONS}</select></slot></td>
75 <td scope="row"><slot>{MOD.LBL_START_DATE_TIME} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
76 <td class="datafield"><slot><table cellpadding="0" cellspacing="0"><tr><td nowrap><input name='date_start' onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');" id='date_start_date' size='11' tabindex='1' maxlength='10' type="text" value="{DATE_START}"> <img src="index.php?entryPoint=getImage&themeName={THEME}&imageName=jscalendar.gif" alt="{CALENDAR_DATEFORMAT}" id="jscal_trigger" align="absmiddle"> </td>
77 <td nowrap><input type="text" size='5' maxlength='5' name='time_start' tabindex="1" value="{TIME_START}"/>{TIME_MERIDIEM}</td></tr><tr><td nowrap><span class="dateFormat">{USER_DATEFORMAT}</span></td><td nowrap><span class="dateFormat">{TIME_FORMAT}</span></td></tr></table></slot></td>
78 <td scope="row"><slot>{MOD.LBL_TEMPLATE} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
79 <td class="datafield">
81 <select id="template_id" name='template_id' tabindex='2' onchange="show_edit_template_link(this);">{EMAIL_TEMPLATE_OPTIONS}</select>
83 <A href="javascript:open_email_template_form()" >{MOD.LBL_CREATE_EMAIL_TEMPLATE}</A>
84 <span name='edit_template' id='edit_template' style="{EDIT_TEMPLATE}"> <A href="javascript:edit_email_template_form()" >{MOD.LBL_EDIT_EMAIL_TEMPLATE}</A>
90 <td width="15%" scope="row"><slot>{MOD.LBL_MESSAGE_FOR} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
91 <td width="35%" class="datafield"><slot><input type="checkbox" tabindex='1' onclick="toggle_message_for(this);" id="all_prospect_lists" {ALL_PROSPECT_LISTS_CHECKED} name='all_prospect_lists'>{MOD.LBL_ALL_PROSPECT_LISTS}</slot></td>
92 <td scope="row"><slot> </slot></td>
93 <td><slot> </slot></td>
96 <td scope="row"><slot>{MOD.LBL_FROM_MAILBOX_NAME}</slot></td>
97 <td ><slot><select id='inbound_email_id' tabindex='1' onchange='set_from_email_and_name(this);' name='inbound_email_id'>{MAILBOXES}</select> <SPAN id='from_email' style="font-style:italic">{DEFAULT_FROM_EMAIL}</SPAN></slot></td>
98 <td scope="row"><slot> </slot></td>
99 <td class="datafield"><slot> </slot></td>
102 <td scope="row"><slot>{MOD.LBL_FROM_NAME} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
103 <td ><slot><input name='from_name' id='from_name' tabindex='2' size='25' maxlength='25' type="text" value="{FROM_NAME}"></slot></td>
104 <td scope="row"><slot>{MOD.LBL_FROM_ADDR}</slot></td>
105 <td class="datafield"><slot><input name='from_addr' id='from_addr' title='{MOD.LBL_FROM_ADDR}' tabindex='2' size='25' maxlength='25' type="text" value="{FROM_ADDR}"></slot></td>
108 <td width="15%" scope="row"><slot>{MOD.LBL_REPLY_NAME}</slot></td>
109 <td width="35%" class="datafield"><slot><input name='reply_to_name' id='reply_to_name' title='{MOD.LBL_REPLY_NAME}' tabindex='2' size='25' maxlength='25' type="text" value="{REPLY_NAME}"></slot></td>
110 <td scope="row"><slot>{MOD.LBL_REPLY_ADDR}</slot></td>
111 <td class="datafield"><slot><input name='reply_to_addr' id='reply_to_addr' title='{MOD.LBL_REPLY_ADDR}' tabindex='2' size='25' maxlength='25' type="text" value="{REPLY_ADDR}"></slot></td>
115 <td scope="row"><slot> </slot></td>
116 <td width="35%" class="datafield"><slot><select {MESSAGE_FOR_DISABLED} tabindex='1' multiple size="5" id="message_for" name='message_for[]'>{SCOPE_OPTIONS}</select></slot></td>
117 <td scope="row"><slot> </slot></td>
118 <td><slot> </slot></td>
122 <td scope="row"><slot> </slot></td>
123 <td><slot> </slot></td>
124 <td scope="row"><slot> </slot></td>
125 <td><slot> </slot></td>
134 <script type="text/javascript">
136 inputField : "date_start_date", ifFormat : "{CALENDAR_DATEFORMAT}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
139 function show_edit_template_link(field) {
141 var field1=document.getElementById('edit_template');
142 if (field.selectedIndex == 0) {
143 field1.style.visibility="hidden";
146 field1.style.visibility="visible";
150 function refresh_email_template_list(template_id, template_name) {
153 var field=document.getElementById('template_id');
155 for (var i=0; i < field.options.length; i++) {
156 if (field.options[i].value == template_id) {
157 if (field.options[i].selected==false) {
158 field.options[i].selected=true;
160 field.options[i].text = template_name;
164 //add item to selection list.
166 var newElement=document.createElement('option');
167 newElement.text=template_name;
168 newElement.value=template_id;
169 field.options.add(newElement);
170 newElement.selected=true;
173 //enable the edit button.
174 var field1=document.getElementById('edit_template');
175 field1.style.visibility="visible";
178 function open_email_template_form() {
179 URL="index.php?module=EmailTemplates&action=EditView&campaign_id={CAMPAIGN_ID}";
182 windowName = 'email_template';
183 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
185 win = window.open(URL, windowName, windowFeatures);
188 // put the focus on the popup if the browser supports the focus() method
192 function edit_email_template_form() {
193 var field=document.getElementById('template_id');
194 URL="index.php?module=EmailTemplates&action=EditView&campaign_id={CAMPAIGN_ID}";
195 if (field.options[field.selectedIndex].value != 'undefined') {
196 URL+="&record="+field.options[field.selectedIndex].value;
200 windowName = 'email_template';
201 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
203 win = window.open(URL, windowName, windowFeatures);
206 // put the focus on the popup if the browser supports the focus() method
211 function toggle_message_for(all_prospects_checkbox) {
212 message_for = document.getElementById('message_for');
213 if (all_prospects_checkbox.checked) {
214 message_for.disabled=true;
216 message_for.disabled=false;
220 //get values to populate from and reply boxes on change of mail box dropdown
221 var ie_stored_options = {IEStoredOptions};
222 var from_emails=new Array({FROM_EMAILS});
224 function set_from_email_and_name(mailbox) {
225 var fn = document.getElementById('from_name');
226 var fa = document.getElementById('from_addr');
227 var rn = document.getElementById('reply_to_name');
228 var ra = document.getElementById('reply_to_addr');
230 if(mailbox.value != '') {
231 if(ie_stored_options[mailbox.value]) {
232 var focusIe = ie_stored_options[mailbox.value];
234 if(focusIe.from_name && focusIe.from_name != "")
235 fn.value = focusIe.from_name;
240 if(focusIe.from_addr && focusIe.from_addr != "")
241 fa.value = focusIe.from_addr;
246 if(focusIe.reply_to_name && focusIe.reply_to_name != "")
247 rn.value = focusIe.reply_to_name;
252 if(focusIe.reply_to_addr && focusIe.reply_to_addr != "")
253 ra.value = focusIe.reply_to_addr;