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