]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/EmailMarketing/EditView.html
Release 6.5.0
[Github/sugarcrm.git] / modules / EmailMarketing / EditView.html
1 <!--
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2012 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 <!-- BEGIN: main -->
42 {ERROR_STRING}
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">
52                 <tr>
53                         <td>
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}  ">
56                         </td>
57                         <td align="right" nowrap><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
58                         <td align='right'>{ADMIN_EDIT}</td>
59                 </tr>
60         </table>
61
62
63 <div class="edit view">
64 <table width="100%" border="0" cellspacing="0" cellpadding="0">
65 <tr>
66 <td>
67         <table width="100%" border="0" cellspacing="0" cellpadding="0">
68         <tr>
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>
73         </tr>
74         <tr>
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">&nbsp;</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">
80                 <slot>
81                         <select  id="template_id" name='template_id' tabindex='2' onchange="show_edit_template_link(this);">{EMAIL_TEMPLATE_OPTIONS}</select>
82                         &nbsp;
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}">&nbsp;<A href="javascript:edit_email_template_form()"   >{MOD.LBL_EDIT_EMAIL_TEMPLATE}</A>
85                         </span>         
86                 </slot>
87         </td>
88         </tr>
89         <tr>
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>&nbsp;</slot></td>
93         <td><slot>&nbsp;</slot></td>
94         </tr>
95     <tr>
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>&nbsp;<SPAN id='from_email' style="font-style:italic">{DEFAULT_FROM_EMAIL}</SPAN></slot></td>
98         <td scope="row"><slot>&nbsp;</slot></td>
99         <td class="datafield"><slot>&nbsp;</slot></td>
100     </tr>
101     <tr>
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>
106     </tr>
107     <tr>
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>
112     </tr>
113
114         <tr>
115         <td scope="row"><slot>&nbsp;</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>&nbsp;</slot></td>
118         <td><slot>&nbsp;</slot></td>
119         </tr>
120
121         <tr>
122         <td scope="row"><slot>&nbsp;</slot></td>
123         <td><slot>&nbsp;</slot></td>
124         <td scope="row"><slot>&nbsp;</slot></td>
125         <td><slot>&nbsp;</slot></td>
126         </tr>
127         </table>
128 </td>
129 </tr>
130 </table>
131 </div>
132
133 </form>
134 <script type="text/javascript">
135 Calendar.setup ({
136         inputField : "date_start_date", ifFormat : "{CALENDAR_DATEFORMAT}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
137 });
138
139 function show_edit_template_link(field) {
140
141         var field1=document.getElementById('edit_template');
142         if (field.selectedIndex == 0) {
143                 field1.style.visibility="hidden";
144         }
145         else {
146                 field1.style.visibility="visible";
147         }
148 }
149
150 function refresh_email_template_list(template_id, template_name) {
151
152
153         var field=document.getElementById('template_id');
154         var bfound=0;
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;
159                                 }
160                                 field.options[i].text = template_name;
161                                 bfound=1;
162                         }
163         }
164         //add item to selection list.
165         if (bfound == 0) {
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;
171         }       
172
173         //enable the edit button.
174         var field1=document.getElementById('edit_template');
175         field1.style.visibility="visible";
176 }
177
178 function open_email_template_form() {
179         URL="index.php?module=EmailTemplates&action=EditView&campaign_id={CAMPAIGN_ID}";
180         URL+="&show_js=1";
181
182         windowName = 'email_template';
183         windowFeatures = 'width=800' + ',height=600'    + ',resizable=1,scrollbars=1';
184
185         win = window.open(URL, windowName, windowFeatures);
186         if(window.focus)
187         {
188                 // put the focus on the popup if the browser supports the focus() method
189                 win.focus();
190         }
191 }
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;
197         }
198         URL+="&show_js=1";
199         
200         windowName = 'email_template';
201         windowFeatures = 'width=800' + ',height=600'    + ',resizable=1,scrollbars=1';
202
203         win = window.open(URL, windowName, windowFeatures);
204         if(window.focus)
205         {
206                 // put the focus on the popup if the browser supports the focus() method
207                 win.focus();
208         }
209 }
210
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;
215         } else {
216                 message_for.disabled=false;
217         }
218 }
219
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});
223
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');
229
230     if(mailbox.value != '') {
231         if(ie_stored_options[mailbox.value]) {
232             var focusIe = ie_stored_options[mailbox.value];
233             // from name
234             if(focusIe.from_name && focusIe.from_name != "")
235                 fn.value = focusIe.from_name;
236             else
237                 fn.value = '';
238
239             // from addr
240             if(focusIe.from_addr && focusIe.from_addr != "")
241                 fa.value = focusIe.from_addr;
242             else
243                 fa.value = '';
244
245             // reply name
246             if(focusIe.reply_to_name && focusIe.reply_to_name != "")
247                 rn.value = focusIe.reply_to_name;
248             else
249                 rn.value = '';
250
251             // reply add
252             if(focusIe.reply_to_addr && focusIe.reply_to_addr != "")
253                 ra.value = focusIe.reply_to_addr;
254             else
255                 ra.value = '';
256         }
257     } else {
258         fn.value = '';
259         fa.value = '';
260         rn.value = '';
261         ra.value = '';
262     }
263 }
264 </script>
265 {JAVASCRIPT}
266
267 <!-- END: main -->