Merge branch '2014.11' into 2014.11-develop
[tine20] / tine20 / ExampleApplication / 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      * @private
29      */
30     tbarItems: [{xtype: 'widget-activitiesaddbutton'}],
31     windowHeight: 470,
32     windowWidth: 800,
33     
34     /**
35      * returns dialog
36      * 
37      * NOTE: when this method gets called, all initalisation is done.
38      * 
39      * @return {Object}
40      * @private
41      */
42     getFormItems: function() {
43         return {
44             xtype: 'tabpanel',
45             border: false,
46             plain:true,
47             activeTab: 0,
48             border: false,
49             items:[{
50                 title: this.app.i18n._('ExampleRecord'),
51                 autoScroll: true,
52                 border: false,
53                 frame: true,
54                 layout: 'border',
55                 items: [{
56                     region: 'center',
57                     xtype: 'columnform',
58                     labelAlign: 'top',
59                     formDefaults: {
60                         xtype:'textfield',
61                         anchor: '100%',
62                         labelSeparator: '',
63                         columnWidth: .333
64                     },
65                     items: [[{
66                         columnWidth: 1,
67                         fieldLabel: this.app.i18n._('Name'),
68                         name: 'name',
69                         allowBlank: false
70                         }], [new Tine.Tinebase.widgets.keyfield.ComboBox({
71                             app: 'ExampleApplication',
72                             keyFieldName: 'exampleStatus',
73                             fieldLabel: this.app.i18n._('Status'),
74                             name: 'status',
75                             columnWidth: 0.5
76                         }), new Tine.Tinebase.widgets.keyfield.ComboBox({
77                             app: 'ExampleApplication',
78                             keyFieldName: 'exampleReason',
79                             fieldLabel: this.app.i18n._('Reason'),
80                             name: 'reason',
81                             columnWidth: 0.5
82                         })]
83                     ] 
84                 }, {
85                     // activities and tags
86                     layout: 'accordion',
87                     animate: true,
88                     region: 'east',
89                     width: 210,
90                     split: true,
91                     collapsible: true,
92                     collapseMode: 'mini',
93                     header: false,
94                     margins: '0 5 0 5',
95                     border: true,
96                     items: [
97                     new Tine.widgets.activities.ActivitiesPanel({
98                         app: 'ExampleApplication',
99                         showAddNoteForm: false,
100                         border: false,
101                         bodyStyle: 'border:1px solid #B5B8C8;'
102                     }),
103                     new Tine.widgets.tags.TagPanel({
104                         app: 'ExampleApplication',
105                         border: false,
106                         bodyStyle: 'border:1px solid #B5B8C8;'
107                     })]
108                 }]
109             }, new Tine.widgets.activities.ActivitiesTabPanel({
110                 app: this.appName,
111                 record_id: this.record.id,
112                 record_model: this.appName + '_Model_' + this.recordClass.getMeta('modelName')
113             })]
114         };
115     }
116 });