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_FROM_MAILBOX_NAME}</slot></td>
76 <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>
77 <td scope="row"><slot>{MOD.LBL_FROM_NAME} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
78 <td class="datafield"><slot><input name='from_name' id='from_name' tabindex='2' size='25' maxlength='25' type="text" value="{FROM_NAME}"></slot></td>
81 <td scope="row"><slot>{MOD.LBL_START_DATE_TIME} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
82 <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>
83 <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>
84 <td scope="row"><slot>{MOD.LBL_TEMPLATE} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
85 <td class="datafield">
87 <select id="template_id" name='template_id' tabindex='2' onchange="show_edit_template_link(this);">{EMAIL_TEMPLATE_OPTIONS}</select>
89 <A href="javascript:open_email_template_form()" >{MOD.LBL_CREATE_EMAIL_TEMPLATE}</A>
90 <span name='edit_template' id='edit_template' style="{EDIT_TEMPLATE}"> <A href="javascript:edit_email_template_form()" >{MOD.LBL_EDIT_EMAIL_TEMPLATE}</A>
96 <td width="15%" scope="row"><slot>{MOD.LBL_MESSAGE_FOR} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
97 <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>
98 <td scope="row"><slot> </slot></td>
99 <td><slot> </slot></td>
102 <td scope="row"><slot> </slot></td>
103 <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>
104 <td scope="row"><slot> </slot></td>
105 <td><slot> </slot></td>
109 <td scope="row"><slot> </slot></td>
110 <td><slot> </slot></td>
111 <td scope="row"><slot> </slot></td>
112 <td><slot> </slot></td>
121 <script type="text/javascript">
123 inputField : "date_start_date", ifFormat : "{CALENDAR_DATEFORMAT}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
126 function show_edit_template_link(field) {
128 var field1=document.getElementById('edit_template');
129 if (field.selectedIndex == 0) {
130 field1.style.visibility="hidden";
133 field1.style.visibility="visible";
137 function refresh_email_template_list(template_id, template_name) {
140 var field=document.getElementById('template_id');
142 for (var i=0; i < field.options.length; i++) {
143 if (field.options[i].value == template_id) {
144 if (field.options[i].selected==false) {
145 field.options[i].selected=true;
147 field.options[i].text = template_name;
151 //add item to selection list.
153 var newElement=document.createElement('option');
154 newElement.text=template_name;
155 newElement.value=template_id;
156 field.options.add(newElement);
157 newElement.selected=true;
160 //enable the edit button.
161 var field1=document.getElementById('edit_template');
162 field1.style.visibility="visible";
165 function open_email_template_form() {
166 URL="index.php?module=EmailTemplates&action=EditView&campaign_id={CAMPAIGN_ID}";
169 windowName = 'email_template';
170 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
172 win = window.open(URL, windowName, windowFeatures);
175 // put the focus on the popup if the browser supports the focus() method
179 function edit_email_template_form() {
180 var field=document.getElementById('template_id');
181 URL="index.php?module=EmailTemplates&action=EditView&campaign_id={CAMPAIGN_ID}";
182 if (field.options[field.selectedIndex].value != 'undefined') {
183 URL+="&record="+field.options[field.selectedIndex].value;
187 windowName = 'email_template';
188 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
190 win = window.open(URL, windowName, windowFeatures);
193 // put the focus on the popup if the browser supports the focus() method
198 function toggle_message_for(all_prospects_checkbox) {
199 message_for = document.getElementById('message_for');
200 if (all_prospects_checkbox.checked) {
201 message_for.disabled=true;
203 message_for.disabled=false;
207 var from_emails=new Array({FROM_EMAILS});
209 function set_from_email_and_name(mailbox) {
210 from_email_span = document.getElementById('from_email');
211 from_name = document.getElementById('from_name');
212 for (i=0;i<=from_emails.length; i++) {
213 if ((mailbox.value=='' && from_emails[i] =='EMPTY') || from_emails[i] == mailbox.value) {
215 from_email_span.innerHTML=from_emails[j+1];
216 if (from_name.value=='') {
217 from_name.value=from_emails[j];