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