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