]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/modules/UpgradeWizard/SugarMerge/metadata_files/610/modules/Notes/vardefs.php
Release 6.2.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_require'=>'include/upload_file.php',
160         'function_class'=>'UploadFile',
161         'function_name'=>'get_url',
162         'function_params'=> array('filename', 'id'),
163         'source'=>'function',
164         'reportable'=>false,
165         'comment' => 'Path to file (can be URL)',
166     'importable' => false,
167         ),
168   'parent_type'=>
169   array(
170         'name'=>'parent_type',
171         'vname'=>'LBL_PARENT_TYPE',
172         'type' =>'parent_type',
173     'dbType' => 'varchar',
174     'group'=>'parent_name',
175         'len'=> '255',
176         'comment' => 'Sugar module the Note is associated with'
177   ),
178   'parent_id'=>
179   array(
180         'name'=>'parent_id',
181         'vname'=>'LBL_PARENT_ID',
182         'type'=>'id',
183         'required'=>false,
184         'reportable'=>true,
185         'comment' => 'The ID of the Sugar item specified in parent_type'
186   ),
187   'contact_id'=>
188   array(
189         'name'=>'contact_id',
190         'vname'=>'LBL_CONTACT_ID',
191         'type'=>'id',
192         'required'=>false,
193         'reportable'=>false,
194         'comment' => 'Contact ID note is associated with'
195   ),
196   'portal_flag' =>
197   array (
198     'name' => 'portal_flag',
199     'vname' => 'LBL_PORTAL_FLAG',
200     'type' => 'bool',
201         'required' => true,
202         'comment' => 'Portal flag indicator determines if note created via portal'
203   ),
204   'embed_flag' =>
205   array (
206     'name' => 'embed_flag',
207     'vname' => 'LBL_EMBED_FLAG',
208     'type' => 'bool',
209     'default' => 0,
210         'comment' => 'Embed flag indicator determines if note embedded in email'
211   ),
212   'description' =>
213   array (
214     'name' => 'description',
215     'vname' => 'LBL_NOTE_STATUS',
216     'type' => 'text',
217     'comment' => 'Full text of the note'
218   ),
219   'deleted' =>
220   array (
221     'name' => 'deleted',
222     'vname' => 'LBL_DELETED',
223     'type' => 'bool',
224     'required' => false,
225     'default' => '0',
226     'reportable'=>false,
227     'comment' => 'Record deletion indicator'
228   ),
229
230
231
232  'parent_name'=>
233         array(
234                 'name'=> 'parent_name',
235                 'parent_type'=>'record_type_display' ,
236                 'type_name'=>'parent_type',
237                 'id_name'=>'parent_id', 'vname'=>'LBL_RELATED_TO',
238                 'type'=>'parent',
239                 'source'=>'non-db',
240                 'options'=> 'record_type_display_notes',
241                 ),
242
243  'contact_name'=>
244         array(
245                 'name'=>'contact_name',
246                 'rname'=>'last_name',
247                 'id_name'=>'contact_id',
248                 'vname'=>'LBL_CONTACT_NAME',
249         'table'=>'contacts',
250                 'type'=>'relate',
251                 'link'=>'contact',
252                 'join_name'=>'contacts',
253         'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
254                 'isnull'=>'true',
255                 'module'=>'Contacts',
256                 'source'=>'non-db',
257                 ),
258
259   'contact_phone'=>
260     array(
261         'name'=>'contact_phone',
262         'vname' => 'LBL_PHONE',
263         'type'=>'phone',
264         'vname' => 'LBL_PHONE',
265         'source'=>'non-db'
266     ),
267
268  'contact_email'=>
269     array(
270         'name'=>'contact_email',
271         'type'=>'varchar',
272                 'vname' => 'LBL_EMAIL_ADDRESS',
273                 'source' => 'non-db'
274     ),
275
276   'account_id' =>
277   array (
278     'name' => 'account_id',
279     'vname' => 'LBL_ACCOUNT_ID',
280     'type' => 'id',
281     'reportable'=>false,
282         'source'=>'non-db',
283   ),
284   'opportunity_id' =>
285   array (
286     'name' => 'opportunity_id',
287     'vname' => 'LBL_OPPORTUNITY_ID',
288     'type' => 'id',
289     'reportable'=>false,
290         'source'=>'non-db',
291   ),
292   'acase_id' =>
293   array (
294     'name' => 'acase_id',
295     'vname' => 'LBL_CASE_ID',
296     'type' => 'id',
297     'reportable'=>false,
298         'source'=>'non-db',
299   ),
300   'lead_id' =>
301   array (
302     'name' => 'lead_id',
303     'vname' => 'LBL_LEAD_ID',
304     'type' => 'id',
305     'reportable'=>false,
306         'source'=>'non-db',
307   ),
308   'product_id' =>
309   array (
310     'name' => 'product_id',
311     'vname' => 'LBL_PRODUCT_ID',
312     'type' => 'id',
313     'reportable'=>false,
314         'source'=>'non-db',
315   ),
316   'quote_id' =>
317   array (
318     'name' => 'quote_id',
319     'vname' => 'LBL_QUOTE_ID',
320     'type' => 'id',
321     'reportable'=>false,
322         'source'=>'non-db',
323   ),
324
325   'created_by_link' =>
326   array (
327         'name' => 'created_by_link',
328     'type' => 'link',
329     'relationship' => 'notes_created_by',
330     'vname' => 'LBL_CREATED_BY_USER',
331     'link_type' => 'one',
332     'module'=>'Users',
333     'bean_name'=>'User',
334     'source'=>'non-db',
335   ),
336   'modified_user_link' =>
337   array (
338         'name' => 'modified_user_link',
339     'type' => 'link',
340     'relationship' => 'notes_modified_user',
341     'vname' => 'LBL_MODIFIED_BY_USER',
342     'link_type' => 'one',
343     'module'=>'Users',
344     'bean_name'=>'User',
345     'source'=>'non-db',
346   ),
347
348   'contact' =>
349   array (
350     'name' => 'contact',
351     'type' => 'link',
352     'relationship' => 'contact_notes',
353     'vname' => 'LBL_LIST_CONTACT_NAME',
354     'source'=>'non-db',
355   ),
356   'cases' =>
357   array (
358     'name' => 'cases',
359     'type' => 'link',
360     'relationship' => 'case_notes',
361     'vname' => 'LBL_CASES',
362     'source'=>'non-db',
363   ),
364   'accounts' =>
365   array (
366     'name' => 'accounts',
367     'type' => 'link',
368     'relationship' => 'account_notes',
369     'source'=>'non-db',
370     'vname'=>'LBL_ACCOUNTS',
371   ),
372   'opportunities' =>
373   array (
374     'name' => 'opportunities',
375     'type' => 'link',
376     'relationship' => 'opportunity_notes',
377     'source'=>'non-db',
378     'vname'=>'LBL_OPPORTUNITIES',
379   ),
380   'leads' =>
381   array (
382     'name' => 'leads',
383     'type' => 'link',
384     'relationship' => 'lead_notes',
385     'source'=>'non-db',
386     'vname'=>'LBL_LEADS',
387   ),
388   'products' =>
389   array (
390     'name' => 'products',
391     'type' => 'link',
392     'relationship' => 'product_notes',
393     'source'=>'non-db',
394     'vname'=>'LBL_PRODUCTS',
395   ),
396   'quotes' =>
397   array (
398     'name' => 'quotes',
399     'type' => 'link',
400     'relationship' => 'quote_notes',
401     'vname' => 'LBL_QUOTES',
402     'source'=>'non-db',
403   ),
404   'contracts' =>
405   array (
406     'name' => 'contracts',
407     'type' => 'link',
408     'relationship' => 'contract_notes',
409     'source' => 'non-db',
410     'vname' => 'LBL_CONTRACTS',
411   ),
412   'bugs' =>
413   array (
414     'name' => 'bugs',
415     'type' => 'link',
416     'relationship' => 'bug_notes',
417     'source'=>'non-db',
418     'vname'=>'LBL_BUGS',
419   ),
420   'emails' =>
421   array(
422     'name'=> 'emails',
423     'vname'=> 'LBL_EMAILS',
424     'type'=> 'link',
425     'relationship'=> 'emails_notes_rel',
426     'source'=> 'non-db',
427   ),
428   'projects' =>
429   array (
430     'name' => 'projects',
431     'type' => 'link',
432     'relationship' => 'projects_notes',
433     'source'=>'non-db',
434     'vname'=>'LBL_PROJECTS',
435   ),
436   'project_tasks' =>
437   array (
438     'name' => 'project_tasks',
439     'type' => 'link',
440     'relationship' => 'project_tasks_notes',
441     'source'=>'non-db',
442     'vname'=>'LBL_PROJECT_TASKS',
443   ),
444   'meetings' =>
445   array (
446     'name' => 'meetings',
447     'type' => 'link',
448     'relationship' => 'meetings_notes',
449     'source'=>'non-db',
450     'vname'=>'LBL_MEETINGS',
451   ),
452   'calls' =>
453   array (
454     'name' => 'calls',
455     'type' => 'link',
456     'relationship' => 'calls_notes',
457     'source'=>'non-db',
458     'vname'=>'LBL_CALLS',
459   ),
460   'description' =>
461       array (
462         'name' => 'description',
463         'vname' => 'LBL_DESCRIPTION',
464         'type' => 'text',
465         'comment' => 'Full text of the note',
466         'rows' => 30,
467         'cols' => 90,
468       ),
469 ),
470 'relationships'=>array(
471 'notes_modified_user' =>
472    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
473    'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'modified_user_id',
474    'relationship_type'=>'one-to-many')
475
476    ,'notes_created_by' =>
477    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
478    'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'created_by',
479    'relationship_type'=>'one-to-many')
480
481
482 )
483                                                       , 'indices' => array (
484        array('name' =>'notespk', 'type' =>'primary', 'fields'=>array('id')),
485        array('name' =>'idx_note_name', 'type'=>'index', 'fields'=>array('name')),
486        array('name' =>'idx_notes_parent', 'type'=>'index', 'fields'=>array('parent_id', 'parent_type')),
487        array('name' =>'idx_note_contact', 'type'=>'index', 'fields'=>array('contact_id')),
488                                                       )
489
490
491                                                       //This enables optimistic locking for Saves From EditView
492         ,'optimistic_locking'=>true,
493                             );
494
495 VardefManager::createVardef('Notes','Note', array('assignable',
496 'team_security',
497 ));
498 ?>