]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/ProjectTask/vardefs.php
Release 6.2.0
[Github/sugarcrm.git] / modules / ProjectTask / 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-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
39
40 $dictionary['ProjectTask'] = array('audited'=>true,
41         'table' => 'project_task',
42         'unified_search' => true,
43         'unified_search_default_enabled' => false,
44         'fields' => array(
45                 'id' => array(
46                         'name' => 'id',
47                         'vname' => 'LBL_ID',
48                         'required' => true,
49                         'type' => 'id',
50                         'reportable'=>true,
51                 ),
52                 'date_entered' => array(
53                         'name' => 'date_entered',
54                         'vname' => 'LBL_DATE_ENTERED',
55                         'type' => 'datetime',
56                     'enable_range_search' => true,
57                     'options' => 'date_range_search_dom',
58                 ),
59                 'date_modified' => array(
60                         'name' => 'date_modified',
61                         'vname' => 'LBL_DATE_MODIFIED',
62                         'type' => 'datetime',
63                     'enable_range_search' => true,
64                     'options' => 'date_range_search_dom',
65                 ),
66         'project_id' => array(
67             'name' => 'project_id',
68             'vname' => 'LBL_PROJECT_ID',
69             'required' => false,
70             'type' => 'id',
71             'reportable' => false,
72             'importable' => 'required',
73             'required' => true,
74         ),
75         'project_task_id' => array(
76             'name' => 'project_task_id',
77             'vname' => 'LBL_PROJECT_TASK_ID',
78             'required' => false,
79             'type' => 'int',
80             'reportable' => false,
81
82         ),
83         'name' => array(
84             'name' => 'name',
85             'vname' => 'LBL_NAME',
86             'required' => true,
87             'dbType' => 'varchar',
88             'type' => 'name',
89             'len' => 50,
90             'unified_search' => true,
91             'importable' => 'required',
92             'required' => true,
93         ),
94                 'status' => array(
95                         'name' => 'status',
96                         'vname' => 'LBL_STATUS',
97                         'type' => 'enum',
98                         'required' => false,
99                         'options' => 'project_task_status_options',
100                         'audited'=>true,
101                 ),
102         'description' => array(
103             'name' => 'description',
104             'vname' => 'LBL_DESCRIPTION',
105             'required' => false,
106             'type' => 'text',
107         ),
108         'predecessors' => array(
109             'name' => 'predecessors',
110             'vname' => 'LBL_PREDECESSORS',
111             'required' => false,
112             'type' => 'text',
113         ),
114         'date_start' => array(
115             'name' => 'date_start',
116             'vname' => 'LBL_DATE_START',
117             'type' => 'date',
118             'validation'=>array('type' => 'isbefore', 'compareto'=>'date_finish', 'blank' => true),
119             'audited'=>true,
120             'enable_range_search' => true,
121         ),
122         'time_start' => array(
123             'name' => 'time_start',
124             'vname' => 'LBL_TIME_START',
125             'type' => 'int',
126             'reportable'=>false,
127             //'validation'=>array('type' => 'isbefore', 'compareto'=>'date_due', 'blank' => true),
128             //'audited'=>true,
129         ),
130         'time_finish' => array(
131             'name' => 'time_finish',
132             'vname' => 'LBL_TIME_FINISH',
133             'type' => 'int',
134             'reportable'=>false,
135            // 'validation'=>array('type' => 'isbefore', 'compareto'=>'date_due', 'blank' => true),
136            // 'audited'=>true,
137         ),
138         'date_finish' => array(
139             'name' => 'date_finish',
140             'vname' => 'LBL_DATE_FINISH',
141             'type' => 'date',
142             'validation'=>array('type' => 'isafter', 'compareto'=>'date_start', 'blank' => true),
143             'audited'=>true,
144             'enable_range_search' => true,
145         ),
146         'duration' => array(
147             'name' => 'duration',
148             'vname' => 'LBL_DURATION',
149             'required' => true,
150             'type' => 'int',
151         ),
152         'duration_unit' => array(
153             'name' => 'duration_unit',
154             'vname' => 'LBL_DURATION_UNIT',
155             'options' => 'project_duration_units_dom',        
156             'type' => 'text',
157         ),
158         'actual_duration' => array(
159             'name' => 'actual_duration',
160             'vname' => 'LBL_ACTUAL_DURATION',
161             'required' => false,
162             'type' => 'int',
163         ),
164         'percent_complete' => array(
165             'name' => 'percent_complete',
166             'vname' => 'LBL_PERCENT_COMPLETE',
167             'type' => 'int',
168             'required' => false,
169             'audited'=>true,
170         ),
171         'parent_task_id' => array(
172             'name' => 'parent_task_id',
173             'vname' => 'LBL_PARENT_TASK_ID',
174             'required' => false,
175             'type' => 'int',
176             'reportable'=>true,
177         ),
178
179                 'assigned_user_id' => array(
180                         'name' => 'assigned_user_id',
181                         'rname' => 'user_name',
182                         'id_name' => 'assigned_user_id',
183                         'type' => 'assigned_user_name',
184                         'vname' => 'LBL_ASSIGNED_USER_ID',
185                         'required' => false,
186                         'dbType' => 'id',
187                         'table' => 'users',
188                         'isnull' => false,
189                         'reportable'=>true,
190                         'audited'=>true,
191                 ),
192                 'modified_user_id' => array(
193                         'name' => 'modified_user_id',
194                         'rname' => 'user_name',
195                         'id_name' => 'modified_user_id',
196                         'vname' => 'LBL_MODIFIED_USER_ID',
197                         'type' => 'assigned_user_name',
198                         'table' => 'users',
199                         'isnull' => 'false',
200                         'dbType' => 'id',
201                         'reportable'=>true,
202                 ),
203                 'modified_by_name' => 
204           array (
205             'name' => 'modified_by_name',
206             'vname' => 'LBL_MODIFIED_NAME',
207             'type' => 'relate',
208             'reportable'=>false,
209             'source'=>'non-db',
210             'rname'=>'user_name',
211             'table' => 'users',
212             'id_name' => 'modified_user_id',
213             'module'=>'Users',
214             'link'=>'modified_user_link',
215             'duplicate_merge'=>'disabled' 
216           ),  
217         'priority' => array(
218             'name' => 'priority',
219             'vname' => 'LBL_PRIORITY',
220             'type' => 'enum',
221             'options' => 'project_task_priority_options',
222         ),
223                 'created_by' => array(
224                         'name' => 'created_by',
225                         'rname' => 'user_name',
226                         'id_name' => 'modified_user_id',
227                         'vname' => 'LBL_CREATED_BY',
228                         'type' => 'assigned_user_name',
229                         'table' => 'users',
230                         'isnull' => 'false',
231                         'dbType' => 'id',
232                         'reportable'=>true,
233                 ),
234                 'created_by_name' => 
235           array (
236             'name' => 'created_by_name',
237                 'vname' => 'LBL_CREATED',
238                 'type' => 'relate',
239                 'reportable'=>false,
240             'link' => 'created_by_link',
241             'rname' => 'user_name',
242                 'source'=>'non-db',
243                 'table' => 'users',
244                 'id_name' => 'created_by',
245                 'module'=>'Users',
246                 'duplicate_merge'=>'disabled',
247         'importable' => 'false',
248         ),
249                 'milestone_flag' => array(
250                         'name' => 'milestone_flag',
251                         'vname' => 'LBL_MILESTONE_FLAG',
252                         'type' =>'bool',
253                         'required' => false,
254                 ),
255                 'order_number' => array(
256                         'name' => 'order_number',
257                         'vname' => 'LBL_ORDER_NUMBER',
258                         'required' => false,
259                         'type' => 'int',
260                         'default' => '1',
261                 ),
262                 'task_number' => array(
263                         'name' => 'task_number',
264                         'vname' => 'LBL_TASK_NUMBER',
265                         'required' => false,
266                         'type' => 'int',
267                 ),
268                 'estimated_effort' => array(
269                         'name' => 'estimated_effort',
270                         'vname' => 'LBL_ESTIMATED_EFFORT',
271                         'required' => false,
272                         'type' => 'int',
273                 ),
274                 'actual_effort' => array(
275                         'name' => 'actual_effort',
276                         'vname' => 'LBL_ACTUAL_EFFORT',
277                         'required' => false,
278                         'type' => 'int',
279                 ),
280                 'deleted' => array(
281                         'name' => 'deleted',
282                         'vname' => 'LBL_DELETED',
283                         'type' => 'bool',
284                         'required' => false,
285                         'default' => '0',
286                         'reportable'=>false,
287                 ),
288                 'utilization' => array(
289                         'name' => 'utilization',
290                         'vname' => 'LBL_UTILIZATION',
291                         'required' => false,
292                         'type' => 'int',
293                         'validation' => array('type' => 'range', 'min' => 0, 'max' => 100),
294                         //'function' => 'getUtilizationDropdown',
295                 'function' => array('name'=>'getUtilizationDropdown', 'returns'=>'html', 'include'=>'modules/ProjectTask/ProjectTask.php'),
296                         'default' => 100,
297                 ),
298
299                 'project_name'=>    array(
300                         'name'=>'project_name',
301                         'rname'=>'name',
302                         'id_name'=>'project_id',
303                         'vname'=>'LBL_PARENT_NAME',
304                         'type'=>'relate',
305             'join_name'=>'project',
306                         'table'=>'project',
307                         'isnull'=>'true',
308                         'module'=>'Project',
309             'link'=>'project_name_link',
310                         'massupdate'=>false,
311                         'source'=>'non-db'),
312
313                 'notes' =>
314                 array (
315                         'name' => 'notes',
316                 'type' => 'link',
317                 'relationship' => 'project_tasks_notes',
318                 'source'=>'non-db',
319                                 'vname'=>'LBL_NOTES',
320                 ),
321                 'tasks' =>
322                         array (
323                         'name' => 'tasks',
324                 'type' => 'link',
325                 'relationship' => 'project_tasks_tasks',
326                 'source'=>'non-db',
327                                 'vname'=>'LBL_TASKS',
328                 ),
329                 'meetings' =>
330                         array (
331                         'name' => 'meetings',
332                 'type' => 'link',
333                 'relationship' => 'project_tasks_meetings',
334                 'source'=>'non-db',
335                                 'vname'=>'LBL_MEETINGS',
336                 ),
337                 'calls' =>
338                         array (
339                         'name' => 'calls',
340                 'type' => 'link',
341                 'relationship' => 'project_tasks_calls',
342                 'source'=>'non-db',
343                                 'vname'=>'LBL_CALLS',
344                 ),
345
346                 'emails' =>
347                         array (
348                         'name' => 'emails',
349                 'type' => 'link',
350                 'relationship' => 'emails_project_task_rel',/* reldef in emails */
351                 'source'=>'non-db',
352                                 'vname'=>'LBL_EMAILS',
353                 ),
354         'projects' =>
355             array (
356             'name' => 'projects',
357             'type' => 'link',
358             'relationship' => 'projects_project_tasks',
359             'source'=>'non-db',
360                 'vname'=>'LBL_LIST_PARENT_NAME',
361         ),
362   'created_by_link' =>
363   array (
364         'name' => 'created_by_link',
365     'type' => 'link',
366     'relationship' => 'project_tasks_created_by',
367     'vname' => 'LBL_CREATED_BY_USER',
368     'link_type' => 'one',
369     'module'=>'Users',
370     'bean_name'=>'User',
371     'source'=>'non-db',
372   ),
373   'modified_user_link' =>
374   array (
375         'name' => 'modified_user_link',
376     'type' => 'link',
377     'relationship' => 'project_tasks_modified_user',
378     'vname' => 'LBL_MODIFIED_BY_USER',
379     'link_type' => 'one',
380     'module'=>'Users',
381     'bean_name'=>'User',
382     'source'=>'non-db',
383   ),
384   'project_name_link' =>
385   array (
386     'name' => 'project_name_link',
387     'type' => 'link',
388     'relationship' => 'projects_project_tasks',
389     'vname' => 'LBL_PROJECT_NAME',
390     'link_type' => 'one',
391     'module'=>'Projects',
392     'bean_name'=>'Project',
393     'source'=>'non-db',
394   ),
395   'assigned_user_link' =>
396   array (
397         'name' => 'assigned_user_link',
398     'type' => 'link',
399     'relationship' => 'project_tasks_assigned_user',
400     'vname' => 'LBL_ASSIGNED_TO_USER',
401     'link_type' => 'one',
402     'module'=>'Users',
403     'bean_name'=>'User',
404     'source'=>'non-db',
405   ),
406 'assigned_user_name' =>
407 array (
408         'name' => 'assigned_user_name',
409         'rname' => 'user_name',
410         'id_name' => 'assigned_user_id',
411         'vname' => 'LBL_ASSIGNED_USER_NAME',
412         'type' => 'relate',
413         'table' => 'users',
414         'module' => 'Users',
415         'dbType' => 'varchar',
416         'link'=>'users',
417         'len' => '255',
418         'source'=>'non-db',
419         ),
420
421         ),
422         'indices' => array(
423                 array(
424                         'name' =>'proj_tasks_primary_key_idx',
425                         'type' =>'primary',
426                         'fields'=>array('id')
427                 ),
428         ),
429
430  'relationships' => array (
431         'project_tasks_notes' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
432                                                           'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
433                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
434                                                           'relationship_role_column_value'=>'ProjectTask')
435         ,'project_tasks_tasks' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
436                                                           'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'parent_id',
437                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
438                                                           'relationship_role_column_value'=>'ProjectTask')
439     ,'project_tasks_meetings' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
440                                                           'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'parent_id',
441                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
442                                                           'relationship_role_column_value'=>'ProjectTask')
443         ,'project_tasks_calls' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
444                                                           'rhs_module'=> 'Calls', 'rhs_table'=> 'calls', 'rhs_key' => 'parent_id',
445                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
446                                                           'relationship_role_column_value'=>'ProjectTask')
447         ,'project_tasks_emails' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
448                                                           'rhs_module'=> 'Emails', 'rhs_table'=> 'emails', 'rhs_key' => 'parent_id',
449                                                           'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
450                                                           'relationship_role_column_value'=>'ProjectTask')
451
452   ,'project_tasks_assigned_user' =>
453    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
454    'rhs_module'=> 'ProjectTask', 'rhs_table'=> 'project_task', 'rhs_key' => 'assigned_user_id',
455    'relationship_type'=>'one-to-many')
456
457    ,'project_tasks_modified_user' =>
458    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
459    'rhs_module'=> 'ProjectTask', 'rhs_table'=> 'project_task', 'rhs_key' => 'modified_user_id',
460    'relationship_type'=>'one-to-many')
461
462    ,'project_tasks_created_by' =>
463    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
464    'rhs_module'=> 'ProjectTask', 'rhs_table'=> 'project_task', 'rhs_key' => 'created_by',
465    'relationship_type'=>'one-to-many')
466 ),
467 );
468
469 VardefManager::createVardef('ProjectTask','ProjectTask', array(
470 ));
471 ?>