2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2013 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 ********************************************************************************/
41 <table width="100%" border="0" cellspacing="0" cellpadding="0">
43 <th colspan="4" align="left" ><h4>{$MOD.LBL_WIZ_NEWSLETTER_TITLE_STEP4}</h4></th>
46 <td colspan="4">{$MOD.LBL_WIZARD_SUBSCRIPTION_MESSAGE}<br></td>
49 <td colspan="4"> </td>
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'>
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}
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>
66 <tr><td colspan='4'> </td></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'>
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}
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>
83 <tr><td colspan='4'> </td></tr>
86 <span sugar='slot28'>{sugar_help text=$MOD.LBL_TEST_TARGET_WIZARD_DESC }
87 {$MOD.LBL_TEST_LIST_NAME}</span sugar='slot'>
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}
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>
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) {
116 list_name = 'wiz_step3_subscription_name';
118 def_id ='{$SUBSCRIPTION_ID}';
119 def_value ='{$SUBSCRIPTION_NAME}'
122 if(list == 'unsubs'){
123 list_name = 'wiz_step3_unsubscription_name';
125 def_id ='{$UNSUBSCRIPTION_ID}';
126 def_value ='{$UNSUBSCRIPTION_NAME}'
130 list_name = 'wiz_step3_test_name';
132 def_id ='{$TEST_ID}';
133 def_value ='{$TEST_NAME}'
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);
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='';
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
157 switch (list){{/literal}
159 listname = '{$MOD.LBL_SUBSCRIPTION_LIST}';
160 inputname = 'subscription_name';
163 listname = '{$MOD.LBL_UNSUBSCRIPTION_LIST}';
164 inputname = 'unsubscription_name';
167 inputname = 'test_name';
168 listname = '{$MOD.LBL_TEST_LIST}';
176 //populate specified input with default value
178 def_value = document.getElementById('name').value + ' ' + listname;}
179 document.getElementById(inputname).value = def_value;