]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Campaigns/metadata/editviewdefs.php
Release 6.5.0
[Github/sugarcrm.git] / modules / Campaigns / metadata / editviewdefs.php
1 <?php
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 $viewdefs['Campaigns']['EditView'] = array(
38     'templateMeta' => array('maxColumns' => '2',
39                             'widths' => array(
40                                             array('label' => '10', 'field' => '30'),
41                                             array('label' => '10', 'field' => '30')
42                                             ),
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\';
53          {rdelim}
54  {rdelim}
55 type_change();
56
57 function ConvertItems(id)  {ldelim}
58         var items = new Array();
59
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\');
65
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);
71
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;
77
78         //call function that will convert currency
79         ConvertRate(id, items);
80
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);
86  {rdelim}
87 </script>',
88 ),
89  'panels' =>array (
90   'lbl_campaign_information' =>
91   array (
92
93     array (
94       array('name'=>'name'),
95       array('name' => 'status'),
96     ),
97
98     array (
99        array('name'=>'start_date', 'displayParams'=>array('required'=>false, 'showFormats'=>true)),
100        array('name'=>'campaign_type',
101             'displayParams'=>array('javascript'=>'onchange="type_change();"'),
102        ),
103     ),
104
105     array (
106       array('name'=>'end_date', 'displayParams'=>array('showFormats'=>true)),
107       array (
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>',
111           ),
112     ),
113
114    array (
115       'currency_id',
116       'impressions',
117     ),
118
119     array (
120         'budget',
121         'expected_cost',
122     ),
123
124     array (
125         'actual_cost',
126         'expected_revenue',
127     ),
128
129     array (
130       array('name'=>'objective','displayParams'=>array('rows'=>8,'cols'=>80)),
131     ),
132
133     array (
134       array('name'=>'content','displayParams'=>array('rows'=>8, 'cols'=>80)),
135     ),
136
137   ),
138   'LBL_PANEL_ASSIGNMENT' => array(
139         array (
140           array (
141             'name' => 'assigned_user_name',
142             'label' => 'LBL_ASSIGNED_TO',
143           ),
144         ),  
145   ),
146 )
147
148
149 );
150 ?>