2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 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 $viewdefs['Campaigns']['EditView'] = array(
38 'templateMeta' => array('maxColumns' => '2',
40 array('label' => '10', 'field' => '30'),
41 array('label' => '10', 'field' => '30')
43 'javascript' => '<script type="text/javascript" src="' . getJSPath('include/javascript/popup_parent_helper.js') . '"></script>
44 <script type="text/javascript">
45 function type_change() {ldelim}
46 type = document.getElementsByName(\'campaign_type\');
47 if(type[0].value==\'NewsLetter\') {ldelim}
48 document.getElementById(\'freq_label\').style.display = \'\';
49 document.getElementById(\'freq_field\').style.display = \'\';
50 {rdelim} else {ldelim}
51 document.getElementById(\'freq_label\').style.display = \'none\';
52 document.getElementById(\'freq_field\').style.display = \'none\';
57 function ConvertItems(id) {ldelim}
58 var items = new Array();
60 //get the items that are to be converted
61 expected_revenue = document.getElementById(\'expected_revenue\');
62 budget = document.getElementById(\'budget\');
63 actual_cost = document.getElementById(\'actual_cost\');
64 expected_cost = document.getElementById(\'expected_cost\');
66 //unformat the values of the items to be converted
67 expected_revenue.value = unformatNumber(expected_revenue.value, num_grp_sep, dec_sep);
68 expected_cost.value = unformatNumber(expected_cost.value, num_grp_sep, dec_sep);
69 budget.value = unformatNumber(budget.value, num_grp_sep, dec_sep);
70 actual_cost.value = unformatNumber(actual_cost.value, num_grp_sep, dec_sep);
72 //add the items to an array
73 items[items.length] = expected_revenue;
74 items[items.length] = budget;
75 items[items.length] = expected_cost;
76 items[items.length] = actual_cost;
78 //call function that will convert currency
79 ConvertRate(id, items);
81 //Add formatting back to items
82 expected_revenue.value = formatNumber(expected_revenue.value, num_grp_sep, dec_sep);
83 expected_cost.value = formatNumber(expected_cost.value, num_grp_sep, dec_sep);
84 budget.value = formatNumber(budget.value, num_grp_sep, dec_sep);
85 actual_cost.value = formatNumber(actual_cost.value, num_grp_sep, dec_sep);
90 'lbl_campaign_information' =>
94 array('name'=>'name'),
95 array('name' => 'status'),
99 array('name'=>'start_date', 'displayParams'=>array('required'=>false, 'showFormats'=>true)),
100 array('name'=>'campaign_type',
101 'displayParams'=>array('javascript'=>'onchange="type_change();"'),
106 array('name'=>'end_date', 'displayParams'=>array('showFormats'=>true)),
108 'name' => 'frequency',
109 'customCode' => '<div style=\'none\' id=\'freq_field\'>{html_options name="frequency" options=$fields.frequency.options selected=$fields.frequency.value}</div></TD>',
110 'customLabel' => '<div style=\'none\' id=\'freq_label\'>{$MOD.LBL_CAMPAIGN_FREQUENCY}</div>',
130 array('name'=>'objective','displayParams'=>array('rows'=>8,'cols'=>80)),
134 array('name'=>'content','displayParams'=>array('rows'=>8, 'cols'=>80)),
138 'LBL_PANEL_ASSIGNMENT' => array(
141 'name' => 'assigned_user_name',
142 'label' => 'LBL_ASSIGNED_TO',