]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/EmailMarketing/EditView.html
Release 6.2.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-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 <!-- 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_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>&nbsp;<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>
79         </tr>
80         <tr>
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='jscal_field' 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>
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">
86                 <slot>
87                         <select  id="template_id" name='template_id' tabindex='2' onchange="show_edit_template_link(this);">{EMAIL_TEMPLATE_OPTIONS}</select>
88                         &nbsp;
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}">&nbsp;<A href="javascript:edit_email_template_form()"   >{MOD.LBL_EDIT_EMAIL_TEMPLATE}</A>
91                         </span>         
92                 </slot>
93         </td>
94         </tr>
95         <tr>
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>&nbsp;</slot></td>
99         <td><slot>&nbsp;</slot></td>
100         </tr>
101         <tr>
102         <td scope="row"><slot>&nbsp;</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>&nbsp;</slot></td>
105         <td><slot>&nbsp;</slot></td>
106         </tr>
107
108         <tr>
109         <td scope="row"><slot>&nbsp;</slot></td>
110         <td><slot>&nbsp;</slot></td>
111         <td scope="row"><slot>&nbsp;</slot></td>
112         <td><slot>&nbsp;</slot></td>
113         </tr>
114         </table>
115 </td>
116 </tr>
117 </table>
118 </div>
119
120 </form>
121 <script type="text/javascript">
122 Calendar.setup ({
123         inputField : "jscal_field", ifFormat : "{CALENDAR_DATEFORMAT}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
124 });
125
126 function show_edit_template_link(field) {
127
128         var field1=document.getElementById('edit_template');
129         if (field.selectedIndex == 0) {
130                 field1.style.visibility="hidden";
131         }
132         else {
133                 field1.style.visibility="visible";
134         }
135 }
136
137 function refresh_email_template_list(template_id, template_name) {
138
139
140         var field=document.getElementById('template_id');
141         var bfound=0;
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;
146                                 }
147                                 field.options[i].text = template_name;
148                                 bfound=1;
149                         }
150         }
151         //add item to selection list.
152         if (bfound == 0) {
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;
158         }       
159
160         //enable the edit button.
161         var field1=document.getElementById('edit_template');
162         field1.style.visibility="visible";
163 }
164
165 function open_email_template_form() {
166         URL="index.php?module=EmailTemplates&action=EditView&campaign_id={CAMPAIGN_ID}";
167         URL+="&show_js=1";
168
169         windowName = 'email_template';
170         windowFeatures = 'width=800' + ',height=600'    + ',resizable=1,scrollbars=1';
171
172         win = window.open(URL, windowName, windowFeatures);
173         if(window.focus)
174         {
175                 // put the focus on the popup if the browser supports the focus() method
176                 win.focus();
177         }
178 }
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;
184         }
185         URL+="&show_js=1";
186         
187         windowName = 'email_template';
188         windowFeatures = 'width=800' + ',height=600'    + ',resizable=1,scrollbars=1';
189
190         win = window.open(URL, windowName, windowFeatures);
191         if(window.focus)
192         {
193                 // put the focus on the popup if the browser supports the focus() method
194                 win.focus();
195         }
196 }
197
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;
202         } else {
203                 message_for.disabled=false;
204         }
205 }
206
207 var from_emails=new Array({FROM_EMAILS});
208
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) {
214                         var j=i+1;
215                         from_email_span.innerHTML=from_emails[j+1];
216                         if (from_name.value=='') {
217                                 from_name.value=from_emails[j];
218                         }
219                         return;
220                 }
221         }
222 }
223 </script>
224 {JAVASCRIPT}
225
226 <!-- END: main -->