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