]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Campaigns/WizardMarketing.html
Release 6.4.0
[Github/sugarcrm.git] / modules / Campaigns / WizardMarketing.html
1 <!--
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
5  * 
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.
12  * 
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
16  * details.
17  * 
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
21  * 02110-1301 USA.
22  * 
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.
25  * 
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.
29  * 
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  ********************************************************************************/
36
37 /*********************************************************************************
38
39  ********************************************************************************/
40 -->
41
42
43 <div id='wiz_stage'>
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'>
58
59
60 <p>
61 <div id ='buttons' >
62         <table width="100%" border="0" cellspacing="0" cellpadding="0" >
63                 <tr>
64                         <td align="left" width='30%'>
65                                 <table border="0" cellspacing="0" cellpadding="0" ><tr>
66
67                                         <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>
72                                                 </td>
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>
74                                         </tr>
75                                 </table>
76                         </td>
77                         <td  align="right" width='40%'><div id='wiz_location_message'></td>
78                 </tr>
79         </table>
80 </div>
81 </p>
82
83
84 <table class='other view' cellspacing="1">
85 <tr>
86 <td rowspan='2' width='10%' scope="row" style="vertical-align: top;">
87 <div id='nav' >
88
89 <table border="0" cellspacing="0" cellpadding="0" width="100%" >
90 <tr><td scope='col'><div id='nav_step3'><a  href='{$CAMP_WIZ_URL}1'>{$MOD.LBL_NAVIGATION_MENU_GEN1}</a></div></td></tr>
91 <tr><td scope='col'><div id='nav_step4'><a  href='{$CAMP_WIZ_URL}2'>{$MOD.LBL_NAVIGATION_MENU_GEN2}</a></div></td></tr>
92 <tr><td scope='col'><div id='nav_step5'><a  href='{$CAMP_WIZ_URL}3'>{$MOD.LBL_NAVIGATION_MENU_TRACKERS}</a></div></td></tr>
93 <tr><td scope='col'><div id='nav_step6'><a  href='{$CAMP_WIZ_URL}4'>{$MOD.LBL_NAVIGATION_MENU_SUBSCRIPTIONS}</a></div></td></tr>
94 <tr><td scope='col'><div id='nav_step1'>{$MOD.LBL_NAVIGATION_MENU_MARKETING}</div></td></tr>
95 <tr><td scope='col'><div  id='nav_step2'>{$MOD.LBL_NAVIGATION_MENU_SEND_EMAIL}</div></td></tr>
96 <tr><td scope='col'><div id='nav_step7'>{$MOD.LBL_NAVIGATION_MENU_SUMMARY}</div></td></tr>
97 </table>
98 </div>
99 </td>
100
101 <td  rowspan='2' width='100%' style="padding: 0;">
102 <div id="wiz_message"></div>
103 <div id=wizard>
104
105         <div id='step1' >
106                         <table border="0" cellpadding="0" cellspacing="0" width="100%" class='edit view'>
107                 <tr>
108                         <th colspan="4" align="left" ><h4 scope="row" NOWRAP valign="top">{$MOD.LBL_WIZ_MARKETING_TITLE} {$MRKT_NAME}</h4></td>
109                 </tr>
110                 <tr><td scope="row" colspan="3">{$MOD.LBL_WIZARD_MARKETING_MESSAGE}<br></td><td>&nbsp;</td></tr>
111                 <tr><td colspan="4">&nbsp;</td></tr>
112                 <tr>
113                         <td scope="col" 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="col" 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>
117                 </tr>
118                 <tr>
119                         <td scope="col" 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>
121
122                         <td scope="col" 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">&nbsp;</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>
125
126                 </tr>
127                 <tr>
128                         <td scope="col" 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>
130
131                         <td scope="col" 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>
133                 </tr>
134                 <tr>
135                         <td scope="col" 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>
137
138                         <td scope="col" 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>
140                 </tr>
141                 <tr>
142                         <td scope="col" 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' title="{$MOD.LBL_MESSAGE_FOR}'>{$MOD.LBL_ALL_PROSPECT_LISTS}</slot></td>
144                         <td scope="col" 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);" title='{$MOD.LBL_TEMPLATE}'>{$EMAIL_TEMPLATE_OPTIONS}</select>
147                                         &nbsp;<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                                         &nbsp;<input type='button' class='button' onclick='edit_email_template_form();' value='{$MOD.LBL_EDIT_EMAIL_TEMPLATE}'>
150                                         </span>
151                                 </slot>
152                         </td>
153                 </tr>
154                 <tr>
155                         <td  NOWRAP valign="top"><slot>&nbsp;</slot></td>
156                         <td width="35%" class="datafield"><slot><select {$MESSAGE_FOR_DISABLED}  tabindex='1' multiple size="5" id="message_for" name='message_for[]' title="{$MOD.LBL_MESSAGE_FOR}">{$SCOPE_OPTIONS}</select></slot></td>
157                         <td  NOWRAP valign="top"><slot>&nbsp;</slot></td>
158                         <td><slot>&nbsp;</slot></td>
159                 </tr>
160                 </table>
161
162
163                 {literal}
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
167                         {literal}});
168
169
170                 function show_edit_template_link(field) {
171
172                         var field1=document.getElementById('edit_template');
173                         if (field.selectedIndex == 0) {
174                                 field1.style.visibility="hidden";
175                         }
176                         else {
177                                 field1.style.visibility="visible";
178                         }
179                 }
180
181                 function refresh_email_template_list(template_id, template_name) {
182                         var field=document.getElementById('template_id');
183                         var bfound=0;
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;
188                                                 }
189                                                 field.options[i].text = template_name;
190                                                 bfound=1;
191                                         }
192                         }
193                         //add item to selection list.
194                         if (bfound == 0) {
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;
200                         }
201
202                         //enable the edit button.
203                         var field1=document.getElementById('edit_template');
204                         field1.style.visibility="visible";
205                 }
206
207                 function open_email_template_form() {
208                 {/literal}
209                         URL="index.php?module=EmailTemplates&action=EditView&campaign_id={$CAMPAIGN_ID}";
210                         URL+="&sugar_body_only=1";
211                 {literal}
212                         windowName = 'email_template';
213                         windowFeatures = 'width=800' + ',height=600'    + ',resizable=1,scrollbars=1';
214
215                         win = window.open(URL, windowName, windowFeatures);
216                         if(window.focus)
217                         {
218                                 // put the focus on the popup if the browser supports the focus() method
219                                 win.focus();
220                         }
221                 }
222                 function edit_email_template_form() {
223                 {/literal}
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";
227                         {literal}
228                         if (field.options[field.selectedIndex].value != 'undefined') {
229                                 URL+="&record="+field.options[field.selectedIndex].value;
230                         }
231                         windowName = 'email_template';
232                         windowFeatures = 'width=800' + ',height=600'    + ',resizable=1,scrollbars=1';
233
234                         win = window.open(URL, windowName, windowFeatures);
235                         if(window.focus)
236                         {
237                                 // put the focus on the popup if the browser supports the focus() method
238                                 win.focus();
239                         }
240                 }
241
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;
246                         } else {
247                                 message_for.disabled=false;
248                         }
249                 }
250                 {/literal}
251                 var from_emails=new Array({$FROM_EMAILS});
252                 {literal}
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) {
258                                         var j=i+1;
259                                         from_email_span.innerHTML=from_emails[j+1];
260                                         if (from_name.value=='') {
261                                                 from_name.value=from_emails[j];
262                                         }
263                                         return;
264                                 }
265                         }
266                 }
267
268                 {/literal}
269                 // cn: bug 12587 - allow setting of Reply-to X from campaigns
270                 var ie_stored_options = {$IEStoredOptions};
271                 {literal}
272
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');
278
279                         if(mailbox.value != '') {
280                                 if(ie_stored_options[mailbox.value]) {
281                                         var focusIe = ie_stored_options[mailbox.value];
282                                         // from name
283                                         if(focusIe.from_name && focusIe.from_name != "")
284                                                 fn.value = focusIe.from_name;
285                                         else
286                                                 fn.value = '';
287
288                                         // from addr
289                                         if(focusIe.from_addr && focusIe.from_addr != "")
290                                                 fa.value = focusIe.from_addr;
291                                         else
292                                                 fa.value = '';
293
294                                         // reply name
295                                         if(focusIe.reply_to_name && focusIe.reply_to_name != "")
296                                                 rn.value = focusIe.reply_to_name;
297                                         else
298                                                 rn.value = '';
299
300                                         // reply add
301                                         if(focusIe.reply_to_addr && focusIe.reply_to_addr != "")
302                                                 ra.value = focusIe.reply_to_addr;
303                                         else
304                                                 ra.value = '';
305                                 }
306                         } else {
307                                 fn.value = '';
308                                 fa.value = '';
309                                 rn.value = '';
310                                 ra.value = '';
311                         }
312                 }
313
314
315                 </script>
316                 {/literal}
317                 </div>
318         </div>
319
320
321         <div id='step2' >
322                         <table>
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">&nbsp;</td></tr>
326                         <tr><td>
327                                 <input type="radio"  id="next_step" title="{$MOD.LBL_SAVE_EXIT_BUTTON_LABEL}" name="wiz_home_next_step" value='1'checked >{$MOD.LBL_SAVE_EXIT_BUTTON_LABEL}
328                         </td></tr>
329                         <tr><td>
330                                 &nbsp;<div id='target_message'><font color='red'><b>{$WARNING_MESSAGE}</b></font></div>
331                                 &nbsp;<div id='send_email1' ><input type="radio"  id="next_step" name="wiz_home_next_step" title="{$MOD.LBL_SEND_AS_TEST}" value='2' {$PL_DISABLED}>{$MOD.LBL_SEND_AS_TEST}</div>
332                         </td></tr>
333                         <tr><td>
334                                 &nbsp;<div id='send_email2' {$SHOW_DIVS}><input type="radio"  id="next_step" name='wiz_home_next_step' value='3' title='{$MOD.LBL_SEND_EMAIL}' {$PL_DISABLED}>{$MOD.LBL_SEND_EMAIL}</div>
335                         </td></tr></table>
336         </div>
337
338
339
340
341         </td>
342 </tr>
343 </table>
344
345 {literal}
346 <script language="javascript">
347 function determine_back(){
348 {/literal}
349         var current_step = document.getElementById('wiz_current_step').value;
350     var total_steps = document.getElementById('wiz_total_steps').value;
351 {literal}
352         if(current_step == 1){
353 {/literal}
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();
359 {literal}
360         }else{
361                 navigate('back');
362         }
363
364
365 }
366 </script>
367 {/literal}
368 </form>
369 </div>
370
371 {sugar_getscript file="modules/Campaigns/wizard.js"}
372 {sugar_getscript file="cache/include/javascript/sugar_grp_overlib.js"}
373 <div id='overDiv' style='position:absolute; visibility:hidden; z-index:1000;'></div>
374 {$WIZ_JAVASCRIPT}
375 {$DIV_JAVASCRIPT}
376 {$JAVASCRIPT}
377 <script language="javascript">
378 //      link_navs();
379 addToValidate('wizform', 'inbound_email_id', 'alphanumeric', true,  document.getElementById('inbound_email_id').title);
380 </script>
381
382