]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Tasks/vardefs.php
Release 6.5.0
[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     'options'=> 'parent_type_display',
123         'required'=>false,
124         'len'=>'255',
125     'comment' => 'The Sugar object to which the call is related',
126     'options' => 'parent_type_display',
127 ),
128
129   'parent_name'=>
130   array(
131         'name'=> 'parent_name',
132         'parent_type'=>'record_type_display' ,
133         'type_name'=>'parent_type',
134         'id_name'=>'parent_id',
135     'vname'=>'LBL_LIST_RELATED_TO',
136         'type'=>'parent',
137         'group'=>'parent_name',
138         'source'=>'non-db',
139         'options'=> 'parent_type_display',
140   ),
141
142   'parent_id' =>
143   array (
144     'name' => 'parent_id',
145     'type' => 'id',
146     'group'=>'parent_name',
147     'reportable'=>false,
148     'vname'=>'LBL_PARENT_ID',
149   ),
150   'contact_id' =>
151   array (
152     'name' => 'contact_id',
153     'type' => 'id',
154     'group'=>'contact_name',
155     'reportable'=>false,
156     'vname'=>'LBL_CONTACT_ID',
157   ),
158
159   'contact_name' =>
160   array (
161     'name' => 'contact_name',
162     'rname'=>'last_name',
163     'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
164     'source' => 'non-db',
165     'len' => '510',
166     'group'=>'contact_name',
167     'vname' => 'LBL_CONTACT_NAME',
168     'reportable'=>false,
169     'id_name' => 'contact_id',
170     'join_name' => 'contacts',
171     'type' => 'relate',
172     'module' => 'Contacts',
173     'link'=>'contacts',
174     'table'=>'contacts',
175   ),
176
177   'contact_phone'=>
178     array(
179         'name'=>'contact_phone',
180         'type'=>'phone',
181         'source'=>'non-db',
182         'vname'=>'LBL_CONTACT_PHONE',
183         'studio'=>array('listview' => true)
184     ),
185
186  'contact_email'=>
187     array(
188         'name'=>'contact_email',
189         'type'=>'varchar',
190                 'vname' => 'LBL_EMAIL_ADDRESS',
191                 'source' => 'non-db',
192         'studio' => false
193     ),
194
195   'priority' =>
196   array (
197     'name' => 'priority',
198     'vname' => 'LBL_PRIORITY',
199     'type' => 'enum',
200     'options' => 'task_priority_dom',
201     'len' => 100,
202     'required' => 'true',
203   ),
204         'contacts'=>    array(
205                 'name' => 'contacts',
206                 'type' => 'link',
207                 'relationship' => 'contact_tasks',
208                 'source'=>'non-db',
209                 'side'=>'right',
210                 'vname'=>'LBL_CONTACT',
211         ),
212   'accounts' =>
213   array (
214         'name' => 'accounts',
215     'type' => 'link',
216     'relationship' => 'account_tasks',
217     'source'=>'non-db',
218                 'vname'=>'LBL_ACCOUNT',
219   ),
220   'opportunities' =>
221   array (
222     'name' => 'opportunities',
223     'type' => 'link',
224     'relationship' => 'opportunity_tasks',
225     'source'=>'non-db',
226     'vname'=>'LBL_OPPORTUNITY',
227   ),
228   'cases' =>
229   array (
230     'name' => 'cases',
231     'type' => 'link',
232     'relationship' => 'case_tasks',
233     'source'=>'non-db',
234     'vname'=>'LBL_CASE',
235   ),
236   'bugs' =>
237   array (
238     'name' => 'bugs',
239     'type' => 'link',
240     'relationship' => 'bug_tasks',
241     'source'=>'non-db',
242     'vname'=>'LBL_BUGS',
243   ),
244   'leads' =>
245   array (
246     'name' => 'leads',
247     'type' => 'link',
248     'relationship' => 'lead_tasks',
249     'source'=>'non-db',
250     'vname'=>'LBL_LEADS',
251   ),
252   'projects' =>
253     array (
254     'name' => 'projects',
255     'type' => 'link',
256     'relationship' => 'projects_tasks',
257     'source'=>'non-db',
258     'vname'=>'LBL_PROJECTS',
259   ),
260   'project_tasks' =>
261     array (
262     'name' => 'project_tasks',
263     'type' => 'link',
264     'relationship' => 'project_tasks_tasks',
265     'source'=>'non-db',
266     'vname'=>'LBL_PROJECT_TASKS',
267   ),
268     'notes' =>
269   array (
270         'name' => 'notes',
271     'type' => 'link',
272     'relationship' => 'tasks_notes',
273     'module'=>'Notes',
274     'bean_name'=>'Note',
275     'source'=>'non-db',
276                 'vname'=>'LBL_NOTES',
277   ),
278   
279         'contact_parent'=>
280                 array (
281                         'name' => 'contact_parent',
282                         'type' => 'link',
283                         'relationship' => 'contact_tasks_parent',
284                         'source' => 'non-db',
285             'reportable' => false
286         ),
287 )
288 ,
289  'relationships' => array (
290                 'tasks_notes' => array(
291                         'lhs_module'            => 'Tasks',
292                         'lhs_table'                     => 'tasks',
293                         'lhs_key'                       => 'id',
294                         'rhs_module'            => 'Notes',
295                         'rhs_table'                     => 'notes',
296                         'rhs_key'                       => 'parent_id',
297                         'relationship_type'     => 'one-to-many',
298                 ),
299
300   'tasks_assigned_user' =>
301    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
302    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'assigned_user_id',
303    'relationship_type'=>'one-to-many')
304
305    ,'tasks_modified_user' =>
306    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
307    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'modified_user_id',
308    'relationship_type'=>'one-to-many')
309
310    ,'tasks_created_by' =>
311    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
312    'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'created_by',
313    'relationship_type'=>'one-to-many')
314 )
315                                                       , 'indices' => array (
316        array('name' =>'idx_tsk_name', 'type'=>'index', 'fields'=>array('name')),
317        array('name' =>'idx_task_con_del', 'type'=>'index', 'fields'=>array('contact_id','deleted')),
318        array('name' =>'idx_task_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
319        array('name' =>'idx_task_assigned', 'type'=>'index', 'fields'=>array('assigned_user_id')),
320         array('name' =>'idx_task_status', 'type'=>'index', 'fields'=>array('status')),
321              )
322
323         //This enables optimistic locking for Saves From EditView
324         ,'optimistic_locking'=>true,
325                             );
326 VardefManager::createVardef('Tasks','Task', array('default', 'assignable',
327 ));
328 ?>