]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Tasks/vardefs.php
Release 6.5.0beta6
[Github/sugarcrm.git] / modules / Tasks / vardefs.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2012 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         'full_text_search' => true,
41                                'fields' => array (
42   'name' =>
43   array (
44     'name' => 'name',
45     'vname' => 'LBL_SUBJECT',
46     'dbType' => 'varchar',
47     'type' => 'name',
48     'len' => '50',
49         'unified_search' => true,
50         'full_text_search' => array('boost' => 3),
51     'importable' => 'required',
52     'required' => 'true',
53   ),
54   'status' =>
55   array (
56     'name' => 'status',
57     'vname' => 'LBL_STATUS',
58     'type' => 'enum',
59     'options' => 'task_status_dom',
60     'len' => 100,
61     'required' => 'true',
62     'default' => 'Not Started',
63   ),
64   'date_due_flag' =>
65   array (
66     'name' => 'date_due_flag',
67     'vname' => 'LBL_DATE_DUE_FLAG',
68     'type' =>'bool',
69     'default'=>0,
70     'group'=>'date_due',
71         'studio' => false,
72   ),
73   'date_due' =>
74   array (
75     'name' => 'date_due',
76     'vname' => 'LBL_DUE_DATE',
77     'type' => 'datetimecombo',
78     'dbType' => 'datetime',
79     'group'=>'date_due',
80     'studio' => array('required' => true, 'no_duplicate' => true),
81     'enable_range_search' => true,
82     'options' => 'date_range_search_dom',
83     ),
84   'time_due' =>
85   array (
86     'name' => 'time_due',
87     'vname' => 'LBL_DUE_TIME',
88     'type' => 'datetime',
89     //'db_concat_fields'=> array(0=>'date_due'),
90     'source' => 'non-db',
91     'importable' => 'false',
92     'massupdate' => false,
93     ),
94   'date_start_flag' =>
95   array (
96     'name' => 'date_start_flag',
97     'vname' => 'LBL_DATE_START_FLAG',
98     'type' =>'bool',
99     'group'=>'date_start',
100     'default'=>0,
101         'studio' => false,
102   ),
103   'date_start' =>
104   array (
105     'name' => 'date_start',
106     'vname' => 'LBL_START_DATE',
107     'type' => 'datetimecombo',
108     'dbType' => 'datetime',
109     'group'=>'date_start',
110     'validation' => array('type' => 'isbefore', 'compareto' => 'date_due', 'blank' => false),
111     'studio' => array('required' => true, 'no_duplicate' => true),
112     'enable_range_search' => true,
113     'options' => 'date_range_search_dom',
114     ),
115  'parent_type'=>
116   array(
117         'name'=>'parent_type',
118         'vname'=>'LBL_PARENT_NAME',
119     'type' => 'parent_type',
120     'dbType'=>'varchar',
121          'group'=>'parent_name',
122         'required'=>false,
123         'len'=>'255',
124     'comment' => 'The Sugar object to which the call is related',
125     'options' => 'parent_type_display',
126 ),
127
128   'parent_name'=>
129   array(
130         'name'=> 'parent_name',
131         'parent_type'=>'record_type_display' ,
132         'type_name'=>'parent_type',
133         'id_name'=>'parent_id',
134     'vname'=>'LBL_LIST_RELATED_TO',
135         'type'=>'parent',
136         'group'=>'parent_name',
137         'source'=>'non-db',
138         'options'=> 'parent_type_display',
139   ),
140
141   'parent_id' =>
142   array (
143     'name' => 'parent_id',
144     'type' => 'id',
145     'group'=>'parent_name',
146     'reportable'=>false,
147     'vname'=>'LBL_PARENT_ID',
148   ),
149   'contact_id' =>
150   array (
151     'name' => 'contact_id',
152     'type' => 'id',
153     'group'=>'contact_name',
154     'reportable'=>false,
155     'vname'=>'LBL_CONTACT_ID',
156   ),
157
158   'contact_name' =>
159   array (
160     'name' => 'contact_name',
161     'rname'=>'last_name',
162     'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
163     'source' => 'non-db',
164     'len' => '510',
165     'group'=>'contact_name',
166     'vname' => 'LBL_CONTACT_NAME',
167     'reportable'=>false,
168     'id_name' => 'contact_id',
169     'join_name' => 'contacts',
170     'type' => 'relate',
171     'module' => 'Contacts',
172     'link'=>'contacts',
173     'table'=>'contacts',
174   ),
175
176   'contact_phone'=>
177     array(
178         'name'=>'contact_phone',
179         'type'=>'phone',
180         'source'=>'non-db',
181         'vname'=>'LBL_CONTACT_PHONE',
182         'studio'=>array('listview' => true)
183     ),
184
185  'contact_email'=>
186     array(
187         'name'=>'contact_email',
188         'type'=>'varchar',
189                 'vname' => 'LBL_EMAIL_ADDRESS',
190                 'source' => 'non-db',
191         'studio' => false
192     ),
193
194   'priority' =>
195   array (
196     'name' => 'priority',
197     'vname' => 'LBL_PRIORITY',
198     'type' => 'enum',
199     'options' => 'task_priority_dom',
200     'len' => 100,
201     'required' => 'true',
202   ),
203         'contacts'=>    array(
204                 'name' => 'contacts',
205                 'type' => 'link',
206                 'relationship' => 'contact_tasks',
207                 'source'=>'non-db',
208                 'side'=>'right',
209                 'vname'=>'LBL_CONTACT',
210         ),
211   'accounts' =>
212   array (
213         'name' => 'accounts',
214     'type' => 'link',
215     'relationship' => 'account_tasks',
216     'source'=>'non-db',
217                 'vname'=>'LBL_ACCOUNT',
218   ),
219   'opportunities' =>
220   array (
221     'name' => 'opportunities',
222     'type' => 'link',
223     'relationship' => 'opportunity_tasks',
224     'source'=>'non-db',
225     'vname'=>'LBL_OPPORTUNITY',
226   ),
227   'cases' =>
228   array (
229     'name' => 'cases',
230     'type' => 'link',
231     'relationship' => 'case_tasks',
232     'source'=>'non-db',
233     'vname'=>'LBL_CASE',
234   ),
235   'bugs' =>
236   array (
237     'name' => 'bugs',
238     'type' => 'link',
239     'relationship' => 'bug_tasks',
240     'source'=>'non-db',
241     'vname'=>'LBL_BUGS',
242   ),
243   'leads' =>
244   array (
245     'name' => 'leads',
246     'type' => 'link',
247     'relationship' => 'lead_tasks',
248     'source'=>'non-db',
249     'vname'=>'LBL_LEADS',
250   ),
251   'projects' =>
252     array (
253     'name' => 'projects',
254     'type' => 'link',
255     'relationship' => 'projects_tasks',
256     'source'=>'non-db',
257     'vname'=>'LBL_PROJECTS',
258   ),
259   'project_tasks' =>
260     array (
261     'name' => 'project_tasks',
262     'type' => 'link',
263     'relationship' => 'project_tasks_tasks',
264     'source'=>'non-db',
265     'vname'=>'LBL_PROJECT_TASKS',
266   ),
267     'notes' =>
268   array (
269         'name' => 'notes',
270     'type' => 'link',
271     'relationship' => 'tasks_notes',
272     'module'=>'Notes',
273     'bean_name'=>'Note',
274     'source'=>'non-db',
275                 'vname'=>'LBL_NOTES',
276   ),
277   
278         'contact_parent'=>
279                 array (
280                         'name' => 'contact_parent',
281                         'type' => 'link',
282                         'relationship' => 'contact_tasks_parent',
283                         'source' => 'non-db',
284             'reportable' => false
285         ),
286 )
287 ,
288  'relationships' => array (
289                 'tasks_notes' => array(
290                         'lhs_module'            => 'Tasks',
291                         'lhs_table'                     => 'tasks',
292                         'lhs_key'                       => 'id',
293                         'rhs_module'            => 'Notes',
294                         'rhs_table'                     => 'notes',
295                         'rhs_key'                       => 'parent_id',
296                         'relationship_type'     => 'one-to-many',
297                 ),
298
299   'tasks_assigned_user' =>
300    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
301    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'assigned_user_id',
302    'relationship_type'=>'one-to-many')
303
304    ,'tasks_modified_user' =>
305    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
306    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'modified_user_id',
307    'relationship_type'=>'one-to-many')
308
309    ,'tasks_created_by' =>
310    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
311    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'created_by',
312    'relationship_type'=>'one-to-many')
313 )
314                                                       , 'indices' => array (
315        array('name' =>'idx_tsk_name', 'type'=>'index', 'fields'=>array('name')),
316        array('name' =>'idx_task_con_del', 'type'=>'index', 'fields'=>array('contact_id','deleted')),
317        array('name' =>'idx_task_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
318        array('name' =>'idx_task_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
319         array('name' =>'idx_task_status', 'type'=>'index', 'fields'=>array('status')),
320              )
321
322         //This enables optimistic locking for Saves From EditView
323         ,'optimistic_locking'=>true,
324                             );
325 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',
326 ));
327 ?>