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 ********************************************************************************/
37 /*********************************************************************************
39 ********************************************************************************/
44 <form id="wizform" name="wizform" method="POST" action="index.php">
45 <input type="hidden" name="module" value="Campaigns">
46 <input type="hidden" id="record" name="record" value="{$MRKT_ID}">
47 <input type="hidden" name="campaign_id" value="{$CAMPAIGN_ID}">
48 <input type="hidden" id='action' name="action">
49 <input type="hidden" id="return_module" name="return_module" value="{$RETURN_MODULE}">
50 <input type="hidden" id="return_id" name="return_id" value="{$RETURN_ID}">
51 <input type="hidden" id="return_action" name="return_action" value="{$RETURN_ACTION}">
52 <input type="hidden" id="direct_step" name="direct_step" value='4'>
53 <input type="hidden" id="wiz_total_steps" name="totalsteps" value="2">
54 <input type="hidden" id="wiz_current_step" name="currentstep" value='0'>
55 <input type="hidden" id="wiz_back" name="wiz_back" value='none'>
56 <input type="hidden" id="wiz_next" name="wiz_next" value='2'>
57 <input type="hidden" id="direction" name="wiz_direction" value='exit'>
62 <table width="100%" border="0" cellspacing="0" cellpadding="0" >
64 <td align="left" width='30%'>
65 <table border="0" cellspacing="0" cellpadding="0" ><tr>
68 <td><div id="back_button_div2"><input id="wiz_back_button" type='hidden' title="{$APP.LBL_BACK}" class="button" onclick="determine_back();" name="back" value=" {$APP.LBL_BACK}"></div></td>
69 <td><div id="back_button_div"><input id="wiz_back_button" type='button' title="{$APP.LBL_BACK}" class="button" onclick="determine_back();" name="back" value=" {$APP.LBL_BACK}"></div></td>
70 <td><div id="cancel_button_div"><input id="wiz_cancel_button" title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='WizardHome'; this.form.module.value='Campaigns'; this.form.record.value='{$CAMPAIGN_ID}';" type="submit" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}"></div></td>
71 <td><div id="save_button_div"><input id="wiz_submit_button" title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='WizardMarketingSave'; this.form.module.value='Campaigns';" type="submit" name="button" value="{$MOD.LBL_SAVE_EXIT_BUTTON_LABEL}" ></div>
73 <td><div id="next_button_div"><input id="wiz_next_button" type='button' title="{$APP.LBL_NEXT_BUTTON_LABEL}" class="button" onclick="javascript:navigate('next');" name="button" value="{$APP.LBL_NEXT_BUTTON_LABEL}"></div></td>
77 <td align="right" width='40%'><div id='wiz_location_message'></td>
84 <table class='other view' cellspacing="1">
86 <td rowspan='2' width='10%' scope="row" style="vertical-align: top;">
89 <table border="0" cellspacing="0" cellpadding="0" width="100%" >
90 <tr><td scope='row'><div id='nav_step3'><a href='{$CAMP_WIZ_URL}1'>{$MOD.LBL_NAVIGATION_MENU_GEN1}</a></div></td></tr>
91 <tr><td scope='row'><div id='nav_step4'><a href='{$CAMP_WIZ_URL}2'>{$MOD.LBL_NAVIGATION_MENU_GEN2}</a></div></td></tr>
92 <tr><td scope='row'><div id='nav_step5'><a href='{$CAMP_WIZ_URL}3'>{$MOD.LBL_NAVIGATION_MENU_TRACKERS}</a></div></td></tr>
93 <tr><td scope='row'><div id='nav_step6'><a href='{$CAMP_WIZ_URL}4'>{$MOD.LBL_NAVIGATION_MENU_SUBSCRIPTIONS}</a></div></td></tr>
94 <tr><td scope='row'><div id='nav_step1'>{$MOD.LBL_NAVIGATION_MENU_MARKETING}</div></td></tr>
95 <tr><td scope='row'><div id='nav_step2'>{$MOD.LBL_NAVIGATION_MENU_SEND_EMAIL}</div></td></tr>
96 <tr><td scope='row'><div id='nav_step7'>{$MOD.LBL_NAVIGATION_MENU_SUMMARY}</div></td></tr>
101 <td rowspan='2' width='100%' style="padding: 0;">
102 <div id="wiz_message"></div>
106 <table border="0" cellpadding="0" cellspacing="0" width="100%" class='edit view'>
108 <th colspan="4" align="left" ><h4 scope="row" NOWRAP valign="top">{$MOD.LBL_WIZ_MARKETING_TITLE} {$MRKT_NAME}</h4></td>
110 <tr><td scope="row" colspan="3">{$MOD.LBL_WIZARD_MARKETING_MESSAGE}<br></td><td> </td></tr>
111 <tr><td colspan="4"> </td></tr>
113 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_MRKT_NAME} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
114 <td ><slot><input id='name' name='wiz_step3_name' title='{$MOD.LBL_MRKT_NAME}' size='25' maxlength='25' type="text" value="{$MRKT_NAME}"></slot></td>
115 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_STATUS_TEXT} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
116 <td ><slot><select tabindex='2' id='status' title='{$MOD.LBL_STATUS_TEXT}' name='wiz_step3_status'>{$STATUS_OPTIONS}</select></slot></td>
119 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_FROM_MAILBOX_NAME}<span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
120 <td ><slot><select title='{$MOD.LBL_FROM_MAILBOX_NAME}' id='inbound_email_id' name='wiz_step3_inbound_email_id' onchange='set_from_reply_info(this);'>{$MAILBOXES}</select></slot></td>
122 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_START_DATE_TIME} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
123 <td class="datafield"><slot><table cellpadding="0" cellspacing="0"><tr><td nowrap><input title ='{$MOD.LBL_START_DATE_TIME}' id='date_start' name='wiz_step3_date_start' onblur="parseDate(this, '{$CALENDAR_DATEFORMAT}');" size='11' tabindex='1' maxlength='10' type="text" value="{$MRKT_DATE_START}"> <img src="{sugar_getimagepath file='jscalendar.gif'}" alt="{$CALENDAR_DATEFORMAT}" id="jscal_trigger" align="absmiddle"> </td>
124 <td nowrap><input type="text" size='5' maxlength='5' id='time_start' name='wiz_step3_time_start' tabindex="1" value="{$MRKT_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>
128 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_FROM_NAME} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
129 <td class="datafield"><slot><input name='wiz_step3_from_name' id='from_name' title='{$MOD.LBL_FROM_NAME}' tabindex='2' size='25' maxlength='{$MRKT_FROM_NAME_LEN}' type="text" value="{$MRKT_FROM_NAME}"></slot></td>
131 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_FROM_ADDR} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
132 <td class="datafield"><slot><input name='wiz_step3_from_addr' id='from_addr' title='{$MOD.LBL_FROM_ADDR}' tabindex='2' size='25' maxlength='{$MRKT_FROM_NAME_LEN}' type="text" value="{$MRKT_FROM_ADDR}"></slot></td>
135 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_REPLY_NAME}</slot></td>
136 <td class="datafield"><slot><input name='wiz_step3_reply_to_name' id='reply_name' title='{$MOD.LBL_REPLY_NAME}' tabindex='2' size='25' maxlength='{$MRKT_REPLY_NAME_LEN}' type="text" value="{$MRKT_REPLY_NAME}"></slot></td>
138 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_REPLY_ADDR}</slot></td>
139 <td class="datafield"><slot><input name='wiz_step3_reply_to_addr' id='reply_addr' title='{$MOD.LBL_REPLY_ADDR}' tabindex='2' size='25' maxlength='{$MRKT_REPLY_ADDR_LEN}' type="text" value="{$MRKT_REPLY_ADDR}"></slot></td>
142 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_MESSAGE_FOR} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
143 <td 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>
144 <td scope="row" NOWRAP valign="top"><slot>{$MOD.LBL_TEMPLATE} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
145 <td class="datafield" nowrap>
146 <select id="template_id" name='template_id' tabindex='2' onchange="show_edit_template_link(this);">{$EMAIL_TEMPLATE_OPTIONS}</select>
147 <input type='button' class='button' onclick='open_email_template_form();' value='{$MOD.LBL_CREATE_EMAIL_TEMPLATE}'>
148 <span name='edit_template' id='edit_template' style="{$EDIT_TEMPLATE}">
149 <input type='button' class='button' onclick='edit_email_template_form();' value='{$MOD.LBL_EDIT_EMAIL_TEMPLATE}'>
155 <td scope="row" NOWRAP valign="top"><slot> </slot></td>
156 <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>
157 <td scope="row" NOWRAP valign="top"><slot> </slot></td>
158 <td><slot> </slot></td>
164 <script type="text/javascript">
165 Calendar.setup ({{/literal}
166 inputField : "date_start", ifFormat : "{$CALENDAR_DATEFORMAT}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
170 function show_edit_template_link(field) {
172 var field1=document.getElementById('edit_template');
173 if (field.selectedIndex == 0) {
174 field1.style.visibility="hidden";
177 field1.style.visibility="visible";
181 function refresh_email_template_list(template_id, template_name) {
182 var field=document.getElementById('template_id');
184 for (var i=0; i < field.options.length; i++) {
185 if (field.options[i].value == template_id) {
186 if (field.options[i].selected==false) {
187 field.options[i].selected=true;
189 field.options[i].text = template_name;
193 //add item to selection list.
195 var newElement=document.createElement('option');
196 newElement.text=template_name;
197 newElement.value=template_id;
198 field.options.add(newElement);
199 newElement.selected=true;
202 //enable the edit button.
203 var field1=document.getElementById('edit_template');
204 field1.style.visibility="visible";
207 function open_email_template_form() {
209 URL="index.php?module=EmailTemplates&action=EditView&campaign_id={$CAMPAIGN_ID}";
210 URL+="&sugar_body_only=1";
212 windowName = 'email_template';
213 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
215 win = window.open(URL, windowName, windowFeatures);
218 // put the focus on the popup if the browser supports the focus() method
222 function edit_email_template_form() {
224 var field=document.getElementById('template_id');
225 URL="index.php?module=EmailTemplates&action=EditView&campaign_id={$CAMPAIGN_ID}";
226 URL+="&sugar_body_only=1";
228 if (field.options[field.selectedIndex].value != 'undefined') {
229 URL+="&record="+field.options[field.selectedIndex].value;
231 windowName = 'email_template';
232 windowFeatures = 'width=800' + ',height=600' + ',resizable=1,scrollbars=1';
234 win = window.open(URL, windowName, windowFeatures);
237 // put the focus on the popup if the browser supports the focus() method
242 function toggle_message_for(all_prospects_checkbox) {
243 message_for = document.getElementById('message_for');
244 if (all_prospects_checkbox.checked) {
245 message_for.disabled=true;
247 message_for.disabled=false;
251 var from_emails=new Array({$FROM_EMAILS});
253 function set_from_email_and_name(mailbox) {
254 from_email_span = document.getElementById('from_email');
255 from_name = document.getElementById('from_name');
256 for (i=0; i<=from_emails.length; i++) {
257 if ((mailbox.value == '' && from_emails[i] =='EMPTY') || from_emails[i] == mailbox.value) {
259 from_email_span.innerHTML=from_emails[j+1];
260 if (from_name.value=='') {
261 from_name.value=from_emails[j];
269 // cn: bug 12587 - allow setting of Reply-to X from campaigns
270 var ie_stored_options = {$IEStoredOptions};
273 function set_from_reply_info(mailbox) {
274 var fn = document.getElementById('from_name');
275 var fa = document.getElementById('from_addr');
276 var rn = document.getElementById('reply_name');
277 var ra = document.getElementById('reply_addr');
279 if(mailbox.value != '') {
280 if(ie_stored_options[mailbox.value]) {
281 var focusIe = ie_stored_options[mailbox.value];
283 if(focusIe.from_name && focusIe.from_name != "")
284 fn.value = focusIe.from_name;
289 if(focusIe.from_addr && focusIe.from_addr != "")
290 fa.value = focusIe.from_addr;
295 if(focusIe.reply_to_name && focusIe.reply_to_name != "")
296 rn.value = focusIe.reply_to_name;
301 if(focusIe.reply_to_addr && focusIe.reply_to_addr != "")
302 ra.value = focusIe.reply_to_addr;
323 <td ><h3>{$MOD.LBL_WIZ_SENDMAIL_TITLE} {$MRKT_NAME}</h3></td>
324 <tr><td class="datalabel">{$MOD.LBL_WIZARD_SENDMAIL_MESSAGE}<br></td></tr>
325 <tr><td class="datalabel"> </td></tr>
327 <input type="radio" id="next_step" name="wiz_home_next_step" value='1'checked >{$MOD.LBL_SAVE_EXIT_BUTTON_LABEL}
330 <div id='target_message'><font color='red'><b>{$WARNING_MESSAGE}</b></font></div>
331 <div id='send_email1' ><input type="radio" id="next_step" name="wiz_home_next_step" value='2' {$PL_DISABLED}>{$MOD.LBL_SEND_AS_TEST}</div>
334 <div id='send_email2' {$SHOW_DIVS}><input type="radio" id="next_step" name='wiz_home_next_step' value='3' {$PL_DISABLED}>{$MOD.LBL_SEND_EMAIL}</div>
346 <script language="javascript">
347 function determine_back(){
349 var current_step = document.getElementById('wiz_current_step').value;
350 var total_steps = document.getElementById('wiz_total_steps').value;
352 if(current_step == 1){
354 document.getElementById('action').value='WizardNewsletter';
355 document.getElementById('record').value='{$CAMPAIGN_ID}';
356 document.getElementById('return_id').value='{$CAMPAIGN_ID}';
357 document.getElementById('direct_step').value='4';
358 document.getElementById('wizform').submit();
371 <script type="text/javascript" language="javascript" src="modules/Campaigns/wizard.js"></script>
372 <script type='text/javascript' src='include/javascript/sugar_grp_overlib.js'></script>
373 <div id='overDiv' style='position:absolute; visibility:hidden; z-index:1000;'></div>
377 <script language="javascript">
379 addToValidate('wizform', 'inbound_email_id', 'alphanumeric', true, document.getElementById('inbound_email_id').title);