]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/modules/UpgradeWizard/SugarMerge/metadata_files/610/modules/Notes/vardefs.php
Release 6.4.0
[Github/sugarcrm.git] / tests / modules / UpgradeWizard / SugarMerge / metadata_files / 610 / modules / Notes / 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 $dictionary['Note'] = array(
40     'favorites'=>true, 
41     'table' => 'notes', 
42         'unified_search' => true,
43         'comment' => 'Notes and Attachments'
44                                ,'fields' => array (
45   'id' =>
46   array (
47     'name' => 'id',
48     'vname' => 'LBL_ID',
49     'type' => 'id',
50     'required'=>true,
51     'reportable'=>true,
52     'comment' => 'Unique identifier'
53   ),
54    'date_entered' =>
55   array (
56     'name' => 'date_entered',
57     'vname' => 'LBL_DATE_ENTERED',
58     'type' => 'datetime',
59     'comment' => 'Date record created'
60   ),
61   'date_modified' =>
62   array (
63     'name' => 'date_modified',
64     'vname' => 'LBL_DATE_MODIFIED',
65     'type' => 'datetime',
66     'comment' => 'Date record last modified'
67   ),
68    'modified_user_id' =>
69           array (
70             'name' => 'modified_user_id',
71             'rname' => 'user_name',
72             'id_name' => 'modified_user_id',
73             'vname' => 'LBL_MODIFIED',
74             'type' => 'assigned_user_name',
75             'table' => 'users',
76             'isnull' => 'false',
77              'group'=>'modified_by_name',
78             'dbType' => 'id',
79             'reportable'=>true,
80             'comment' => 'User who last modified record',
81           ),
82           'modified_by_name' => 
83           array (
84             'name' => 'modified_by_name',
85     'vname' => 'LBL_MODIFIED_BY',
86             'type' => 'relate',
87             'reportable'=>false,
88             'source'=>'non-db',
89             'rname'=>'user_name',
90             'table' => 'users',
91             'id_name' => 'modified_user_id',
92             'module'=>'Users',
93             'link'=>'modified_user_link',
94             'duplicate_merge'=>'disabled' 
95           ),  
96           'created_by' =>
97           array (
98             'name' => 'created_by',
99             'rname' => 'user_name',
100             'id_name' => 'modified_user_id',
101                 'vname' => 'LBL_CREATED_BY',
102             'type' => 'assigned_user_name',
103             'table' => 'users',
104             'isnull' => 'false',
105             'dbType' => 'id',
106     'comment' => 'User who created record'
107           ),
108                 'created_by_name' => 
109           array (
110             'name' => 'created_by_name',
111                 'vname' => 'LBL_CREATED_BY',
112                 'type' => 'relate',
113                 'reportable'=>false,
114             'link' => 'created_by_link',
115             'rname' => 'user_name',
116                 'source'=>'non-db',
117                 'table' => 'users',
118                 'id_name' => 'created_by',
119                 'module'=>'Users',
120                 'duplicate_merge'=>'disabled',
121         'importable' => 'false',
122         ),
123   'name' =>
124   array (
125     'name' => 'name',
126     'vname' => 'LBL_NOTE_SUBJECT',
127     'dbType' => 'varchar',
128     'type' => 'name',
129     'len' => '255',
130         'unified_search' => true,
131     'comment' => 'Name of the note',
132     'importable' => 'required',
133     'required' => true,
134   ),
135   'filename' =>
136   array (
137     'name' => 'filename',
138     'vname' => 'LBL_FILENAME',
139     'type' => 'varchar',
140     'len' => '255',
141     'reportable'=>true,
142     'comment' => 'File name associated with the note (attachment)',
143     'importable' => false,
144   ),
145   'file_mime_type' =>
146   array (
147     'name' => 'file_mime_type',
148     'vname' => 'LBL_FILE_MIME_TYPE',
149     'type' => 'varchar',
150     'len' => '100',
151     'comment' => 'Attachment MIME type',
152     'importable' => false,
153   ),
154   'file_url'=>
155   array(
156         'name'=>'file_url',
157     'vname' => 'LBL_FILE_URL',
158         'type'=>'function',
159         'function_class'=>'UploadFile',
160         'function_name'=>'get_upload_url',
161         'function_params'=> array('$this'),
162         'source'=>'function',
163         'reportable'=>false,
164         'comment' => 'Path to file (can be URL)',
165     'importable' => false,
166         ),
167   'parent_type'=>
168   array(
169         'name'=>'parent_type',
170         'vname'=>'LBL_PARENT_TYPE',
171         'type' =>'parent_type',
172     'dbType' => 'varchar',
173     'group'=>'parent_name',
174         'len'=> '255',
175         'comment' => 'Sugar module the Note is associated with'
176   ),
177   'parent_id'=>
178   array(
179         'name'=>'parent_id',
180         'vname'=>'LBL_PARENT_ID',
181         'type'=>'id',
182         'required'=>false,
183         'reportable'=>true,
184         'comment' => 'The ID of the Sugar item specified in parent_type'
185   ),
186   'contact_id'=>
187   array(
188         'name'=>'contact_id',
189         'vname'=>'LBL_CONTACT_ID',
190         'type'=>'id',
191         'required'=>false,
192         'reportable'=>false,
193         'comment' => 'Contact ID note is associated with'
194   ),
195   'portal_flag' =>
196   array (
197     'name' => 'portal_flag',
198     'vname' => 'LBL_PORTAL_FLAG',
199     'type' => 'bool',
200         'required' => true,
201         'comment' => 'Portal flag indicator determines if note created via portal'
202   ),
203   'embed_flag' =>
204   array (
205     'name' => 'embed_flag',
206     'vname' => 'LBL_EMBED_FLAG',
207     'type' => 'bool',
208     'default' => 0,
209         'comment' => 'Embed flag indicator determines if note embedded in email'
210   ),
211   'description' =>
212   array (
213     'name' => 'description',
214     'vname' => 'LBL_NOTE_STATUS',
215     'type' => 'text',
216     'comment' => 'Full text of the note'
217   ),
218   'deleted' =>
219   array (
220     'name' => 'deleted',
221     'vname' => 'LBL_DELETED',
222     'type' => 'bool',
223     'required' => false,
224     'default' => '0',
225     'reportable'=>false,
226     'comment' => 'Record deletion indicator'
227   ),
228
229
230
231  'parent_name'=>
232         array(
233                 'name'=> 'parent_name',
234                 'parent_type'=>'record_type_display' ,
235                 'type_name'=>'parent_type',
236                 'id_name'=>'parent_id', 'vname'=>'LBL_RELATED_TO',
237                 'type'=>'parent',
238                 'source'=>'non-db',
239                 'options'=> 'record_type_display_notes',
240                 ),
241
242  'contact_name'=>
243         array(
244                 'name'=>'contact_name',
245                 'rname'=>'last_name',
246                 'id_name'=>'contact_id',
247                 'vname'=>'LBL_CONTACT_NAME',
248         'table'=>'contacts',
249                 'type'=>'relate',
250                 'link'=>'contact',
251                 'join_name'=>'contacts',
252         'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
253                 'isnull'=>'true',
254                 'module'=>'Contacts',
255                 'source'=>'non-db',
256                 ),
257
258   'contact_phone'=>
259     array(
260         'name'=>'contact_phone',
261         'vname' => 'LBL_PHONE',
262         'type'=>'phone',
263         'vname' => 'LBL_PHONE',
264         'source'=>'non-db'
265     ),
266
267  'contact_email'=>
268     array(
269         'name'=>'contact_email',
270         'type'=>'varchar',
271                 'vname' => 'LBL_EMAIL_ADDRESS',
272                 'source' => 'non-db'
273     ),
274
275   'account_id' =>
276   array (
277     'name' => 'account_id',
278     'vname' => 'LBL_ACCOUNT_ID',
279     'type' => 'id',
280     'reportable'=>false,
281         'source'=>'non-db',
282   ),
283   'opportunity_id' =>
284   array (
285     'name' => 'opportunity_id',
286     'vname' => 'LBL_OPPORTUNITY_ID',
287     'type' => 'id',
288     'reportable'=>false,
289         'source'=>'non-db',
290   ),
291   'acase_id' =>
292   array (
293     'name' => 'acase_id',
294     'vname' => 'LBL_CASE_ID',
295     'type' => 'id',
296     'reportable'=>false,
297         'source'=>'non-db',
298   ),
299   'lead_id' =>
300   array (
301     'name' => 'lead_id',
302     'vname' => 'LBL_LEAD_ID',
303     'type' => 'id',
304     'reportable'=>false,
305         'source'=>'non-db',
306   ),
307   'product_id' =>
308   array (
309     'name' => 'product_id',
310     'vname' => 'LBL_PRODUCT_ID',
311     'type' => 'id',
312     'reportable'=>false,
313         'source'=>'non-db',
314   ),
315   'quote_id' =>
316   array (
317     'name' => 'quote_id',
318     'vname' => 'LBL_QUOTE_ID',
319     'type' => 'id',
320     'reportable'=>false,
321         'source'=>'non-db',
322   ),
323
324   'created_by_link' =>
325   array (
326         'name' => 'created_by_link',
327     'type' => 'link',
328     'relationship' => 'notes_created_by',
329     'vname' => 'LBL_CREATED_BY_USER',
330     'link_type' => 'one',
331     'module'=>'Users',
332     'bean_name'=>'User',
333     'source'=>'non-db',
334   ),
335   'modified_user_link' =>
336   array (
337         'name' => 'modified_user_link',
338     'type' => 'link',
339     'relationship' => 'notes_modified_user',
340     'vname' => 'LBL_MODIFIED_BY_USER',
341     'link_type' => 'one',
342     'module'=>'Users',
343     'bean_name'=>'User',
344     'source'=>'non-db',
345   ),
346
347   'contact' =>
348   array (
349     'name' => 'contact',
350     'type' => 'link',
351     'relationship' => 'contact_notes',
352     'vname' => 'LBL_LIST_CONTACT_NAME',
353     'source'=>'non-db',
354   ),
355   'cases' =>
356   array (
357     'name' => 'cases',
358     'type' => 'link',
359     'relationship' => 'case_notes',
360     'vname' => 'LBL_CASES',
361     'source'=>'non-db',
362   ),
363   'accounts' =>
364   array (
365     'name' => 'accounts',
366     'type' => 'link',
367     'relationship' => 'account_notes',
368     'source'=>'non-db',
369     'vname'=>'LBL_ACCOUNTS',
370   ),
371   'opportunities' =>
372   array (
373     'name' => 'opportunities',
374     'type' => 'link',
375     'relationship' => 'opportunity_notes',
376     'source'=>'non-db',
377     'vname'=>'LBL_OPPORTUNITIES',
378   ),
379   'leads' =>
380   array (
381     'name' => 'leads',
382     'type' => 'link',
383     'relationship' => 'lead_notes',
384     'source'=>'non-db',
385     'vname'=>'LBL_LEADS',
386   ),
387   'products' =>
388   array (
389     'name' => 'products',
390     'type' => 'link',
391     'relationship' => 'product_notes',
392     'source'=>'non-db',
393     'vname'=>'LBL_PRODUCTS',
394   ),
395   'quotes' =>
396   array (
397     'name' => 'quotes',
398     'type' => 'link',
399     'relationship' => 'quote_notes',
400     'vname' => 'LBL_QUOTES',
401     'source'=>'non-db',
402   ),
403   'contracts' =>
404   array (
405     'name' => 'contracts',
406     'type' => 'link',
407     'relationship' => 'contract_notes',
408     'source' => 'non-db',
409     'vname' => 'LBL_CONTRACTS',
410   ),
411   'bugs' =>
412   array (
413     'name' => 'bugs',
414     'type' => 'link',
415     'relationship' => 'bug_notes',
416     'source'=>'non-db',
417     'vname'=>'LBL_BUGS',
418   ),
419   'emails' =>
420   array(
421     'name'=> 'emails',
422     'vname'=> 'LBL_EMAILS',
423     'type'=> 'link',
424     'relationship'=> 'emails_notes_rel',
425     'source'=> 'non-db',
426   ),
427   'projects' =>
428   array (
429     'name' => 'projects',
430     'type' => 'link',
431     'relationship' => 'projects_notes',
432     'source'=>'non-db',
433     'vname'=>'LBL_PROJECTS',
434   ),
435   'project_tasks' =>
436   array (
437     'name' => 'project_tasks',
438     'type' => 'link',
439     'relationship' => 'project_tasks_notes',
440     'source'=>'non-db',
441     'vname'=>'LBL_PROJECT_TASKS',
442   ),
443   'meetings' =>
444   array (
445     'name' => 'meetings',
446     'type' => 'link',
447     'relationship' => 'meetings_notes',
448     'source'=>'non-db',
449     'vname'=>'LBL_MEETINGS',
450   ),
451   'calls' =>
452   array (
453     'name' => 'calls',
454     'type' => 'link',
455     'relationship' => 'calls_notes',
456     'source'=>'non-db',
457     'vname'=>'LBL_CALLS',
458   ),
459   'description' =>
460       array (
461         'name' => 'description',
462         'vname' => 'LBL_DESCRIPTION',
463         'type' => 'text',
464         'comment' => 'Full text of the note',
465         'rows' => 30,
466         'cols' => 90,
467       ),
468 ),
469 'relationships'=>array(
470 'notes_modified_user' =>
471    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
472    'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'modified_user_id',
473    'relationship_type'=>'one-to-many')
474
475    ,'notes_created_by' =>
476    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
477    'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'created_by',
478    'relationship_type'=>'one-to-many')
479
480
481 )
482                                                       , 'indices' => array (
483        array('name' =>'notespk', 'type' =>'primary', 'fields'=>array('id')),
484        array('name' =>'idx_note_name', 'type'=>'index', 'fields'=>array('name')),
485        array('name' =>'idx_notes_parent', 'type'=>'index', 'fields'=>array('parent_id', 'parent_type')),
486        array('name' =>'idx_note_contact', 'type'=>'index', 'fields'=>array('contact_id')),
487                                                       )
488
489
490                                                       //This enables optimistic locking for Saves From EditView
491         ,'optimistic_locking'=>true,
492                             );
493
494 VardefManager::createVardef('Notes','Note', array('assignable',
495 'team_security',
496 ));
497 ?>