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 ********************************************************************************/
42 <table width="100%" border="0" cellspacing="0" cellpadding="0">
44 <th colspan="4" align="left" ><h4>{$MOD.LBL_WIZ_NEWSLETTER_TITLE_STEP2}</h4></th>
46 <tr><td class="datalabel" colspan="3">{$MOD.LBL_WIZARD_BUDGET_MESSAGE}<br></td><td> </td></tr>
47 <tr><td class="datalabel" colspan="4"> </td></tr>
49 <td scope="col"><span sugar='slot14'>{$MOD.LBL_CAMPAIGN_BUDGET}</span sugar='slot'></td>
50 <td ><span sugar='slot14b'><input type="text" size="10" maxlength="15" id="budget" name="wiz_step2_budget" title="{$MOD.LBL_CAMPAIGN_BUDGET}" value="{$CAMP_BUDGET}"></span sugar='slot'></td>
51 <td scope="col"><span sugar='slot15'>{$MOD.LBL_CAMPAIGN_ACTUAL_COST}</span sugar='slot'></td>
52 <td ><span sugar='slot15b'><input type="text" size="10" maxlength="15" id="actual_cost" name="wiz_step2_actual_cost" title="{$MOD.LBL_CAMPAIGN_ACTUAL_COST}" value="{$CAMP_ACTUAL_COST}"></span sugar='slot'></td>
55 <td scope="col"><span sugar='slot16'>{$MOD.LBL_CAMPAIGN_EXPECTED_REVENUE}</span sugar='slot'></td>
56 <td ><span sugar='slot16b'><input type="text" size="10" maxlength="15" id="expected_revenue" name="wiz_step2_expected_revenue" title="{$MOD.LBL_CAMPAIGN_EXPECTED_REVENUE}" value="{$CAMP_EXPECTED_REVENUE}"></span sugar='slot'></td>
57 <td scope="col"><span sugar='slot17'>{$MOD.LBL_CAMPAIGN_EXPECTED_COST}</span sugar='slot'></td>
58 <td ><span sugar='slot17b'><input type="text" size="10" maxlength="15" id="expected_cost" name="wiz_step2_expected_cost" title="{$MOD.LBL_CAMPAIGN_EXPECTED_COST}" value="{$CAMP_EXPECTED_COST}"></span sugar='slot'></td>
61 <td scope="col"><span sugar='slot18'>{$MOD.LBL_CURRENCY}</span sugar='slot'></td>
62 <td><span sugar='slot18b'><select title='{$MOD.LBL_CURRENCY}' name='wiz_step2_currency_id' id='currency_id' onchange='ConvertItems(this.options[selectedIndex].value);'>{$CURRENCY}</select></span sugar='slot'></td>
63 <td scope="col"><span sugar='slot17'>{$MOD.LBL_CAMPAIGN_IMPRESSIONS}</span sugar='slot'></td>
64 <td ><span sugar='slot17b'><input type="text" size="10" maxlength="15" id="impressions" name="wiz_step2_impressions" title="{$MOD.LBL_CAMPAIGN_IMPRESSIONS}" value="{$CAMP_IMPRESSIONS}"></span sugar='slot'></td></tr>
66 <td scope="col"><span sugar='slot18'> </span sugar='slot'></td>
67 <td><span sugar='slot18b'> </td>
68 <td scope="col"><span sugar='slot19'> </span sugar='slot'></td>
69 <td><span sugar='slot19b'> </span sugar='slot'></td>
72 <td valign="top" scope="row"><span sugar='slot20'>{$MOD.LBL_CAMPAIGN_OBJECTIVE}</span sugar='slot'></td>
73 <td colspan="4"><span sugar='slot20b'><textarea id="objective" name="wiz_step2_objective" title='{$MOD.LBL_CAMPAIGN_OBJECTIVE}' cols="110" rows="5">{$OBJECTIVE}</textarea></span sugar='slot'></td>
85 var num_grp_sep ='{$NUM_GRP_SEP}';
86 var dec_sep = '{$DEC_SEP}';
89 * this is the custom validation script that will validate the fields on step2 of wizard
92 function validate_step2(){
93 //add fields to validation and call generic validation script
94 var requiredTxt = SUGAR.language.get('app_strings', 'ERR_MISSING_REQUIRED_FIELDS');
95 if(validate['wizform']!='undefined'){delete validate['wizform']};
96 addToValidate('wizform', 'budget', 'float', false, document.getElementById('budget').title);
97 addToValidate('wizform', 'actual_cost', 'float', false, document.getElementById('actual_cost').title);
98 addToValidate('wizform', 'expected_revenue', 'float', false, document.getElementById('expected_revenue').title);
99 addToValidate('wizform', 'expected_cost', 'float', false, document.getElementById('expected_cost').title);
100 addToValidate('wizform', 'impressions', 'float', false, document.getElementById('impressions').title);
101 var check_date = new Date();
103 return check_form('wizform');
106 function ConvertItems(id) {
107 var items = new Array();
109 //get the items that are to be converted
110 expected_revenue = document.getElementById('expected_revenue');
111 budget = document.getElementById('budget');
112 actual_cost = document.getElementById('actual_cost');
113 expected_cost = document.getElementById('expected_cost');
115 //unformat the values of the items to be converted
116 expected_revenue.value = unformatNumber(expected_revenue.value, num_grp_sep, dec_sep);
117 expected_cost.value = unformatNumber(expected_cost.value, num_grp_sep, dec_sep);
118 budget.value = unformatNumber(budget.value, num_grp_sep, dec_sep);
119 actual_cost.value = unformatNumber(actual_cost.value, num_grp_sep, dec_sep);
121 //add the items to an array
122 items[items.length] = expected_revenue;
123 items[items.length] = budget;
124 items[items.length] = expected_cost;
125 items[items.length] = actual_cost;
127 //call function that will convert currency
128 ConvertRate(id, items);
130 //Add formatting back to items
131 expected_revenue.value = formatNumber(expected_revenue.value, num_grp_sep, dec_sep);
132 expected_cost.value = formatNumber(expected_cost.value, num_grp_sep, dec_sep);
133 budget.value = formatNumber(budget.value, num_grp_sep, dec_sep);
134 actual_cost.value = formatNumber(actual_cost.value, num_grp_sep, dec_sep);