]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Documents/vardefs.php
Release 6.5.6
[Github/sugarcrm.git] / modules / Documents / 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 $dictionary['Document'] = array('table' => 'documents',
39     'unified_search' => true,
40     'full_text_search' => true,
41     'unified_search_default_enabled' => true,
42     'fields' => array(
43
44         'document_name' =>
45         array(
46             'name' => 'document_name',
47             'vname' => 'LBL_NAME',
48             'type' => 'varchar',
49             'len' => '255',
50             'required' => true,
51             'importable' => 'required',
52             'unified_search' => true,
53             'full_text_search' => array('boost' => 3),
54         ),
55         'name' => array(
56             'name' => 'name',
57             'vname' => 'LBL_NAME',
58             'source' => 'non-db',
59             'type' => 'varchar'
60         ),
61         'doc_id' =>
62         array(
63             'name' => 'doc_id',
64             'vname' => 'LBL_DOC_ID',
65             'type' => 'varchar',
66             'len' => '100',
67             'comment' => 'Document ID from documents web server provider',
68             'importable' => false,
69             'studio' => 'false',
70         ),
71         'doc_type' =>
72         array(
73             'name' => 'doc_type',
74             'vname' => 'LBL_DOC_TYPE',
75             'type' => 'enum',
76             'function' => 'getDocumentsExternalApiDropDown',
77             'len' => '100',
78             'comment' => 'Document type (ex: Google, box.net, IBM SmartCloud)',
79             'popupHelp' => 'LBL_DOC_TYPE_POPUP',
80             'massupdate' => false,
81             'options' => 'eapm_list',
82             'default' => 'Sugar',
83             'studio' => 'false',
84         ),
85         'doc_url' =>
86         array(
87             'name' => 'doc_url',
88             'vname' => 'LBL_DOC_URL',
89             'type' => 'varchar',
90             'len' => '255',
91             'comment' => 'Document URL from documents web server provider',
92             'importable' => false,
93             'massupdate' => false,
94             'studio' => 'false',
95         ),
96         'filename' =>
97         array(
98             'name' => 'filename',
99             'vname' => 'LBL_FILENAME',
100             'type' => 'file',
101             'source' => 'non-db',
102             'comment' => 'The filename of the document attachment',
103             'required' => true,
104             'noChange' => true,
105             'allowEapm' => true,
106             'fileId' => 'document_revision_id',
107             'docType' => 'doc_type',
108             'docUrl' => 'doc_url',
109             'docId' => 'doc_id',
110         ),
111
112         'active_date' =>
113         array(
114             'name' => 'active_date',
115             'vname' => 'LBL_DOC_ACTIVE_DATE',
116             'type' => 'date',
117             'importable' => 'required',
118             'required' => true,
119             'display_default' => 'now',
120         ),
121
122         'exp_date' =>
123         array(
124             'name' => 'exp_date',
125             'vname' => 'LBL_DOC_EXP_DATE',
126             'type' => 'date',
127         ),
128
129         'category_id' =>
130         array(
131             'name' => 'category_id',
132             'vname' => 'LBL_SF_CATEGORY',
133             'type' => 'enum',
134             'len' => 100,
135             'options' => 'document_category_dom',
136             'reportable' => true,
137         ),
138
139         'subcategory_id' =>
140         array(
141             'name' => 'subcategory_id',
142             'vname' => 'LBL_SF_SUBCATEGORY',
143             'type' => 'enum',
144             'len' => 100,
145             'options' => 'document_subcategory_dom',
146             'reportable' => true,
147         ),
148
149         'status_id' =>
150         array(
151             'name' => 'status_id',
152             'vname' => 'LBL_DOC_STATUS',
153             'type' => 'enum',
154             'len' => 100,
155             'options' => 'document_status_dom',
156             'reportable' => false,
157         ),
158
159         'status' =>
160         array(
161             'name' => 'status',
162             'vname' => 'LBL_DOC_STATUS',
163             'type' => 'varchar',
164             'source' => 'non-db',
165             'comment' => 'Document status for Meta-Data framework',
166         ),
167
168         'document_revision_id' =>
169         array(
170             'name' => 'document_revision_id',
171             'vname' => 'LBL_LATEST_REVISION',
172             'type' => 'varchar',
173             'len' => '36',
174             'reportable' => false,
175         ),
176
177         'revisions' =>
178         array(
179             'name' => 'revisions',
180             'type' => 'link',
181             'relationship' => 'document_revisions',
182             'source' => 'non-db',
183             'vname' => 'LBL_REVISIONS',
184         ),
185
186         'revision' =>
187         array(
188             'name' => 'revision',
189             'vname' => 'LBL_DOC_VERSION',
190             'type' => 'varchar',
191             'reportable' => false,
192             'required' => true,
193             'source' => 'non-db',
194             'importable' => 'required',
195             'required' => true,
196             'default' => '1',
197         ),
198
199         'last_rev_created_name' =>
200         array(
201             'name' => 'last_rev_created_name',
202             'vname' => 'LBL_LAST_REV_CREATOR',
203             'type' => 'varchar',
204             'reportable' => false,
205             'source' => 'non-db'
206         ),
207         'last_rev_mime_type' =>
208         array(
209             'name' => 'last_rev_mime_type',
210             'vname' => 'LBL_LAST_REV_MIME_TYPE',
211             'type' => 'varchar',
212             'reportable' => false,
213             'studio' => 'false',
214             'source' => 'non-db'
215         ),
216         'latest_revision' =>
217         array(
218             'name' => 'latest_revision',
219             'vname' => 'LBL_LATEST_REVISION',
220             'type' => 'varchar',
221             'reportable' => false,
222             'source' => 'non-db'
223         ),
224         'last_rev_create_date' =>
225         array(
226             'name' => 'last_rev_create_date',
227             'type' => 'date',
228             'table' => 'document_revisions',
229             'link' => 'revisions',
230             'join_name' => 'document_revisions',
231             'vname' => 'LBL_LAST_REV_CREATE_DATE',
232             'rname' => 'date_entered',
233             'reportable' => false,
234             'source' => 'non-db'
235         ),
236         'contracts' => array(
237             'name' => 'contracts',
238             'type' => 'link',
239             'relationship' => 'contracts_documents',
240             'source' => 'non-db',
241             'vname' => 'LBL_CONTRACTS',
242         ),
243         //todo remove
244         'leads' => array(
245             'name' => 'leads',
246             'type' => 'link',
247             'relationship' => 'leads_documents',
248             'source' => 'non-db',
249             'vname' => 'LBL_LEADS',
250         ),
251         // Links around the world
252         'accounts' =>
253         array(
254             'name' => 'accounts',
255             'type' => 'link',
256             'relationship' => 'documents_accounts',
257             'source' => 'non-db',
258             'vname' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',
259         ),
260         'contacts' =>
261         array(
262             'name' => 'contacts',
263             'type' => 'link',
264             'relationship' => 'documents_contacts',
265             'source' => 'non-db',
266             'vname' => 'LBL_CONTACTS_SUBPANEL_TITLE',
267         ),
268         'opportunities' =>
269         array(
270             'name' => 'opportunities',
271             'type' => 'link',
272             'relationship' => 'documents_opportunities',
273             'source' => 'non-db',
274             'vname' => 'LBL_OPPORTUNITIES_SUBPANEL_TITLE',
275         ),
276         'cases' =>
277         array(
278             'name' => 'cases',
279             'type' => 'link',
280             'relationship' => 'documents_cases',
281             'source' => 'non-db',
282             'vname' => 'LBL_CASES_SUBPANEL_TITLE',
283         ),
284         'bugs' =>
285         array(
286             'name' => 'bugs',
287             'type' => 'link',
288             'relationship' => 'documents_bugs',
289             'source' => 'non-db',
290             'vname' => 'LBL_BUGS_SUBPANEL_TITLE',
291         ),
292         'related_doc_id' =>
293         array(
294             'name' => 'related_doc_id',
295             'vname' => 'LBL_RELATED_DOCUMENT_ID',
296             'reportable' => false,
297             'dbType' => 'id',
298             'type' => 'varchar',
299             'len' => '36',
300         ),
301
302         'related_doc_name' =>
303         array(
304             'name' => 'related_doc_name',
305             'vname' => 'LBL_DET_RELATED_DOCUMENT',
306             'type' => 'relate',
307             'table' => 'documents',
308             'id_name' => 'related_doc_id',
309             'module' => 'Documents',
310             'source' => 'non-db',
311             'comment' => 'The related document name for Meta-Data framework',
312         ),
313
314         'related_doc_rev_id' =>
315         array(
316             'name' => 'related_doc_rev_id',
317             'vname' => 'LBL_RELATED_DOCUMENT_REVISION_ID',
318             'reportable' => false,
319             'dbType' => 'id',
320             'type' => 'varchar',
321             'len' => '36',
322         ),
323
324         'related_doc_rev_number' =>
325         array(
326             'name' => 'related_doc_rev_number',
327             'vname' => 'LBL_DET_RELATED_DOCUMENT_VERSION',
328             'type' => 'varchar',
329             'source' => 'non-db',
330             'comment' => 'The related document version number for Meta-Data framework',
331         ),
332
333         'is_template' =>
334         array(
335             'name' => 'is_template',
336             'vname' => 'LBL_IS_TEMPLATE',
337             'type' => 'bool',
338             'default' => 0,
339             'reportable' => false,
340         ),
341         'template_type' =>
342         array(
343             'name' => 'template_type',
344             'vname' => 'LBL_TEMPLATE_TYPE',
345             'type' => 'enum',
346             'len' => 100,
347             'options' => 'document_template_type_dom',
348             'reportable' => false,
349         ),
350 //BEGIN field used for contract document subpanel.
351         'latest_revision_name' =>
352         array(
353             'name' => 'latest_revision_name',
354             'vname' => 'LBL_LASTEST_REVISION_NAME',
355             'type' => 'varchar',
356             'reportable' => false,
357             'source' => 'non-db'
358         ),
359
360         'selected_revision_name' =>
361         array(
362             'name' => 'selected_revision_name',
363             'vname' => 'LBL_SELECTED_REVISION_NAME',
364             'type' => 'varchar',
365             'reportable' => false,
366             'source' => 'non-db'
367         ),
368         'contract_status' =>
369         array(
370             'name' => 'contract_status',
371             'vname' => 'LBL_CONTRACT_STATUS',
372             'type' => 'varchar',
373             'reportable' => false,
374             'source' => 'non-db'
375         ),
376         'contract_name' =>
377         array(
378             'name' => 'contract_name',
379             'vname' => 'LBL_CONTRACT_NAME',
380             'type' => 'varchar',
381             'reportable' => false,
382             'source' => 'non-db'
383         ),
384         'linked_id' =>
385         array(
386             'name' => 'linked_id',
387             'vname' => 'LBL_LINKED_ID',
388             'type' => 'varchar',
389             'reportable' => false,
390             'source' => 'non-db'
391         ),
392         'selected_revision_id' =>
393         array(
394             'name' => 'selected_revision_id',
395             'vname' => 'LBL_SELECTED_REVISION_ID',
396             'type' => 'varchar',
397             'reportable' => false,
398             'source' => 'non-db'
399         ),
400         'latest_revision_id' =>
401         array(
402             'name' => 'latest_revision_id',
403             'vname' => 'LBL_LATEST_REVISION_ID',
404             'type' => 'varchar',
405             'reportable' => false,
406             'source' => 'non-db'
407         ),
408         'selected_revision_filename' =>
409         array(
410             'name' => 'selected_revision_filename',
411             'vname' => 'LBL_SELECTED_REVISION_FILENAME',
412             'type' => 'varchar',
413             'reportable' => false,
414             'source' => 'non-db'
415         ),
416 //END fields used for contract documents subpanel.
417
418     ),
419     'indices' => array(
420         array('name' => 'idx_doc_cat', 'type' => 'index', 'fields' => array('category_id', 'subcategory_id')),
421     ),
422     'relationships' => array(
423         'document_revisions' => array('lhs_module' => 'Documents', 'lhs_table' => 'documents', 'lhs_key' => 'id',
424             'rhs_module' => 'DocumentRevisions', 'rhs_table' => 'document_revisions', 'rhs_key' => 'document_id',
425             'relationship_type' => 'one-to-many')
426
427     , 'documents_modified_user' =>
428         array('lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id',
429             'rhs_module' => 'Documents', 'rhs_table' => 'documents', 'rhs_key' => 'modified_user_id',
430             'relationship_type' => 'one-to-many')
431
432     , 'documents_created_by' =>
433         array('lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id',
434             'rhs_module' => 'Documents', 'rhs_table' => 'documents', 'rhs_key' => 'created_by',
435             'relationship_type' => 'one-to-many')
436     ),
437
438 );
439 VardefManager::createVardef('Documents', 'Document', array('default', 'assignable',
440 ));
441 ?>