]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/modules/UpgradeWizard/SugarMerge/metadata_files/610/modules/Documents/vardefs.php
Release 6.2.0
[Github/sugarcrm.git] / tests / modules / UpgradeWizard / SugarMerge / metadata_files / 610 / 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
39 $dictionary['Document'] = array('table' => 'documents'
40                                ,'fields' => array (
41
42   'document_name' =>
43   array (
44     'name' => 'document_name',
45     'vname' => 'LBL_NAME',
46     'type' => 'varchar',
47     'len' => '255',
48     'required'=>true,
49     'importable' => 'required',
50   ),
51   'name'=>
52   array('name'=>'name', 'vname' => 'LBL_NAME', 'source'=>'non-db', 'type'=>'varchar'),
53   'filename' =>
54   array (
55      'name' => 'filename',
56      'vname' => 'LBL_FILENAME',
57      'type' => 'file',
58      'source' => 'non-db',
59      'comment' => 'The filename of the document attachment',
60          'required' => true,
61   ),
62
63   'uploadfile' =>
64   array (
65      'name'=>'uploadfile',
66      'required' => true,
67      'vname' => 'LBL_FILENAME',
68      'type' => 'file',
69      'source' => 'non-db',
70   ),
71
72 'active_date' =>
73   array (
74     'name' => 'active_date',
75     'vname' => 'LBL_DOC_ACTIVE_DATE',
76     'type' => 'date',
77     'importable' => 'required',
78         'required' => true,
79   ),
80
81 'exp_date' =>
82   array (
83     'name' => 'exp_date',
84     'vname' => 'LBL_DOC_EXP_DATE',
85     'type' => 'date',
86   ),
87
88   'category_id' =>
89   array (
90     'name' => 'category_id',
91     'vname' => 'LBL_SF_CATEGORY',
92     'type' => 'enum',
93     'len' => 100,
94     'options' => 'document_category_dom',
95     'reportable'=>false,
96   ),
97
98   'subcategory_id' =>
99   array (
100     'name' => 'subcategory_id',
101     'vname' => 'LBL_SF_SUBCATEGORY',
102     'type' => 'enum',
103     'len' => 100,
104     'options' => 'document_subcategory_dom',
105     'reportable'=>false,
106   ),
107
108   'status_id' =>
109   array (
110     'name' => 'status_id',
111     'vname' => 'LBL_DOC_STATUS',
112     'type' => 'enum',
113     'len' => 100,
114     'options' => 'document_status_dom',
115     'reportable'=>false,
116   ),
117
118   'status' =>
119   array (
120     'name' => 'status',
121     'vname' => 'LBL_DOC_STATUS',
122     'type' => 'varchar',
123     'source' => 'non-db',
124     'comment' => 'Document status for Meta-Data framework',
125   ),
126
127   'document_revision_id'=>
128   array (
129     'name' => 'document_revision_id',
130     'vname' => 'LBL_LATEST_REVISION',
131     'type' => 'varchar',
132     'len' => '36',
133     'reportable'=>false,
134   ),
135
136   'revisions' =>
137   array (
138     'name' => 'revisions',
139     'type' => 'link',
140     'relationship' => 'document_revisions',
141     'source'=>'non-db',
142     'vname'=>'LBL_REVISIONS',
143   ),
144
145   'revision' =>
146   array (
147     'name' => 'revision',
148     'vname' => 'LBL_DOC_VERSION',
149     'type' => 'varchar',
150     'reportable'=>false,
151     'required' => true,
152     'source'=>'non-db',
153     'importable' => 'required',
154         'required' => true,
155   ),
156
157   'last_rev_created_name' =>
158   array (
159     'name' => 'last_rev_created_name',
160     'vname' => 'LBL_LAST_REV_CREATOR',
161     'type' => 'varchar',
162     'reportable'=>false,
163     'source'=>'non-db'
164   ),
165     'last_rev_mime_type' =>
166   array (
167     'name' => 'last_rev_mime_type',
168     'vname' => 'LBL_LAST_REV_MIME_TYPE',
169     'type' => 'varchar',
170     'reportable'=>false,
171         'studio' => 'false',
172     'source'=>'non-db'
173   ),
174    'latest_revision' =>
175   array (
176     'name' => 'latest_revision',
177     'vname' => 'LBL_LATEST_REVISION',
178     'type' => 'varchar',
179     'reportable'=>false,
180     'source'=>'non-db'
181   ),
182   'last_rev_create_date' =>
183   array (
184     'name' => 'last_rev_create_date',
185     'type' => 'date',
186     'table' => 'document_revisions',
187     'link'  => 'revisions',
188     'join_name'  => 'document_revisions',
189     'vname'=>'LBL_LAST_REV_CREATE_DATE',
190     'rname'=> 'date_entered',
191     'reportable'=>false,
192     'source'=>'non-db'
193   ),
194   'contracts' => array (
195     'name' => 'contracts',
196     'type' => 'link',
197     'relationship' => 'contracts_documents',
198     'source' => 'non-db',
199     'vname' => 'LBL_CONTRACTS',
200   ),
201   //todo remove
202   'leads' => array (
203     'name' => 'leads',
204     'type' => 'link',
205     'relationship' => 'leads_documents',
206     'source' => 'non-db',
207     'vname' => 'LBL_LEADS',
208   ),
209
210   'related_doc_id' =>
211   array (
212     'name' => 'related_doc_id',
213     'vname' => 'LBL_RELATED_DOCUMENT_ID',
214     'reportable'=>false,
215     'dbType' => 'id',
216     'type' => 'varchar',
217     'len' => '36',
218   ),
219
220   'related_doc_name' =>
221   array (
222     'name' => 'related_doc_name',
223     'vname' => 'LBL_DET_RELATED_DOCUMENT',
224     'type' => 'relate',
225     'table' => 'documents',
226     'id_name' => 'related_doc_id',
227     'module' => 'Documents',
228     'source' => 'non-db',
229     'comment' => 'The related document name for Meta-Data framework',
230   ),
231
232   'related_doc_rev_id' =>
233   array (
234     'name' => 'related_doc_rev_id',
235     'vname' => 'LBL_RELATED_DOCUMENT_REVISION_ID',
236     'reportable'=>false,
237     'dbType' => 'id',
238     'type' => 'varchar',
239     'len' => '36',
240   ),
241
242   'related_doc_rev_number' =>
243   array (
244     'name' => 'related_doc_rev_number',
245     'vname' => 'LBL_DET_RELATED_DOCUMENT_VERSION',
246     'type' => 'varchar',
247     'source' => 'non-db',
248     'comment' => 'The related document version number for Meta-Data framework',
249   ),
250
251   'is_template' =>
252   array (
253     'name' => 'is_template',
254     'vname' => 'LBL_IS_TEMPLATE',
255     'type' => 'bool',
256     'default'=> 0,
257     'reportable'=>false,
258   ),
259   'template_type' =>
260   array (
261     'name' => 'template_type',
262     'vname' => 'LBL_TEMPLATE_TYPE',
263     'type' => 'enum',
264     'len' => 100,
265     'options' => 'document_template_type_dom',
266     'reportable'=>false,
267   ),
268 //BEGIN field used for contract document subpanel.
269   'latest_revision_name' =>
270   array (
271     'name' => 'latest_revision_name',
272         'vname' => 'LBL_LASTEST_REVISION_NAME',         
273     'type' => 'varchar',
274     'reportable'=>false,
275     'source'=>'non-db'
276   ),
277
278   'selected_revision_name' =>
279   array (
280     'name' => 'selected_revision_name',
281         'vname' => 'LBL_SELECTED_REVISION_NAME',
282     'type' => 'varchar',
283     'reportable'=>false,
284     'source'=>'non-db'
285   ),
286   'contract_status' =>
287   array (
288     'name' => 'contract_status',
289         'vname' => 'LBL_CONTRACT_STATUS',
290     'type' => 'varchar',
291     'reportable'=>false,
292     'source'=>'non-db'
293   ),
294   'contract_name'=>
295   array (
296     'name' => 'contract_name',
297         'vname' => 'LBL_CONTRACT_NAME',
298     'type' => 'varchar',
299     'reportable'=>false,
300     'source'=>'non-db'
301   ),
302   'linked_id'=>
303   array (
304     'name' => 'linked_id',
305         'vname' => 'LBL_LINKED_ID',
306     'type' => 'varchar',
307     'reportable'=>false,
308     'source'=>'non-db'
309   ),
310   'selected_revision_id'=>
311   array (
312     'name' => 'selected_revision_id',
313         'vname' => 'LBL_SELECTED_REVISION_ID',
314     'type' => 'varchar',
315     'reportable'=>false,
316     'source'=>'non-db'
317   ),
318   'latest_revision_id'=>
319   array (
320     'name' => 'latest_revision_id',
321         'vname' => 'LBL_LATEST_REVISION_ID',
322     'type' => 'varchar',
323     'reportable'=>false,
324     'source'=>'non-db'
325   ),
326   'selected_revision_filename'=>
327   array (
328     'name' => 'selected_revision_filename',
329         'vname' => 'LBL_SELECTED_REVISION_FILENAME',
330     'type' => 'varchar',
331     'reportable'=>false,
332     'source'=>'non-db'
333   ),
334 //END fields used for contract documents subpanel.
335
336 ),
337  'indices' => array (
338        array('name' =>'idx_doc_cat', 'type' =>'index', 'fields'=>array('category_id', 'subcategory_id')),
339        ),
340  'relationships' => array (
341     'document_revisions' => array('lhs_module'=> 'Documents', 'lhs_table'=> 'documents', 'lhs_key' => 'id',
342                               'rhs_module'=> 'Documents', 'rhs_table'=> 'document_revisions', 'rhs_key' => 'document_id',
343                               'relationship_type'=>'one-to-many')
344
345    ,'documents_modified_user' =>
346    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
347    'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'modified_user_id',
348    'relationship_type'=>'one-to-many')
349
350    ,'documents_created_by' =>
351    array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
352    'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'created_by',
353    'relationship_type'=>'one-to-many')
354     ),
355
356 );
357 VardefManager::createVardef('Documents','Document', array('default',
358 'team_security',
359 ));
360 ?>