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