1df58342442e2fcdb8ccab8ed04145979a9caf41
[tine20] / tine20 / Tool / Application / templates / js / ExampleRecordEditDialog.js
1 /*
2  * Tine 2.0
3  * 
4  * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
5  * @author      Cornelius Weiss <c.weiss@metaways.de>
6  * @copyright   Copyright (c) 2007-2012 Metaways Infosystems GmbH (http://www.metaways.de)
7  */
8 Ext.ns('Tine.ExampleApplication');
9
10 /**
11  * @namespace   Tine.ExampleApplication
12  * @class       Tine.ExampleApplication.ExampleRecordEditDialog
13  * @extends     Tine.widgets.dialog.EditDialog
14  * 
15  * <p>ExampleRecord Compose Dialog</p>
16  * <p></p>
17  * 
18  *  @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
19  * @author      Cornelius Weiss <c.weiss@metaways.de>
20  * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
21  * 
22  * @param       {Object} config
23  * @constructor
24  * Create a new Tine.ExampleApplication.ExampleRecordEditDialog
25  */
26 Tine.ExampleApplication.ExampleRecordEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
27     
28     /**
29      * @private
30      */
31     appName: 'ExampleApplication',
32     modelName: 'ExampleRecord',
33     
34     windowHeight: 470,
35     windowWidth: 800,
36     
37     /**
38      * returns dialog
39      * 
40      * NOTE: when this method gets called, all initalisation is done.
41      * 
42      * @return {Object}
43      * @private
44      */
45     getFormItems: function() {
46         return {
47             xtype: 'tabpanel',
48             border: false,
49             plain:true,
50             activeTab: 0,
51             border: false,
52             items:[{
53                 title: this.app.i18n._('ExampleRecord'),
54                 autoScroll: true,
55                 border: false,
56                 frame: true,
57                 layout: 'border',
58                 items: [{
59                     region: 'center',
60                     xtype: 'columnform',
61                     labelAlign: 'top',
62                     formDefaults: {
63                         xtype:'textfield',
64                         anchor: '100%',
65                         labelSeparator: '',
66                         columnWidth: .333
67                     },
68                     items: [[{
69                         columnWidth: 1,
70                         fieldLabel: this.app.i18n._('Name'),
71                         name: 'name',
72                         allowBlank: false
73                         }], [new Tine.Tinebase.widgets.keyfield.ComboBox({
74                             app: 'ExampleApplication',
75                             keyFieldName: 'exampleStatus',
76                             fieldLabel: this.app.i18n._('Status'),
77                             name: 'status',
78                             columnWidth: 0.5
79                         })]
80                     ] 
81                 }, {
82                     // activities and tags
83                     layout: 'accordion',
84                     animate: true,
85                     region: 'east',
86                     width: 210,
87                     split: true,
88                     collapsible: true,
89                     collapseMode: 'mini',
90                     header: false,
91                     margins: '0 5 0 5',
92                     border: true,
93                     items: [
94                     new Tine.widgets.activities.ActivitiesPanel({
95                         app: 'ExampleApplication',
96                         showAddNoteForm: false,
97                         border: false,
98                         bodyStyle: 'border:1px solid #B5B8C8;'
99                     }),
100                     new Tine.widgets.tags.TagPanel({
101                         app: 'ExampleApplication',
102                         border: false,
103                         bodyStyle: 'border:1px solid #B5B8C8;'
104                     })]
105                 }]
106             }, new Tine.widgets.activities.ActivitiesTabPanel({
107                 app: this.appName,
108                 record_id: this.record.id,
109                 record_model: this.appName + '_Model_' + this.recordClass.getMeta('modelName')
110             })]
111         };
112     }
113 });