]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Campaigns/tpls/WizardCampaignTargetList.tpl
Release 6.5.0
[Github/sugarcrm.git] / modules / Campaigns / tpls / WizardCampaignTargetList.tpl
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         <table width="100%" border="0" cellspacing="0" cellpadding="0">
42         <tr>
43         <th colspan="4" align="left" ><h4>{$MOD.LBL_WIZ_NEWSLETTER_TITLE_STEP4}</h4></th>
44         </tr>
45         <tr>
46         <td colspan="4">{$MOD.LBL_WIZARD_SUBSCRIPTION_MESSAGE}<br></td>
47         </tr>
48         <tr>
49         <td colspan="4">&nbsp;</td>
50         </tr>
51         <tr>
52         <td scope='row'><span sugar='slot26'>{sugar_help text=$MOD.LBL_SUBSCRIPTION_TARGET_WIZARD_DESC }
53         {$MOD.LBL_SUBSCRIPTION_LIST_NAME}</span sugar='slot'>
54         </td>
55         <td><input type='radio' onclick="change_target_list(this,'subs');" name='wiz_subscriptions_def_type' id='wiz_subscriptions_def_type' title="{$MOD.LBL_DEFAULT_LOCATION}" value="1" >{$MOD.LBL_DEFAULT_LOCATION}<br>
56             <input type='radio' onclick="change_target_list(this,'subs');" name='wiz_subscriptions_def_type' id='wiz_subscriptions_def_type' title="{$MOD.LBL_CUSTOM_LOCATION}" value="2" checked >{$MOD.LBL_CUSTOM_LOCATION}
57         </td>
58         <td  colspan='2'><span sugar='slot26b'>
59         <input class="sqsEnabled" autocomplete="off" id="subscription_name" name="wiz_step3_subscription_name" title='{$MOD.LBL_SUBSCRIPTION_LIST_NAME}' type="text" size='35' value="{$SUBSCRIPTION_NAME}">
60         <input id='prospect_list_type_default' name='prospect_list_type_default' type="hidden" value="default" />       
61         <input id='wiz_step3_subscription_name_id' name='wiz_step3_subscription_list_id' title='Subscription List ID' type="hidden" value='{$SUBSCRIPTION_ID}'>
62         <input title="{$APP.LBL_SELECT_BUTTON_TITLE}" type="button"  class="button" value='{$APP.LBL_SELECT_BUTTON_LABEL}' name=btn1 id='wiz_step3_subscription_name_button'
63         onclick='open_popup("ProspectLists", 600, 400, "&list_type=default", true, false,  {$encoded_subscription_popup_request_data}, "single", true);'>
64         </span sugar='slot'></td>
65         </tr>
66         <tr><td colspan='4'>&nbsp;</td></tr>
67
68         <tr>
69         <td scope='row'><span sugar='slot27'>{sugar_help text=$MOD.LBL_UNSUBSCRIPTION_TARGET_WIZARD_DESC }
70         {$MOD.LBL_UNSUBSCRIPTION_LIST_NAME}</span sugar='slot'>
71         </td>
72         <td><input type='radio' onclick="change_target_list(this,'unsubs');" name='wiz_unsubscriptions_def_type' id='wiz_unsubscriptions_def_type' title="{$MOD.LBL_DEFAULT_LOCATION}" value="1">{$MOD.LBL_DEFAULT_LOCATION}<br>
73         <input type='radio' onclick="change_target_list(this,'unsubs');" name='wiz_unsubscriptions_def_type' id='wiz_unsubscriptions_def_type' title="{$MOD.LBL_CUSTOM_LOCATION}" value="2" checked>{$MOD.LBL_CUSTOM_LOCATION}
74         </td>
75         <td colspan='2'><span sugar='slot27b'>
76         <input  class="sqsEnabled" autocomplete="off" id="unsubscription_name" name="wiz_step3_unsubscription_name" title='{$MOD.LBL_UNSUBSCRIPTION_LIST_NAME}' type="text" size='35' value="{$UNSUBSCRIPTION_NAME}" >
77         <input id='prospect_list_type_exempt' name='prospect_list_type_exempt' type="hidden" value="exempt" />  
78         <iput id='wiz_step3_unsubscription_name_id' name='wiz_step3_unsubscription_list_id' title='UnSubscription List ID' type="hidden" value='{$UNSUBSCRIPTION_ID}'>
79         <input title="{$APP.LBL_SELECT_BUTTON_TITLE}" type="button"  class="button" value='{$APP.LBL_SELECT_BUTTON_LABEL}' name=btn2 id='wiz_step3_unsubscription_name_button'
80         onclick='open_popup("ProspectLists", 600, 400, "&list_type=exempt", true, false,  {$encoded_unsubscription_popup_request_data}, "single", true);'>
81         </span sugar='slot'></td>
82         </tr>
83         <tr><td colspan='4'>&nbsp;</td></tr>
84         <tr>
85         <td scope='row'>
86         <span sugar='slot28'>{sugar_help text=$MOD.LBL_TEST_TARGET_WIZARD_DESC }
87         {$MOD.LBL_TEST_LIST_NAME}</span sugar='slot'>
88         </td>
89         <td><input type='radio' onclick="change_target_list(this,'test');" name='wiz_test_def_type' id='wiz_test_def_type' title="{$MOD.LBL_DEFAULT_LOCATION}" value="1" >{$MOD.LBL_DEFAULT_LOCATION}<br>
90         <input type='radio' onclick="change_target_list(this,'test');" name='wiz_test_def_type' id='wiz_test_def_type' title="{$MOD.LBL_CUSTOM_LOCATION}" value="2" checked >{$MOD.LBL_CUSTOM_LOCATION}
91         </td>
92         <td   colspan='2'><span sugar='slot28b'>
93         <input  class="sqsEnabled" autocomplete="off" id="test_name" name="wiz_step3_test_name" title='{$MOD.LBL_TEST_LIST_NAME}' type="text" size='35' value="{$TEST_NAME}">
94         <input id='prospect_list_type_test' name='prospect_list_type_test' type="hidden" value="test" />        
95         <input id='wiz_step3_test_name_id' name='wiz_step3_test_list_id' title='Test List ID' type="hidden" value='{$TEST_ID}'>
96         <input title="{$APP.LBL_SELECT_BUTTON_TITLE}" type="button"  class="button" value='{$APP.LBL_SELECT_BUTTON_LABEL}' name=btn3 id='wiz_step3_test_name_button'
97         onclick='open_popup("ProspectLists", 600, 400, "&list_type=test", true, false,  {$encoded_test_popup_request_data}, "single", true);'>  
98         </span sugar='slot'></td>
99         </tr>
100         <tr>
101         <td>&nbsp;</td>
102         <td>&nbsp;</td>
103         <td>&nbsp;</td>
104         <td>&nbsp;</td>
105         </tr>
106         </table>
107         <p>
108
109         {literal}
110         <script type="text/javascript" >
111         //this function will toggle the popup forms to be read only if "Default" is selected,
112         //and enable the pop up select if "Custom" is selected
113         function change_target_list(radiobutton,list) {
114         var def_value ='';
115                 if(list == 'subs'){
116                         list_name = 'wiz_step3_subscription_name';
117                         {/literal}
118                         def_id ='{$SUBSCRIPTION_ID}';
119                         def_value ='{$SUBSCRIPTION_NAME}'
120                         {literal}
121                 }
122                 if(list == 'unsubs'){
123                         list_name = 'wiz_step3_unsubscription_name';
124                         {/literal}
125                         def_id ='{$UNSUBSCRIPTION_ID}';
126                         def_value ='{$UNSUBSCRIPTION_NAME}'
127                         {literal}
128                 }
129                 if(list == 'test'){
130                         list_name = 'wiz_step3_test_name';
131                         {/literal}
132                         def_id ='{$TEST_ID}';
133                         def_value ='{$TEST_NAME}'
134                         {literal}
135                 }               
136                         //default selected, set inputs to read only
137                         if (radiobutton.value == '1') {
138                                 radiobutton.form[list_name].disabled=true;
139                                 radiobutton.form[list_name+"_button"].style.visibility='hidden';                                                                
140                                 radiobutton.form[list_name+"_id"].value=def_id;                                                         
141                                 //call function that populates the default value
142                                 change_target_list_names(list,def_value);                               
143                         } else {
144                                 //custom selected, make inputs editable
145                                 radiobutton.form[list_name].disabled=false;
146                                 radiobutton.form[list_name+"_button"].style.visibility='visible';                                                                                               
147                                 radiobutton.form[list_name].value='';
148                                 radiobutton.form[list_name+"_id"].value='';                                                             
149                         }
150         }
151
152         //this function will populate the "default" name on the target list.  It will either do one, 
153         //if specified, or all three widgets, if blank idis passed in
154         function change_target_list_names(list,def_value)       {
155                 //id was passed in, create the listname and inputname variables
156                 if(list != ''){
157                switch (list){{/literal}
158                     case 'subs':
159                     listname = '{$MOD.LBL_SUBSCRIPTION_LIST}';               
160                     inputname = 'subscription_name';
161                     break;
162                     case 'unsubs':
163                     listname = '{$MOD.LBL_UNSUBSCRIPTION_LIST}';               
164                     inputname = 'unsubscription_name';              
165                     break;   
166                     case 'test':
167                     inputname = 'test_name';                
168                     listname = '{$MOD.LBL_TEST_LIST}';
169                     break;                              
170                     default: 
171                     inputname = '';
172                     {literal}
173                         }               
174                 }
175
176         //populate specified input with default value
177         if(def_value==''){
178         def_value = document.getElementById('name').value + ' ' + listname;}
179         document.getElementById(inputname).value = def_value;
180         }
181         
182         </script>       
183         {/literal}