]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Tasks/vardefs.php
Release 6.1.5
[Github/sugarcrm.git] / modules / Tasks / vardefs.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38 $dictionary['Task'] = array('table' => 'tasks',
39         'unified_search' => true,
40                                'fields' => array (
41   'name' =>
42   array (
43     'name' => 'name',
44     'vname' => 'LBL_SUBJECT',
45     'dbType' => 'varchar',
46     'type' => 'name',
47     'len' => '50',
48         'unified_search' => true,
49     'importable' => 'required',
50     'required' => 'true',
51   ),
52   'status' =>
53   array (
54     'name' => 'status',
55     'vname' => 'LBL_STATUS',
56     'type' => 'enum',
57     'options' => 'task_status_dom',
58     'len' => 100,
59     'required' => 'true',
60   ),
61   'date_due_flag' =>
62   array (
63     'name' => 'date_due_flag',
64     'vname' => 'LBL_DATE_DUE_FLAG',
65     'type' =>'bool',
66     'default'=>0,
67     'group'=>'date_due',
68         'studio' => false,
69   ),
70   'date_due' =>
71   array (
72     'name' => 'date_due',
73     'vname' => 'LBL_DUE_DATE',
74     'type' => 'datetimecombo',
75     'dbType' => 'datetime',
76     'group'=>'date_due',
77     'studio' => array('required' => true, 'no_duplicate' => true),
78     ),
79   'time_due' =>
80   array (
81     'name' => 'time_due',
82     'vname' => 'LBL_DUE_TIME',
83     'type' => 'datetime',
84     //'db_concat_fields'=> array(0=>'date_due'),
85     'source' => 'non-db',
86     'importable' => 'false',
87     'massupdate' => false,
88     ),
89   'date_start_flag' =>
90   array (
91     'name' => 'date_start_flag',
92     'vname' => 'LBL_DATE_START_FLAG',
93     'type' =>'bool',
94     'group'=>'date_start',
95     'default'=>0,
96         'studio' => false,
97   ),
98   'date_start' =>
99   array (
100     'name' => 'date_start',
101     'vname' => 'LBL_START_DATE',
102     'type' => 'datetimecombo',
103     'dbType' => 'datetime',
104     'group'=>'date_start',
105     'validation' => array('type' => 'isbefore', 'compareto' => 'date_due', 'blank' => false),
106     'studio' => array('required' => true, 'no_duplicate' => true),
107     ),
108  'parent_type'=>
109   array(
110         'name'=>'parent_type',
111         'vname'=>'LBL_PARENT_NAME',
112     'type' => 'parent_type',
113     'dbType'=>'varchar',
114          'group'=>'parent_name',
115         'required'=>false,
116         'len'=>'255',
117     'comment' => 'The Sugar object to which the call is related'
118   ),
119
120   'parent_name'=>
121   array(
122         'name'=> 'parent_name',
123         'parent_type'=>'record_type_display' ,
124         'type_name'=>'parent_type',
125         'id_name'=>'parent_id',
126     'vname'=>'LBL_LIST_RELATED_TO',
127         'type'=>'parent',
128         'group'=>'parent_name',
129         'source'=>'non-db',
130         'options'=> 'parent_type_display',
131   ),
132
133   'parent_id' =>
134   array (
135     'name' => 'parent_id',
136     'type' => 'id',
137     'group'=>'parent_name',
138     'reportable'=>false,
139     'vname'=>'LBL_PARENT_ID',
140   ),
141   'contact_id' =>
142   array (
143     'name' => 'contact_id',
144     'type' => 'id',
145     'group'=>'contact_name',
146     'reportable'=>false,
147     'vname'=>'LBL_CONTACT_ID',
148   ),
149
150   'contact_name' =>
151   array (
152     'name' => 'contact_name',
153     'rname'=>'last_name',
154     'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
155     'source' => 'non-db',
156     'len' => '510',
157     'group'=>'contact_name',
158     'vname' => 'LBL_CONTACT_NAME',
159     'reportable'=>false,
160     'id_name' => 'contact_id',
161     'join_name' => 'contacts',
162     'type' => 'relate',
163     'module' => 'Contacts',
164     'link'=>'contacts',
165     'table'=>'contacts',
166   ),
167
168   'contact_phone'=>
169     array(
170         'name'=>'contact_phone',
171         'type'=>'phone',
172         'source'=>'non-db',
173         'vname'=>'LBL_CONTACT_PHONE',
174     ),
175
176  'contact_email'=>
177     array(
178         'name'=>'contact_email',
179         'type'=>'varchar',
180                 'vname' => 'LBL_EMAIL_ADDRESS',
181                 'source' => 'non-db',
182     ),
183
184   'priority' =>
185   array (
186     'name' => 'priority',
187     'vname' => 'LBL_PRIORITY',
188     'type' => 'enum',
189     'options' => 'task_priority_dom',
190     'len' => 100,
191     'required' => 'true',
192   ),
193         'contacts'=>    array(
194                 'name' => 'contacts',
195                 'type' => 'link',
196                 'relationship' => 'contact_tasks',
197                 'source'=>'non-db',
198                 'side'=>'right',
199                 'vname'=>'LBL_CONTACT',
200         ),
201   'accounts' =>
202   array (
203         'name' => 'accounts',
204     'type' => 'link',
205     'relationship' => 'account_tasks',
206     'source'=>'non-db',
207                 'vname'=>'LBL_ACCOUNT',
208   ),
209   'opportunities' =>
210   array (
211     'name' => 'opportunities',
212     'type' => 'link',
213     'relationship' => 'opportunity_tasks',
214     'source'=>'non-db',
215     'vname'=>'LBL_OPPORTUNITY',
216   ),
217   'cases' =>
218   array (
219     'name' => 'cases',
220     'type' => 'link',
221     'relationship' => 'case_tasks',
222     'source'=>'non-db',
223     'vname'=>'LBL_CASE',
224   ),
225   'bugs' =>
226   array (
227     'name' => 'bugs',
228     'type' => 'link',
229     'relationship' => 'bug_tasks',
230     'source'=>'non-db',
231     'vname'=>'LBL_BUGS',
232   ),
233   'leads' =>
234   array (
235     'name' => 'leads',
236     'type' => 'link',
237     'relationship' => 'lead_tasks',
238     'source'=>'non-db',
239     'vname'=>'LBL_LEADS',
240   ),
241   'projects' =>
242     array (
243     'name' => 'projects',
244     'type' => 'link',
245     'relationship' => 'projects_tasks',
246     'source'=>'non-db',
247     'vname'=>'LBL_PROJECTS',
248   ),
249   'project_tasks' =>
250     array (
251     'name' => 'project_tasks',
252     'type' => 'link',
253     'relationship' => 'project_tasks_tasks',
254     'source'=>'non-db',
255     'vname'=>'LBL_PROJECT_TASKS',
256   ),
257         'contact_parent'=>
258                 array (
259                         'name' => 'contact_parent',
260                         'type' => 'link',
261                         'relationship' => 'contact_tasks_parent',
262                         'source' => 'non-db',
263         ),
264 )
265 ,
266  'relationships' => array (
267
268   'tasks_assigned_user' =>
269    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
270    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'assigned_user_id',
271    'relationship_type'=>'one-to-many')
272
273    ,'tasks_modified_user' =>
274    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
275    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'modified_user_id',
276    'relationship_type'=>'one-to-many')
277
278    ,'tasks_created_by' =>
279    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
280    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'created_by',
281    'relationship_type'=>'one-to-many')
282 )
283                                                       , 'indices' => array (
284        array('name' =>'idx_tsk_name', 'type'=>'index', 'fields'=>array('name')),
285        array('name' =>'idx_task_con_del', 'type'=>'index', 'fields'=>array('contact_id','deleted')),
286        array('name' =>'idx_task_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
287        array('name' =>'idx_task_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
288              )
289
290         //This enables optimistic locking for Saves From EditView
291         ,'optimistic_locking'=>true,
292                             );
293 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',
294 ));
295 ?>